common: Clean up some gcc warnings (when -Wextra is used)

This commit is contained in:
Solomon Peachy 2013-07-26 16:18:35 -04:00
parent 193ced9487
commit 884919b5fe
3 changed files with 11 additions and 13 deletions

View file

@ -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

View file

@ -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");

View file

@ -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)