From 0f7b9136ed566f4a79b2d6ca33299babcce3049e Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 14 May 2015 11:16:04 -0700 Subject: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer --- src/ecs.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/ecs.c') diff --git a/src/ecs.c b/src/ecs.c index b206351..9250fe3 100644 --- a/src/ecs.c +++ b/src/ecs.c @@ -36,7 +36,7 @@ /* ccl2ecl - convert character classes to set of equivalence classes */ -void ccl2ecl () +void ccl2ecl (void) { int i, ich, newlen, cclp, ccls, cclmec; @@ -74,8 +74,7 @@ void ccl2ecl () * Returned is the number of classes. */ -int cre8ecs (fwd, bck, num) - int fwd[], bck[], num; +int cre8ecs (int fwd[], int bck[], int num) { int i, j, numcl; @@ -112,9 +111,7 @@ int cre8ecs (fwd, bck, num) * NUL_mapping is the value which NUL (0) should be mapped to. */ -void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) - Char ccls[]; - int lenccl, fwd[], bck[], llsiz, NUL_mapping; +void mkeccl (Char ccls[], int lenccl, int fwd[], int bck[], int llsiz, int NUL_mapping) { int cclp, oldec, newec; int cclm, i, j; @@ -201,8 +198,7 @@ void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping) /* mkechar - create equivalence class for single character */ -void mkechar (tch, fwd, bck) - int tch, fwd[], bck[]; +void mkechar (int tch, int fwd[], int bck[]) { /* If until now the character has been a proper subset of * an equivalence class, break it away to create a new ec -- cgit v1.2.3 From a97cf48486226d538797ef721c62a80b9327c43f Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Fri, 27 Nov 2015 21:38:23 -0500 Subject: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. --- src/ecs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ecs.c') diff --git a/src/ecs.c b/src/ecs.c index 9250fe3..b2afc1f 100644 --- a/src/ecs.c +++ b/src/ecs.c @@ -99,9 +99,9 @@ int cre8ecs (int fwd[], int bck[], int num) /* mkeccl - update equivalence classes based on character class xtions * * synopsis - * Char ccls[]; + * unsigned char ccls[]; * int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping; - * void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz], + * void mkeccl( unsigned char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz], * int llsiz, int NUL_mapping ); * * ccls contains the elements of the character class, lenccl is the @@ -111,7 +111,7 @@ int cre8ecs (int fwd[], int bck[], int num) * NUL_mapping is the value which NUL (0) should be mapped to. */ -void mkeccl (Char ccls[], int lenccl, int fwd[], int bck[], int llsiz, int NUL_mapping) +void mkeccl (unsigned char ccls[], int lenccl, int fwd[], int bck[], int llsiz, int NUL_mapping) { int cclp, oldec, newec; int cclm, i, j; -- cgit v1.2.3