[PATCH] uml: compile fixes for gcc 4
authorJeff Dike <jdike@addtoit.com>
Wed, 8 Jun 2005 22:48:01 +0000 (15:48 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 8 Jun 2005 23:21:12 +0000 (16:21 -0700)
This is a bunch of compile fixes provoked by building UML with gcc 4.  There
are a bunch of signedness mismatches, a couple of uninitialized references,
and a botched C99 structure initialization which had somehow gone unnoticed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
12 files changed:
arch/um/drivers/chan_user.c
arch/um/drivers/net_user.c
arch/um/drivers/slip.h
arch/um/drivers/slip_proto.h
arch/um/drivers/slirp.h
arch/um/drivers/stderr_console.c
arch/um/include/mconsole.h
arch/um/include/net_user.h
arch/um/include/os.h
arch/um/include/user_util.h
arch/um/os-Linux/elf_aux.c
arch/um/os-Linux/file.c

index 583b8e1..96f3a47 100644 (file)
@@ -168,7 +168,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
                printk("winch_tramp : failed to read synchronization byte\n");
                printk("read failed, err = %d\n", -n);
                printk("fd %d will not support SIGWINCH\n", fd);
-               *fd_out = -1;
+                pid = -1;
        }
        return(pid);
 }
@@ -186,7 +186,7 @@ void register_winch(int fd, struct tty_struct *tty)
        if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd,
                             tty) && (pid == -1)){
                thread = winch_tramp(fd, tty, &thread_fd);
-               if(fd != -1){
+               if(thread > 0){
                        register_winch_irq(thread_fd, fd, thread, tty);
 
                        count = os_write_file(thread_fd, &c, sizeof(c));
index 47229fe..3730d4f 100644 (file)
@@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr)
        return(0);
 }
 
-void tap_check_ips(char *gate_addr, char *eth_addr)
+void tap_check_ips(char *gate_addr, unsigned char *eth_addr)
 {
        int tap_addr[4];
 
index 495f2f1..d523618 100644 (file)
@@ -12,8 +12,8 @@ struct slip_data {
        char *addr;
        char *gate_addr;
        int slave;
-       char ibuf[ENC_BUF_SIZE];
-       char obuf[ENC_BUF_SIZE];
+       unsigned char ibuf[ENC_BUF_SIZE];
+       unsigned char obuf[ENC_BUF_SIZE];
        int more; /* more data: do not read fd until ibuf has been drained */
        int pos;
        int esc;
index 7206361..4c4d94a 100644 (file)
@@ -12,7 +12,8 @@
 #define SLIP_ESC_END         0334      /* ESC ESC_END means END 'data' */
 #define SLIP_ESC_ESC         0335      /* ESC ESC_ESC means ESC 'data' */
 
-static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc)
+static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos,
+                             int *esc)
 {
        int ret;
 
index 04e407d..afa4e30 100644 (file)
@@ -24,8 +24,8 @@ struct slirp_data {
        struct arg_list_dummy_wrapper argw;
        int pid;
        int slave;
-       char ibuf[ENC_BUF_SIZE];
-       char obuf[ENC_BUF_SIZE];
+       unsigned char ibuf[ENC_BUF_SIZE];
+       unsigned char obuf[ENC_BUF_SIZE];
        int more; /* more data: do not read fd until ibuf has been drained */
        int pos;
        int esc;
index 98565b5..429ae8e 100644 (file)
@@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string,
 }
 
 static struct console stderr_console = {
-       .name           "stderr",
-       .write          stderr_console_write,
-       .flags          CON_PRINTBUFFER,
+       .name           "stderr",
+       .write          stderr_console_write,
+       .flags          CON_PRINTBUFFER,
 };
 
 static int __init stderr_console_init(void)
index 9fbe308..cfa368e 100644 (file)
@@ -56,7 +56,7 @@ struct mc_request
        int as_interrupt;
 
        int originating_fd;
-       int originlen;
+       unsigned int originlen;
        unsigned char origin[128];                      /* sockaddr_un */
 
        struct mconsole_request request;
index 36807b7..89885a7 100644 (file)
@@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out);
 extern void free_output_buffer(void *buffer);
 
 extern int tap_open_common(void *dev, char *gate_addr);
-extern void tap_check_ips(char *gate_addr, char *eth_addr);
+extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr);
 
 extern void read_output(int fd, char *output_out, int len);
 
index d246d5a..881d298 100644 (file)
@@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset);
 extern int os_open_file(char *file, struct openflags flags, int mode);
 extern int os_read_file(int fd, void *buf, int len);
 extern int os_write_file(int fd, const void *buf, int count);
-extern int os_file_size(char *file, long long *size_out);
+extern int os_file_size(char *file, unsigned long long *size_out);
 extern int os_file_modtime(char *file, unsigned long *modtime);
 extern int os_pipe(int *fd, int stream, int close_on_exec);
 extern int os_set_fd_async(int fd, int owner);
index b8c5b8a..7b6a24d 100644 (file)
@@ -41,9 +41,6 @@ extern unsigned long highmem;
 extern char host_info[];
 
 extern char saved_command_line[];
-extern char command_line[];
-
-extern char *tempdir;
 
 extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
 extern unsigned long _unprotected_end;
index 9aee0b6..f0d6060 100644 (file)
@@ -45,7 +45,11 @@ __init void scan_elf_aux( char **envp)
                                elf_aux_hwcap = auxv->a_un.a_val;
                                break;
                        case AT_PLATFORM:
-                               elf_aux_platform = auxv->a_un.a_ptr;
+                                /* elf.h removed the pointer elements from
+                                 * a_un, so we have to use a_val, which is
+                                 * all that's left.
+                                 */
+                               elf_aux_platform = (char *) auxv->a_un.a_val;
                                break;
                        case AT_PAGESZ:
                                page_size = auxv->a_un.a_val;
index 77d4066..fd45bb2 100644 (file)
@@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len)
                       (int (*)(int, void *, int)) write, copy_to_user_proc));
 }
 
-int os_file_size(char *file, long long *size_out)
+int os_file_size(char *file, unsigned long long *size_out)
 {
        struct uml_stat buf;
        int err;