Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci `typedef void ifnet_ret_t; ' isn't valid C -- use...



details:   https://anonhg.NetBSD.org/src/rev/d26e2729bd26
branches:  trunk
changeset: 485719:d26e2729bd26
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 03 21:08:02 2000 +0000

description:
`typedef void ifnet_ret_t;' isn't valid C -- use #define, instead.  Also,
don't abuse the C preprocessor.

diffstat:

 sys/dev/pci/if_lmc.c        |  20 ++++++++++----------
 sys/dev/pci/if_lmc_common.c |  22 +++++++++++-----------
 sys/dev/pci/if_lmc_media.c  |  22 +++++++++++-----------
 sys/dev/pci/if_lmc_nbsd.c   |  23 +++++++++++------------
 sys/dev/pci/if_lmcvar.h     |   8 ++++----
 5 files changed, 47 insertions(+), 48 deletions(-)

diffs (256 lines):

diff -r 69a30e2d0878 -r d26e2729bd26 sys/dev/pci/if_lmc.c
--- a/sys/dev/pci/if_lmc.c      Wed May 03 20:52:29 2000 +0000
+++ b/sys/dev/pci/if_lmc.c      Wed May 03 21:08:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lmc.c,v 1.2 1999/12/04 12:11:13 ragge Exp $ */
+/*     $NetBSD: if_lmc.c,v 1.3 2000/05/03 21:08:02 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@@ -125,7 +125,6 @@
 #if NPCI > 0
 #include <pci/pcivar.h>
 #include <pci/dc21040reg.h>
-#define INCLUDE_PATH_PREFIX "pci/"
 #endif
 #endif /* __FreeBSD__ */
 
@@ -137,7 +136,6 @@
 #include <i386/isa/isavar.h>
 #include <i386/pci/pci.h>
 
-#define        INCLUDE_PATH_PREFIX     "i386/pci/"
 #endif /* __bsdi__ */
 
 #if defined(__NetBSD__)
@@ -148,17 +146,19 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include <dev/ic/dc21040reg.h>
-#define        INCLUDE_PATH_PREFIX     "dev/pci/"
 #endif /* __NetBSD__ */
 
 /*
- * Sigh.  Every OS puts these in different places.  NetBSD and FreeBSD use
- * a C preprocessor that allows this hack, but BSDI does not.  Grr.
+ * Sigh.  Every OS puts these in different places.
  */
-#if defined(__NetBSD__) || defined(__FreeBSD__)
-#include INCLUDE_PATH_PREFIX "if_lmc_types.h"
-#include INCLUDE_PATH_PREFIX "if_lmcioctl.h"
-#include INCLUDE_PATH_PREFIX "if_lmcvar.h"
+#if defined(__NetBSD__)
+#include <dev/pci/if_lmc_types.h>
+#include <dev/pci/if_lmcioctl.h>
+#include <dev/pci/if_lmcvar.h>
+#elif defined(__FreeBSD__)
+#include "pci/if_lmc_types.h"
+#include "pci/if_lmcioctl.h"
+#include "pci/if_lmcvar.h"
 #else /* BSDI */
 #include "i386/pci/if_lmctypes.h"
 #include "i386/pci/if_lmcioctl.h"
diff -r 69a30e2d0878 -r d26e2729bd26 sys/dev/pci/if_lmc_common.c
--- a/sys/dev/pci/if_lmc_common.c       Wed May 03 20:52:29 2000 +0000
+++ b/sys/dev/pci/if_lmc_common.c       Wed May 03 21:08:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lmc_common.c,v 1.1 1999/03/25 03:32:43 explorer Exp $       */
+/*     $NetBSD: if_lmc_common.c,v 1.2 2000/05/03 21:08:02 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@@ -125,7 +125,6 @@
 #if NPCI > 0
 #include <pci/pcivar.h>
 #include <pci/dc21040reg.h>
-#define INCLUDE_PATH_PREFIX "pci/"
 #endif
 #endif /* __FreeBSD__ */
 
@@ -137,7 +136,6 @@
 #include <i386/isa/isavar.h>
 #include <i386/pci/pci.h>
 
-#define        INCLUDE_PATH_PREFIX     "i386/pci/"
 #endif /* __bsdi__ */
 
 #if defined(__NetBSD__)
@@ -148,19 +146,21 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include <dev/ic/dc21040reg.h>
-#define        INCLUDE_PATH_PREFIX     "dev/pci/"
 #endif /* __NetBSD__ */
 
 /*
- * Sigh.  Every OS puts these in different places.  NetBSD and FreeBSD use
- * a C preprocessor that allows this hack, but BSDI does not.
+ * Sigh.  Every OS puts these in different places.
  */
-#if defined(__NetBSD__) || defined(__FreeBSD__)
-#include INCLUDE_PATH_PREFIX "if_lmc_types.h"
-#include INCLUDE_PATH_PREFIX "if_lmcioctl.h"
-#include INCLUDE_PATH_PREFIX "if_lmcvar.h"
+#if defined(__NetBSD__)
+#include <dev/pci/if_lmc_types.h>
+#include <dev/pci/if_lmcioctl.h>
+#include <dev/pci/if_lmcvar.h>  
+#elif defined(__FreeBSD__)
+#include "pci/if_lmc_types.h"
+#include "pci/if_lmcioctl.h"
+#include "pci/if_lmcvar.h"
 #else /* BSDI */
-#include "i386/pci/if_lmc_types.h"
+#include "i386/pci/if_lmctypes.h"
 #include "i386/pci/if_lmcioctl.h"
 #include "i386/pci/if_lmcvar.h"
 #endif
diff -r 69a30e2d0878 -r d26e2729bd26 sys/dev/pci/if_lmc_media.c
--- a/sys/dev/pci/if_lmc_media.c        Wed May 03 20:52:29 2000 +0000
+++ b/sys/dev/pci/if_lmc_media.c        Wed May 03 21:08:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lmc_media.c,v 1.1 1999/03/25 03:32:43 explorer Exp $        */
+/*     $NetBSD: if_lmc_media.c,v 1.2 2000/05/03 21:08:02 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@@ -99,7 +99,6 @@
 #if NPCI > 0
 #include <pci/pcivar.h>
 #include <pci/dc21040reg.h>
-#define INCLUDE_PATH_PREFIX "pci/"
 #endif
 #endif /* __FreeBSD__ */
 
@@ -111,7 +110,6 @@
 #include <i386/isa/isavar.h>
 #include <i386/pci/pci.h>
 
-#define        INCLUDE_PATH_PREFIX     "i386/pci/"
 #endif /* __bsdi__ */
 
 #if defined(__NetBSD__)
@@ -122,19 +120,21 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include <dev/ic/dc21040reg.h>
-#define        INCLUDE_PATH_PREFIX     "dev/pci/"
 #endif /* __NetBSD__ */
 
 /*
- * Sigh.  Every OS puts these in different places.  NetBSD and FreeBSD use
- * a C preprocessor that allows this hack, but BSDI does not.
+ * Sigh.  Every OS puts these in different places.
  */
-#if defined(__NetBSD__) || defined(__FreeBSD__)
-#include INCLUDE_PATH_PREFIX "if_lmc_types.h"
-#include INCLUDE_PATH_PREFIX "if_lmcioctl.h"
-#include INCLUDE_PATH_PREFIX "if_lmcvar.h"
+#if defined(__NetBSD__)  
+#include <dev/pci/if_lmc_types.h>
+#include <dev/pci/if_lmcioctl.h>
+#include <dev/pci/if_lmcvar.h>
+#elif defined(__FreeBSD__)
+#include "pci/if_lmc_types.h"
+#include "pci/if_lmcioctl.h"
+#include "pci/if_lmcvar.h"
 #else /* BSDI */
-#include "i386/pci/if_lmc_types.h"
+#include "i386/pci/if_lmctypes.h"
 #include "i386/pci/if_lmcioctl.h"
 #include "i386/pci/if_lmcvar.h"
 #endif
diff -r 69a30e2d0878 -r d26e2729bd26 sys/dev/pci/if_lmc_nbsd.c
--- a/sys/dev/pci/if_lmc_nbsd.c Wed May 03 20:52:29 2000 +0000
+++ b/sys/dev/pci/if_lmc_nbsd.c Wed May 03 21:08:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lmc_nbsd.c,v 1.2 1999/05/12 22:55:14 explorer Exp $ */
+/*     $NetBSD: if_lmc_nbsd.c,v 1.3 2000/05/03 21:08:03 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@@ -125,7 +125,6 @@
 #if NPCI > 0
 #include <pci/pcivar.h>
 #include <pci/dc21040reg.h>
-#define INCLUDE_PATH_PREFIX "pci/"
 #endif
 #endif /* __FreeBSD__ */
 
@@ -136,8 +135,6 @@
 #include <i386/isa/dma.h>
 #include <i386/isa/isavar.h>
 #include <i386/pci/pci.h>
-
-#define        INCLUDE_PATH_PREFIX     "i386/pci/"
 #endif /* __bsdi__ */
 
 #if defined(__NetBSD__)
@@ -148,21 +145,23 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include <dev/ic/dc21040reg.h>
-#define        INCLUDE_PATH_PREFIX     "dev/pci/"
 #endif /* __NetBSD__ */
 
 /*
- * Sigh.  Every OS puts these in different places.  NetBSD and FreeBSD use
- * a C preprocessor that allows this hack, but BSDI does not.  Grr.
+ * Sigh.  Every OS puts these in different places.
  */
-#if defined(__NetBSD__) || defined(__FreeBSD__)
-#include INCLUDE_PATH_PREFIX "if_lmc_types.h"
-#include INCLUDE_PATH_PREFIX "if_lmcioctl.h"
-#include INCLUDE_PATH_PREFIX "if_lmcvar.h"
+#if defined(__NetBSD__)
+#include <dev/pci/if_lmc_types.h>
+#include <dev/pci/if_lmcioctl.h>
+#include <dev/pci/if_lmcvar.h>  
+#elif defined(__FreeBSD__)
+#include "pci/if_lmc_types.h"
+#include "pci/if_lmcioctl.h"
+#include "pci/if_lmcvar.h"
 #else /* BSDI */
 #include "i386/pci/if_lmctypes.h"
 #include "i386/pci/if_lmcioctl.h"
-#include "i386/pci/if_lmcvar.h"
+#include "i386/pci/if_lmcvar.h" 
 #endif
 
 /*
diff -r 69a30e2d0878 -r d26e2729bd26 sys/dev/pci/if_lmcvar.h
--- a/sys/dev/pci/if_lmcvar.h   Wed May 03 20:52:29 2000 +0000
+++ b/sys/dev/pci/if_lmcvar.h   Wed May 03 21:08:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lmcvar.h,v 1.2 1999/05/11 02:57:58 thorpej Exp $    */
+/*     $NetBSD: if_lmcvar.h,v 1.3 2000/05/03 21:08:03 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@@ -466,7 +466,7 @@
 #define        LMC_MAX_DEVICES 32
 
 #if defined(__FreeBSD__)
-typedef void ifnet_ret_t;
+#define        ifnet_ret_t void
 typedef int ioctl_cmd_t;
 static lmc_softc_t *tulips[LMC_MAX_DEVICES];
 #if BSD >= 199506
@@ -493,7 +493,7 @@
 #endif
 
 #if defined(__bsdi__)
-typedef int ifnet_ret_t;
+#define        ifnet_ret_t int
 typedef u_long ioctl_cmd_t;
 extern struct cfdriver lmccd;
 #define        LMC_UNIT_TO_SOFTC(unit) ((lmc_softc_t *)lmccd.cd_devs[unit])
@@ -508,7 +508,7 @@
 #endif /* __bsdi__ */
 
 #if defined(__NetBSD__)
-typedef void ifnet_ret_t;
+#define        ifnet_ret_t void
 typedef u_long ioctl_cmd_t;
 extern struct cfattach de_ca;
 extern struct cfdriver de_cd;



Home | Main Index | Thread Index | Old Index