summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-02-09 12:40:35 +0100
committerPeter Stuge <peter@stuge.se>2011-07-24 23:33:59 +0200
commita68f956dd4c29d6ed799f04f07a3346317843999 (patch)
tree65940cad256e15f59a050a5dde0e4317b0ac875e /examples
parent209b5ccd827039b933b730e3f29abd0d72d3c6c6 (diff)
downloadlibusb-a68f956dd4c29d6ed799f04f07a3346317843999.tar.gz
Linux: Fix warnings seen when compiling with gcc-4.6
Compiling with gcc-4.6 results in the following warnings: os/linux_usbfs.c: In function 'op_get_configuration': os/linux_usbfs.c:1144:6: warning: variable 'r' set but not used ... os/linux_usbfs.c: In function 'op_handle_events': os/linux_usbfs.c:2091:40: warning: 'status' may be used uninitialized ... os/linux_usbfs.c:2044:6: note: 'status' was declared here dpfp.c: In function 'save_to_file': dpfp.c:228:9: warning: variable 'ignore' set but not used ... dpfp_threaded.c: In function 'save_to_file': dpfp_threaded.c:257:9: warning: variable 'ignore' set but not used ... This patch fixes these. (The second comes from handle_control_completion() which gcc seems to inline into op_handle_events().) Signed-off-by: Hans de Goede <hdegoede@redhat.com> [stuge: Add fixes for dpfp examples and update source references]
Diffstat (limited to 'examples')
-rw-r--r--examples/dpfp.c3
-rw-r--r--examples/dpfp_threaded.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/dpfp.c b/examples/dpfp.c
index 5127dde..1b3c3a4 100644
--- a/examples/dpfp.c
+++ b/examples/dpfp.c
@@ -225,7 +225,6 @@ static int save_to_file(unsigned char *data)
{
FILE *fd;
char filename[64];
- size_t ignore;
sprintf(filename, "finger%d.pgm", img_idx++);
fd = fopen(filename, "w");
@@ -233,7 +232,7 @@ static int save_to_file(unsigned char *data)
return -1;
fputs("P5 384 289 255 ", fd);
- ignore = fwrite(data + 64, 1, 384*289, fd);
+ (void) fwrite(data + 64, 1, 384*289, fd);
fclose(fd);
printf("saved image to %s\n", filename);
return 0;
diff --git a/examples/dpfp_threaded.c b/examples/dpfp_threaded.c
index c3cac73..c3d314d 100644
--- a/examples/dpfp_threaded.c
+++ b/examples/dpfp_threaded.c
@@ -254,7 +254,6 @@ static int save_to_file(unsigned char *data)
{
FILE *fd;
char filename[64];
- size_t ignore;
sprintf(filename, "finger%d.pgm", img_idx++);
fd = fopen(filename, "w");
@@ -262,7 +261,7 @@ static int save_to_file(unsigned char *data)
return -1;
fputs("P5 384 289 255 ", fd);
- ignore = fwrite(data + 64, 1, 384*289, fd);
+ (void) fwrite(data + 64, 1, 384*289, fd);
fclose(fd);
printf("saved image to %s\n", filename);
return 0;