diff options
author | Brian Paul <[email protected]> | 2009-12-31 09:02:27 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-31 09:02:27 -0700 |
commit | 25024d948298a9f3f3210a0b91486f79a3917b0f (patch) | |
tree | 5647623b9781193b7ed55c8d9233404938aeb853 /progs/demos/geartrain.c | |
parent | d14beea534dcb2b3ae2ae1f7ee0ba5dcdef3dba3 (diff) | |
parent | 195e7657e2f15f7ad8b22042b86bcf33c5bba76b (diff) |
Merge branch 'mesa_7_7_branch'
Conflicts:
configs/darwin
src/gallium/auxiliary/util/u_clear.h
src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
src/mesa/drivers/dri/i965/brw_draw_upload.c
Diffstat (limited to 'progs/demos/geartrain.c')
-rw-r--r-- | progs/demos/geartrain.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c index d2a195f39a2..00b6e78b724 100644 --- a/progs/demos/geartrain.c +++ b/progs/demos/geartrain.c @@ -25,6 +25,7 @@ */ +#include <assert.h> #include <math.h> #include <stdlib.h> #include <GL/glut.h> @@ -129,8 +130,10 @@ Clear_Buffers () static void LoadTriplet (TDA A) { + int result; Clear_Buffers (); - fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4); + result = fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4); + assert(result != EOF); A[0] = atof (Buf2); A[1] = atof (Buf3); A[2] = atof (Buf4); @@ -140,8 +143,10 @@ LoadTriplet (TDA A) static void LoadReal (float *a) { + int result; Clear_Buffers (); - fscanf (mainfile, "%s %s", Buf1, Buf2); + result = fscanf (mainfile, "%s %s", Buf1, Buf2); + assert(result != EOF); *a = atof (Buf2); } @@ -149,8 +154,10 @@ LoadReal (float *a) static void LoadInteger (int *a) { + int result; Clear_Buffers (); - fscanf (mainfile, "%s %s", Buf1, Buf2); + result = fscanf (mainfile, "%s %s", Buf1, Buf2); + assert(result != EOF); *a = atoi (Buf2); } @@ -158,8 +165,10 @@ LoadInteger (int *a) static void LoadText (char *a) { + int result; Clear_Buffers (); - fscanf (mainfile, "%s %s", Buf1, Buf2); + result = fscanf (mainfile, "%s %s", Buf1, Buf2); + assert(result != EOF); strcpy (a, Buf2); } @@ -177,8 +186,10 @@ getdata (char filename[]) do { + int result; Clear_Buffers (); - fscanf (mainfile, "%s", Buf1); + result = fscanf (mainfile, "%s", Buf1); + (void) result; if (ferror (mainfile)) { printf ("\nError opening file !\n"); |