From f15a8d97cbea79b6c95416e8181d080fcb155dec Mon Sep 17 00:00:00 2001 From: Ludovic Jacomme Date: Thu, 23 Jan 2003 21:24:42 +0000 Subject: [PATCH] Potential bugs (fixed) --- alliance/src/abl/src/abl.h | 1 + alliance/src/abl/src/ablctlnorm.c | 6 +++--- alliance/src/abl/src/abloptim.c | 2 +- alliance/src/abl/src/ablpolar.c | 2 +- alliance/src/abl/src/ablsimp.c | 2 +- alliance/src/abl/src/ablunflat.c | 2 +- alliance/src/dreal/src/LIP6bw.h | 2 +- alliance/src/syf/src/syf_tools.c | 6 +++--- alliance/src/vbl/src/vbl_bspec.c | 2 +- alliance/src/vex/src/vexcreate.c | 10 +++++----- alliance/src/vex/src/vexget.c | 2 +- 11 files changed, 19 insertions(+), 18 deletions(-) diff --git a/alliance/src/abl/src/abl.h b/alliance/src/abl/src/abl.h index 6c7b6c0b..3f3a6a36 100644 --- a/alliance/src/abl/src/abl.h +++ b/alliance/src/abl/src/abl.h @@ -129,6 +129,7 @@ # define ABL_ATOM( E ) ( ( E )->NEXT == (ablexpr *)0 ) # define ABL_ATOM_VALUE( E ) ( (char *)( ( E )->DATA ) ) # define ABL_OPER( E ) ( (long)( ( ABL_CAR( ( E ) ) )->DATA ) ) +# define SET_ABL_OPER( E,O ) ( ( ABL_CAR( (E) )->DATA = (void *)(O) ) ) /*------------------------------------------------------\ | | diff --git a/alliance/src/abl/src/ablctlnorm.c b/alliance/src/abl/src/ablctlnorm.c index 4040feaa..e24dbefd 100644 --- a/alliance/src/abl/src/ablctlnorm.c +++ b/alliance/src/abl/src/ablctlnorm.c @@ -111,7 +111,7 @@ static ablexpr *local_normablctl( Expr ) if ( NormExpr != ABL_CADR( Expr ) ) ABL_CADR( Expr ) = NormExpr; ABL_CADR( Expr ) = createablnotexpr( ABL_CADR( Expr ) ); - ABL_OPER( Expr ) = ABL_EX; + SET_ABL_OPER( Expr, ABL_EX ); NormExpr = createablnotexpr( Expr ); return( NormExpr ); } @@ -143,7 +143,7 @@ static ablexpr *local_normablctl( Expr ) if ( NormExpr != ABL_CADR( Expr ) ) ABL_CADR( Expr ) = NormExpr; ABL_CADR( Expr ) = createablnotexpr( ABL_CADR( Expr ) ); - ABL_OPER( Expr ) = ABL_EG; + SET_ABL_OPER( Expr, ABL_EG ); NormExpr = createablnotexpr( Expr ); return( NormExpr ); } @@ -157,7 +157,7 @@ static ablexpr *local_normablctl( Expr ) if ( NormExpr != ABL_CADR( Expr ) ) ABL_CADR( Expr ) = NormExpr; ABL_CADR( Expr ) = createablnotexpr( ABL_CADR( Expr ) ); - ABL_OPER( Expr ) = ABL_EF; + SET_ABL_OPER( Expr, ABL_EF ); NormExpr = createablnotexpr( Expr ); NormExpr = local_normablctl( NormExpr ); return( NormExpr ); diff --git a/alliance/src/abl/src/abloptim.c b/alliance/src/abl/src/abloptim.c index d83632ea..fdae45c9 100644 --- a/alliance/src/abl/src/abloptim.c +++ b/alliance/src/abl/src/abloptim.c @@ -189,7 +189,7 @@ ablexpr *optimablnotexpr( Expr ) else if ( NotOper != -1 ) { - ABL_OPER( Expr ) = NotOper; + SET_ABL_OPER( Expr, NotOper ); return( Expr ); } } diff --git a/alliance/src/abl/src/ablpolar.c b/alliance/src/abl/src/ablpolar.c index 0c7a7890..85665242 100644 --- a/alliance/src/abl/src/ablpolar.c +++ b/alliance/src/abl/src/ablpolar.c @@ -239,7 +239,7 @@ ablexpr *polarablexpr( Expr, Polar ) if ( AblPolarOperTable[ Oper ][ 2 ] == 1 ) Polar = ! Polar; if ( AblPolarOperTable[ Oper ][ 2 ] == -1 ) Polar = ABL_POLAR_POSITIVE; - ABL_OPER( Expr ) = NewOper; + SET_ABL_OPER( Expr, NewOper ); ScanExpr = Expr; while ( ( ScanExpr = ABL_CDR( ScanExpr ) ) != (ablexpr *)0 ) diff --git a/alliance/src/abl/src/ablsimp.c b/alliance/src/abl/src/ablsimp.c index 6b023746..4984c21b 100644 --- a/alliance/src/abl/src/ablsimp.c +++ b/alliance/src/abl/src/ablsimp.c @@ -312,7 +312,7 @@ ablexpr *loc_simpablexpr( Expr ) if ( getabloperpolar( Oper ) == ABL_POLAR_NEGATIVE ) { Oper = getablopernot( Oper ); - ABL_OPER( Expr ) = Oper; + SET_ABL_OPER( Expr, Oper ); Negative = 1; } else diff --git a/alliance/src/abl/src/ablunflat.c b/alliance/src/abl/src/ablunflat.c index 9048bd01..917b87d5 100644 --- a/alliance/src/abl/src/ablunflat.c +++ b/alliance/src/abl/src/ablunflat.c @@ -99,7 +99,7 @@ ablexpr *unflatablexpr( Expr ) if ( Polar != ABL_POLAR_POSITIVE ) { Oper = getablopernot( Oper ); - ABL_OPER( Expr ) = Oper; + SET_ABL_OPER( Expr, Oper ); ScanExpr = createabloper( ABL_NOT ); addablhexpr( ScanExpr, Expr ); diff --git a/alliance/src/dreal/src/LIP6bw.h b/alliance/src/dreal/src/LIP6bw.h index e9098253..6364702c 100644 --- a/alliance/src/dreal/src/LIP6bw.h +++ b/alliance/src/dreal/src/LIP6bw.h @@ -290,4 +290,4 @@ static char LIP6bw_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/alliance/src/syf/src/syf_tools.c b/alliance/src/syf/src/syf_tools.c index 90422651..88b65e29 100644 --- a/alliance/src/syf/src/syf_tools.c +++ b/alliance/src/syf/src/syf_tools.c @@ -85,10 +85,10 @@ int SyfGetNumberBit( Value ) long Value; { - long Mask; - int NumberBit; + unsigned long Mask; + int NumberBit; - Mask = 1 << 31; + Mask = 1U << 31; for ( NumberBit = 32; NumberBit > 0; NumberBit-- ) { diff --git a/alliance/src/vbl/src/vbl_bspec.c b/alliance/src/vbl/src/vbl_bspec.c index 54ae57b5..0d90c93a 100644 --- a/alliance/src/vbl/src/vbl_bspec.c +++ b/alliance/src/vbl/src/vbl_bspec.c @@ -1012,7 +1012,7 @@ int right; if ( Value != 0 ) { - Mask = 1L << 31; + Mask = 1U << 31; if ( src[ 0 ] == '-' ) { diff --git a/alliance/src/vex/src/vexcreate.c b/alliance/src/vex/src/vexcreate.c index b56bb144..300245fc 100644 --- a/alliance/src/vex/src/vexcreate.c +++ b/alliance/src/vex/src/vexcreate.c @@ -412,7 +412,7 @@ vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) { Width = MaxWidth; Index = 0; - Mask = 1L << 31; + Mask = 1U << 31; Integer = Array[ 0 ]; @@ -431,7 +431,7 @@ vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) if ( Index == Size ) break; Integer = Array[ Index ]; - Mask = 1L << 31; + Mask = 1U << 31; } } @@ -453,7 +453,7 @@ vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) if ( Index == Size ) break; Integer = Array[ Index ]; - Mask = 1L << 31; + Mask = 1U << 31; } } @@ -470,7 +470,7 @@ vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) Scan = 1; Index = Size - ((Width + 31) / 32); - Mask = 1L << ((Width - 1) % 32); + Mask = 1U << ((Width - 1) % 32); do { @@ -482,7 +482,7 @@ vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) if ( Mask == 0 ) { - Mask = 1L << 31; Index++; + Mask = 1U << 31; Index++; } } while ( Index < Size ); diff --git a/alliance/src/vex/src/vexget.c b/alliance/src/vex/src/vexget.c index 756ffe5e..faaf3360 100644 --- a/alliance/src/vex/src/vexget.c +++ b/alliance/src/vex/src/vexget.c @@ -184,7 +184,7 @@ int getvexintnumbit( Size ) if ( Size < 0 ) return( 0 ); if ( Size == 0 ) return( 1 ); - Mask = 1L << 31; + Mask = 1U << 31; for ( NumberBit = 32; NumberBit > 0; NumberBit-- ) {