ia64/xen-unstable

changeset 3993:59a924789d34

bitkeeper revision 1.1236.1.62 (422996dcaXWGIhR3ZzSlNz3XpvLF0A)

[PATCH] [PATCH] gcc4isms part 2

This completes the gcc4ism changes to the Xen tree. All of
the changes in this patch are in the tools/ subdirectory and
are pretty simple. Some of the changes are for overly strict
gcc4 warnings, but I guess it's still good to verify that the
variable really wasn't unused, or that the sign change is
really harmless.

I guess I really do like -Werror now...

Signed-off-by: Rik van Riel <riel@redhat.com>

libxc/xc_linux_build.c | 2 +-
libxc/xc_plan9_build.c | 24 ++++++++++++------------
libxc/xc_vmx_build.c | 2 +-
python/xen/lowlevel/xu/xu.c | 2 +-
xcs/xcs.c | 2 +-
xfrd/lzi_stream.c | 2 +-
xfrd/marshal.c | 4 ++--
xfrd/xdr.c | 2 +-
xfrd/xfrd.c | 12 ++++++------
9 files changed, 26 insertions(+), 26 deletions(-)
author riel@redhat.com[kaf24]
date Sat Mar 05 11:24:12 2005 +0000 (2005-03-05)
parents 00e4db805624
children 7d6b08b325ff 4e765d177de7
files tools/libxc/xc_linux_build.c tools/libxc/xc_plan9_build.c tools/libxc/xc_vmx_build.c tools/python/xen/lowlevel/xu/xu.c tools/xcs/xcs.c tools/xfrd/lzi_stream.c tools/xfrd/marshal.c tools/xfrd/xdr.c tools/xfrd/xfrd.c
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Sat Mar 05 11:24:07 2005 +0000
     1.2 +++ b/tools/libxc/xc_linux_build.c	Sat Mar 05 11:24:12 2005 +0000
     1.3 @@ -279,7 +279,7 @@ static int setup_guest(int xc_handle,
     1.4          start_info->mod_start    = vinitrd_start;
     1.5          start_info->mod_len      = initrd_len;
     1.6      }
     1.7 -    strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
     1.8 +    strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
     1.9      start_info->cmd_line[MAX_CMDLINE-1] = '\0';
    1.10      munmap(start_info, PAGE_SIZE);
    1.11  
     2.1 --- a/tools/libxc/xc_plan9_build.c	Sat Mar 05 11:24:07 2005 +0000
     2.2 +++ b/tools/libxc/xc_plan9_build.c	Sat Mar 05 11:24:12 2005 +0000
     2.3 @@ -81,14 +81,14 @@ void
     2.4  plan9header(Exec * header)
     2.5  {
     2.6  	/* header is big-endian */
     2.7 -	swabby(&header->magic, "magic");
     2.8 -	swabby(&header->text, "text");
     2.9 -	swabby(&header->data, "data");
    2.10 -	swabby(&header->bss, "bss");
    2.11 -	swabby(&header->syms, "syms");
    2.12 -	swabby(&header->entry, "entry");
    2.13 -	swabby(&header->spsz, "spsz");
    2.14 -	swabby(&header->pcsz, "pcsz");
    2.15 +	swabby((unsigned long *)&header->magic, "magic");
    2.16 +	swabby((unsigned long *)&header->text, "text");
    2.17 +	swabby((unsigned long *)&header->data, "data");
    2.18 +	swabby((unsigned long *)&header->bss, "bss");
    2.19 +	swabby((unsigned long *)&header->syms, "syms");
    2.20 +	swabby((unsigned long *)&header->entry, "entry");
    2.21 +	swabby((unsigned long *)&header->spsz, "spsz");
    2.22 +	swabby((unsigned long *)&header->pcsz, "pcsz");
    2.23  
    2.24  }
    2.25  
    2.26 @@ -132,8 +132,8 @@ setup_guest(int xc_handle,
    2.27  	unsigned long ksize;
    2.28  	mmu_t *mmu = NULL;
    2.29  	int i;
    2.30 -	unsigned long first_page_after_kernel, 
    2.31 -	  first_data_page, 
    2.32 +	unsigned long first_page_after_kernel = 0, 
    2.33 +	  first_data_page = 0, 
    2.34  	  page_array_page;
    2.35  	unsigned long cpu0pdb, cpu0pte, cpu0ptelast;
    2.36  	unsigned long /*last_pfn, */ tot_pte_pages;
    2.37 @@ -358,7 +358,7 @@ setup_guest(int xc_handle,
    2.38  	start_info->flags = 0;
    2.39  	DPRINTF((" control event channel is %d\n", control_evtchn));
    2.40  	start_info->domain_controller_evtchn = control_evtchn;
    2.41 -	strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
    2.42 +	strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
    2.43  	start_info->cmd_line[MAX_CMDLINE - 1] = '\0';
    2.44  	munmap(start_info, PAGE_SIZE);
    2.45  
    2.46 @@ -407,7 +407,7 @@ xc_plan9_build(int xc_handle,
    2.47  	       unsigned int control_evtchn, unsigned long flags)
    2.48  {
    2.49  	dom0_op_t launch_op, op;
    2.50 -	unsigned long load_addr;
    2.51 +	unsigned long load_addr = 0;
    2.52  	long tot_pages;
    2.53  	int kernel_fd = -1;
    2.54  	gzFile kernel_gfd = NULL;
     3.1 --- a/tools/libxc/xc_vmx_build.c	Sat Mar 05 11:24:07 2005 +0000
     3.2 +++ b/tools/libxc/xc_vmx_build.c	Sat Mar 05 11:24:12 2005 +0000
     3.3 @@ -339,7 +339,7 @@ static int setup_guest(int xc_handle,
     3.4          page_array[(vboot_params_start-dsi.v_start)>>PAGE_SHIFT]);
     3.5      memset(boot_paramsp, 0, sizeof(*boot_paramsp));
     3.6  
     3.7 -    strncpy(boot_paramsp->cmd_line, cmdline, 0x800);
     3.8 +    strncpy((char *)boot_paramsp->cmd_line, cmdline, 0x800);
     3.9      boot_paramsp->cmd_line[0x800-1] = '\0';
    3.10      boot_paramsp->cmd_line_ptr = ((unsigned long) vboot_params_start) + offsetof(struct linux_boot_params, cmd_line);
    3.11  
     4.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Sat Mar 05 11:24:07 2005 +0000
     4.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Sat Mar 05 11:24:12 2005 +0000
     4.3 @@ -773,7 +773,7 @@ static PyObject *xu_message_get_payload(
     4.4          return dict;
     4.5      }
     4.6  
     4.7 -    return PyString_FromStringAndSize(xum->msg.msg, xum->msg.length);
     4.8 +    return PyString_FromStringAndSize((char *)xum->msg.msg, xum->msg.length);
     4.9  }
    4.10  
    4.11  static PyObject *xu_message_get_header(PyObject *self, PyObject *args)
     5.1 --- a/tools/xcs/xcs.c	Sat Mar 05 11:24:07 2005 +0000
     5.2 +++ b/tools/xcs/xcs.c	Sat Mar 05 11:24:12 2005 +0000
     5.3 @@ -743,7 +743,7 @@ int main (int argc, char *argv[])
     5.4              int size;
     5.5              memset (&remote_addr, 0, sizeof (remote_addr));
     5.6              size = sizeof remote_addr;
     5.7 -            ret = accept(listen_fd, (struct sockaddr *)&remote_addr, &size);
     5.8 +            ret = accept(listen_fd, (struct sockaddr *)&remote_addr, (socklen_t *)&size);
     5.9              if ( ret < 0 )
    5.10              {
    5.11                  perror("accept()");
     6.1 --- a/tools/xfrd/lzi_stream.c	Sat Mar 05 11:24:07 2005 +0000
     6.2 +++ b/tools/xfrd/lzi_stream.c	Sat Mar 05 11:24:12 2005 +0000
     6.3 @@ -242,7 +242,7 @@ int read_block(LZIState *s){
     6.4      int err = 0, k = 0;
     6.5      //dprintf(">\n");
     6.6      if(s->eof) goto exit;
     6.7 -    err = unmarshal_uint32(s->io, &k);
     6.8 +    err = unmarshal_uint32(s->io, (unsigned int *)&k);
     6.9      if(err) goto exit;
    6.10      if(k > s->inbuf_size){
    6.11          err = -EINVAL;
     7.1 --- a/tools/xfrd/marshal.c	Sat Mar 05 11:24:07 2005 +0000
     7.2 +++ b/tools/xfrd/marshal.c	Sat Mar 05 11:24:12 2005 +0000
     7.3 @@ -166,7 +166,7 @@ int marshal_string(IOStream *io, char *s
     7.4  int unmarshal_string(IOStream *io, char *s, uint32_t s_n){
     7.5      int err = 0, val_n = 0;
     7.6      //dprintf(">\n");
     7.7 -    err = unmarshal_uint32(io, &val_n);
     7.8 +    err = unmarshal_uint32(io, (unsigned int *)&val_n);
     7.9      if(err) goto exit;
    7.10      if(val_n >= s_n){
    7.11          err = -EINVAL;
    7.12 @@ -184,7 +184,7 @@ int unmarshal_new_string(IOStream *io, c
    7.13      int err = 0, val_n = 0;
    7.14      char *val = NULL;
    7.15      //dprintf(">\n");
    7.16 -    err = unmarshal_uint32(io, &val_n);
    7.17 +    err = unmarshal_uint32(io, (unsigned int *)&val_n);
    7.18      if(err) goto exit;
    7.19      val = allocate(val_n + 1);
    7.20      if(!val){
     8.1 --- a/tools/xfrd/xdr.c	Sat Mar 05 11:24:07 2005 +0000
     8.2 +++ b/tools/xfrd/xdr.c	Sat Mar 05 11:24:12 2005 +0000
     8.3 @@ -283,7 +283,7 @@ int unpack_sxpr(IOStream *io, Sxpr *x){
     8.4          err = unpack_cons(io, &val);
     8.5          break;
     8.6      case T_BOOL:
     8.7 -        err = unpack_bool(io, &u);
     8.8 +        err = unpack_bool(io, (int *)&u);
     8.9          if(err) goto exit;
    8.10          val = (u ? OTRUE : OFALSE);
    8.11          break;
     9.1 --- a/tools/xfrd/xfrd.c	Sat Mar 05 11:24:07 2005 +0000
     9.2 +++ b/tools/xfrd/xfrd.c	Sat Mar 05 11:24:12 2005 +0000
     9.3 @@ -481,9 +481,9 @@ int xfr_hello(Conn *conn){
     9.4          err = -EINVAL;
     9.5          goto exit;
     9.6      }
     9.7 -    err = intof(sxpr_childN(sxpr, 0, ONONE), &hello_major);
     9.8 +    err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&hello_major);
     9.9      if(err) goto exit;
    9.10 -    err = intof(sxpr_childN(sxpr, 1, ONONE), &hello_minor);
    9.11 +    err = intof(sxpr_childN(sxpr, 1, ONONE), (int *)&hello_minor);
    9.12      if(err) goto exit;
    9.13      if(hello_major != major || hello_minor != minor){
    9.14          eprintf("> Wanted protocol version %d.%d, got %d.%d",
    9.15 @@ -646,7 +646,7 @@ int xfr_send_state(XfrState *state, Conn
    9.16          if(!err) err = errcode;
    9.17      } else if(sxpr_elementp(sxpr, oxfr_xfr_ok)){
    9.18          // Ok - get the new domain id.
    9.19 -        err = intof(sxpr_childN(sxpr, 0, ONONE), &state->vmid_new);
    9.20 +        err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&state->vmid_new);
    9.21          xfr_error(peer, err);
    9.22      } else {
    9.23          // Anything else is invalid. But it may be too late.
    9.24 @@ -917,7 +917,7 @@ int xfrd_service(Args *args, int peersoc
    9.25          int n = 0;
    9.26  
    9.27          dprintf("> xfr.migrate\n");
    9.28 -        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
    9.29 +        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
    9.30          if(err) goto exit;
    9.31          err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
    9.32          if(err) goto exit;
    9.33 @@ -939,7 +939,7 @@ int xfrd_service(Args *args, int peersoc
    9.34          int n = 0;
    9.35  
    9.36          dprintf("> xfr.save\n");
    9.37 -        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
    9.38 +        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
    9.39          if(err) goto exit;
    9.40          err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
    9.41          if(err) goto exit;
    9.42 @@ -965,7 +965,7 @@ int xfrd_service(Args *args, int peersoc
    9.43          int n = 0;
    9.44  
    9.45          dprintf("> xfr.xfr\n");
    9.46 -        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
    9.47 +        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
    9.48          if(err) goto exit;
    9.49          err = xfr_recv(args, state, conn);
    9.50