]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2005-04-02 05:28:58 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 2 Apr 2005 05:28:58 +0000 (05:28 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 2 Apr 2005 05:28:58 +0000 (05:28 +0000)
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
drv_SimpleLCD.c
drv_USBLCD.c

index a92ff307dfa104cc6875fc47e36a53c90f353db0..1dc6c7133dc172dada179fd410c5218b4835ac09 100644 (file)
@@ -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;
   }
index 85f91bf73fc593156861217c146b4ca1f7912828..eb449a67e9e7553ba9ddf0c90d72b57e304b8b11 100644 (file)
@@ -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') {
index ba9ab40da111949f2823f960b7176a18e5bc9361..a1e8ebaaf153ee8a9ce4c3e4e4b71e9865fb3355 100644 (file)
@@ -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