[m-rev.] trivial diff: avoid C compiler warnings in opengl binding
    Julien Fischer 
    juliensf at cs.mu.OZ.AU
       
    Wed Aug 31 15:12:12 AEST 2005
    
    
  
Estimated hours taken: 0.1
Branches: main
extras/graphics/mercury_opengl/mogl.m:
	Fix C compilation warnings in the OpenGL binding.
Julien.
Index: mogl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_opengl/mogl.m,v
retrieving revision 1.18
diff -u -r1.18 mogl.m
--- mogl.m	4 Aug 2005 13:03:17 -0000	1.18
+++ mogl.m	31 Aug 2005 05:09:33 -0000
@@ -1193,6 +1193,7 @@
 	GLenum err;
 	MR_Integer i;
+	Err = 0;
 	err = glGetError();
 	for (i=0; i < 7; i++) {
@@ -3145,7 +3146,10 @@
 	get_fog_mode_2(Mode::out, IO0::di, IO::uo),
 	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
-	glGetIntegerv(GL_FOG_MODE, &Mode);
+	GLint mode;
+
+	glGetIntegerv(GL_FOG_MODE, &mode);
+	Mode = (MR_Integer) mode;
 	IO = IO0;
 ").
@@ -4371,7 +4375,9 @@
 	get_hint_2(Target::in, Mode::out, IO0::di, IO::uo),
 	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
-	glGetIntegerv(hint_target_flags[Target], &Mode);
+	GLint mode;
+	glGetIntegerv(hint_target_flags[Target], &mode);
+	Mode = (MR_Integer) mode;
 	IO = IO0;
 ").
@@ -5068,15 +5074,12 @@
 	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	/*
- 	** XXX Apple's OpenGL implementation is broken.
-	** It doesn't define GL_ALL_CLIENT_ATTRIB_BITS.
+	** Some OpenGL implementations don't define
+	** GL_ALL_CLIENT_ATTRIB_BITS, so we fake its
+	** effect here.
 	*/
-	#if defined(__APPLE__) && defined(__MACH__)
-		glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
-		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
-	#else
-		glPushClientAttrib(GL_ALL_CLIENT_ATTRIB_BITS);
-	#endif
+	glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
+	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 	IO = IO0;
 ").
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
    
    
More information about the reviews
mailing list