From 08f37c757a8c9afbbe514527b6ba0676db5edee7 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Tue, 7 Dec 1993 10:18:09 +0000 Subject: [PATCH] {min,max,abs} -> {MIN,MAX,ABS} --- dfa.c | 4 ++-- ecs.c | 2 +- flexdef.h | 12 ++++++------ gen.c | 8 ++++---- main.c | 2 +- nfa.c | 4 ++-- tblcmp.c | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dfa.c b/dfa.c index 0293e3c..5d4c45f 100644 --- a/dfa.c +++ b/dfa.c @@ -204,7 +204,7 @@ int state[]; for ( i = 0; i < csize; ++i ) { - ec = abs( ecgroup[i] ); + ec = ABS( ecgroup[i] ); out_char_set[i] = state[ec]; } @@ -978,7 +978,7 @@ int ds[], dsize, transsym, nset[]; { /* do nothing */ } - else if ( abs( ecgroup[sym] ) == transsym ) + else if ( ABS( ecgroup[sym] ) == transsym ) nset[++numstates] = tsp; bottom: ; diff --git a/ecs.c b/ecs.c index cc4e955..4c3b950 100644 --- a/ecs.c +++ b/ecs.c @@ -80,7 +80,7 @@ int fwd[], bck[], num; numcl = 0; - /* Create equivalence class numbers. From now on, abs( bck(x) ) + /* Create equivalence class numbers. From now on, ABS( bck(x) ) * is the equivalence class number for object x. If bck(x) * is positive, then x is the representative of its equivalence * class. diff --git a/flexdef.h b/flexdef.h index bea7aa5..74f075b 100644 --- a/flexdef.h +++ b/flexdef.h @@ -61,14 +61,14 @@ /* Maximum line length we'll have to deal with. */ #define MAXLINE 2048 -#ifndef min -#define min(x,y) ((x) < (y) ? (x) : (y)) +#ifndef MIN +#define MIN(x,y) ((x) < (y) ? (x) : (y)) #endif -#ifndef max -#define max(x,y) ((x) > (y) ? (x) : (y)) +#ifndef MAX +#define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif -#ifndef abs -#define abs(x) ((x) < 0 ? -(x) : (x)) +#ifndef ABS +#define ABS(x) ((x) < 0 ? -(x) : (x)) #endif diff --git a/gen.c b/gen.c index 34c605e..c12849c 100644 --- a/gen.c +++ b/gen.c @@ -240,7 +240,7 @@ void genecs() if ( caseins && (i >= 'A') && (i <= 'Z') ) ecgroup[i] = ecgroup[clower( i )]; - ecgroup[i] = abs( ecgroup[i] ); + ecgroup[i] = ABS( ecgroup[i] ); mkdata( ecgroup[i] ); } @@ -786,7 +786,7 @@ void gentabs() dfaacc[end_of_buffer_state].dfaacc_set = EOB_accepting_list; printf( long_align ? C_long_decl : C_short_decl, - "yy_acclist", max( numas, 1 ) + 1 ); + "yy_acclist", MAX( numas, 1 ) + 1 ); j = 1; /* index into "yy_acclist" array */ @@ -910,9 +910,9 @@ void gentabs() { if ( trace ) fprintf( stderr, "%d = %d\n", - i, abs( tecbck[i] ) ); + i, ABS( tecbck[i] ) ); - mkdata( abs( tecbck[i] ) ); + mkdata( ABS( tecbck[i] ) ); } dataend(); diff --git a/main.c b/main.c index 8e9d108..dd6d8cc 100644 --- a/main.c +++ b/main.c @@ -873,7 +873,7 @@ void readin() /* Now map the equivalence class for NUL to its expected place. */ ecgroup[0] = ecgroup[csize]; - NUL_ec = abs( ecgroup[0] ); + NUL_ec = ABS( ecgroup[0] ); if ( useecs ) ccl2ecl(); diff --git a/nfa.c b/nfa.c index 2424176..44e893d 100644 --- a/nfa.c +++ b/nfa.c @@ -301,8 +301,8 @@ int first, last; { mkxtion( finalst[first], last ); finalst[first] = finalst[last]; - lastst[first] = max( lastst[first], lastst[last] ); - firstst[first] = min( firstst[first], firstst[last] ); + lastst[first] = MAX( lastst[first], lastst[last] ); + firstst[first] = MIN( firstst[first], firstst[last] ); return first; } diff --git a/tblcmp.c b/tblcmp.c index 654f95c..e8dd615 100644 --- a/tblcmp.c +++ b/tblcmp.c @@ -610,7 +610,7 @@ int numchars, statenum, deflink, totaltrans; /* Ensure that the base address we eventually generate is * non-negative. */ - baseaddr = max( tblend + 1, minec ); + baseaddr = MAX( tblend + 1, minec ); } tblbase = baseaddr - minec; @@ -635,7 +635,7 @@ int numchars, statenum, deflink, totaltrans; for ( ++firstfree; chk[firstfree] != 0; ++firstfree ) ; - tblend = max( tblend, tbllast ); + tblend = MAX( tblend, tbllast ); } -- 2.40.0