From 884919b5fe8b43447eb8ce237a4aa1419280a5af Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 26 Jul 2013 16:18:35 -0400 Subject: [PATCH] common: Clean up some gcc warnings (when -Wextra is used) --- Makefile | 13 ++++++------- backend_common.c | 5 ++--- selphy_print.c | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 70ce5fb..2c26c52 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -Wall -g +CFLAGS = -Wall -Wextra -g LDFLAGS = -lusb-1.0 CUPS_BACKEND_DIR = /usr/lib/cups/backend @@ -11,20 +11,19 @@ gutenprint: $(SOURCES) $(DEPS) gcc -o $@ $(SOURCES) $(LDFLAGS) $(CFLAGS) sonyupdr150: gutenprint - ln -s gutenprint $@ + ln -sf gutenprint $@ kodak6800: gutenprint - ln -s gutenprint $@ + ln -sf gutenprint $@ kodak1400: gutenprint - ln -s gutenprint $@ + ln -sf gutenprint $@ shinkos2145: gutenprint - ln -s gutenprint $@ + ln -sf gutenprint $@ canonselphy: gutenprint - ln -s gutenprint $@ - + ln -sf gutenprint $@ install: install -o root -m 700 gutenprint $(CUPS_BACKEND_DIR)/gutenprint+usb diff --git a/backend_common.c b/backend_common.c index c2cbbdc..5cf6be7 100644 --- a/backend_common.c +++ b/backend_common.c @@ -243,7 +243,6 @@ static int find_and_enumerate(struct libusb_context *ctx, struct libusb_device ***list, char *match_serno, int printer_type, - int media_type, /* XXX for future use */ int scan_only) { int num; @@ -393,7 +392,7 @@ int main (int argc, char **argv) } } libusb_init(&ctx); - find_and_enumerate(ctx, &list, NULL, P_ANY, -1, 1); + find_and_enumerate(ctx, &list, NULL, P_ANY, 1); libusb_free_device_list(list, 1); libusb_exit(ctx); exit(1); @@ -504,7 +503,7 @@ int main (int argc, char **argv) /* Libusb setup */ libusb_init(&ctx); /* Enumerate devices */ - found = find_and_enumerate(ctx, &list, use_serno, printer_type, -1, 0); + found = find_and_enumerate(ctx, &list, use_serno, printer_type, 0); if (found == -1) { ERROR("Printer open failure (No suitable printers found!)\n"); diff --git a/selphy_print.c b/selphy_print.c index 3926ccf..67a888f 100644 --- a/selphy_print.c +++ b/selphy_print.c @@ -152,7 +152,7 @@ static struct printer_data selphy_printers[] = { #define MAX_HEADER 28 -static const int es40_cp790_plane_lengths[4] = { 2227456, 1601600, 698880, 2976512 }; +static const uint32_t es40_cp790_plane_lengths[4] = { 2227456, 1601600, 698880, 2976512 }; static void setup_paper_codes(void) { @@ -217,10 +217,10 @@ enum { static int fancy_memcmp(const uint8_t *buf_a, const int16_t *buf_b, uint len, int16_t papercode_offset, int16_t papercode_val) { - int i; + uint i; for (i = 0 ; i < len ; i++) { - if (papercode_offset != -1 && i == papercode_offset) { + if (papercode_offset != -1 && i == (uint) papercode_offset) { if (papercode_val == -1) continue; else if (buf_a[i] != papercode_val)