Takashi Ishizaki
isiza****@da2*****
2005年 7月 2日 (土) 14:18:12 JST
石崎と申します。初めてポストします。 MacOSX 10.3.9 ですが Gauche-gl-0.4 でコンパイル時にいくつかワーニングが出ます。 環境: MacOSX 10.3.9 gcc 3.3 Gauche 0.8.5 Gauche-gl-0.4: ./configure --without-x 1. (use gl) がエラーになりました。コンパイル時にワーニングが出ていたので 確認したら以下の typo のようです。 --- Gauche-gl-0.4.dist/src/gauche-gl.c Thu Jun 30 22:29:29 2005 +++ Gauche-gl-0.4/src/gauche-gl.c Sat Jul 2 00:38:06 2005 @@ -144,7 +144,7 @@ return glXGetProcAddressARB(name); } #elif defined(MacOSX) - return glutGetprocAddress(name); + return glutGetProcAddress(name); #endif /* !defined(GLX_VERSION_1_4) && !defined(GLX_ARB_get_proc_address) */ Scm_Error("GL extension %s is not supported on this platform", name); } 2. その他、コンパイル時にワーニングがでるのですが、以下の修正で問題な いでしょうか。 (1) gl-lib.c gl-lib.c: In function `gl_lib_gl_get_pixel_map': gl-lib.c:3072: warning: passing arg 2 of `glGetIntegerv' from incompatible pointer type --- Gauche-gl-0.4.dist/src/gl-lib.stub Thu Jun 30 21:24:29 2005 +++ Gauche-gl-0.4/src/gl-lib.stub Sat Jul 2 11:48:54 2005 @@ -1227,7 +1227,7 @@ ;; allocate the vector in it. type can be a class ;; <u32vector> (default), <u16vector> or <f32vector> (define-cproc gl-get-pixel-map (map::<fixnum> &optional type) - " int size; ScmObj vec = SCM_UNDEFINED; + "GLint size; ScmObj vec = SCM_UNDEFINED; glGetIntegerv(map, &size); CHECK_ERROR(\"couldn't get pixel map size\"); SCM_ASSERT(size >= 0); (2) glext-lib.c glext-lib.c: In function `glext_lib_gl_color_table_parameter': glext-lib.c:383: warning: passing arg 3 of pointer to function from incompatible pointer type 等10数カ所 --- Gauche-gl-0.4.dist/src/glext-lib.stub Fri Jun 10 20:27:17 2005 +++ Gauche-gl-0.4/src/glext-lib.stub Sat Jul 2 13:24:29 2005 @@ -145,7 +145,7 @@ } else if (SCM_S32VECTORP(param)) { if (SCM_S32VECTOR_SIZE(param) != 4) goto err; ENSURE(glColorTableParameteriv); - glColorTableParameteriv(target, pname, SCM_S32VECTOR_ELEMENTS(param)); + glColorTableParameteriv(target, pname, (GLint*)SCM_S32VECTOR_ELEMENTS(param)); } else goto err; SCM_RETURN(SCM_UNDEFINED); err: @@ -329,7 +329,7 @@ if (SCM_F32VECTORP(param) && SCM_F32VECTOR_SIZE(param) == 4) { glConvolutionParameterfv(target, pname, SCM_F32VECTOR_ELEMENTS(param)); } else if (SCM_S32VECTORP(param) && SCM_S32VECTOR_SIZE(param) == 4) { - glConvolutionParameteriv(target, pname, SCM_S32VECTOR_ELEMENTS(param)); + glConvolutionParameteriv(target, pname, (GLint*)SCM_S32VECTOR_ELEMENTS(param)); } else { Scm_Error(\"bad type of param value for GL_CONVOLUTION_FILTER_SCALE/GL_CONVOLUTION_FILTER_BIAS (s32 or f32vector of size 4 required): %S\", param); } @@ -420,16 +420,16 @@ } else if (SCM_S32VECTORP(v)) { switch (SCM_S32VECTOR_SIZE(v)) { case 2: ENSURE(glMultiTexCoord2ivARB); - glMultiTexCoord2ivARB(texunit, SCM_S32VECTOR_ELEMENTS(v)); + glMultiTexCoord2ivARB(texunit, (GLint*)SCM_S32VECTOR_ELEMENTS(v)); break; case 1: ENSURE(glMultiTexCoord2ivARB); - glMultiTexCoord2ivARB(texunit, SCM_S32VECTOR_ELEMENTS(v)); + glMultiTexCoord2ivARB(texunit, (GLint*)SCM_S32VECTOR_ELEMENTS(v)); break; case 3: ENSURE(glMultiTexCoord3ivARB); - glMultiTexCoord3ivARB(texunit, SCM_S32VECTOR_ELEMENTS(v)); + glMultiTexCoord3ivARB(texunit, (GLint*)SCM_S32VECTOR_ELEMENTS(v)); break; case 4: ENSURE(glMultiTexCoord4ivARB); - glMultiTexCoord4ivARB(texunit, SCM_S32VECTOR_ELEMENTS(v)); + glMultiTexCoord4ivARB(texunit, (GLint*)SCM_S32VECTOR_ELEMENTS(v)); break; default: goto badarg; } @@ -587,7 +587,7 @@ } else if (SCM_S32VECTORP(v0)) { int count = SCM_S32VECTOR_SIZE(v0); ENSURE(glUniform1ivARB); - glUniform1ivARB(location, count, SCM_S32VECTOR_ELEMENTS(v0)); + glUniform1ivARB(location, count, (GLint*)SCM_S32VECTOR_ELEMENTS(v0)); } else { ENSURE(glUniform1fARB); glUniform1fARB(location, (GLfloat)Scm_GetDouble(v0)); @@ -601,7 +601,7 @@ } else if (SCM_S32VECTORP(v0)) { int count = SCM_S32VECTOR_SIZE(v0)/2; ENSURE(glUniform2ivARB); - glUniform2ivARB(location, count, SCM_S32VECTOR_ELEMENTS(v0)); + glUniform2ivARB(location, count, (GLint*)SCM_S32VECTOR_ELEMENTS(v0)); } else if (SCM_UNBOUNDP(v1)) { Scm_Error(\"Not enough arguments for gl-uniform2-arb\"); } else { @@ -618,7 +618,7 @@ } else if (SCM_S32VECTORP(v0)) { int count = SCM_S32VECTOR_SIZE(v0)/3; ENSURE(glUniform3ivARB); - glUniform3ivARB(location, count, SCM_S32VECTOR_ELEMENTS(v0)); + glUniform3ivARB(location, count, (GLint*)SCM_S32VECTOR_ELEMENTS(v0)); } else if (SCM_UNBOUNDP(v2)) { Scm_Error(\"Not enough arguments for gl-uniform3-arb\"); } else { @@ -636,7 +636,7 @@ } else if (SCM_S32VECTORP(v0)) { int count = SCM_S32VECTOR_SIZE(v0)/4; ENSURE(glUniform4ivARB); - glUniform4ivARB(location, count, SCM_S32VECTOR_ELEMENTS(v0)); + glUniform4ivARB(location, count, (GLint*)SCM_S32VECTOR_ELEMENTS(v0)); } else if (SCM_UNBOUNDP(v3)) { Scm_Error(\"Not enough arguments for gl-uniform4-arb\"); } else { @@ -859,13 +859,13 @@ (define-cproc gl-delete-buffers-arb (buffers::<u32vector>) "ENSURE(glDeleteBuffersARB); glDeleteBuffersARB(SCM_U32VECTOR_SIZE(buffers), - SCM_U32VECTOR_ELEMENTS(buffers)); + (GLuint*)SCM_U32VECTOR_ELEMENTS(buffers)); SCM_RETURN(SCM_UNDEFINED);") (define-cproc gl-gen-buffers-arb (n::<uint>) "ScmObj v = Scm_MakeU32Vector(n, 0); ENSURE(glGenBuffersARB); - glGenBuffersARB(n, SCM_U32VECTOR_ELEMENTS(v)); + glGenBuffersARB(n, (GLuint*)SCM_U32VECTOR_ELEMENTS(v)); SCM_RETURN(v);") (define-cproc gl-is-buffer-arb (buffer::<uint>) @@ -964,14 +964,14 @@ } else if (SCM_S32VECTORP(arg0)) { switch (SCM_S32VECTOR_SIZE(arg0)) { case 4: ENSURE(glVertexAttrib4ivARB); - glVertexAttrib4ivARB(index, SCM_S32VECTOR_ELEMENTS(arg0)); + glVertexAttrib4ivARB(index, (GLint*)SCM_S32VECTOR_ELEMENTS(arg0)); break; default: goto err; } } else if (SCM_U32VECTORP(arg0)) { switch (SCM_U32VECTOR_SIZE(arg0)) { case 4: ENSURE(glVertexAttrib4uivARB); - glVertexAttrib4uivARB(index, SCM_U32VECTOR_ELEMENTS(arg0)); + glVertexAttrib4uivARB(index, (GLuint*)SCM_U32VECTOR_ELEMENTS(arg0)); break; default: goto err; } @@ -1039,14 +1039,14 @@ } else if (SCM_S32VECTORP(arg0)) { switch (SCM_S32VECTOR_SIZE(arg0)) { case 4: ENSURE(glVertexAttrib4NivARB); - glVertexAttrib4NivARB(index, SCM_S32VECTOR_ELEMENTS(arg0)); + glVertexAttrib4NivARB(index, (GLint*)SCM_S32VECTOR_ELEMENTS(arg0)); break; default: goto err; } } else if (SCM_U32VECTORP(arg0)) { switch (SCM_U32VECTOR_SIZE(arg0)) { case 4: ENSURE(glVertexAttrib4NuivARB); - glVertexAttrib4NuivARB(index, SCM_U32VECTOR_ELEMENTS(arg0)); + glVertexAttrib4NuivARB(index, (GLuint*)SCM_U32VECTOR_ELEMENTS(arg0)); break; default: goto err; } @@ -1160,14 +1160,14 @@ glDeleteProgramsARB(1,&prog); } else if(SCM_U32VECTORP(arg0)) { ENSURE(glDeleteProgramsARB); - glDeleteProgramsARB(SCM_S32VECTOR_SIZE(arg0), SCM_U32VECTOR_ELEMENTS(arg0)); + glDeleteProgramsARB(SCM_S32VECTOR_SIZE(arg0), (GLuint*)SCM_U32VECTOR_ELEMENTS(arg0)); } SCM_RETURN(SCM_UNDEFINED); ") (define-cproc gl-gen-programs-arb (n::<int>) "ScmU32Vector *v = SCM_U32VECTOR(Scm_MakeU32Vector(n, 0)); ENSURE(glGenProgramsARB); - glGenProgramsARB(n, SCM_U32VECTOR_ELEMENTS(v)); + glGenProgramsARB(n, (GLuint*)SCM_U32VECTOR_ELEMENTS(v)); SCM_RETURN(SCM_OBJ(v));") ; target should be GL_FRAGMENT_PROGRAM_ARB or GL_VERTEX_PROGRAM_ARB @@ -1287,9 +1287,9 @@ } else if (SCM_S32VECTORP(arg0)) { switch (SCM_S32VECTOR_SIZE(arg0)) { case 2: ENSURE(glWindowPos2ivARB); - glWindowPos2ivARB(SCM_S32VECTOR_ELEMENTS(arg0)); break; + glWindowPos2ivARB((GLint*)SCM_S32VECTOR_ELEMENTS(arg0)); break; case 3: ENSURE(glWindowPos3ivARB); - glWindowPos3ivARB(SCM_S32VECTOR_ELEMENTS(arg0)); break; + glWindowPos3ivARB((GLint*)SCM_S32VECTOR_ELEMENTS(arg0)); break; default: goto err; } } else if (SCM_S16VECTORP(arg0)) { 以上 -- Takashi Ishizaki