boot/ChangeLog 2005-09-01 Thomas Schwinge * boot.c (boot_script_exec_cmd): Fix invalid lvalues. libdiskfs/ChangeLog 2005-09-01 Thomas Schwinge * priv.h: Include . nfsd/ChangeLog 2005-09-01 Thomas Schwinge * loop.c (server_loop): Fix invalid lvalues. pfinet/ChangeLog 2005-09-01 Thomas Schwinge * glue-include/asm/system.h (xchg): Fix invalid lvalue. * linux-src/net/ipv4/tcp_ipv4.c (tcp_v4_rst_req): Don't use ?: as a lvalue. ufs/ChangeLog 2005-09-01 Thomas Schwinge * dir.h (DIRECT_NAMELEN): Don't use ?: as a lvalue. ufs-utils/ChangeLog 2005-09-01 Thomas Schwinge * mkfs.c (parse_opt): Move UP's functionality into UP_INT in order to fix invalid lvalues. utils/ChangeLog 2005-09-01 Thomas Schwinge * ps.c (current_tty_name): Don't declare as `static'. * rpctrace.c (print_contents): Don't use ?: as a lvalue. serverboot/ChageLog 2005-08-13 Alfred M. Szmidt * kalloc.c: #include (init_hook, malloc_hook, free_hook): New functions. (__malloc_initialize_hook): New variable. (malloc, free): Functions removed. diff -rN -u old-hurd-0-branch.1.tmp-1/boot/boot.c new-hurd-0-branch.1.tmp-1/boot/boot.c --- old-hurd-0-branch.1.tmp-1/boot/boot.c 2005-09-01 19:18:01.293715312 +0200 +++ new-hurd-0-branch.1.tmp-1/boot/boot.c 2005-09-01 19:18:01.307713184 +0200 @@ -367,11 +367,17 @@ str_start = ((vm_address_t) arg_pos + (argc + 2) * sizeof (char *) + sizeof (integer_t)); p = args + ((vm_address_t) arg_pos & (vm_page_size - 1)); - *((int *) p)++ = argc; + *(int *) p = argc; + p = (char *) ((int *) p + 1); for (i = 0; i < argc; i++) - *((char **) p)++ = argv[i] - strings + (char *) str_start; - *((char **) p)++ = 0; - *((char **) p)++ = 0; + { + *(char **) p = argv[i] - strings + (char *) str_start; + p = (char *) ((char **) p + 1); + } + *(char **) p = 0; + p = (char *) ((char **) p + 1); + *(char **) p = 0; + p = (char *) ((char **) p + 1); memcpy (p, strings, stringlen); bzero (args, (vm_offset_t) arg_pos & (vm_page_size - 1)); vm_write (task, trunc_page ((vm_offset_t) arg_pos), (vm_address_t) args, diff -rN -u old-hurd-0-branch.1.tmp-1/libdiskfs/priv.h new-hurd-0-branch.1.tmp-1/libdiskfs/priv.h --- old-hurd-0-branch.1.tmp-1/libdiskfs/priv.h 2005-09-01 19:18:01.291715616 +0200 +++ new-hurd-0-branch.1.tmp-1/libdiskfs/priv.h 2005-09-01 19:18:01.737647824 +0200 @@ -26,6 +26,7 @@ #include #include #include +#include #include "diskfs.h" diff -rN -u old-hurd-0-branch.1.tmp-1/nfsd/loop.c new-hurd-0-branch.1.tmp-1/nfsd/loop.c --- old-hurd-0-branch.1.tmp-1/nfsd/loop.c 2005-09-01 19:18:01.291715616 +0200 +++ new-hurd-0-branch.1.tmp-1/nfsd/loop.c 2005-09-01 19:18:01.318711512 +0200 @@ -77,7 +77,7 @@ /* This transacation has already completed. */ goto repost_reply; - r = (int *) rbuf = malloc (MAXIOSIZE); + r = (int *) (rbuf = malloc (MAXIOSIZE)); if (ntohl (*p) != RPC_MSG_VERSION) { @@ -173,7 +173,7 @@ if (amt > MAXIOSIZE) { free (rbuf); - r = (int *) rbuf = malloc (amt); + r = (int *) (rbuf = malloc (amt)); } } diff -rN -u old-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h new-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h --- old-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h 2005-09-01 19:18:01.291715616 +0200 +++ new-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h 2005-09-01 19:18:01.495684608 +0200 @@ -9,7 +9,7 @@ #define xchg(ptr, x) \ ({ \ __typeof__ (*(ptr)) *_ptr = (ptr), _x = *_ptr; \ - (uintptr_t) *_ptr = (x); _x; \ + *_ptr = (x); _x; \ }) #define mb() ((void) 0) /* memory barrier */ diff -rN -u old-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c new-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c --- old-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c 2005-09-01 19:18:01.290715768 +0200 +++ new-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c 2005-09-01 19:18:01.512682024 +0200 @@ -1584,7 +1584,10 @@ after(TCP_SKB_CB(skb)->seq, req->rcv_isn+1)) return; tcp_synq_unlink(tp, req, prev); - (req->sk ? sk->ack_backlog : tp->syn_backlog)--; + if (req->sk) + sk->ack_backlog--; + else + tp->syn_backlog--; req->class->destructor(req); tcp_openreq_free(req); diff -rN -u old-hurd-0-branch.1.tmp-1/ufs/dir.h new-hurd-0-branch.1.tmp-1/ufs/dir.h --- old-hurd-0-branch.1.tmp-1/ufs/dir.h 2005-09-01 19:18:01.288716072 +0200 +++ new-hurd-0-branch.1.tmp-1/ufs/dir.h 2005-09-01 19:18:01.301714096 +0200 @@ -91,13 +91,13 @@ /* Return the namlen from a struct direct, paying attention to whether this filesystem supports the type extension */ #if (BYTE_ORDER == LITTLE_ENDIAN) -#define DIRECT_NAMLEN(dp) (direct_symlink_extension || swab_disk \ - ? (dp)->d_namlen \ - : (dp)->d_type) +#define DIRECT_NAMLEN(dp) (*(direct_symlink_extension || swab_disk \ + ? &(dp)->d_namlen \ + : &(dp)->d_type)) #else -#define DIRECT_NAMLEN(dp) (!direct_symlink_extension && swab_disk \ - ? (dp)->d_type \ - : (dp)->d_namlen) +#define DIRECT_NAMLEN(dp) (*(!direct_symlink_extension && swab_disk \ + ? &(dp)->d_type \ + : &(dp)->d_namlen)) #endif /* diff -rN -u old-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c new-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c --- old-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c 2005-09-01 19:18:01.287716224 +0200 +++ new-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c 2005-09-01 19:18:01.461689776 +0200 @@ -279,10 +279,8 @@ case 'N': Nflag = 1; break; case 'O': Oflag = 1; break; - /* Mark &VAR as being a uparam, and return a lvalue for VAR. */ -#define UP(var) (amarks_add (&uparams, &var), var) - /* Record an integer uparam into VAR. */ -#define UP_INT(var) { int _i = atoi (arg); UP (var) = _i; } +/* Mark &VAR as being a uparam, and set VAR. */ +#define UP_INT(var) { amarks_add (&uparams, &var); var = atoi (arg); } case 'a': UP_INT (maxcontig); break; case 'b': UP_INT (bsize); break; diff -rN -u old-hurd-0-branch.1.tmp-1/utils/ps.c new-hurd-0-branch.1.tmp-1/utils/ps.c --- old-hurd-0-branch.1.tmp-1/utils/ps.c 2005-09-01 19:18:01.286716376 +0200 +++ new-hurd-0-branch.1.tmp-1/utils/ps.c 2005-09-01 19:18:01.452691144 +0200 @@ -249,7 +249,7 @@ } /* Returns the name of the current controlling terminal. */ - static const char *current_tty_name() + const char *current_tty_name() { error_t err; struct ps_tty *tty; diff -rN -u old-hurd-0-branch.1.tmp-1/utils/rpctrace.c new-hurd-0-branch.1.tmp-1/utils/rpctrace.c --- old-hurd-0-branch.1.tmp-1/utils/rpctrace.c 2005-09-01 19:18:01.285716528 +0200 +++ new-hurd-0-branch.1.tmp-1/utils/rpctrace.c 2005-09-01 19:18:01.454690840 +0200 @@ -616,11 +616,16 @@ name = MACH_MSG_TYPE_MOVE_SEND; } - (type->msgt_longform ? lt->msgtl_name : type->msgt_name) = name; + if (type->msgt_longform) + lt->msgtl_name = name; + else + type->msgt_name = name; } else if (newtypes[0] != name) - (type->msgt_longform ? lt->msgtl_name : type->msgt_name) - = newtypes[0]; + if (type->msgt_longform) + lt->msgtl_name = newtypes[0]; + else + type->msgt_name = newtypes[0]; } else print_data (name, data, nelt, eltsize); =================================================================== RCS file: /cvsroot/hurd/cvsroot/hurd/hurd/serverboot/kalloc.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- hurd/serverboot/kalloc.c 1997/04/03 23:27:41 1.1 +++ hurd/serverboot/kalloc.c 2005/09/19 20:19:56 1.1.2.1 @@ -34,6 +34,14 @@ #include #include /* for spin locks */ +#include /* for malloc_hook/free_hook */ + +static void init_hook (void); +static void *malloc_hook (size_t size, const void *caller); +static void free_hook (void *ptr, const void *caller); + +void (*__malloc_initialize_hook) (void) = init_hook; + #define DEBUG @@ -250,12 +258,21 @@ } } -void *malloc(vm_size_t size) +static void +init_hook (void) +{ + __malloc_hook = malloc_hook; + __free_hook = free_hook; +} + +static void * +malloc_hook (size_t size, const void *caller) { - return (void *)kalloc(size); + return (void *) kalloc ((vm_size_t) size); } -void free(void *addr) +static void +free_hook (void *ptr, const void *caller) { /* Just ignore harmless attempts at cleanliness. */ /* panic("free not implemented"); */