This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC 4.x fixes for Hurd #2


Fixes the usual GCC 4.x love (updated with Neal's comments)

2005-08-05  Alfred M. Szmidt  <ams@gnu.org>

	* hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Silence GCC 4.x
        errors.
	* sysdeps/mach/hurd/setitimer.c: Likewise,
	* sysdeps/mach/hurd/profil.c: Likewise.
	* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.

--- hurd/intr-msg.c
+++ hurd/intr-msg.c
@@ -201,9 +201,10 @@
 		    case MACH_MSG_TYPE_MOVE_SEND:
 		      for (i = 0; i < number; i++)
 			__mach_port_deallocate (__mach_task_self (), *ports++);
-		      (ty->msgtl_header.msgt_longform
-		       ? ty->msgtl_name : ty->msgtl_header.msgt_name)
-			= MACH_MSG_TYPE_COPY_SEND;
+		      if (ty->msgtl_header.msgt_longform)
+			ty->msgtl_name = MACH_MSG_TYPE_COPY_SEND;
+		      else
+			ty->msgtl_header.msgt_name = MACH_MSG_TYPE_COPY_SEND;
 		      break;
 		    case MACH_MSG_TYPE_COPY_SEND:
 		    case MACH_MSG_TYPE_MOVE_RECEIVE:
@@ -223,29 +224,29 @@
 		  name = ty->msgtl_name;
 		  size = ty->msgtl_size;
 		  number = ty->msgtl_number;
-		  (char *) ty += sizeof (mach_msg_type_long_t);
+		  ty = (char *) ty + sizeof (mach_msg_type_long_t);
 		}
 	      else
 		{
 		  name = ty->msgtl_header.msgt_name;
 		  size = ty->msgtl_header.msgt_size;
 		  number = ty->msgtl_header.msgt_number;
-		  (char *) ty += sizeof (mach_msg_type_t);
+		  ty = (char *) ty + sizeof (mach_msg_type_t);
 		}
 
 	      if (ty->msgtl_header.msgt_inline)
 		{
 		  clean_ports ((void *) ty, 0);
 		  /* calculate length of data in bytes, rounding up */
-		  (char *) ty += (((((number * size) + 7) >> 3)
-				   + sizeof (mach_msg_type_t) - 1)
-				  &~ (sizeof (mach_msg_type_t) - 1));
+		  ty = (char *) ty + (((((number * size) + 7) >> 3)
+			  + sizeof (mach_msg_type_t) - 1)
+			 &~ (sizeof (mach_msg_type_t) - 1));
 		}
 	      else
 		{
 		  clean_ports (*(void **) ty,
 			       ty->msgtl_header.msgt_deallocate);
-		  ++(void **) ty;
+		  ty = (void **) ty + 1;
 		}
 	    }
 #else  /* Untyped Mach IPC flavor. */

--- sysdeps/mach/hurd/setitimer.c
+++ sysdeps/mach/hurd/setitimer.c
@@ -37,6 +37,9 @@
 vm_address_t _hurd_itimer_thread_stack_size; /* Size of its stack.  */
 struct timeval _hurd_itimer_started; /* Time the thread started waiting.  */
 
+static int setitimer_locked (const struct itimerval *new,
+			     struct itimerval *old, void *crit);
+
 static void
 quantize_timeval (struct timeval *tv)
 {
@@ -126,15 +129,11 @@
     }
 }
 
-
 static sighandler_t
 restart_itimer (struct hurd_signal_preemptor *preemptor,
 		struct hurd_sigstate *ss,
 		int *signo, struct hurd_signal_detail *detail)
 {
-  static int setitimer_locked (const struct itimerval *new,
-			       struct itimerval *old, void *crit);
-
   /* This function gets called in the signal thread
      each time a SIGALRM is arriving (even if blocked).  */
   struct itimerval it;

--- sysdeps/mach/hurd/profil.c
+++ sysdeps/mach/hurd/profil.c
@@ -49,6 +49,7 @@
 						  sampled_pc_array_t,
 						  mach_msg_type_number_t *);
 static void fetch_samples (void);
+static void profile_waiter (void);
 
 /* Enable statistical profiling, writing samples of the PC into at most
    SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
@@ -64,7 +65,6 @@
   if (profile_thread == MACH_PORT_NULL)
     {
       /* Set up the profiling collector thread.  */
-      static void profile_waiter (void);
       err = __thread_create (__mach_task_self (), &profile_thread);
       if (! err)
 	err = __mach_setup_thread (__mach_task_self (), profile_thread,

--- sysdeps/mach/hurd/ioctl.c
+++ sysdeps/mach/hurd/ioctl.c
@@ -136,9 +136,11 @@
 	     Rather than pointing to the value, ARG is the value itself.  */
 #ifdef MACH_MSG_TYPE_BIT
 	  *t++ = io2mach_type (1, _IOTS (integer_t));
-	  *((integer_t *) t)++ = (integer_t) arg;
+	  *(integer_t *) t = (integer_t) arg;
+	  t += sizeof (integer_t);
 #else
-	  *((integer_t *) p)++ = (integer_t) arg;
+	  *(integer_t *) p = (integer_t) arg;
+	  p += sizeof (integer_t);
 #endif
 	}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]