bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnumach and gcc 4.0 (patch 1)


From: Alfred M. Szmidt
Subject: gnumach and gcc 4.0 (patch 1)
Date: Sun, 29 May 2005 19:35:34 -0400

Fixes even more gcc 4.0.0 brain damage, did I say that gcc 4.0.0 is a
pile of shit?

Oh, and with the previous patch, this makes gnumach compile, and run
with gcc 4.0.0.

Ok to apply?

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

        * linux/src/drivers/scsi/u14-34f.c (ihdlr): Silence gcc 4.x
        errors.
        * linux/src/drivers/scsi/qlogicisp.h: Likewise.
        * linux/src/drivers/scsi/advansys.c: Likewise.
        (advansys_reset, advansys_interrupt, asc_scsi_done_list,
        (asc_enqueue, asc_dequeue, asc_dequeue_list, asc_rmqueue,
        (asc_isqueued): Likewise.
        * linux/src/drivers/scsi/53c78xx.c (NCR53c7xx_queue_command):
        Likewise.
        * linux/src/drivers/net/ne2k-pci.c (ne_block_input)
        (ne_block_output): Likewise.
        * linux/src/drivers/net/hp100.c (__initfunc): Likewise.
        * linux/src/drivers/net/3c507.c (el16_interrupt): Likewise.
        * linux/dev/drivers/scsi/seagate.c (seagate_st0x_queue_command):
        Likewise.

--- linux/src/drivers/net/3c507.c
+++ linux/src/drivers/net/3c507.c
@@ -71,6 +71,8 @@
 static unsigned int netcard_portlist[] =
        { 0x300, 0x320, 0x340, 0x280, 0};
 
+static void init_rx_bufs(struct device *dev);
+
 /*
                        Details of the i82586.
 
@@ -589,7 +591,6 @@
        }
 
        if ((status & 0x0070) != 0x0040  &&  dev->start) {
-         static void init_rx_bufs(struct device *);
                /* The Rx unit is not ready, it must be hung.  Restart the 
receiver by
                   initializing the rx buffers, and issuing an Rx start 
command. */
                if (net_debug)
--- linux/src/drivers/scsi/53c78xx.c
+++ linux/src/drivers/scsi/53c78xx.c
@@ -3918,7 +3918,7 @@
        restore_flags (flags);
        cmd->result = 0xffff;   /* The NCR will overwrite message
                                       and status with valid data */
-       cmd->host_scribble = (unsigned char *) tmp = create_cmd (cmd);
+       cmd->host_scribble = (unsigned char *) (tmp = create_cmd (cmd));
     }
     cli();
     /*
--- linux/src/drivers/scsi/advansys.c
+++ linux/src/drivers/scsi/advansys.c
@@ -3136,7 +3136,7 @@
 /*
  * Default EEPROM Configuration structure defined in a_init.c.
  */
-extern ADVEEP_CONFIG Default_EEPROM_Config;
+STATIC ADVEEP_CONFIG Default_EEPROM_Config;
 
 /*
  * DvcGetPhyAddr() flag arguments
@@ -3256,7 +3256,7 @@
  *  REQTIMESTAMP() - system time stamp value
  */
 typedef Scsi_Cmnd            REQ, *REQP;
-#define REQPNEXT(reqp)       ((REQP) ((reqp)->host_scribble))
+#define REQPNEXT(reqp)       ((reqp)->host_scribble)
 #define REQPNEXTP(reqp)      ((REQP *) &((reqp)->host_scribble))
 #define REQPTID(reqp)        ((reqp)->target)
 #define REQPTIME(reqp)       ((reqp)->SCp.this_residual)
@@ -6015,16 +6015,19 @@
          */
         if (done_scp == NULL) {
             done_scp = asc_dequeue_list(&boardp->active, &last_scp, target);
-            for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
+            for (tscp = done_scp; tscp; tscp = (REQP) REQPNEXT(tscp)) {
                 tscp->result = HOST_BYTE(DID_RESET);
             }
         } else {
             ASC_ASSERT(last_scp != NULL);
-            REQPNEXT(last_scp) = asc_dequeue_list(&boardp->active,
-                &new_last_scp, target);
-            if (new_last_scp != NULL) {
-                ASC_ASSERT(REQPNEXT(last_scp) != NULL);
-                for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) {
+            REQPNEXT(last_scp) =
+             (unsigned char *) asc_dequeue_list(&boardp->active,
+                                                &new_last_scp, target);
+            if (new_last_scp != (Scsi_Cmnd *) NULL) {
+               ASC_ASSERT((REQP) REQPNEXT(last_scp) != NULL);
+                for (tscp = (Scsi_Cmnd *) REQPNEXT(last_scp);
+                    tscp;
+                    tscp = (Scsi_Cmnd *) REQPNEXT(tscp)) {
                     tscp->result = HOST_BYTE(DID_RESET);
                 }
                 last_scp = new_last_scp;
@@ -6037,16 +6040,19 @@
          */
         if (done_scp == NULL) {
             done_scp = asc_dequeue_list(&boardp->waiting, &last_scp, target);
-            for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
+            for (tscp = done_scp; tscp; tscp = (REQP) REQPNEXT(tscp)) {
                 tscp->result = HOST_BYTE(DID_RESET);
             }
         } else {
             ASC_ASSERT(last_scp != NULL);
-            REQPNEXT(last_scp) = asc_dequeue_list(&boardp->waiting,
-                &new_last_scp, target);
+            REQPNEXT(last_scp) =
+             (unsigned char *) asc_dequeue_list(&boardp->waiting,
+                                                &new_last_scp, target);
             if (new_last_scp != NULL) {
-                ASC_ASSERT(REQPNEXT(last_scp) != NULL);
-                for (tscp = REQPNEXT(last_scp); tscp; tscp = REQPNEXT(tscp)) {
+               ASC_ASSERT((REQP) REQPNEXT(last_scp) != NULL);
+                for (tscp = (REQP) REQPNEXT(last_scp);
+                    tscp;
+                    tscp = (REQP) REQPNEXT(tscp)) {
                     tscp->result = HOST_BYTE(DID_RESET);
                 }
                 last_scp = new_last_scp;
@@ -6342,8 +6348,10 @@
                     ASC_TID_ALL);
             } else {
                 ASC_ASSERT(last_scp != NULL);
-                REQPNEXT(last_scp) = asc_dequeue_list(&boardp->done,
-                    &new_last_scp, ASC_TID_ALL);
+                REQPNEXT(last_scp) =
+                 (unsigned char *) asc_dequeue_list(&boardp->done,
+                                                    &new_last_scp,
+                                                    ASC_TID_ALL);
                 if (new_last_scp != NULL) {
                     ASC_ASSERT(REQPNEXT(last_scp) != NULL);
                     last_scp = new_last_scp;
@@ -6441,7 +6449,7 @@
     ASC_DBG(2, "asc_scsi_done_list: begin\n");
     while (scp != NULL) {
         ASC_DBG1(3, "asc_scsi_done_list: scp %x\n", (unsigned) scp);
-        tscp = REQPNEXT(scp);
+        tscp = (REQP) REQPNEXT(scp);
         REQPNEXT(scp) = NULL;
         ASC_STATS(scp->host, done);
         ASC_ASSERT(scp->scsi_done != NULL);
@@ -7874,7 +7882,7 @@
     tid = REQPTID(reqp);
     ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID);
     if (flag == ASC_FRONT) {
-        REQPNEXT(reqp) = ascq->q_first[tid];
+        REQPNEXT(reqp) = (unsigned char *) ascq->q_first[tid];
         ascq->q_first[tid] = reqp;
         /* If the queue was empty, set the last pointer. */
         if (ascq->q_last[tid] == NULL) {
@@ -7882,7 +7890,7 @@
         }
     } else { /* ASC_BACK */
         if (ascq->q_last[tid] != NULL) {
-            REQPNEXT(ascq->q_last[tid]) = reqp;
+            REQPNEXT(ascq->q_last[tid]) = (unsigned char *) reqp;
         }
         ascq->q_last[tid] = reqp;
         REQPNEXT(reqp) = NULL;
@@ -7925,7 +7933,7 @@
     ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID);
     if ((reqp = ascq->q_first[tid]) != NULL) {
         ASC_ASSERT(ascq->q_tidmask & ADV_TID_TO_TIDMASK(tid));
-        ascq->q_first[tid] = REQPNEXT(reqp);
+        ascq->q_first[tid] = (REQP) REQPNEXT(reqp);
         /* If the queue is empty, clear its bit and the last pointer. */
         if (ascq->q_first[tid] == NULL) {
             ascq->q_tidmask &= ~ADV_TID_TO_TIDMASK(tid);
@@ -7992,7 +8000,7 @@
             {
                 REQP reqp;
                 ascq->q_cur_cnt[tid] = 0;
-                for (reqp = firstp; reqp; reqp = REQPNEXT(reqp)) {
+                for (reqp = firstp; reqp; reqp = (REQP) REQPNEXT(reqp)) {
                     REQTIMESTAT("asc_dequeue_list", ascq, reqp, tid);
                 }
             }
@@ -8008,7 +8016,7 @@
                     lastp = ascq->q_last[i];
                 } else {
                     ASC_ASSERT(lastp != NULL);
-                    REQPNEXT(lastp) = ascq->q_first[i];
+                    REQPNEXT(lastp) = (unsigned char *) ascq->q_first[i];
                     lastp = ascq->q_last[i];
                 }
                 ascq->q_first[i] = ascq->q_last[i] = NULL;
@@ -8021,7 +8029,7 @@
 #ifdef ADVANSYS_STATS
         {
             REQP reqp;
-            for (reqp = firstp; reqp; reqp = REQPNEXT(reqp)) {
+            for (reqp = firstp; reqp; reqp = (REQP) REQPNEXT(reqp)) {
                 REQTIMESTAT("asc_dequeue_list", ascq, reqp, reqp->target);
             }
         }
@@ -8065,7 +8073,7 @@
      */
     if (reqp == ascq->q_first[tid]) {
         ret = ASC_TRUE;
-        ascq->q_first[tid] = REQPNEXT(reqp);
+        ascq->q_first[tid] = (REQP) REQPNEXT(reqp);
         /* If the queue is now empty, clear its bit and the last pointer. */
         if (ascq->q_first[tid] == NULL) {
             ascq->q_tidmask &= ~ADV_TID_TO_TIDMASK(tid);
@@ -8083,8 +8091,8 @@
          * Set 'prevp' to the first entry, 'currp' to the second entry,
          * and search for 'reqp'.
          */
-        for (prevp = ascq->q_first[tid], currp = REQPNEXT(prevp);
-             currp; prevp = currp, currp = REQPNEXT(currp)) {
+        for (prevp = ascq->q_first[tid], currp = (REQP) REQPNEXT(prevp);
+             currp; prevp = currp, currp = (REQP) REQPNEXT(currp)) {
             if (currp == reqp) {
                 ret = ASC_TRUE;
                 REQPNEXT(prevp) = REQPNEXT(currp);
@@ -8127,7 +8135,7 @@
     tid = REQPTID(reqp);
     ASC_ASSERT(tid >= 0 && tid <= ADV_MAX_TID);
 
-    for (treqp = ascq->q_first[tid]; treqp; treqp = REQPNEXT(treqp)) {
+    for (treqp = ascq->q_first[tid]; treqp; treqp = (REQP) REQPNEXT(treqp)) {
         ASC_ASSERT(ascq->q_tidmask & ADV_TID_TO_TIDMASK(tid));
         if (treqp == reqp) {
             ret = ASC_TRUE;
--- linux/src/drivers/net/hp100.c
+++ linux/src/drivers/net/hp100.c
@@ -648,8 +648,7 @@
     {
       mem_ptr_phys = (u_int *)( hp100_inw( MEM_MAP_LSW ) | 
                                ( hp100_inw( MEM_MAP_MSW ) << 16 ) );
-      (u_int)mem_ptr_phys &= ~0x1fff;  /* 8k alignment */
-
+      mem_ptr_phys = (u_int *) ((u_int) mem_ptr_phys & ~0x1fff);  /* 8k 
alignment */
       if ( bus == HP100_BUS_ISA && ( (u_long)mem_ptr_phys & ~0xfffff ) != 0 )
         {
          printk("hp100: %s: Can only use programmed i/o mode.\n", dev->name);
--- linux/src/drivers/net/ne2k-pci.c
+++ linux/src/drivers/net/ne2k-pci.c
@@ -542,7 +542,10 @@
        if (count & 3) {
                buf += count & ~3;
                if (count & 2)
-                       *((u16*)buf)++ = inw(NE_BASE + NE_DATAPORT);
+                       {
+                               *buf = *(u16 *) buf + 1;
+                               *buf = inw(NE_BASE + NE_DATAPORT);
+                       }
                if (count & 1)
                        *buf = inb(NE_BASE + NE_DATAPORT);
        }
@@ -605,7 +608,8 @@
        if (count & 3) {
                buf += count & ~3;
                if (count & 2)
-                       outw(*((u16*)buf)++, NE_BASE + NE_DATAPORT);
+                       outw(*buf++, NE_BASE + NE_DATAPORT);
+
        }
 #else
        outsw(NE_BASE + NE_DATAPORT, buf, count>>1);
--- linux/src/drivers/scsi/qlogicisp.h
+++ linux/src/drivers/scsi/qlogicisp.h
@@ -112,7 +112,7 @@
 #define NULL (0)
 #endif
 
-extern struct proc_dir_entry proc_scsi_isp1020;
+static struct proc_dir_entry proc_scsi_isp1020;
 
 #define QLOGICISP {                                                       \
        /* next */              NULL,                                      \
--- linux/dev/drivers/scsi/seagate.c
+++ linux/dev/drivers/scsi/seagate.c
@@ -565,7 +565,7 @@
        done_fn = done;
        current_target = SCpnt->target;
        current_lun = SCpnt->lun;
-       (const void *) current_cmnd = SCpnt->cmnd;
+       current_cmnd = SCpnt->cmnd;
        current_data = (unsigned char *) SCpnt->request_buffer;
        current_bufflen = SCpnt->request_bufflen;
        SCint = SCpnt;
--- linux/src/drivers/scsi/u14-34f.c
+++ linux/src/drivers/scsi/u14-34f.c
@@ -1771,7 +1771,8 @@
       return;
       }
 
-   spp = (struct mscp *)DEV2V(ret = inl(sh[j]->io_port + REG_ICM));
+   ret = inl(sh[j]->io_port + REG_ICM);
+   spp = (struct mscp *)DEV2V(ret);
    cpp = spp;
 
    /* Clear interrupt pending flag */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]