[syslinux:elflink] ldlinux: Use signed char consistently

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Apr 17 11:24:16 PDT 2012


Commit-ID:  c23ac08d9e3c1582906ca4f412effdb56fe19b37
Gitweb:     http://www.syslinux.org/commit/c23ac08d9e3c1582906ca4f412effdb56fe19b37
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 3 Apr 2012 10:48:52 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 17 Apr 2012 10:58:34 +0100

ldlinux: Use signed char consistently

In get_key() we use unsigned chars but seem to use signed chars in
other functions. There's no real reason to use unsigned chars so let's
be consistent. This also eliminates the following warnings,

get_key.c: In function ‘get_key’:
get_key.c:187:2: warning: pointer targets in passing argument 1 of ‘get_key_decode’ differ in signedness
get_key.c:129:5: note: expected ‘char *’ but argument is of type ‘unsigned char *’
serirq.c:29:29: warning: pointer targets in initialization differ in signedness
serirq.c:30:29: warning: pointer targets in initialization differ in signedness

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/elflink/ldlinux/get_key.c |    4 ++--
 core/include/bios.h             |    4 ++--
 core/serirq.c                   |   10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/com32/elflink/ldlinux/get_key.c b/com32/elflink/ldlinux/get_key.c
index 42ff5c1..f6e16e9 100644
--- a/com32/elflink/ldlinux/get_key.c
+++ b/com32/elflink/ldlinux/get_key.c
@@ -148,10 +148,10 @@ int get_key_decode(char *buffer, int nc, int *code)
 
 int get_key(FILE * f, clock_t timeout)
 {
-    unsigned char buffer[KEY_MAXLEN];
+    char buffer[KEY_MAXLEN];
     int nc, i, rv;
     int another;
-    unsigned char ch;
+    char ch;
     clock_t start;
     int code;
 
diff --git a/core/include/bios.h b/core/include/bios.h
index 3c49cf2..1248e48 100644
--- a/core/include/bios.h
+++ b/core/include/bios.h
@@ -96,8 +96,8 @@ extern void vgaclearmode(void);
 extern void vgadisplayfile(FILE *fd);
 
 /* serirq.c */
-extern unsigned char *SerialHead;
-extern unsigned char *SerialTail;
+extern char *SerialHead;
+extern char *SerialTail;
 
 extern void bios_init(void);
 extern void bios_cleanup_hardware(void);
diff --git a/core/serirq.c b/core/serirq.c
index 767099e..e0675c9 100644
--- a/core/serirq.c
+++ b/core/serirq.c
@@ -26,8 +26,8 @@
 static char serial_buf[serial_buf_size];
 
 static unsigned short SerialIRQPort; /* Serial port w IRQ service */
-unsigned char *SerialHead = serial_buf;    /* Head of serial port rx buffer */
-unsigned char *SerialTail = serial_buf;    /* Tail of serial port rx buffer */
+char *SerialHead = serial_buf;    /* Head of serial port rx buffer */
+char *SerialTail = serial_buf;    /* Tail of serial port rx buffer */
 
 static unsigned char IRQMask[2];	     /* PIC IRQ mask status */
 
@@ -39,11 +39,11 @@ void sirq_cleanup(void);
 
 static void irq_common(unsigned short old_irq)
 {
-	unsigned char *dst;
+	char *dst;
 	irqhandler_t next;
 	char val;
 
-	dst = (unsigned char *)SerialHead;
+	dst = SerialHead;
 	next = (irqhandler_t)oldirq[old_irq];
 
 	/* LSR */
@@ -57,7 +57,7 @@ static void irq_common(unsigned short old_irq)
 		val = inb(SerialPort + 5);
 		if ((val & FlowIgnore) == FlowIgnore) {
 			/* Wrap around if necessary */
-			dst = (unsigned char *)((unsigned long)dst & (serial_buf_size - 1));
+			dst = (char *)((unsigned long)dst & (serial_buf_size - 1));
 
 			/* Would this cause overflow? */
 			if (dst != SerialTail)


More information about the Syslinux-commits mailing list