summaryrefslogtreecommitdiffstats
path: root/test/gheap.c
Commit message (Expand)AuthorAgeFilesLines
* [svn-r11245] Purpose:Quincey Koziol2005-08-131-8/+8
* [svn-r9183] Purpose: New featureRaymond Lu2004-09-011-35/+7
* [svn-r7507] *** empty log message ***Raymond Lu2003-09-241-7/+35
* [svn-r7265] *** empty log message ***Raymond Lu2003-07-261-7/+7
* [svn-r6538] Purpose:Bill Wendling2003-03-311-3/+14
* [svn-r6387] Purpose:Quincey Koziol2003-02-101-8/+8
* [svn-r3770] Purpose:Bill Wendling2001-04-031-8/+8
* [svn-r3326] Purpose:Quincey Koziol2001-01-251-15/+15
* [svn-r2531] Description:Albert Cheng2000-09-101-1/+1
* [svn-r1548] Changes since 19990727Robb Matzke1999-07-281-1/+1
* [svn-r949] Changes since 19981124Robb Matzke1998-11-251-179/+155
* [svn-r925] Changes since 19981116Robb Matzke1998-11-181-6/+6
* [svn-r633] Changes since 19980828Robb Matzke1998-08-311-3/+4
* [svn-r410] Changes since 19980604Robb Matzke1998-06-051-5/+8
* [svn-r402] Added cleanup function that removes all temporary test files whenAlbert Cheng1998-05-281-5/+36
* [svn-r400] Changes since 19980513Robb Matzke1998-05-221-8/+12
* [svn-r335] Changes since 19980330Robb Matzke1998-04-031-0/+398
thetic'>core_stabilizer_merge_synthetic Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat
-rw-r--r--generic/tclBasic.c144
-rw-r--r--generic/tclBinary.c30
-rw-r--r--generic/tclClock.c19
-rw-r--r--generic/tclCmdAH.c3
-rw-r--r--generic/tclCmdIL.c9
-rw-r--r--generic/tclCmdMZ.c8
-rw-r--r--generic/tclCompCmds.c8
-rw-r--r--generic/tclCompCmdsSZ.c8
-rw-r--r--generic/tclCompExpr.c18
-rw-r--r--generic/tclCompile.c3
-rw-r--r--generic/tclDictObj.c4
-rw-r--r--generic/tclEnsemble.c28
-rw-r--r--generic/tclEnv.c5
-rw-r--r--generic/tclFileName.c9
-rw-r--r--generic/tclIORTrans.c19
-rw-r--r--generic/tclIOUtil.c4
-rw-r--r--generic/tclIndexObj.c83
-rw-r--r--generic/tclInt.h242
-rw-r--r--generic/tclInterp.c18
-rw-r--r--generic/tclLoad.c14
-rw-r--r--generic/tclNamesp.c13
-rw-r--r--generic/tclOO.c5
-rw-r--r--generic/tclParse.c6
-rw-r--r--generic/tclPathObj.c44
-rw-r--r--generic/tclProc.c12
-rw-r--r--generic/tclScan.c14
-rwxr-xr-xgeneric/tclStrToD.c36
-rw-r--r--generic/tclStringObj.c8
-rwxr-xr-xgeneric/tclThreadAlloc.c30
-rw-r--r--generic/tclUtil.c25
-rw-r--r--generic/tclVar.c19
-rw-r--r--generic/tclZlib.c65
-rw-r--r--macosx/tclMacOSXFCmd.c19
-rw-r--r--unix/tclUnixFCmd.c19
-rw-r--r--unix/tclUnixThrd.c63
35 files changed, 547 insertions, 507 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index fde9b1b..b9282ae 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.447 2010/02/24 10:45:04 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.448 2010/03/05 14:34:03 dkf Exp $
*/
#include "tclInt.h"
@@ -1310,6 +1310,7 @@ DeleteInterpProc(
Tcl_HashSearch search;
Tcl_HashTable *hTablePtr;
ResolverScheme *resPtr, *nextResPtr;
+ int i;
/*
* Punt if there is an error in the Tcl_Release/Tcl_Preserve matchup.
@@ -1503,89 +1504,87 @@ DeleteInterpProc(
* contents.
*/
- {
- Tcl_HashEntry *hPtr;
- Tcl_HashSearch hSearch;
- int i;
-
- for (hPtr = Tcl_FirstHashEntry(iPtr->linePBodyPtr, &hSearch);
- hPtr != NULL;
- hPtr = Tcl_NextHashEntry(&hSearch)) {
- CmdFrame *cfPtr = Tcl_GetHashValue(hPtr);
+ for (hPtr = Tcl_FirstHashEntry(iPtr->linePBodyPtr, &search);
+ hPtr != NULL;
+ hPtr = Tcl_NextHashEntry(&search)) {
+ CmdFrame *cfPtr = Tcl_GetHashValue(hPtr);
- if (cfPtr->type == TCL_LOCATION_SOURCE) {
- Tcl_DecrRefCount(cfPtr->data.eval.path);
- }
- ckfree((char *) cfPtr->line);
- ckfree((char *) cfPtr);
- Tcl_DeleteHashEntry(hPtr);
+ if (cfPtr->type == TCL_LOCATION_SOURCE) {
+ Tcl_DecrRefCount(cfPtr->data.eval.path);
}
- Tcl_DeleteHashTable(iPtr->linePBodyPtr);
- ckfree((char *) iPtr->linePBodyPtr);
- iPtr->linePBodyPtr = NULL;
+ ckfree((char *) cfPtr->line);
+ ckfree((char *) cfPtr);
+ Tcl_DeleteHashEntry(hPtr);
+ }
+ Tcl_DeleteHashTable(iPtr->linePBodyPtr);
+ ckfree((char *) iPtr->linePBodyPtr);
+ iPtr->linePBodyPtr = NULL;
- /*
- * See also tclCompile.c, TclCleanupByteCode
- */
+ /*
+ * See also tclCompile.c, TclCleanupByteCode
+ */
- for (hPtr = Tcl_FirstHashEntry(iPtr->lineBCPtr, &hSearch);
- hPtr != NULL;
- hPtr = Tcl_NextHashEntry(&hSearch)) {
- ExtCmdLoc *eclPtr = Tcl_GetHashValue(hPtr);
+ for (hPtr = Tcl_FirstHashEntry(iPtr->lineBCPtr, &search);
+ hPtr != NULL;
+ hPtr = Tcl_NextHashEntry(&search)) {
+ ExtCmdLoc *eclPtr = Tcl_GetHashValue(hPtr);
- if (eclPtr->type == TCL_LOCATION_SOURCE) {
- Tcl_DecrRefCount(eclPtr->path);
- }
- for (i=0; i< eclPtr->nuloc; i++) {
- ckfree((char *) eclPtr->loc[i].line);
- }
+ if (eclPtr->type == TCL_LOCATION_SOURCE) {
+ Tcl_DecrRefCount(eclPtr->path);
+ }
+ for (i=0; i< eclPtr->nuloc; i++) {
+ ckfree((char *) eclPtr->loc[i].line);
+ }
- if (eclPtr->loc != NULL) {
- ckfree((char *) eclPtr->loc);
- }
+ if (eclPtr->loc != NULL) {
+ ckfree((char *) eclPtr->loc);
+ }
- Tcl_DeleteHashTable(&eclPtr->litInfo);
+ Tcl_DeleteHashTable(&eclPtr->litInfo);
- ckfree((char *) eclPtr);
- Tcl_DeleteHashEntry(hPtr);
- }
- Tcl_DeleteHashTable(iPtr->lineBCPtr);
- ckfree((char *) iPtr->lineBCPtr);
- iPtr->lineBCPtr = NULL;
+ ckfree((char *) eclPtr);
+ Tcl_DeleteHashEntry(hPtr);
+ }
+ Tcl_DeleteHashTable(iPtr->lineBCPtr);
+ ckfree((char *) iPtr->lineBCPtr);
+ iPtr->lineBCPtr = NULL;
+
+ /*
+ * Location stack for uplevel/eval/... scripts which were passed through
+ * proc arguments. Actually we track all arguments as we do not and cannot
+ * know which arguments will be used as scripts and which will not.
+ */
+ if (iPtr->lineLAPtr->numEntries) {
/*
- * Location stack for uplevel/eval/... scripts which were passed
- * through proc arguments. Actually we track all arguments as we do
- * not and cannot know which arguments will be used as scripts and
- * which will not.
+ * When the interp goes away we have nothing on the stack, so there
+ * are no arguments, so this table has to be empty.
*/
- if (iPtr->lineLAPtr->numEntries) {
- /*
- * When the interp goes away we have nothing on the stack, so
- * there are no arguments, so this table has to be empty.
- */
+ Tcl_Panic("Argument location tracking table not empty");
+ }
- Tcl_Panic("Argument location tracking table not empty");
- }
+ Tcl_DeleteHashTable(iPtr->lineLAPtr);
+ ckfree((char *) iPtr->lineLAPtr);
+ iPtr->lineLAPtr = NULL;
- Tcl_DeleteHashTable(iPtr->lineLAPtr);
- ckfree((char *) iPtr->lineLAPtr);
- iPtr->lineLAPtr = NULL;
+ if (iPtr->lineLABCPtr->numEntries) {
+ /*
+ * When the interp goes away we have nothing on the stack, so there
+ * are no arguments, so this table has to be empty.
+ */
- if (iPtr->lineLABCPtr->numEntries) {
- /*
- * When the interp goes away we have nothing on the stack, so
- * there are no arguments, so this table has to be empty.
- */
+ Tcl_Panic("Argument location tracking table not empty");
+ }
- Tcl_Panic("Argument location tracking table not empty");
- }
+ Tcl_DeleteHashTable(iPtr->lineLABCPtr);
+ ckfree((char *) iPtr->lineLABCPtr);
+ iPtr->lineLABCPtr = NULL;
- Tcl_DeleteHashTable(iPtr->lineLABCPtr);
- ckfree((char *) iPtr->lineLABCPtr);
- iPtr->lineLABCPtr = NULL;
- }
+ /*
+ * Squelch the tables of traces on variables and searches over arrays in
+ * the in the interpreter.
+ */
Tcl_DeleteHashTable(&iPtr->varTraces);
Tcl_DeleteHashTable(&iPtr->varSearches);
@@ -7423,12 +7422,17 @@ ExprAbsFunc(
goto unChanged;
} else if (l == (long)0) {
const char *string = objv[1]->bytes;
+
if (!string) {
- /* There is no string representation, so internal one is correct */
+ /*
+ * There is no string representation, so internal one is
+ * correct.
+ */
+
goto unChanged;
}
while (isspace(UCHAR(*string))) {
- ++string;
+ string++;
}
if (*string != '-') {
goto unChanged;
@@ -7927,7 +7931,7 @@ MathFuncWrongNumArgs(
const char *tail = name + strlen(name);
while (tail > name+1) {
- --tail;
+ tail--;
if (*tail == ':' && tail[-1] == ':') {
name = tail+1;
break;
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 042cbed..62f8f46 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBinary.c,v 1.59 2009/12/29 01:43:23 patthoyts Exp $
+ * RCS: @(#) $Id: tclBinary.c,v 1.60 2010/03/05 14:34:03 dkf Exp $
*/
#include "tclInt.h"
@@ -1303,7 +1303,6 @@ BinaryScanCmd(
case 'H': {
char *dest;
unsigned char *src;
- int i;
static const char hexdigit[] = "0123456789abcdef";
if (arg >= objc) {
@@ -2303,13 +2302,15 @@ BinaryDecodeHex(
value |= (c & 0xf);
} else {
value <<= 4;
- ++cut;
+ cut++;
}
}
*cursor++ = UCHAR(value);
value = 0;
}
- if (cut > size) cut = size;
+ if (cut > size) {
+ cut = size;
+ }
Tcl_SetByteArrayLength(resultObj, cursor - begin - cut);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
@@ -2344,7 +2345,7 @@ BinaryDecodeHex(
#define OUTPUT(c) \
do { \
*cursor++ = (c); \
- ++outindex; \
+ outindex++; \
if (maxlen > 0 && cursor != limit) { \
if (outindex == maxlen) { \
memcpy(cursor, wrapchar, wrapcharlen); \
@@ -2505,10 +2506,12 @@ BinaryDecodeUu(
continue;
}
} else {
- ++cut;
+ cut++;
}
}
- if (cut>3) cut=3;
+ if (cut > 3) {
+ cut = 3;
+ }
*cursor++ = (((d[0] - 0x20) & 0x3f) << 2)
| (((d[1] - 0x20) & 0x3f) >> 4);
*cursor++ = (((d[1] - 0x20) & 0x3f) << 4)
@@ -2516,7 +2519,9 @@ BinaryDecodeUu(
*cursor++ = (((d[2] - 0x20) & 0x3f) << 6)
| (((d[3] - 0x20) & 0x3f));
}
- if (cut > size) cut = size;
+ if (cut > size) {
+ cut = size;
+ }
Tcl_SetByteArrayLength(resultObj, cursor - begin - cut);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
@@ -2584,7 +2589,6 @@ BinaryDecode64(
size = ((count + 3) & ~3) * 3 / 4;
begin = cursor = Tcl_SetByteArrayLength(resultObj, size);
while (data < dataend) {
- int i;
unsigned long value = 0;
for (i=0 ; i<4 ; i++) {
@@ -2604,7 +2608,7 @@ BinaryDecode64(
} else if (c == '=') {
value <<= 6;
if (cut < 2) {
- ++cut;
+ cut++;
}
} else {
if (strict || !isspace(c)) {
@@ -2615,14 +2619,16 @@ BinaryDecode64(
}
} else {
value <<= 6;
- ++cut;
+ cut++;
}
}
*cursor++ = UCHAR((value >> 16) & 0xff);
*cursor++ = UCHAR((value >> 8) & 0xff);
*cursor++ = UCHAR(value & 0xff);
}
- if (cut > size) cut = size;
+ if (cut > size) {
+ cut = size;
+ }
Tcl_SetByteArrayLength(resultObj, cursor - begin - cut);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 6c87db0..7519da8 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclClock.c,v 1.74 2010/02/24 10:45:04 dkf Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.75 2010/03/05 14:34:03 dkf Exp $
*/
#include "tclInt.h"
@@ -796,8 +796,7 @@ ConvertLocalToUTCUsingTable(
if (nHave == 8) {
Tcl_Panic("loop in ConvertLocalToUTCUsingTable");
}
- have[nHave] = fields->tzOffset;
- ++nHave;
+ have[nHave++] = fields->tzOffset;
}
fields->seconds = fields->localSeconds - fields->tzOffset;
}
@@ -844,7 +843,7 @@ ConvertLocalToUTCUsingC(
secondOfDay = (int)(jsec % SECONDS_PER_DAY);
if (secondOfDay < 0) {
secondOfDay += SECONDS_PER_DAY;
- --fields->julianDay;
+ fields->julianDay--;
}
GetGregorianEraYearDay(fields, changeover);
GetMonthDay(fields);
@@ -1257,7 +1256,7 @@ GetGregorianEraYearDay(
day %= FOUR_CENTURIES;
if (day < 0) {
day += FOUR_CENTURIES;
- --n;
+ n--;
}
year += 400 * n;
@@ -1295,7 +1294,7 @@ GetGregorianEraYearDay(
day %= FOUR_YEARS;
if (day < 0) {
day += FOUR_YEARS;
- --n;
+ n--;
}
year += 4 * n;
@@ -1476,15 +1475,15 @@ GetJulianDayFromEraYearMonthDay(
ym1o4 = ym1 / 4;
if (ym1 % 4 < 0) {
- --ym1o4;
+ ym1o4--;
}
ym1o100 = ym1 / 100;
if (ym1 % 100 < 0) {
- --ym1o100;
+ ym1o100--;
}
ym1o400 = ym1 / 400;
if (ym1 % 400 < 0) {
- --ym1o400;
+ ym1o400--;
}
fields->julianDay = JDAY_1_JAN_1_CE_GREGORIAN - 1
+ fields->dayOfMonth
@@ -2022,7 +2021,7 @@ ClockDeleteCmdProc(
ClockClientData *data = clientData;
int i;
- --data->refCount;
+ data->refCount--;
if (data->refCount == 0) {
for (i = 0; i < LIT__END; ++i) {
Tcl_DecrRefCount(data->literals[i]);
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c