summaryrefslogtreecommitdiffstats
path: root/progs/demos/geartrain.c
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-12-26 01:08:26 -0800
committerVinson Lee <[email protected]>2009-12-26 01:08:26 -0800
commite81fe088f447b959b354fadf0d73fcc7ac7c468d (patch)
treebd09b205a05817524ffdcac5f785b67075e234a4 /progs/demos/geartrain.c
parentcdc69e34694a16e9f762aba45d7eba05e9dc8514 (diff)
progs/demos: Silence warn_unused_result warnings.
Diffstat (limited to 'progs/demos/geartrain.c')
-rw-r--r--progs/demos/geartrain.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c
index 8fe405e8076..e6567dd6470 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");