From 13ae5915d6044acc6a4675901be0f10a3f3d3bec Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Jan 2019 22:23:27 +0000 Subject: Fix signed<->unsigned comparsion warning (occurring in some gcc compilation flags). Micro-optimization: Use char array in stead of const char pointer for static variable. --- generic/tclCompExpr.c | 6 +++--- win/tclWinPipe.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index abb917f..27d7503 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -574,12 +574,12 @@ ParseExpr( { OpNode *nodes = NULL; /* Pointer to the OpNode storage array where * we build the parse tree. */ - int nodesAvailable = 64; /* Initial size of the storage array. This + unsigned nodesAvailable = 64; /* Initial size of the storage array. This * value establishes a minimum tree memory cost * of only about 1 kibyte, and is large enough * for most expressions to parse with no need * for array growth and reallocation. */ - int nodesUsed = 0; /* Number of OpNodes filled. */ + unsigned nodesUsed = 0; /* Number of OpNodes filled. */ int scanned = 0; /* Capture number of byte scanned by * parsing routines. */ int lastParsed; /* Stores info about what the lexeme parsed @@ -658,7 +658,7 @@ ParseExpr( */ if (nodesUsed >= nodesAvailable) { - int size = nodesUsed * 2; + unsigned size = nodesUsed * 2; OpNode *newPtr = NULL; do { diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index e596cac..e33273b 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1621,9 +1621,9 @@ BuildCommandLine( Tcl_DString ds; /* characters to enclose in quotes if unpaired quote flag set */ - const static char *specMetaChars = "&|^<>!()%"; - /* characters to enclose in quotes in any case (regardless unpaired-flag) */ - const static char *specMetaChars2 = "%"; + static const char specMetaChars[] = "&|^<>!()%"; + /* character to enclose in quotes in any case (regardless unpaired-flag) */ + static const char specMetaChars2[] = "%"; /* Quote flags: * CL_ESCAPE - escape argument; -- cgit v0.12