From 940f0517d1272e195e7b14be567b9002811f6146 Mon Sep 17 00:00:00 2001 From: reinelt Date: Thu, 7 Sep 2006 09:06:25 +0000 Subject: [lcd4linux @ 2006-09-07 09:06:25 by reinelt] lots of wrong printf formats corrected (thanks to Ernst Bachmann) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@708 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- debug.h | 7 +++++-- drv_BeckmannEgle.c | 9 ++++++--- drv_Crystalfontz.c | 17 ++++++++++------- drv_Curses.c | 9 ++++++--- drv_LEDMatrix.c | 7 +++++-- drv_M50530.c | 10 ++++++---- drv_NULL.c | 9 ++++++--- drv_USBHUB.c | 17 ++++++++++------- drv_generic_i2c.c | 7 +++++-- plugin_i2c_sensors.c | 7 +++++-- widget_image.c | 7 +++++-- 11 files changed, 69 insertions(+), 37 deletions(-) diff --git a/debug.h b/debug.h index 0cfdd63..77cdbce 100644 --- a/debug.h +++ b/debug.h @@ -1,4 +1,4 @@ -/* $Id: debug.h,v 1.10 2005/05/08 04:32:43 reinelt Exp $ +/* $Id: debug.h,v 1.11 2006/09/07 09:06:25 reinelt Exp $ * * debug messages * @@ -23,6 +23,9 @@ * * * $Log: debug.h,v $ + * Revision 1.11 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.10 2005/05/08 04:32:43 reinelt * CodingStyle added and applied * @@ -73,7 +76,7 @@ extern int running_foreground; extern int running_background; extern int verbose_level; -void message(const int level, const char *format, ...); +void message(const int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3)));; #define debug(args...) message (2, __FILE__ ": " args) #define info(args...) message (1, args) diff --git a/drv_BeckmannEgle.c b/drv_BeckmannEgle.c index 5ce094e..4e6c726 100644 --- a/drv_BeckmannEgle.c +++ b/drv_BeckmannEgle.c @@ -1,4 +1,4 @@ -/* $Id: drv_BeckmannEgle.c,v 1.16 2006/01/30 06:25:49 reinelt Exp $ +/* $Id: drv_BeckmannEgle.c,v 1.17 2006/09/07 09:06:25 reinelt Exp $ * * driver for Beckmann+Egle "Mini Terminals" and "Compact Terminals" * Copyright (C) 2000 Michael Reinelt @@ -22,6 +22,9 @@ * * * $Log: drv_BeckmannEgle.c,v $ + * Revision 1.17 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.16 2006/01/30 06:25:49 reinelt * added CVS Revision * @@ -502,7 +505,7 @@ static int drv_BuE_CT_start(const char *section) if (type != NULL) { info("%s: Port %d: %s", Name, i, type); } else { - error("%s: internal error: port % unknown type %d", Name, i, cmd[3]); + error("%s: internal error: port %d unknown type %d", Name, i, cmd[3]); } } else { error("%s: error fetching type of port %d", Name, i); @@ -696,7 +699,7 @@ int drv_BuE_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Revision: 1.16 $"); + info("%s: %s", Name, "$Revision: 1.17 $"); /* start display */ if ((ret = drv_BuE_start(section)) != 0) { diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c index bade58b..eda3e2e 100644 --- a/drv_Crystalfontz.c +++ b/drv_Crystalfontz.c @@ -1,4 +1,4 @@ -/* $Id: drv_Crystalfontz.c,v 1.45 2006/07/19 01:48:11 cmay Exp $ +/* $Id: drv_Crystalfontz.c,v 1.46 2006/09/07 09:06:25 reinelt Exp $ * * new style driver for Crystalfontz display modules * @@ -23,6 +23,9 @@ * * * $Log: drv_Crystalfontz.c,v $ + * Revision 1.46 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.45 2006/07/19 01:48:11 cmay * Ran indent.sh to make pretty code. * @@ -367,7 +370,7 @@ static void drv_CF_process_packet(void) default: /* this should not happen */ - error("%s: unexpected response type=0x%02x code=0x%02x size=%d", Packet.type, Packet.code, Packet.size); + error("%s: unexpected response type=0x%02x code=0x%02x size=%d", Name, Packet.type, Packet.code, Packet.size); break; } @@ -375,14 +378,14 @@ static void drv_CF_process_packet(void) case 0x03: /* error response from display to host */ - error("%s: error response type=0x%02x code=0x%02x size=%d", Packet.type, Packet.code, Packet.size); + error("%s: error response type=0x%02x code=0x%02x size=%d", Name, Packet.type, Packet.code, Packet.size); break; default: /* these should not happen: */ /* type 0x00: command from host to display: should never come back */ /* type 0x01: command response from display to host: are processed within send() */ - error("%s: unexpected packet type=0x%02x code=0x%02x size=%d", Packet.type, Packet.code, Packet.size); + error("%s: unexpected packet type=0x%02x code=0x%02x size=%d", Name, Packet.type, Packet.code, Packet.size); break; } @@ -502,7 +505,7 @@ static void drv_CF_send(const unsigned char cmd, const unsigned char len, const /* this is the ack we're waiting for */ if (0) { gettimeofday(&end, NULL); - debug("%s: ACK after %d usec", Name, + debug("%s: ACK after %ld usec", Name, 1000000 * (end.tv_sec - now.tv_sec) + end.tv_usec - now.tv_usec); } break; @@ -1079,7 +1082,7 @@ static void plugin_backlight(RESULT * result, const int argc, RESULT * argv[]) SetResult(&result, R_NUMBER, &backlight); break; default: - error("%s.backlight(): wrong number of parameters"); + error("%s.backlight(): wrong number of parameters", Name); SetResult(&result, R_STRING, ""); } } @@ -1123,7 +1126,7 @@ int drv_CF_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Revision: 1.45 $"); + info("%s: %s", Name, "$Revision: 1.46 $"); /* start display */ if ((ret = drv_CF_start(section)) != 0) { diff --git a/drv_Curses.c b/drv_Curses.c index 12590ae..2c47012 100644 --- a/drv_Curses.c +++ b/drv_Curses.c @@ -1,4 +1,4 @@ -/* $Id: drv_Curses.c,v 1.13 2006/07/19 01:48:11 cmay Exp $ +/* $Id: drv_Curses.c,v 1.14 2006/09/07 09:06:25 reinelt Exp $ * * pure ncurses based text driver * @@ -26,6 +26,9 @@ * * * $Log: drv_Curses.c,v $ + * Revision 1.14 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.13 2006/07/19 01:48:11 cmay * Ran indent.sh to make pretty code. * @@ -217,7 +220,7 @@ static int drv_Curs_start(const char *section, const int quiet) return -1; } if (sscanf(s, "%dx%d", &DCOLS, &DROWS) != 2 || DROWS < 1 || DCOLS < 1) { - error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source); + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); free(s); return -1; } @@ -338,7 +341,7 @@ int drv_Curs_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Revision: 1.13 $"); + info("%s: %s", Name, "$Revision: 1.14 $"); /* display preferences */ XRES = 1; /* pixel width of one char */ diff --git a/drv_LEDMatrix.c b/drv_LEDMatrix.c index 55234be..5a0c76e 100644 --- a/drv_LEDMatrix.c +++ b/drv_LEDMatrix.c @@ -1,4 +1,4 @@ -/* $Id: drv_LEDMatrix.c,v 1.9 2006/08/14 19:24:22 harbaum Exp $ +/* $Id: drv_LEDMatrix.c,v 1.10 2006/09/07 09:06:25 reinelt Exp $ * * LED matrix driver for LCD4Linux * (see http://www.harbaum.org/till/ledmatrix for hardware) @@ -23,6 +23,9 @@ * * * $Log: drv_LEDMatrix.c,v $ + * Revision 1.10 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.9 2006/08/14 19:24:22 harbaum * Umlaut support, added KVV HTTP-User-Agent * @@ -206,7 +209,7 @@ static int drv_LEDMatrix_start(const char *section) info("%s: port set to %d", Name, val); port = val; } else { - info("%s: using default port", Name, port); + info("%s: using default port %d", Name, port); } /* display size is hard coded */ diff --git a/drv_M50530.c b/drv_M50530.c index 8387b6b..e5daad0 100644 --- a/drv_M50530.c +++ b/drv_M50530.c @@ -1,4 +1,4 @@ -/* $Id: drv_M50530.c,v 1.24 2006/08/13 06:46:51 reinelt Exp $ +/* $Id: drv_M50530.c,v 1.25 2006/09/07 09:06:25 reinelt Exp $ * * new style driver for M50530-based displays * @@ -23,6 +23,9 @@ * * * $Log: drv_M50530.c,v $ + * Revision 1.25 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.24 2006/08/13 06:46:51 reinelt * T6963 soft-timing & enhancements; indent * @@ -448,8 +451,7 @@ static int drv_M5_start(const char *section, const int quiet) if (DCOLS * DROWS > 256) { - error("%s: %s.Size '%dx%d' is too big, would require %d bytes", Name, section, DCOLS, DROWS, DCOLS * DROWS, - cfg_source()); + error("%s: %s.Size '%dx%d' is too big, would require %d bytes", Name, section, DCOLS, DROWS, DCOLS * DROWS); return -1; } else if (DCOLS * DROWS > 224) { DDRAM = 256; @@ -691,7 +693,7 @@ int drv_M5_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Revision: 1.24 $"); + info("%s: %s", Name, "$Revision: 1.25 $"); /* display preferences */ XRES = -1; /* pixel width of one char */ diff --git a/drv_NULL.c b/drv_NULL.c index 6e2c084..54be585 100644 --- a/drv_NULL.c +++ b/drv_NULL.c @@ -1,4 +1,4 @@ -/* $Id: drv_NULL.c,v 1.9 2006/01/30 06:25:53 reinelt Exp $ +/* $Id: drv_NULL.c,v 1.10 2006/09/07 09:06:25 reinelt Exp $ * * NULL driver (for testing) * @@ -23,6 +23,9 @@ * * * $Log: drv_NULL.c,v $ + * Revision 1.10 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.9 2006/01/30 06:25:53 reinelt * added CVS Revision * @@ -122,7 +125,7 @@ static int drv_NULL_start(const char *section) return -1; } if (sscanf(s, "%dx%d", &DCOLS, &DROWS) != 2 || DROWS < 1 || DCOLS < 1) { - error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source); + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); free(s); return -1; } @@ -167,7 +170,7 @@ int drv_NULL_init(const char *section, const __attribute__ ((unused)) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Revision: 1.9 $"); + info("%s: %s", Name, "$Revision: 1.10 $"); /* display preferences */ XRES = 6; /* pixel width of one char */ diff --git a/drv_USBHUB.c b/drv_USBHUB.c index a98d50f..b324967 100644 --- a/drv_USBHUB.c +++ b/drv_USBHUB.c @@ -1,4 +1,4 @@ -/* $Id: drv_USBHUB.c,v 1.4 2006/08/14 19:24:22 harbaum Exp $ +/* $Id: drv_USBHUB.c,v 1.5 2006/09/07 09:06:25 reinelt Exp $ * * new style driver for USBLCD displays * @@ -25,6 +25,9 @@ * * * $Log: drv_USBHUB.c,v $ + * Revision 1.5 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.4 2006/08/14 19:24:22 harbaum * Umlaut support, added KVV HTTP-User-Agent * @@ -122,7 +125,7 @@ static int drv_UH_open(void) (v & 0xF000) >> 12, (v & 0xF00) >> 8, (v & 0xF0) >> 4, (v & 0xF), bus->dirname, dev->filename); if (dev->descriptor.bDeviceClass != USB_CLASS_HUB) { - error("%s: the specified device claims to be no HUB"); + error("%s: the specified device claims to be no HUB", Name); return -1; } @@ -197,11 +200,11 @@ static int drv_UH_start(const char *section, const __attribute__ ((unused)) buf = cfg_get(section, "Vendor", NULL); if (buf) { if (!*buf) { - error("%s: Strange Vendor Specification"); + error("%s: Strange Vendor Specification", Name); return -1; } if (sscanf(buf, "0x%x", &hubVendor) != 1) { - error("%s: Strange Vendor Specification: [%s]", buf); + error("%s: Strange Vendor Specification: [%s]", Name, buf); return -1; } } @@ -209,11 +212,11 @@ static int drv_UH_start(const char *section, const __attribute__ ((unused)) buf = cfg_get(section, "Product", NULL); if (buf) { if (!*buf) { - error("%s: Strange Product Specification"); + error("%s: Strange Product Specification", Name); return -1; } if (sscanf(buf, "0x%x", &hubProduct) != 1) { - error("%s: Strange Product Specification: [%s]", buf); + error("%s: Strange Product Specification: [%s]", Name, buf); return -1; } } @@ -282,7 +285,7 @@ int drv_UH_init(const char *section, const int quiet) int ret; int i; - info("%s: %s", Name, "$Revision: 1.4 $"); + info("%s: %s", Name, "$Revision: 1.5 $"); diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c index b9ef1b6..6c1213a 100644 --- a/drv_generic_i2c.c +++ b/drv_generic_i2c.c @@ -1,4 +1,4 @@ -/* $Id: drv_generic_i2c.c,v 1.8 2006/07/31 03:48:09 reinelt Exp $ +/* $Id: drv_generic_i2c.c,v 1.9 2006/09/07 09:06:25 reinelt Exp $ * * generic driver helper for i2c displays * @@ -23,6 +23,9 @@ * * * $Log: drv_generic_i2c.c,v $ + * Revision 1.9 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.8 2006/07/31 03:48:09 reinelt * preparations for scrolling * @@ -105,7 +108,7 @@ static void my_i2c_smbus_write_byte_data(const int device, const unsigned char v data.byte = val; args.data = &data; if (ioctl(device, I2C_SMBUS, &args) < 0) { - info("I2C: device %s IOCTL failed !\n", device); + info("I2C: device %d IOCTL failed !\n", device); } } diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index b3bbc2f..7dee1e9 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,4 +1,4 @@ -/* $Id: plugin_i2c_sensors.c,v 1.25 2006/02/25 13:36:33 geronet Exp $ +/* $Id: plugin_i2c_sensors.c,v 1.26 2006/09/07 09:06:25 reinelt Exp $ * * I2C sensors plugin * @@ -23,6 +23,9 @@ * * * $Log: plugin_i2c_sensors.c,v $ + * Revision 1.26 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.25 2006/02/25 13:36:33 geronet * updated indent.sh, applied coding style * @@ -414,7 +417,7 @@ static int configure_i2c_sensors(void) } else if (strncmp(path, "/proc", 5) == 0) { parse_i2c_sensors = parse_i2c_sensors_procfs; } else { - error("i2c_sensors: unknown path %s, should start with /sys or /proc"); + error("i2c_sensors: unknown path %s, should start with /sys or /proc", path); configured = -1; return configured; } diff --git a/widget_image.c b/widget_image.c index b9d37e7..17d73de 100644 --- a/widget_image.c +++ b/widget_image.c @@ -1,4 +1,4 @@ -/* $Id: widget_image.c,v 1.9 2006/06/21 05:12:43 reinelt Exp $ +/* $Id: widget_image.c,v 1.10 2006/09/07 09:06:25 reinelt Exp $ * * image widget handling * @@ -21,6 +21,9 @@ * * * $Log: widget_image.c,v $ + * Revision 1.10 2006/09/07 09:06:25 reinelt + * lots of wrong printf formats corrected (thanks to Ernst Bachmann) + * * Revision 1.9 2006/06/21 05:12:43 reinelt * added checks for libgd version 2 (thanks to Sam) * @@ -148,7 +151,7 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image) int i = Image->width * Image->height * sizeof(Image->bitmap[0]); Image->bitmap = malloc(i); if (Image->bitmap == NULL) { - error("Warning: Image %s: malloc(%d) failed!", Name, i, strerror(errno)); + error("Warning: Image %s: malloc(%d) failed: %s", Name, i, strerror(errno)); return; } for (i = 0; i < Image->height * Image->width; i++) { -- cgit v1.2.3