Index: modules/md5/md5.c ================================================================== --- modules/md5/md5.c +++ modules/md5/md5.c @@ -113,11 +113,11 @@ /* The routine MD5Update updates the message-digest context to account for the presence of each of the characters inBuf[0..inLen-1] in the message whose digest is being computed. */ void MD5Update (mdContext, inBuf, inLen) -register MD5_CTX *mdContext; unsigned char *inBuf; +register MD5_CTX *mdContext; const unsigned char *inBuf; unsigned int inLen; { register int i, ii; int mdi; UINT4 in[16]; Index: modules/md5/md5.h ================================================================== --- modules/md5/md5.h +++ modules/md5/md5.h @@ -57,10 +57,10 @@ UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ unsigned char in[64]; /* input buffer */ } MD5_CTX; void MD5Init (MD5_CTX *mdContext); -void MD5Update (MD5_CTX *mdContext, unsigned char *buf, unsigned int len); +void MD5Update (MD5_CTX *mdContext, const unsigned char *buf, unsigned int len); void MD5Final (unsigned char digest[16], MD5_CTX *mdContext); void Transform (UINT4 *buf, UINT4 *in); #endif Index: modules/md5crypt/md5cryptc.tcl ================================================================== --- modules/md5crypt/md5cryptc.tcl +++ modules/md5crypt/md5cryptc.tcl @@ -55,12 +55,13 @@ static char * md5crypt(const char *pw, const char *salt, const char *magic) { - static char passwd[120], *p; - static const unsigned char *sp,*ep; + static char passwd[120]; + char *p; + const unsigned char *sp,*ep; unsigned char final[16]; int sl,pl,i; MD5_CTX ctx,ctx1; unsigned long l; @@ -111,11 +112,11 @@ else MD5Update(&ctx, (unsigned char *)pw, 1); } /* Now make the output string */ - snprintf(passwd, sizeof(passwd), "%s%.*s$", (char *)magic, + p = passwd + snprintf(passwd, sizeof(passwd), "%s%.*s$", (char *)magic, sl, (const char *)sp); MD5Final(final,&ctx); /* @@ -141,12 +142,10 @@ else MD5Update(&ctx1,(unsigned char *)pw,strlen(pw)); MD5Final(final,&ctx1); } - p = passwd + strlen(passwd); - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4; l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4; l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4; Index: modules/pt/pt_cparam_config_critcl.tcl ================================================================== --- modules/pt/pt_cparam_config_critcl.tcl +++ modules/pt/pt_cparam_config_critcl.tcl @@ -112,10 +112,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static @@RUNTIME@@ } Index: modules/pt/pt_cparam_config_tea.tcl ================================================================== --- modules/pt/pt_cparam_config_tea.tcl +++ modules/pt/pt_cparam_config_tea.tcl @@ -92,10 +92,11 @@ ** for user @user@ ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static @@RUNTIME@@ Index: modules/pt/pt_parse_peg_c.tcl ================================================================== --- modules/pt/pt_parse_peg_c.tcl +++ modules/pt/pt_parse_peg_c.tcl @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void *)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1000,28 +1002,28 @@ return 1; } SCOPE void rde_param_i_symbol_save (RDE_PARAM p, long int s) { - long int at = (long int) rde_stack_top (p->LS); + intptr_t at = (intptr_t)rde_stack_top (p->LS); NC_STATE* scs; Tcl_HashEntry* hPtr; Tcl_HashTable* tablePtr; int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*) at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void*)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); @@ -4725,11 +4729,11 @@ critcl::ccode { /* -*- c -*- */ typedef struct PARSERg { - long int counter; + size_t counter; char buf [50]; } PARSERg; static void PARSERgRelease (ClientData cd, Tcl_Interp* interp) @@ -4753,11 +4757,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) parserg); } parserg->counter ++; - sprintf (parserg->buf, "peg%ld", parserg->counter); + sprintf (parserg->buf, "peg%td", parserg->counter); return parserg->buf; #undef KEY } static void Index: modules/pt/pt_rdengine_c.tcl ================================================================== --- modules/pt/pt_rdengine_c.tcl +++ modules/pt/pt_rdengine_c.tcl @@ -46,11 +46,11 @@ /* .................................................. */ /* Global PARAM management, per interp */ typedef struct PARAMg { - long int counter; + size_t counter; char buf [50]; } PARAMg; static void PARAMgRelease (ClientData cd, Tcl_Interp* interp) @@ -74,11 +74,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) paramg); } paramg->counter ++; - sprintf (paramg->buf, "rde%ld", paramg->counter); + sprintf (paramg->buf, "rde%td", paramg->counter); return paramg->buf; #undef KEY } Index: modules/pt/rde_critcl/p.c ================================================================== --- modules/pt/rde_critcl/p.c +++ modules/pt/rde_critcl/p.c @@ -1,12 +1,13 @@ /* pt::rde::critcl - critcl - layer 1 definitions * (c) PARAM functions */ -#include /* Our public and internal APIs */ -#include /* Allocation macros */ +#include #include +#include "pInt.h" /* Our public and internal APIs */ +#include "util.h" /* Allocation macros */ /* .................................................. */ static char* dup_string (const char* str); @@ -130,11 +131,11 @@ } hPtr = Tcl_CreateHashEntry(&p->str, literal, &isnew); ASSERT (isnew, "Should have found entry"); - Tcl_SetHashValue (hPtr, p->numstr); + Tcl_SetHashValue (hPtr, (intptr_t)p->numstr); if (p->numstr >= p->maxnum) { long int new; char** str; Index: modules/pt/rde_critcl/param.c ================================================================== --- modules/pt/rde_critcl/param.c +++ modules/pt/rde_critcl/param.c @@ -1,15 +1,17 @@ /* * = = == === ===== ======== ============= ===================== * == pt::rde (critcl) - Data Structures - PARAM architectural state. */ -#include /* Public and private APIs */ -#include /* Stack handling */ -#include /* Token cache handling */ -#include /* Allocation utilities */ +#include +#include #include +#include "param.h" /* Public and private APIs */ +#include "stack.h" /* Stack handling */ +#include "tc.h" /* Token cache handling */ +#include "util.h" /* Allocation utilities */ /* * = = == === ===== ======== ============= ===================== */ @@ -418,14 +420,14 @@ rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } -SCOPE long int +SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { @@ -668,11 +670,11 @@ p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { @@ -818,11 +820,11 @@ hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } /* * Found information, apply it to the state, restoring the cached * situation. @@ -859,21 +861,21 @@ /* * 2-level hash table keyed by location, and symbol ... */ - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { /* * Copy state into new cache entry. */ @@ -1069,17 +1071,19 @@ } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } /* * = = == === ===== ======== ============= ===================== */ Index: modules/pt/rde_critcl/param.h ================================================================== --- modules/pt/rde_critcl/param.h +++ modules/pt/rde_critcl/param.h @@ -7,10 +7,11 @@ #define _RDE_DS_PARAM_H 1 #include "tcl.h" #include /* Scoping */ #include /* Stack handling */ +#include /* intptr_t */ /* * The state structure is opaque, its internals are known only to the * functions declared here. */ @@ -52,11 +53,11 @@ SCOPE int rde_param_query_cl (RDE_PARAM p); SCOPE const ERROR_STATE* rde_param_query_er (RDE_PARAM p); SCOPE Tcl_Obj* rde_param_query_er_tcl (RDE_PARAM p, const ERROR_STATE* er); SCOPE void rde_param_query_es (RDE_PARAM p, long int* ec, ERROR_STATE*** ev); SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv); -SCOPE long int rde_param_query_lstop (RDE_PARAM p); +SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p); SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p); SCOPE int rde_param_query_st (RDE_PARAM p); SCOPE Tcl_Obj* rde_param_query_sv (RDE_PARAM p); SCOPE long int rde_param_query_tc_size (RDE_PARAM p); SCOPE void rde_param_query_tc_get_s (RDE_PARAM p, long int at, long int last, char** ch, long int* len); Index: modules/pt/tests/data/ok/peg_cparam-critcl/0_basic_arithmetic ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/0_basic_arithmetic +++ modules/pt/tests/data/ok/peg_cparam-critcl/0_basic_arithmetic @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/10_notahead ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/10_notahead +++ modules/pt/tests/data/ok/peg_cparam-critcl/10_notahead @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/11_epsilon ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/11_epsilon +++ modules/pt/tests/data/ok/peg_cparam-critcl/11_epsilon @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/1_functions ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/1_functions +++ modules/pt/tests/data/ok/peg_cparam-critcl/1_functions @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/2_fun_arithmetic ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/2_fun_arithmetic +++ modules/pt/tests/data/ok/peg_cparam-critcl/2_fun_arithmetic @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/3_peg_itself ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/3_peg_itself +++ modules/pt/tests/data/ok/peg_cparam-critcl/3_peg_itself @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/4_choice ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/4_choice +++ modules/pt/tests/data/ok/peg_cparam-critcl/4_choice @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/5_sequence ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/5_sequence +++ modules/pt/tests/data/ok/peg_cparam-critcl/5_sequence @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/6_optional ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/6_optional +++ modules/pt/tests/data/ok/peg_cparam-critcl/6_optional @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/7_kleene ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/7_kleene +++ modules/pt/tests/data/ok/peg_cparam-critcl/7_kleene @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/8_pkleene ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/8_pkleene +++ modules/pt/tests/data/ok/peg_cparam-critcl/8_pkleene @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-critcl/9_ahead ================================================================== --- modules/pt/tests/data/ok/peg_cparam-critcl/9_ahead +++ modules/pt/tests/data/ok/peg_cparam-critcl/9_ahead @@ -43,10 +43,12 @@ # provides its own layer for that. critcl::ccode { /* -*- c -*- */ + #include + #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -730,14 +732,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -894,11 +896,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -984,11 +986,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -1009,19 +1011,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1167,16 +1169,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/0_basic_arithmetic ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/0_basic_arithmetic +++ modules/pt/tests/data/ok/peg_cparam-tea/0_basic_arithmetic @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/10_notahead ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/10_notahead +++ modules/pt/tests/data/ok/peg_cparam-tea/10_notahead @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/11_epsilon ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/11_epsilon +++ modules/pt/tests/data/ok/peg_cparam-tea/11_epsilon @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/1_functions ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/1_functions +++ modules/pt/tests/data/ok/peg_cparam-tea/1_functions @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/2_fun_arithmetic ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/2_fun_arithmetic +++ modules/pt/tests/data/ok/peg_cparam-tea/2_fun_arithmetic @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/3_peg_itself ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/3_peg_itself +++ modules/pt/tests/data/ok/peg_cparam-tea/3_peg_itself @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/4_choice ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/4_choice +++ modules/pt/tests/data/ok/peg_cparam-tea/4_choice @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/5_sequence ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/5_sequence +++ modules/pt/tests/data/ok/peg_cparam-tea/5_sequence @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/6_optional ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/6_optional +++ modules/pt/tests/data/ok/peg_cparam-tea/6_optional @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/7_kleene ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/7_kleene +++ modules/pt/tests/data/ok/peg_cparam-tea/7_kleene @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/8_pkleene ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/8_pkleene +++ modules/pt/tests/data/ok/peg_cparam-tea/8_pkleene @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/pt/tests/data/ok/peg_cparam-tea/9_ahead ================================================================== --- modules/pt/tests/data/ok/peg_cparam-tea/9_ahead +++ modules/pt/tests/data/ok/peg_cparam-tea/9_ahead @@ -9,10 +9,11 @@ ** for user unknown ** * * ** *** ***** ******** ************* *********************/ #include #include + #include #include #include #define SCOPE static #line 1 "rde_critcl/util.h" @@ -697,14 +698,14 @@ SCOPE void rde_param_query_ls (RDE_PARAM p, long int* lc, void*** lv) { rde_stack_get (p->LS, lc, lv); } - SCOPE long int + SCOPE intptr_t rde_param_query_lstop (RDE_PARAM p) { - (long int) rde_stack_top (p->LS); + return (intptr_t) rde_stack_top (p->LS); } SCOPE Tcl_HashTable* rde_param_query_nc (RDE_PARAM p) { return &p->NC; @@ -861,11 +862,11 @@ p->ER = ALLOC (ERROR_STATE); p->ER->refCount = 1; p->ER->loc = p->CL; p->ER->msg = rde_stack_new (NULL); ASSERT_BOUNDS(s,p->numstr); - rde_stack_push (p->ER->msg, (void*) s); + rde_stack_push (p->ER->msg, (void*)(intptr_t)s); } static void error_state_free (void* esx) { ERROR_STATE* es = esx; @@ -951,11 +952,11 @@ Tcl_HashTable* tablePtr; hPtr = Tcl_FindHashEntry (&p->NC, (char*) p->CL); if (!hPtr) { return 0; } tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); - hPtr = Tcl_FindHashEntry (tablePtr, (char*) s); + hPtr = Tcl_FindHashEntry (tablePtr, (void*)(intptr_t)s); if (!hPtr) { return 0; } scs = Tcl_GetHashValue (hPtr); p->CL = scs->CL; p->ST = scs->ST; @@ -976,19 +977,19 @@ int isnew; ENTER ("rde_param_i_symbol_save"); TRACE (("RDE_PARAM %p",p)); TRACE (("INT %d",s)); - hPtr = Tcl_CreateHashEntry (&p->NC, (char*) at, &isnew); + hPtr = Tcl_CreateHashEntry (&p->NC, (void*)(intptr_t)at, &isnew); if (isnew) { tablePtr = ALLOC (Tcl_HashTable); Tcl_InitHashTable (tablePtr, TCL_ONE_WORD_KEYS); Tcl_SetHashValue (hPtr, tablePtr); } else { tablePtr = (Tcl_HashTable*) Tcl_GetHashValue (hPtr); } - hPtr = Tcl_CreateHashEntry (tablePtr, (char*) s, &isnew); + hPtr = Tcl_CreateHashEntry (tablePtr, (void *)(intptr_t)s, &isnew); if (isnew) { scs = ALLOC (NC_STATE); scs->CL = p->CL; scs->ST = p->ST; @@ -1134,16 +1135,18 @@ return (character >= 0) && (character < 0x80); } static int UniCharIsHexDigit (int character) { - return (character >= 0) && (character < 0x80) && isxdigit(character); + return UniCharIsDecDigit(character) || + (character >= 'a' && character <= 'f') || + (character >= 'A' && character <= 'F'); } static int UniCharIsDecDigit (int character) { - return (character >= 0) && (character < 0x80) && isdigit(character); + return (character >= '0') && (character <= '9'); } SCOPE void rde_param_i_value_clear (RDE_PARAM p) { SV_CLEAR (p); Index: modules/rc4/rc4c.tcl ================================================================== --- modules/rc4/rc4c.tcl +++ modules/rc4/rc4c.tcl @@ -18,10 +18,12 @@ package provide rc4c 1.1.0 namespace eval ::rc4 { critcl::ccode { + #include + #include typedef struct RC4_CTX { unsigned char x; unsigned char y; Index: modules/sha1/sha1c.tcl ================================================================== --- modules/sha1/sha1c.tcl +++ modules/sha1/sha1c.tcl @@ -30,12 +30,11 @@ Tcl_ObjType sha1_type; /* fast internal access representation */ static void sha1_free_rep(Tcl_Obj* obj) { - SHA1_CTX* mp = (SHA1_CTX*) obj->internalRep.otherValuePtr; - Tcl_Free ((char*)mp); + Tcl_Free(obj->internalRep.otherValuePtr); } static void sha1_dup_rep(Tcl_Obj* obj, Tcl_Obj* dup) { Index: modules/struct/graph/arc.c ================================================================== --- modules/struct/graph/arc.c +++ modules/struct/graph/arc.c @@ -1,13 +1,14 @@ /* struct::tree - critcl - layer 1 declarations * (b) Arc operations. */ -#include -#include -#include -#include +#include "arc.h" +#include "attr.h" +#include "graph.h" +#include "nacommon.h" +#include "util.h" /* .................................................. */ static GL* gla_link (GA* a, GL* i, GN* n, GLA* na); static void gla_unlink (GL* i, GLA* na); Index: modules/struct/graph/attr.c ================================================================== --- modules/struct/graph/attr.c +++ modules/struct/graph/attr.c @@ -1,11 +1,13 @@ /* struct::graph - critcl - layer 1 definitions * (c) Graph functions */ -#include -#include +#include "attr.h" +#include "util.h" +#include + /* .................................................. */ Tcl_Obj* g_attr_serial (Tcl_HashTable* attr, Tcl_Obj* empty) Index: modules/struct/graph/ds.h ================================================================== --- modules/struct/graph/ds.h +++ modules/struct/graph/ds.h @@ -158,11 +158,11 @@ /* * 'Global' management. One structure per interpreter. */ typedef struct GG { - long int counter; /* Graph id generator */ + size_t counter; /* Graph id generator */ char buf [50]; /* Buffer for handle construction */ } GG; typedef GC* (GN_GET_GC) (G* g, Tcl_Obj* x, Tcl_Interp* interp, Tcl_Obj* graph); Index: modules/struct/graph/filter.c ================================================================== --- modules/struct/graph/filter.c +++ modules/struct/graph/filter.c @@ -1,12 +1,13 @@ /* struct::graph - critcl - layer 1 definitions * (c) Graph functions */ -#include -#include -#include +#include +#include "nacommon.h" +#include "util.h" +#include "node.h" /* .................................................. */ typedef enum NA_MODE { NA_ADJ, NA_EMBEDDING, NA_IN, NA_INNER, @@ -251,17 +252,16 @@ if (!na->key && !na->filter && (na->mode == NA_NONE)) { filter_none (interp, gx, &l); } else { - if (na->mode != NA_NONE) { - if (nodes) { - filter_mode_n (na->mode, gx, &l, na->nc, na->nv, g); - } else { - filter_mode_a (na->mode, gx, &l, na->nc, na->nv, g); - } + if (nodes) { + filter_mode_n (na->mode, gx, &l, na->nc, na->nv, g); + } else { + filter_mode_a (na->mode, gx, &l, na->nc, na->nv, g); } + if (na->key && na->value) { filter_kv (interp, gx, &l, gf, g, na->key, na->value); } else if (na->key) { filter_k (interp, gx, &l, gf, g, na->key); } @@ -322,10 +322,11 @@ case NA_ADJ: filter_mode_a_adj (gx, l, nc, nv, g); break; case NA_EMBEDDING: filter_mode_a_emb (gx, l, nc, nv, g); break; case NA_IN: filter_mode_a_in (gx, l, nc, nv, g); break; case NA_INNER: filter_mode_a_inn (gx, l, nc, nv, g); break; case NA_OUT: filter_mode_a_out (gx, l, nc, nv, g); break; + case NA_NONE: /* nothing */; } } /* .................................................. */ @@ -582,10 +583,11 @@ case NA_ADJ: filter_mode_n_adj (gx, l, nc, nv, g); break; case NA_EMBEDDING: filter_mode_n_emb (gx, l, nc, nv, g); break; case NA_IN: filter_mode_n_in (gx, l, nc, nv, g); break; case NA_INNER: filter_mode_n_inn (gx, l, nc, nv, g); break; case NA_OUT: filter_mode_n_out (gx, l, nc, nv, g); break; + case NA_NONE: /* nothing */; } } /* .................................................. */ Index: modules/struct/graph/global.c ================================================================== --- modules/struct/graph/global.c +++ modules/struct/graph/global.c @@ -22,11 +22,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) gg); } gg->counter ++; - sprintf (gg->buf, "graph%d", gg->counter); + sprintf (gg->buf, "graph%td", gg->counter); return gg->buf; } /* .................................................. */ Index: modules/struct/graph/graph.c ================================================================== --- modules/struct/graph/graph.c +++ modules/struct/graph/graph.c @@ -1,15 +1,16 @@ /* struct::graph - critcl - layer 1 definitions * (c) Graph functions */ -#include -#include -#include -#include -#include -#include +#include +#include "arc.h" +#include "attr.h" +#include "graph.h" +#include "node.h" +#include "objcmd.h" +#include "util.h" /* .................................................. */ static void swap (G* dst, G* src); static G* dup (G* src); @@ -157,15 +158,15 @@ ASSERT_BOUNDS(i, oc); n = gn_get_node (g, ov[i], interp, go); if (!n) { goto abort; } - if (Tcl_FindHashEntry (&cn, (char*) n)) continue; + if (Tcl_FindHashEntry (&cn, (void *) n)) continue; ASSERT_BOUNDS(j, lc-1); - he = Tcl_CreateHashEntry (&cn, (char*) n, &new); + he = Tcl_CreateHashEntry (&cn, (void *) n, &new); lv [j] = n->base.name; - Tcl_SetHashValue (he, (ClientData) j); + Tcl_SetHashValue (he, (ClientData)(intptr_t)j); j += 3; } lc = j + 1; } else { /* Enumerate all nodes */ @@ -178,11 +179,11 @@ n = (GN*) n->base.next) { ASSERT_BOUNDS(j, lc-1); he = Tcl_CreateHashEntry (&cn, (char*) n, &new); lv [j] = n->base.name; - Tcl_SetHashValue (he, (ClientData) j); + Tcl_SetHashValue (he, (ClientData)(intptr_t)j); j += 3; } lc = j + 1; } Index: modules/struct/graph/methods.c ================================================================== --- modules/struct/graph/methods.c +++ modules/struct/graph/methods.c @@ -2,18 +2,20 @@ * * -> Method functions. * Implementations for all tree methods. */ +#include #include -#include -#include -#include -#include -#include -#include -#include +#include "arc.h" +#include "attr.h" +#include "graph.h" +#include "methods.h" +#include "nacommon.h" +#include "node.h" +#include "util.h" +#include "walk.h" /* .................................................. * Handling of all indices, numeric and 'end-x' forms. Copied straight out of * the Tcl core as this is not exported through the public API. */ Index: modules/struct/graph/methods.h ================================================================== --- modules/struct/graph/methods.h +++ modules/struct/graph/methods.h @@ -28,19 +28,24 @@ int gm_arc_APPEND (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_ATTR (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_DELETE (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_EXISTS (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); +int gm_arc_FLIP (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_GET (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_GETALL (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_GETUNWEIGH (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_GETWEIGHT (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_HASWEIGHT (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_INSERT (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_KEYEXISTS (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_KEYS (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_LAPPEND (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); +int gm_arc_MOVE (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); +int gm_arc_MOVE_SRC (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); +int gm_arc_MOVE_TARG (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); +int gm_arc_NODES (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_RENAME (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_SET (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_SETUNWEIGH (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_SETWEIGHT (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); int gm_arc_SOURCE (G* g, Tcl_Interp* interp, int objc, Tcl_Obj* const* objv); Index: modules/struct/graph/nacommon.c ================================================================== --- modules/struct/graph/nacommon.c +++ modules/struct/graph/nacommon.c @@ -1,12 +1,13 @@ /* struct::graph - critcl - layer 1 definitions * (c) Graph functions */ -#include -#include -#include +#include "attr.h" +#include "nacommon.h" +#include "util.h" +#include "node.h" /* .................................................. */ void gc_add (GC* c, GCC* gx) Index: modules/struct/graph/node.c ================================================================== --- modules/struct/graph/node.c +++ modules/struct/graph/node.c @@ -1,12 +1,13 @@ /* struct::graph - critcl - layer 1 declarations * (b) Node operations. */ -#include -#include -#include +#include "nacommon.h" +#include "arc.h" +#include "node.h" +#include "util.h" /* .................................................. */ GN* gn_new (G* g, const char* name) Index: modules/struct/graph/objcmd.c ================================================================== --- modules/struct/graph/objcmd.c +++ modules/struct/graph/objcmd.c @@ -38,11 +38,11 @@ enum methods { M_GSET, M_GASSIGN, M_APPEND, M_ARC, M_ARCS, M_DESERIALIZE, M_DESTROY, M_GET, M_GETALL, M_KEYEXISTS, M_KEYS, M_LAPPEND, M_NODE, M_NODES, M_SERIALIZE, M_SET, M_SWAP, M_UNSET, M_WALK - }; + } method; static CONST char* a_methods [] = { "append", "attr", "delete", "exists", "flip", "get", "getall", "getunweighted", "getweight", "hasweight", "insert", "keyexists", "keys", "lappend", "move", "move-source", @@ -55,11 +55,11 @@ MA_GET, MA_GETALL, MA_GETUNWEIGHTED, MA_GETWEIGHT, MA_HASWEIGHT, MA_INSERT, MA_KEYEXISTS, MA_KEYS, MA_LAPPEND, MA_MOVE, MA_MOVE_SOURCE, MA_MOVE_TARGET, MA_NODES, MA_RENAME, MA_SET, MA_SETUNWEIGHTED, MA_SETWEIGHT, MA_SOURCE, MA_TARGET, MA_UNSET, MA_UNSETWEIGHT, MA_WEIGHTS - }; + } a_method; static CONST char* n_methods [] = { "append", "attr", "degree", "delete", "exists", "get", "getall", "insert", "keyexists", "keys", "lappend", "opposite", "rename", "set", "unset", @@ -67,11 +67,11 @@ }; enum n_methods { MN_APPEND, MN_ATTR, MN_DEGREE, MN_DELETE, MN_EXISTS, MN_GET, MN_GETALL, MN_INSERT, MN_KEYEXISTS, MN_KEYS, MN_LAPPEND, MN_OPPOSITE, MN_RENAME, MN_SET, MN_UNSET - }; + } n_method; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", @@ -81,11 +81,11 @@ /* Dispatch to methods. They check the #args in detail before performing * the requested functionality */ - switch (m) { + switch (method = m) { case M_GSET: return gm_GSET (g, interp, objc, objv); case M_GASSIGN: return gm_GASSIGN (g, interp, objc, objv); case M_APPEND: return gm_APPEND (g, interp, objc, objv); case M_ARC: if (objc < 3) { @@ -93,11 +93,11 @@ return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [2], a_methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } - switch (m) { + switch (a_method = m) { case MA_APPEND: return gm_arc_APPEND (g, interp, objc, objv); case MA_ATTR: return gm_arc_ATTR (g, interp, objc, objv); case MA_DELETE: return gm_arc_DELETE (g, interp, objc, objv); case MA_EXISTS: return gm_arc_EXISTS (g, interp, objc, objv); case MA_FLIP: return gm_arc_FLIP (g, interp, objc, objv); @@ -139,11 +139,11 @@ return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [2], n_methods, "option", 0, &m) != TCL_OK) { return TCL_ERROR; } - switch (m) { + switch (n_method = m) { case MN_APPEND: return gm_node_APPEND (g, interp, objc, objv); case MN_ATTR: return gm_node_ATTR (g, interp, objc, objv); case MN_DEGREE: return gm_node_DEGREE (g, interp, objc, objv); case MN_DELETE: return gm_node_DELETE (g, interp, objc, objv); case MN_EXISTS: return gm_node_EXISTS (g, interp, objc, objv); Index: modules/struct/graph/util.c ================================================================== --- modules/struct/graph/util.c +++ modules/struct/graph/util.c @@ -75,11 +75,11 @@ } /* Delete all items in the list. */ -void* +void g_nlq_clear (NLQ* q) { NL* next; NL* qi = q->start; Index: modules/struct/graph/util.h ================================================================== --- modules/struct/graph/util.h +++ modules/struct/graph/util.h @@ -51,11 +51,11 @@ void g_nlq_init (NLQ* q); void g_nlq_append (NLQ* q, void* n); void g_nlq_push (NLQ* q, void* n); void* g_nlq_pop (NLQ* q); -void* g_nlq_clear (NLQ* q); +void g_nlq_clear (NLQ* q); #endif /* _G_UTIL_H */ /* * Local Variables: Index: modules/struct/graph/walk.c ================================================================== --- modules/struct/graph/walk.c +++ modules/struct/graph/walk.c @@ -1,10 +1,10 @@ - -#include "tcl.h" -#include -#include -#include +#include +#include +#include "graph.h" +#include "util.h" +#include "walk.h" /* .................................................. */ static int walkdfspre (Tcl_Interp* interp, GN* n, int dir, Tcl_HashTable* v, int cc, Tcl_Obj** ev, @@ -20,11 +20,11 @@ Tcl_Obj* action); static int walk_invoke (Tcl_Interp* interp, GN* n, int cc, Tcl_Obj** ev, Tcl_Obj* action); -static int walk_neighbours (GN* n, Tcl_HashTable* v, int dir, +static void walk_neighbours (GN* n, Tcl_HashTable* v, int dir, int* nc, GN*** nv); /* .................................................. */ int @@ -285,11 +285,11 @@ return res; } /* .................................................. */ -static int +static void walk_neighbours (GN* n, Tcl_HashTable* vn, int dir, int* nc, GN*** nv) { GLA* neigh; GL* il; Index: modules/struct/queue/ms.c ================================================================== --- modules/struct/queue/ms.c +++ modules/struct/queue/ms.c @@ -39,11 +39,11 @@ }; enum methods { M_CLEAR, M_DESTROY, M_GET, M_PEEK, M_PUT, M_SIZE, M_UNGET - }; + } method; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", @@ -53,11 +53,11 @@ /* Dispatch to methods. They check the #args in detail before performing * the requested functionality */ - switch (m) { + switch (method = m) { case M_CLEAR: return qum_CLEAR (q, interp, objc, objv); case M_DESTROY: return qum_DESTROY (q, interp, objc, objv); case M_GET: return qum_PEEK (q, interp, objc, objv, 1 /* get */); case M_PEEK: return qum_PEEK (q, interp, objc, objv, 0 /* peek */); case M_PUT: return qum_PUT (q, interp, objc, objv); Index: modules/struct/queue_c.tcl ================================================================== --- modules/struct/queue_c.tcl +++ modules/struct/queue_c.tcl @@ -33,11 +33,11 @@ /* .................................................. */ /* Global queue management, per interp */ typedef struct QDg { - long int counter; + size_t counter; char buf [50]; } QDg; static void QDgrelease (ClientData cd, Tcl_Interp* interp) @@ -61,11 +61,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) qdg); } qdg->counter ++; - sprintf (qdg->buf, "queue%d", qdg->counter); + sprintf (qdg->buf, "queue%td", qdg->counter); return qdg->buf; #undef KEY } Index: modules/struct/sets/m.c ================================================================== --- modules/struct/sets/m.c +++ modules/struct/sets/m.c @@ -78,11 +78,11 @@ val = Tcl_DuplicateObj (val); (void) Tcl_ObjSetVar2 (interp, objv[2], NULL, val, 0); s_get (interp, val, &vs); } - (void*) Tcl_CreateHashEntry(&vs->el, key, &new); + Tcl_CreateHashEntry(&vs->el, key, &new); nx = 1; } if (nx) { Tcl_InvalidateStringRep(val); } Index: modules/struct/sets/s.c ================================================================== --- modules/struct/sets/s.c +++ modules/struct/sets/s.c @@ -291,11 +291,11 @@ key = Tcl_GetHashKey (&a->el, he); if (Tcl_FindHashEntry (&b->el, key) != NULL) continue; /* key is in a, not in b <=> in (a-b) */ - (void*) Tcl_CreateHashEntry(&s->el, key, &new); + Tcl_CreateHashEntry(&s->el, key, &new); } return s; } @@ -327,11 +327,11 @@ key = Tcl_GetHashKey (&a->el, he); if (Tcl_FindHashEntry (&b->el, key) == NULL) continue; /* key is in a, in b <=> in (a*b) */ - (void*) Tcl_CreateHashEntry(&s->el, key, &new); + Tcl_CreateHashEntry(&s->el, key, &new); } return s; } @@ -363,11 +363,11 @@ if (b->el.numEntries) { for(he = Tcl_FirstHashEntry(&b->el, &hs); he != NULL; he = Tcl_NextHashEntry(&hs)) { key = Tcl_GetHashKey (&b->el, he); - (void*) Tcl_CreateHashEntry(&a->el, key, &new); + Tcl_CreateHashEntry(&a->el, key, &new); if (new) {nx = 1;} } } if(newPtr) {*newPtr = nx;} } @@ -375,11 +375,11 @@ void s_add1 (SPtr a, const char* item) { int new; - (void*) Tcl_CreateHashEntry(&a->el, item, &new); + Tcl_CreateHashEntry(&a->el, item, &new); } void s_subtract (SPtr a, SPtr b, int* delPtr) { Index: modules/struct/sets_c.tcl ================================================================== --- modules/struct/sets_c.tcl +++ modules/struct/sets_c.tcl @@ -51,11 +51,11 @@ enum methods { S_add, S_contains, S_difference, S_empty, S_equal,S_exclude, S_include, S_intersect, S_intersect3, S_size, S_subsetof, S_subtract, S_symdiff, S_union - }; + } method; int m; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "cmd ?arg ...?"); @@ -67,11 +67,11 @@ /* Dispatch to methods. They check the #args in detail before performing * the requested functionality */ - switch (m) { + switch (method = m) { case S_add: return sm_ADD (NULL, interp, objc, objv); case S_contains: return sm_CONTAINS (NULL, interp, objc, objv); case S_difference: return sm_DIFFERENCE (NULL, interp, objc, objv); case S_empty: return sm_EMPTY (NULL, interp, objc, objv); case S_equal: return sm_EQUAL (NULL, interp, objc, objv); Index: modules/struct/stack/ms.c ================================================================== --- modules/struct/stack/ms.c +++ modules/struct/stack/ms.c @@ -37,11 +37,11 @@ NULL }; enum methods { M_CLEAR, M_DESTROY, M_GET, M_GETR, M_PEEK, M_PEEKR, M_POP, M_PUSH, M_ROTATE, M_SIZE, M_TRIM, M_TRIMV - }; + } method; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", @@ -51,11 +51,11 @@ /* Dispatch to methods. They check the #args in detail before performing * the requested functionality */ - switch (m) { + switch (method = m) { case M_CLEAR: return stm_CLEAR (s, interp, objc, objv); case M_DESTROY: return stm_DESTROY (s, interp, objc, objv); case M_GET: return stm_GET (s, interp, objc, objv, 0 ); /* get */ case M_GETR: return stm_GET (s, interp, objc, objv, 1 ); /* getr */ case M_PEEK: return stm_PEEK (s, interp, objc, objv, 0, 0); /* peek */ Index: modules/struct/stack_c.tcl ================================================================== --- modules/struct/stack_c.tcl +++ modules/struct/stack_c.tcl @@ -38,11 +38,11 @@ /* .................................................. */ /* Global stack management, per interp */ typedef struct SDg { - long int counter; + size_t counter; char buf [50]; } SDg; static void SDgrelease (ClientData cd, Tcl_Interp* interp) @@ -66,11 +66,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) sdg); } sdg->counter ++; - sprintf (sdg->buf, "stack%d", sdg->counter); + sprintf (sdg->buf, "stack%td", sdg->counter); return sdg->buf; #undef KEY } Index: modules/struct/tree/m.c ================================================================== --- modules/struct/tree/m.c +++ modules/struct/tree/m.c @@ -2,10 +2,12 @@ * * -> Method functions. * Implementations for all tree methods. */ +#include +#include #include #include "util.h" #include "m.h" #include "t.h" #include "tn.h" @@ -16,10 +18,12 @@ * the Tcl core as this is not exported through the public API. */ static int TclGetIntForIndex (Tcl_Interp* interp, Tcl_Obj* objPtr, int endValue, int* indexPtr); +static int TclCheckBadOctal (Tcl_Interp *interp, const char *value); +static int TclFormatInt (char *buffer, long n); /* .................................................. */ /* *--------------------------------------------------------------------------- @@ -2543,11 +2547,11 @@ Tcl_IncrRefCount (ev [i]); } res = t_walk (interp, tn, type, order, t_walk_invokecmd, - (Tcl_Obj*) cc, (Tcl_Obj*) ev, objv [0]); + (void *)(intptr_t)cc, (Tcl_Obj*) ev, objv [0]); ckfree ((char*) ev); return res; } Index: modules/struct/tree/ms.c ================================================================== --- modules/struct/tree/ms.c +++ modules/struct/tree/ms.c @@ -310,11 +310,11 @@ M_HEIGHT, M_INDEX, M_INSERT, M_ISLEAF, M_KEYEXISTS, M_KEYS, M_LAPPEND, M_LEAVES, M_MOVE, M_NEXT, M_NODES, M_NUMCHILDREN, M_PARENT, M_PREVIOUS, M_RENAME, M_ROOTNAME, M_SERIALIZE, M_SET, M_SIZE, M_SPLICE, M_SWAP, M_UNSET, M_WALK, M_WALKPROC - }; + } method; if (objc < 2) { Tcl_WrongNumArgs (interp, objc, objv, "option ?arg arg ...?"); return TCL_ERROR; } else if (Tcl_GetIndexFromObj (interp, objv [1], methods, "option", @@ -324,11 +324,11 @@ /* Dispatch to methods. They check the #args in detail before performing * the requested functionality */ - switch (m) { + switch (method = m) { case M_TASSIGN: return tm_TASSIGN (t, interp, objc, objv); case M_TSET: return tm_TSET (t, interp, objc, objv); case M_ANCESTORS: return tm_ANCESTORS (t, interp, objc, objv); case M_APPEND: return tm_APPEND (t, interp, objc, objv); case M_ATTR: return tm_ATTR (t, interp, objc, objv); Index: modules/struct/tree/t.c ================================================================== --- modules/struct/tree/t.c +++ modules/struct/tree/t.c @@ -1,12 +1,13 @@ /* struct::tree - critcl - layer 1 definitions * (c) Tree functions */ -#include -#include -#include +#include +#include "t.h" +#include "tn.h" +#include "util.h" /* .................................................. */ T* t_new (void) Index: modules/struct/tree/tn.c ================================================================== --- modules/struct/tree/tn.c +++ modules/struct/tree/tn.c @@ -1,11 +1,12 @@ /* struct::tree - critcl - layer 1 declarations * (b) Node operations. */ -#include -#include +#include "t.h" +#include "tn.h" +#include "util.h" /* .................................................. */ static void extend_children (TNPtr n); static int fill_descendants (TNPtr n, int lc, Tcl_Obj** lv, int at); Index: modules/struct/tree/util.c ================================================================== --- modules/struct/tree/util.c +++ modules/struct/tree/util.c @@ -75,11 +75,11 @@ } /* Delete all items in the list. */ -void* +void nlq_clear (NLQ* q) { NL* next; NL* qi = q->start; Index: modules/struct/tree/util.h ================================================================== --- modules/struct/tree/util.h +++ modules/struct/tree/util.h @@ -50,11 +50,11 @@ void nlq_init (NLQ* q); void nlq_append (NLQ* q, void* n); void nlq_push (NLQ* q, void* n); void* nlq_pop (NLQ* q); -void* nlq_clear (NLQ* q); +void nlq_clear (NLQ* q); #endif /* _UTIL_H */ /* * Local Variables: Index: modules/struct/tree/walk.c ================================================================== --- modules/struct/tree/walk.c +++ modules/struct/tree/walk.c @@ -1,10 +1,11 @@ +#include #include -#include "tcl.h" -#include -#include +#include +#include "t.h" +#include "util.h" /* .................................................. */ static int t_walkdfspre (Tcl_Interp* interp, TN* tdn, t_walk_function f, Tcl_Obj* cs, Tcl_Obj* avn, Tcl_Obj* nvn, @@ -235,11 +236,11 @@ t_walk_invokecmd (Tcl_Interp* interp, TN* n, Tcl_Obj* dummy0, Tcl_Obj* dummy1, Tcl_Obj* dummy2, Tcl_Obj* action) { int res; - int cc = (int) dummy0; + int cc = (intptr_t) dummy0; Tcl_Obj** ev = (Tcl_Obj**) dummy1; /* cc+3 elements */ ev [cc] = dummy2; /* Tree */ ev [cc+1] = n->name; /* Node */ ev [cc+2] = action; /* Action */ Index: modules/struct/tree_c.tcl ================================================================== --- modules/struct/tree_c.tcl +++ modules/struct/tree_c.tcl @@ -39,11 +39,11 @@ /* .................................................. */ /* Global tree management, per interp */ typedef struct TDg { - long int counter; + size_t counter; char buf [50]; } TDg; static void TDgrelease (ClientData cd, Tcl_Interp* interp) @@ -67,11 +67,11 @@ Tcl_SetAssocData (interp, KEY, proc, (ClientData) tdg); } tdg->counter ++; - sprintf (tdg->buf, "tree%d", tdg->counter); + sprintf (tdg->buf, "tree%td", tdg->counter); return tdg->buf; #undef KEY }