Some old CPP or tools that take C code in input do
authordeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 12 Sep 1999 14:34:36 +0000 (14:34 +0000)
committerdeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 12 Sep 1999 14:34:36 +0000 (14:34 +0000)
not like #preprocessor_macros that do not start at
the first column.

So write:

#ifdef FOO
#  include <dummy1.h>
#  define DUMMY 1
#else
#  include <dummy2.h>
#  define DUMMY 2
#endif

instead of

#ifdef FOO
  #include <dummy1.h>
  #define DUMMY 1
#else
  #include <dummy2.h>
  #define DUMMY 2
#endif

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@668 f5534014-38df-0310-8fa8-9805f1628bb7

globals.h
packet-atalk.c
packet-snmp.c
proto.c
proto.h
wiretap/buffer.h

index e741ebb52b242a4fb6ea3514ed3c155a4e7779f7..352281c1db9e9e968564a5c43bf55f7ab16dcbe5 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -1,7 +1,7 @@
 /* globals.h
  * Global defines, etc.
  *
- * $Id: globals.h,v 1.3 1999/09/10 07:19:40 guy Exp $
+ * $Id: globals.h,v 1.4 1999/09/12 14:34:18 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 
 /* Byte ordering */
 #ifndef BYTE_ORDER
-  #define LITTLE_ENDIAN 4321
-  #define BIG_ENDIAN 1234
-  #ifdef WORDS_BIGENDIAN
-    #define BYTE_ORDER BIG_ENDIAN
-  #else
-    #define BYTE_ORDER LITTLE_ENDIAN
-  #endif
+define LITTLE_ENDIAN 4321
+define BIG_ENDIAN 1234
+ifdef WORDS_BIGENDIAN
+#  define BYTE_ORDER BIG_ENDIAN
+else
+#  define BYTE_ORDER LITTLE_ENDIAN
+endif
 #endif
 
 /* From the K&R book, p. 89 */
 #ifndef MAX
-  #define MAX(x, y) ((x) > (y) ? (x) : (y))
+define MAX(x, y) ((x) > (y) ? (x) : (y))
 #endif
 
 #ifndef MIN
-  #define MIN(x, y) ((x) < (y) ? (x) : (y))
+define MIN(x, y) ((x) < (y) ? (x) : (y))
 #endif
 
 extern FILE        *data_out_file;
index 3e1237f3fd8af1c883615c1bb4b19ea959eb8cf8..61380d5157c4c9a60a490c6b06b3a5a829081961 100644 (file)
@@ -39,12 +39,12 @@ static int proto_ddp = -1;
 /* P = Padding, H = Hops, L = Len */
 #if BYTE_ORDER == BIG_ENDIAN
  /* PPHHHHLL LLLLLLLL */
- #define ddp_hops(x)   ( ( x >> 10) & 0x3C )
- #define ddp_len(x)            ( x & 0x03ff )
+define ddp_hops(x)   ( ( x >> 10) & 0x3C )
+define ddp_len(x)            ( x & 0x03ff )
 #else
  /* LLLLLLLL PPHHHHLL*/
- #define ddp_hops(x)   ( x & 0x3C )
- #define ddp_len(x)            ( ntohs(x) & 0x03ff )
+define ddp_hops(x)   ( x & 0x3C )
+define ddp_len(x)            ( ntohs(x) & 0x03ff )
 #endif
 typedef struct _e_ddp {
   guint16      hops_len; /* combines pad, hops, and len */
index 4c3729584b4242cd64c9efb822dc2ea1dafbf494..068704e4566f312be0a1d20c0b2e528717ab35cb 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for SNMP (simple network management protocol)
  * D.Jorand (c) 1998
  *
- * $Id: packet-snmp.c,v 1.8 1999/08/29 04:15:31 gram Exp $
+ * $Id: packet-snmp.c,v 1.9 1999/09/12 14:34:18 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -30,9 +30,9 @@
 
 
 #if defined(HAVE_UCD_SNMP_SNMP_H)
-  #define WITH_SNMP_UCD 1
+define WITH_SNMP_UCD 1
 #elif defined(HAVE_SNMP_SNMP_H)
-  #define WITH_SNMP_CMU 1
+define WITH_SNMP_CMU 1
 #endif
 
 #if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD)
diff --git a/proto.c b/proto.c
index d57fa0b8c417ca293dea6ac090f606a9c9aaa945..548a30dcfd31a96335f931ab2062e58e1ae07427 100644 (file)
--- a/proto.c
+++ b/proto.c
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c,v 1.24 1999/09/12 06:11:37 guy Exp $
+ * $Id: proto.c,v 1.25 1999/09/12 14:34:19 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -64,9 +64,9 @@
 #define cVALS(x) (const value_string*)(x)
 
 #if defined(HAVE_UCD_SNMP_SNMP_H)
-  #define WITH_SNMP_UCD 1
+define WITH_SNMP_UCD 1
 #elif defined(HAVE_SNMP_SNMP_H)
-  #define WITH_SNMP_CMU 1
+define WITH_SNMP_CMU 1
 #endif
 
 static gboolean
diff --git a/proto.h b/proto.h
index 21ebc146b8941f35ce70610afd17b7978d9ac343..782828e169a3f7dd9d6501db3463a8d3f6dcf6ac 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -1,7 +1,7 @@
 /* proto.h
  * Definitions for protocol display
  *
- * $Id: proto.h,v 1.10 1999/09/12 06:11:38 guy Exp $
+ * $Id: proto.h,v 1.11 1999/09/12 14:34:20 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #define __PROTO_H__
 
 #ifdef HAVE_SYS_TIME_H
- #ifndef _SYS_TIME_H
-  #include <sys/time.h>
- #endif
+ifndef _SYS_TIME_H
+#  include <sys/time.h>
+endif
 #endif
 
 #ifdef HAVE_WINSOCK_H
-#include <winsock.h>
+# include <winsock.h>
 #endif
 
 /* needs glib.h */
index 83300736e668c1d8d7a8f2f52263c64dc044d0f8..7b72e7ea94fdd3e7c754a68c0d4474b47ca5788e 100644 (file)
@@ -1,6 +1,6 @@
 /* buffer.h
  *
- * $Id: buffer.h,v 1.2 1998/11/12 06:01:19 gram Exp $
+ * $Id: buffer.h,v 1.3 1999/09/12 14:34:36 deniel Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@@ -39,10 +39,10 @@ void buffer_append(Buffer* buffer, char *from, unsigned int bytes);
 void buffer_remove_start(Buffer* buffer, unsigned int bytes);
 
 #ifdef SOME_FUNCTIONS_ARE_DEFINES
- #define buffer_increase_length(buffer,bytes) (buffer)->first_free += (bytes)
- #define buffer_length(buffer) ((buffer)->first_free - (buffer)->start)
- #define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
- #define buffer_end_ptr(buffer) ((buffer)->data + (buffer)->first_free)
+define buffer_increase_length(buffer,bytes) (buffer)->first_free += (bytes)
+define buffer_length(buffer) ((buffer)->first_free - (buffer)->start)
+define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
+define buffer_end_ptr(buffer) ((buffer)->data + (buffer)->first_free)
 #else
  void buffer_increase_length(Buffer* buffer, unsigned int bytes);
  unsigned int buffer_length(Buffer* buffer);