From cf3514b9aeec1c0b5b0a20cc681e03b9bff31590 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 9 Oct 2010 11:40:00 +0000 Subject: [PATCH] remove ancient #defines for AND OR NOT substitute with && || ! --- ChangeLog | 13 +++++++++++++ src/frontend/terminal.c | 1 - src/include/complex.h | 8 ++++---- src/include/fteparse.h | 2 -- src/main.c | 1 - src/maths/sparse/spbuild.c | 10 +++++----- src/maths/sparse/spdefs.h | 11 ++++------- src/misc/ivars.c | 1 - src/spicelib/parser/ifnewuid.c | 1 - src/spicelib/parser/inperror.c | 1 - src/tclspice.c | 1 - 11 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2e1e21cd..794dbbbce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2010-10-09 Robert Larice + * src/frontend/terminal.c , + * src/include/complex.h , + * src/include/fteparse.h , + * src/main.c , + * src/maths/sparse/spbuild.c , + * src/maths/sparse/spdefs.h , + * src/misc/ivars.c , + * src/spicelib/parser/ifnewuid.c , + * src/spicelib/parser/inperror.c , + * src/tclspice.c : + remove ancient #defines for AND OR NOT substitute with && || ! + 2010-10-09 Robert Larice * src/include/profile.h : remove obsolete #defines for BEGIN END LENGTH FORWARD diff --git a/src/frontend/terminal.c b/src/frontend/terminal.c index 03a19b304..07c6edbb4 100644 --- a/src/frontend/terminal.c +++ b/src/frontend/terminal.c @@ -17,7 +17,6 @@ $Id$ #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...); diff --git a/src/include/complex.h b/src/include/complex.h index 175228ebb..23b50ca66 100644 --- a/src/include/complex.h +++ b/src/include/complex.h @@ -495,8 +495,8 @@ typedef struct { /* Complex division: to = num / den */ #define CMPLX_DIV(to,num,den) \ { realNumber r_, s_; \ - if (((den).real >= (den).imag AND (den).real > -(den).imag) OR \ - ((den).real < (den).imag AND (den).real <= -(den).imag)) \ + if (((den).real >= (den).imag && (den).real > -(den).imag) || \ + ((den).real < (den).imag && (den).real <= -(den).imag)) \ { r_ = (den).imag / (den).real; \ s_ = (den).real + r_*(den).imag; \ (to).real = ((num).real + r_*(num).imag)/s_; \ @@ -513,8 +513,8 @@ typedef struct { /* Complex division and assignment: num /= den */ #define CMPLX_DIV_ASSIGN(num,den) \ { realNumber r_, s_, t_; \ - if (((den).real >= (den).imag AND (den).real > -(den).imag) OR \ - ((den).real < (den).imag AND (den).real <= -(den).imag)) \ + if (((den).real >= (den).imag && (den).real > -(den).imag) || \ + ((den).real < (den).imag && (den).real <= -(den).imag)) \ { r_ = (den).imag / (den).real; \ s_ = (den).real + r_*(den).imag; \ t_ = ((num).real + r_*(num).imag)/s_; \ diff --git a/src/include/fteparse.h b/src/include/fteparse.h index 3549d0263..bb9eea0f9 100644 --- a/src/include/fteparse.h +++ b/src/include/fteparse.h @@ -22,8 +22,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #endif #include "pnode.h" -#undef AND /* obsolete macro in ansidecl.h */ - /* Operations. These should really be considered functions. */ struct op { diff --git a/src/main.c b/src/main.c index d4b2cc2ae..ddc11b805 100644 --- a/src/main.c +++ b/src/main.c @@ -13,7 +13,6 @@ #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...); diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index d96dada52..ca0834d70 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -187,9 +187,9 @@ MatrixPtr Matrix = eMatrix; RealNumber *pElement; /* Begin `spFindElement'. */ - assert( IS_SPARSE( Matrix ) AND Row >= 0 AND Col >= 0 ); + assert( IS_SPARSE( Matrix ) && Row >= 0 && Col >= 0 ); - if ((Row == 0) OR (Col == 0)) + if ((Row == 0) || (Col == 0)) return &Matrix->TrashCan.Real; #if TRANSLATE @@ -197,8 +197,8 @@ RealNumber *pElement; if (Matrix->Error == spNO_MEMORY) return NULL; #endif -#if NOT TRANSLATE - assert(Row <= Matrix->Size AND Col <= Matrix->Size); +#if ! TRANSLATE + assert(Row <= Matrix->Size && Col <= Matrix->Size); #endif /* @@ -211,7 +211,7 @@ RealNumber *pElement; * is the first record in the MatrixElement structure. */ - if ((Row != Col) OR ((pElement = (RealNumber *)Matrix->Diag[Row]) == NULL)) + if ((Row != Col) || ((pElement = (RealNumber *)Matrix->Diag[Row]) == NULL)) { /* * Element does not exist or does not reside along diagonal. Search diff --git a/src/maths/sparse/spdefs.h b/src/maths/sparse/spdefs.h index bb521abf1..249fe6765 100644 --- a/src/maths/sparse/spdefs.h +++ b/src/maths/sparse/spdefs.h @@ -61,9 +61,6 @@ #define BOOLEAN int #define NO 0 #define YES 1 -#define NOT ! -#define AND && -#define OR || #define SPARSE_ID 0x772773 /* Arbitrary (is Sparse on phone). */ #define IS_SPARSE(matrix) ((matrix) != NULL && \ @@ -312,8 +309,8 @@ typedef struct /* Complex division: to = num / den */ #define CMPLX_DIV(to,num,den) \ { RealNumber r_, s_; \ - if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR \ - ((den).Real < (den).Imag AND (den).Real <= -(den).Imag)) \ + if (((den).Real >= (den).Imag && (den).Real > -(den).Imag) || \ + ((den).Real < (den).Imag && (den).Real <= -(den).Imag)) \ { r_ = (den).Imag / (den).Real; \ s_ = (den).Real + r_*(den).Imag; \ (to).Real = ((num).Real + r_*(num).Imag)/s_; \ @@ -330,8 +327,8 @@ typedef struct /* Complex division and assignment: num /= den */ #define CMPLX_DIV_ASSIGN(num,den) \ { RealNumber r_, s_, t_; \ - if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR \ - ((den).Real < (den).Imag AND (den).Real <= -(den).Imag)) \ + if (((den).Real >= (den).Imag && (den).Real > -(den).Imag) || \ + ((den).Real < (den).Imag && (den).Real <= -(den).Imag)) \ { r_ = (den).Imag / (den).Real; \ s_ = (den).Real + r_*(den).Imag; \ t_ = ((num).Real + r_*(num).Imag)/s_; \ diff --git a/src/misc/ivars.c b/src/misc/ivars.c index 1a4c9cd89..f1a40eebc 100644 --- a/src/misc/ivars.c +++ b/src/misc/ivars.c @@ -8,7 +8,6 @@ Copyright 1991 Regents of the University of California. All rights reserved. #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...); diff --git a/src/spicelib/parser/ifnewuid.c b/src/spicelib/parser/ifnewuid.c index bccc0c2c5..bb3374d9a 100644 --- a/src/spicelib/parser/ifnewuid.c +++ b/src/spicelib/parser/ifnewuid.c @@ -8,7 +8,6 @@ Author: 1988 Thomas L. Quarles #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...); diff --git a/src/spicelib/parser/inperror.c b/src/spicelib/parser/inperror.c index 27794cbac..347bdf882 100644 --- a/src/spicelib/parser/inperror.c +++ b/src/spicelib/parser/inperror.c @@ -12,7 +12,6 @@ Author: 1985 Thomas L. Quarles #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...); diff --git a/src/tclspice.c b/src/tclspice.c index f64334440..2631e9a6b 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -140,7 +140,6 @@ extern JMP_BUF jbuf; #ifdef HAVE_ASPRINTF #ifdef HAVE_LIBIBERTY_H /* asprintf */ #include -#undef AND /* obsolete macro in ansidecl.h */ #else /* we have asprintf, but not libiberty.h */ #include extern int asprintf(char **out, const char *fmt, ...);