From a6a03faa860233ec2b2d13abbb14bd9661a61222 Mon Sep 17 00:00:00 2001 From: reinelt Date: Sat, 2 Apr 2005 05:28:58 +0000 Subject: [lcd4linux @ 2005-04-02 05:28:58 by reinelt] fixed gcc4 warnings about signed/unsigned mismatches git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@523 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_Crystalfontz.c | 28 +++++++++++++++------------- drv_SimpleLCD.c | 9 ++++++--- drv_USBLCD.c | 9 ++++++--- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c index a92ff30..1dc6c71 100644 --- a/drv_Crystalfontz.c +++ b/drv_Crystalfontz.c @@ -1,4 +1,4 @@ -/* $Id: drv_Crystalfontz.c,v 1.32 2005/03/23 12:23:35 reinelt Exp $ +/* $Id: drv_Crystalfontz.c,v 1.33 2005/04/02 05:28:58 reinelt Exp $ * * new style driver for Crystalfontz display modules * @@ -23,6 +23,9 @@ * * * $Log: drv_Crystalfontz.c,v $ + * Revision 1.33 2005/04/02 05:28:58 reinelt + * fixed gcc4 warnings about signed/unsigned mismatches + * * Revision 1.32 2005/03/23 12:23:35 reinelt * fixed some signed/unsigned char mismatches in the Crystalfontz driver (ticket #12) * @@ -321,22 +324,22 @@ static void drv_CF_process_packet (void) static int drv_CF_poll (void) { - unsigned char buffer[32]; - /* read into RingBuffer */ while (1) { + char buffer[32]; int num, n; num = drv_generic_serial_poll(buffer, sizeof(buffer)); if (num <= 0) break; /* put result into RingBuffer */ for (n = 0; n < num; n++) { - RingBuffer[RingWPos++] = buffer[n]; + RingBuffer[RingWPos++] = (unsigned char)buffer[n]; if (RingWPos >= sizeof(RingBuffer)) RingWPos = 0; } } /* process RingBuffer */ while (1) { + unsigned char buffer[32]; int n, num, size; unsigned short crc; /* packet size */ @@ -395,11 +398,11 @@ static void drv_CF_send (const int cmd, int len, const unsigned char *data) if (len > Payload) { error ("%s: internal error: packet length %d exceeds payload size %d", Name, len, Payload); - len=sizeof(buffer)-1; + len = sizeof(buffer)-1; } - buffer[0]=cmd; - buffer[1]=len; + buffer[0] = cmd; + buffer[1] = len; memcpy (buffer+2, data, len); crc = CRC(buffer, len+2, 0xffff); buffer[len+2] = LSB(crc); @@ -409,14 +412,14 @@ static void drv_CF_send (const int cmd, int len, const unsigned char *data) debug ("Tx Packet %d len=%d", buffer[0], buffer[1]); #endif - drv_generic_serial_write (buffer, len+4); + drv_generic_serial_write ((char*)buffer, len+4); } static void drv_CF_write1 (const int row, const int col, const char *data, const int len) { - unsigned char cmd[3]="\021xy"; /* set cursor position */ + char cmd[3]="\021xy"; /* set cursor position */ if (row==0 && col==0) { drv_generic_serial_write ("\001", 1); /* cursor home */ @@ -475,7 +478,7 @@ static void drv_CF_write3 (const int row, const int col, const char *data, const static void drv_CF_defchar1 (const int ascii, const unsigned char *matrix) { int i; - unsigned char cmd[10]="\031n"; /* set custom char bitmap */ + char cmd[10]="\031n"; /* set custom char bitmap */ /* user-defineable chars start at 128, but are defined at 0 */ cmd[1]=(char)(ascii-CHAR0); @@ -506,7 +509,7 @@ static void drv_CF_defchar23 (const int ascii, const unsigned char *matrix) static int drv_CF_contrast (int contrast) { static unsigned char Contrast=0; - unsigned char buffer[2]; + char buffer[2]; /* -1 is used to query the current contrast */ if (contrast == -1) return Contrast; @@ -544,7 +547,7 @@ static int drv_CF_contrast (int contrast) static int drv_CF_backlight (int backlight) { static unsigned char Backlight=0; - unsigned char buffer[2]; + char buffer[2]; /* -1 is used to query the current backlight */ if (backlight == -1) return Backlight; @@ -563,7 +566,6 @@ static int drv_CF_backlight (int backlight) case 2: case 3: - buffer[0] = Backlight; drv_CF_send (14, 1, &Backlight); break; } diff --git a/drv_SimpleLCD.c b/drv_SimpleLCD.c index 85f91bf..eb449a6 100644 --- a/drv_SimpleLCD.c +++ b/drv_SimpleLCD.c @@ -1,4 +1,4 @@ -/* $Id: drv_SimpleLCD.c,v 1.1 2005/02/24 07:06:48 reinelt Exp $ +/* $Id: drv_SimpleLCD.c,v 1.2 2005/04/02 05:28:58 reinelt Exp $ * * driver for a simple serial terminal. * This driver simply send out caracters on the serial port, without any @@ -40,6 +40,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: drv_SimpleLCD.c,v $ + * Revision 1.2 2005/04/02 05:28:58 reinelt + * fixed gcc4 warnings about signed/unsigned mismatches + * * Revision 1.1 2005/02/24 07:06:48 reinelt * SimpleLCD driver added * @@ -123,12 +126,12 @@ static void drv_SL_write (const int row, const int col, const char *data, int le static int drv_SL_start (const char *section, const int quiet) { int rows=-1, cols=-1; - unsigned int flags=0; + int flags=0; char *s; cfg_number(section,"Options",0,0,0xffff,&flags); - if (drv_generic_serial_open(section, Name, flags) < 0) return -1; + if (drv_generic_serial_open(section, Name, (unsigned) flags) < 0) return -1; s=cfg_get(section, "Size", NULL); if (s==NULL || *s=='\0') { diff --git a/drv_USBLCD.c b/drv_USBLCD.c index ba9ab40..a1e8eba 100644 --- a/drv_USBLCD.c +++ b/drv_USBLCD.c @@ -1,4 +1,4 @@ -/* $Id: drv_USBLCD.c,v 1.20 2005/01/30 06:43:22 reinelt Exp $ +/* $Id: drv_USBLCD.c,v 1.21 2005/04/02 05:28:58 reinelt Exp $ * * new style driver for USBLCD displays * @@ -26,6 +26,9 @@ * * * $Log: drv_USBLCD.c,v $ + * Revision 1.21 2005/04/02 05:28:58 reinelt + * fixed gcc4 warnings about signed/unsigned mismatches + * * Revision 1.20 2005/01/30 06:43:22 reinelt * driver for LCD-Linux finished * @@ -165,8 +168,8 @@ static char Name[] = "USBLCD"; static char *Port = NULL; static int use_libusb = 0; static int usblcd_file; -static unsigned char *Buffer; -static unsigned char *BufPtr; +static char *Buffer; +static char *BufPtr; #ifdef HAVE_USB_H -- cgit v1.2.3 +122 rearranged autoconf a bit, libX11 will be linked only if really needed (i.e. when the X11 driver has been selected) plugin_python filled with life 2005-05-02[lcd4linux @ 2005-05-02 10:29:20 by reinelt]reinelt9-30/+636 preparations for python bindings and python plugin 2005-05-02[lcd4linux @ 2005-05-02 05:15:46 by reinelt]reinelt4-9/+51 make busy-flag checking configurable for LCD-Linux driver 2005-04-30[lcd4linux @ 2005-04-30 06:02:09 by reinelt]reinelt3-15/+44 LCD-Linux display size set up from lcd4linux.conf 2005-04-24[lcd4linux @ 2005-04-24 05:27:09 by reinelt]reinelt2-7/+38 Trefon Backlight added 2005-04-24[lcd4linux @ 2005-04-24 04:41:28 by reinelt]reinelt1-0/+68 Changelog updated 2005-04-24[lcd4linux @ 2005-04-24 04:33:46 by reinelt]reinelt9-10/+444 driver for TREFON USB LCD's added 2005-04-20[lcd4linux @ 2005-04-20 05:49:21 by reinelt]reinelt1-44/+125 Changed the code to add some VT100-compatible control sequences (see the comments above). A configfile boolean option 'VT100_Support' (default to 1) indicate if the display in used support these control-sequences or not. 2005-04-09[lcd4linux @ 2005-04-09 07:36:42 by reinelt]reinelt2-17/+99 updated LCD-Linux driver to version 0.8.8 2005-04-05[lcd4linux @ 2005-04-05 06:57:39 by reinelt]reinelt3-34/+34 AC_CHECK_HEADERS corrected 2005-04-05[lcd4linux @ 2005-04-05 05:12:48 by reinelt]reinelt4-407/+33 i2c patch from Paul (still does not work here :-( 2005-04-05[lcd4linux @ 2005-04-05 04:46:06 by reinelt]reinelt1-1/+20 ceil/floor patch from Maxime 2005-04-04[lcd4linux @ 2005-04-04 20:11:14 by nicowallmeier]nicowallmeier1-2/+6 to be compatible with gcc 2.95 2005-04-03[lcd4linux @ 2005-04-03 07:07:43 by reinelt]reinelt8-9/+152 added statfs plugin 2005-04-02[lcd4linux @ 2005-04-02 05:28:58 by reinelt]reinelt3-19/+27 fixed gcc4 warnings about signed/unsigned mismatches 2005-04-01[lcd4linux @ 2005-04-01 05:16:04 by reinelt]reinelt5-584/+694 moved plugin init stuff to a seperate function called on first use 2005-03-30[lcd4linux @ 2005-03-30 04:57:50 by reinelt]reinelt3-23/+67 Evaluator speedup: use bsearch for finding functions and variables 2005-03-28[lcd4linux @ 2005-03-28 22:29:23 by reinelt]reinelt1-250/+346 HD44780 multiple displays patch from geronet 2005-03-28[lcd4linux @ 2005-03-28 19:39:14 by reinelt]reinelt9-256/+1147 HD44780/I2C patch from Luis merged (still does not work for me) 2005-03-25[lcd4linux @ 2005-03-25 15:44:43 by reinelt]reinelt1-2/+5 HD44780 Backlight fixed (thanks to geronet) 2005-03-23[lcd4linux @ 2005-03-23 12:23:35 by reinelt]reinelt1-27/+32 fixed some signed/unsigned char mismatches in the Crystalfontz driver (ticket #12) 2005-02-24[lcd4linux @ 2005-02-24 07:07:55 by reinelt]reinelt1-0/+53 ChangeLog 2005-02-24[lcd4linux @ 2005-02-24 07:06:45 by reinelt]reinelt11-28/+347 SimpleLCD driver added 2005-02-24[lcd4linux @ 2005-02-24 06:51:40 by reinelt]reinelt1-4/+5 LCD-Linux driver GOTO_COST corrected 2005-01-30[lcd4linux @ 2005-01-30 06:43:22 by reinelt]reinelt4-69/+95 driver for LCD-Linux finished 2005-01-29[lcd4linux @ 2005-01-29 09:30:56 by reinelt]reinelt1-8/+11 minor HD44780 cleanups 2005-01-22[lcd4linux @ 2005-01-22 22:57:57 by reinelt]reinelt9-47/+382 LCD-Linux driver added 2005-01-22[lcd4linux @ 2005-01-22 12:44:41 by reinelt]reinelt1-3/+6 MatrixOrbital backlight micro-fix 2005-01-18[lcd4linux @ 2005-01-18 06:30:21 by reinelt]reinelt89-261/+603 added (C) to all copyright statements 2005-01-17[lcd4linux @ 2005-01-17 06:38:48 by reinelt]reinelt1-1/+6 info about backlight and brightness 2005-01-17[lcd4linux @ 2005-01-17 06:29:24 by reinelt]reinelt3-33/+85 added software-controlled backlight support to HD44780