aboutsummaryrefslogtreecommitdiffstats
path: root/progs/samples
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/samples
parent902d2faadf37a5627ab2cbcd8993825c8749ec82 (diff)
Pedantic compiler fixes (Sven Panne)
Diffstat (limited to 'progs/samples')
-rw-r--r--progs/samples/loadppm.c4
-rw-r--r--progs/samples/nurb.c4
-rw-r--r--progs/samples/quad.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/progs/samples/loadppm.c b/progs/samples/loadppm.c
index bf7c8dd1e89..5d3e3ab56f1 100644
--- a/progs/samples/loadppm.c
+++ b/progs/samples/loadppm.c
@@ -30,7 +30,7 @@ static PPMImage *LoadPPM(const char *filename)
exit(1);
}
- result = malloc(sizeof(PPMImage));
+ result = (PPMImage *) malloc(sizeof(PPMImage));
if (!result)
{
fprintf(stderr, "Unable to allocate memory\n");
@@ -52,7 +52,7 @@ static PPMImage *LoadPPM(const char *filename)
while (fgetc(fp) != '\n')
;
- result->data = malloc(3 * result->sizeX * result->sizeY);
+ result->data = (GLubyte *) malloc(3 * result->sizeX * result->sizeY);
if (!result)
{
fprintf(stderr, "Unable to allocate memory\n");
diff --git a/progs/samples/nurb.c b/progs/samples/nurb.c
index f90c6ee91f6..dc8991295e8 100644
--- a/progs/samples/nurb.c
+++ b/progs/samples/nurb.c
@@ -216,11 +216,13 @@ static void CALLBACK ErrorCallback(GLenum which)
}
}
+typedef void (GLAPIENTRY *callback_t)();
+
static void Init(void)
{
theNurbs = gluNewNurbsRenderer();
- gluNurbsCallback(theNurbs, GLU_ERROR, ErrorCallback);
+ gluNurbsCallback(theNurbs, GLU_ERROR, (callback_t) ErrorCallback);
gluNurbsProperty(theNurbs, GLU_SAMPLING_TOLERANCE, 15.0);
gluNurbsProperty(theNurbs, GLU_DISPLAY_MODE, GLU_OUTLINE_PATCH);
diff --git a/progs/samples/quad.c b/progs/samples/quad.c
index 8dec28b6bbd..5b721a44529 100644
--- a/progs/samples/quad.c
+++ b/progs/samples/quad.c
@@ -102,6 +102,8 @@ static void CALLBACK ErrorHandler(GLenum which)
fprintf(stderr, "Quad Error: %s\n", gluErrorString(which));
}
+typedef void (GLAPIENTRY *callback_t)();
+
static void Init(void)
{
static GLint colorIndexes[3] = {0, 200, 255};
@@ -163,7 +165,7 @@ static void Init(void)
}
quadObj = gluNewQuadric();
- gluQuadricCallback(quadObj, GLU_ERROR, ErrorHandler);
+ gluQuadricCallback(quadObj, GLU_ERROR, (callback_t) ErrorHandler);
radius1 = 10;
radius2 = 5;