aboutsummaryrefslogtreecommitdiffstats
path: root/progs/demos
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-07-12 15:54:01 +0000
committerBrian Paul <[email protected]>2002-07-12 15:54:01 +0000
commitf02a5f6cc55fc61229a038ac72edb3ce97cb6950 (patch)
treeb3f3b47105dd5939751262bd880dc7821b435679 /progs/demos
parent902d2faadf37a5627ab2cbcd8993825c8749ec82 (diff)
Pedantic compiler fixes (Sven Panne)
Diffstat (limited to 'progs/demos')
-rw-r--r--progs/demos/drawpix.c4
-rw-r--r--progs/demos/fire.c2
-rw-r--r--progs/demos/paltex.c4
-rw-r--r--progs/demos/readpix.c4
-rw-r--r--progs/demos/shadowtex.c6
-rw-r--r--progs/demos/terrain.c1
-rw-r--r--progs/demos/tessdemo.c22
-rw-r--r--progs/demos/trispd.c4
8 files changed, 25 insertions, 22 deletions
diff --git a/progs/demos/drawpix.c b/progs/demos/drawpix.c
index 222c8209c1c..25d336ece68 100644
--- a/progs/demos/drawpix.c
+++ b/progs/demos/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.7 2002/04/22 16:03:37 brianp Exp $ */
+/* $Id: drawpix.c,v 1.8 2002/07/12 15:54:02 brianp Exp $ */
/*
* glDrawPixels demo/test/benchmark
@@ -257,7 +257,7 @@ static void Init( GLboolean ciMode )
if (ciMode) {
/* Convert RGB image to grayscale */
- GLubyte *indexImage = malloc( ImgWidth * ImgHeight );
+ GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
GLint i;
for (i=0; i<ImgWidth*ImgHeight; i++) {
int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
diff --git a/progs/demos/fire.c b/progs/demos/fire.c
index e4492cbc161..a648a9d0db9 100644
--- a/progs/demos/fire.c
+++ b/progs/demos/fire.c
@@ -752,7 +752,7 @@ main(int ac, char **av)
glFogfv(GL_FOG_COLOR, fogcolor);
glFogf(GL_FOG_DENSITY, 0.1);
- p = malloc(sizeof(part) * np);
+ p = (part *) malloc(sizeof(part) * np);
for (i = 0; i < np; i++)
setnewpart(&p[i]);
diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c
index d37538bcf43..67ba27bb8ae 100644
--- a/progs/demos/paltex.c
+++ b/progs/demos/paltex.c
@@ -1,4 +1,4 @@
-/* $Id: paltex.c,v 1.7 2002/01/16 00:48:43 kschultz Exp $ */
+/* $Id: paltex.c,v 1.8 2002/07/12 15:54:02 brianp Exp $ */
/*
* Paletted texture demo. Written by Brian Paul.
@@ -161,7 +161,7 @@ static void Init( void )
0, /* border */
GL_COLOR_INDEX, /* texture format */
GL_UNSIGNED_BYTE, /* texture type */
- texture); /* teh texture */
+ texture); /* the texture */
#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c
index 0277a46a037..ec3665008d2 100644
--- a/progs/demos/readpix.c
+++ b/progs/demos/readpix.c
@@ -1,4 +1,4 @@
-/* $Id: readpix.c,v 1.7 2002/05/02 09:17:59 alanh Exp $ */
+/* $Id: readpix.c,v 1.8 2002/07/12 15:54:02 brianp Exp $ */
/*
* glReadPixels and glCopyPixels test
@@ -219,7 +219,7 @@ Init( GLboolean ciMode )
if (ciMode) {
/* Convert RGB image to grayscale */
- GLubyte *indexImage = malloc( ImgWidth * ImgHeight );
+ GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
GLint i;
for (i=0; i<ImgWidth*ImgHeight; i++) {
int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c
index c5251727d67..b574f43acd3 100644
--- a/progs/demos/shadowtex.c
+++ b/progs/demos/shadowtex.c
@@ -1,4 +1,4 @@
-/* $Id: shadowtex.c,v 1.6 2002/03/23 16:34:18 brianp Exp $ */
+/* $Id: shadowtex.c,v 1.7 2002/07/12 15:54:02 brianp Exp $ */
/*
* Shadow demo using the GL_ARB_depth_texture, GL_ARB_shadow and
@@ -276,8 +276,8 @@ Display(void)
*/
if (DisplayMode == SHOW_DEPTH_MAPPING) {
/* load depth image as gray-scale luminance texture */
- GLfloat *depth = malloc(ShadowTexWidth * ShadowTexHeight
- * sizeof(GLfloat));
+ GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
+ * sizeof(GLfloat));
if (depth) {
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
GL_DEPTH_COMPONENT, GL_FLOAT, depth);
diff --git a/progs/demos/terrain.c b/progs/demos/terrain.c
index 5b5ad3e1f7a..da5b90d300c 100644
--- a/progs/demos/terrain.c
+++ b/progs/demos/terrain.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#ifdef WIN32
diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c
index 0659b382c7f..abde73054cd 100644
--- a/progs/demos/tessdemo.c
+++ b/progs/demos/tessdemo.c
@@ -1,4 +1,4 @@
-/* $Id: tessdemo.c,v 1.11 2001/03/21 02:47:32 gareth Exp $ */
+/* $Id: tessdemo.c,v 1.12 2002/07/12 15:54:02 brianp Exp $ */
/*
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
@@ -165,6 +165,8 @@ static void set_screen_wh( GLsizei w, GLsizei h )
height = h;
}
+typedef void (GLAPIENTRY *callback_t)();
+
static void tesse( void )
{
GLUtesselator *tobj;
@@ -177,11 +179,11 @@ static void tesse( void )
if ( tobj != NULL ) {
gluTessNormal( tobj, 0.0, 0.0, 1.0 );
- gluTessCallback( tobj, GLU_TESS_BEGIN, glBegin );
- gluTessCallback( tobj, GLU_TESS_VERTEX, glVertex2fv );
- gluTessCallback( tobj, GLU_TESS_END, glEnd );
- gluTessCallback( tobj, GLU_TESS_ERROR, error_callback );
- gluTessCallback( tobj, GLU_TESS_COMBINE, combine_callback );
+ gluTessCallback( tobj, GLU_TESS_BEGIN, (callback_t) glBegin );
+ gluTessCallback( tobj, GLU_TESS_VERTEX, (callback_t) glVertex2fv );
+ gluTessCallback( tobj, GLU_TESS_END, (callback_t) glEnd );
+ gluTessCallback( tobj, GLU_TESS_ERROR, (callback_t) error_callback );
+ gluTessCallback( tobj, GLU_TESS_COMBINE, (callback_t) combine_callback );
glNewList( list_start, GL_COMPILE );
gluBeginPolygon( tobj );
@@ -201,10 +203,10 @@ static void tesse( void )
gluEndPolygon( tobj );
glEndList();
- gluTessCallback( tobj, GLU_TESS_BEGIN, begin_callback );
- gluTessCallback( tobj, GLU_TESS_VERTEX, vertex_callback );
- gluTessCallback( tobj, GLU_TESS_END, end_callback );
- gluTessCallback( tobj, GLU_TESS_EDGE_FLAG, edge_callback );
+ gluTessCallback( tobj, GLU_TESS_BEGIN, (callback_t) begin_callback );
+ gluTessCallback( tobj, GLU_TESS_VERTEX, (callback_t) vertex_callback );
+ gluTessCallback( tobj, GLU_TESS_END, (callback_t) end_callback );
+ gluTessCallback( tobj, GLU_TESS_EDGE_FLAG, (callback_t) edge_callback );
glNewList( list_start + 1, GL_COMPILE );
gluBeginPolygon( tobj );
diff --git a/progs/demos/trispd.c b/progs/demos/trispd.c
index 96152d4ced9..61d625526f2 100644
--- a/progs/demos/trispd.c
+++ b/progs/demos/trispd.c
@@ -1,4 +1,4 @@
-/* $Id: trispd.c,v 1.3 2002/04/22 16:03:37 brianp Exp $ */
+/* $Id: trispd.c,v 1.4 2002/07/12 15:54:02 brianp Exp $ */
/*
* Simple GLUT program to measure triangle strip rendering speed.
@@ -131,7 +131,7 @@ static void LoadTex(int comp, int filter)
{
GLubyte *pixels;
int x, y;
- pixels = malloc(4*256*256);
+ pixels = (GLubyte *) malloc(4*256*256);
for (y = 0; y < 256; ++y)
for (x = 0; x < 256; ++x) {
pixels[(y*256+x)*4+0] = (int)(128.5 + 127.0 * cos(0.024544 * x));