summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-12-01 09:58:51 (GMT)
committernijtmans <nijtmans>2010-12-01 09:58:51 (GMT)
commitb6d1219a7a9fcdb49db66a4217f34bd79ba40bba (patch)
treeff3e45f716f97fd6829df5f3c3f6ff70710f2771
parent79fc377e16fe1fb9074418c7fa5a4e06b9da28f4 (diff)
downloadtcl-b6d1219a7a9fcdb49db66a4217f34bd79ba40bba.zip
tcl-b6d1219a7a9fcdb49db66a4217f34bd79ba40bba.tar.gz
tcl-b6d1219a7a9fcdb49db66a4217f34bd79ba40bba.tar.bz2
fix gcc 64-bit warnings: cast from pointer to integer of different size
fix gcc(-4.5.2) warning: 'static' is not at beginning of declaration
-rw-r--r--ChangeLog10
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclHash.c8
-rwxr-xr-xgeneric/tclStrToD.c4
-rw-r--r--generic/tclTest.c6
-rw-r--r--generic/tclThreadTest.c22
6 files changed, 32 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 4fb2e64..450b2ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-01 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclBasic.c: fix gcc 64-bit warnings: cast from pointer to
+ * generic/tclHash.c: integer of different size.
+ * generic/tclTest.c:
+ * generic/tclThreadTest.c:
+ * generic/tclStrToD.c: fix gcc(-4.5.2) warning: 'static' is not at
+ beginning of declaration.
+
2010-11-30 Jeff Hobbs <jeffh@ActiveState.com>
* generic/tclInt.decls, generic/tclInt.h, generic/tclIntDecls.h:
@@ -13,6 +22,7 @@
("injects") arbitrary code to a suspended coro's future resumption.
Neat for debugging complex coros without heavy instrumentation.
+>>>>>>> 1.5314
2010-11-29 Kevin B. Kenny <kennykb@acm.org>
* generic/tclInt.decls:
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index f92930c..22daf78 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.470 2010/11/29 22:16:17 ferrieux Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.471 2010/12/01 09:58:52 nijtmans Exp $
*/
#include "tclInt.h"
@@ -7702,7 +7702,7 @@ ExprRandFunc(
* to insure different seeds in different threads (bug #416643)
*/
- iPtr->randSeed = TclpGetClicks() + ((long)Tcl_GetCurrentThread()<<12);
+ iPtr->randSeed = TclpGetClicks() + (PTR2INT(Tcl_GetCurrentThread())<<12);
/*
* Make sure 1 <= randSeed <= (2^31) - 2. See below.
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 81f9326..e778104 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.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: tclHash.c,v 1.46 2010/08/24 06:17:55 nijtmans Exp $
+ * RCS: @(#) $Id: tclHash.c,v 1.47 2010/12/01 09:58:52 nijtmans Exp $
*/
#include "tclInt.h"
@@ -37,7 +37,7 @@
*/
#define RANDOM_INDEX(tablePtr, i) \
- (((((long) (i))*1103515245) >> (tablePtr)->downShift) & (tablePtr)->mask)
+ ((((i)*1103515245L) >> (tablePtr)->downShift) & (tablePtr)->mask)
/*
* Prototypes for the array hash key methods.
@@ -436,7 +436,7 @@ Tcl_DeleteHashEntry(
#if TCL_HASH_KEY_STORE_HASH
if (typePtr->hashKeyProc == NULL
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
- index = RANDOM_INDEX(tablePtr, entryPtr->hash);
+ index = RANDOM_INDEX(tablePtr, PTR2INT(entryPtr->hash));
} else {
index = PTR2UINT(entryPtr->hash) & tablePtr->mask;
}
@@ -1065,7 +1065,7 @@ RebuildTable(
#if TCL_HASH_KEY_STORE_HASH
if (typePtr->hashKeyProc == NULL
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
- index = RANDOM_INDEX(tablePtr, hPtr->hash);
+ index = RANDOM_INDEX(tablePtr, PTR2INT(hPtr->hash));
} else {
index = PTR2UINT(hPtr->hash) & tablePtr->mask;
}
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 69be044..983aeec 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStrToD.c,v 1.48 2010/11/29 02:27:11 kennykb Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.49 2010/12/01 09:58:51 nijtmans Exp $
*
*----------------------------------------------------------------------
*/
@@ -3093,7 +3093,7 @@ ShouldBankerRoundUpPowD(mp_int* b,
/* 1 if the digit is odd, 0 if even */
{
int i;
- const static mp_digit topbit = (1<<(DIGIT_BIT-1));
+ static const mp_digit topbit = (1<<(DIGIT_BIT-1));
if (b->used < sd || (b->dp[sd-1] & topbit) == 0) {
return 0;
}
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 80dbbae..81ba0fb 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.155 2010/11/28 23:20:11 kennykb Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.156 2010/12/01 09:58:52 nijtmans Exp $
*/
#include <math.h>
@@ -5157,7 +5157,7 @@ TestmainthreadCmd(
const char **argv) /* Argument strings. */
{
if (argc == 1) {
- Tcl_Obj *idObj = Tcl_NewLongObj((long) Tcl_GetCurrentThread());
+ Tcl_Obj *idObj = Tcl_NewLongObj((long)(size_t)Tcl_GetCurrentThread());
Tcl_SetObjResult(interp, idObj);
return TCL_OK;
@@ -5554,7 +5554,7 @@ TestChannelCmd(
return TCL_ERROR;
}
- TclFormatInt(buf, (long) Tcl_GetChannelThread(chan));
+ TclFormatInt(buf, (size_t) Tcl_GetChannelThread(chan));
Tcl_AppendResult(interp, buf, NULL);
return TCL_OK;
}
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 8607b15..486dcda 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.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: tclThreadTest.c,v 1.35 2009/11/23 20:17:36 nijtmans Exp $
+ * RCS: @(#) $Id: tclThreadTest.c,v 1.36 2010/12/01 09:58:52 nijtmans Exp $
*/
#ifndef USE_TCL_STUBS
@@ -168,7 +168,7 @@ TclThread_Init(
*/
Tcl_MutexLock(&threadMutex);
- if ((long) mainThreadId == 0) {
+ if (mainThreadId == 0) {
mainThreadId = Tcl_GetCurrentThread();
}
Tcl_MutexUnlock(&threadMutex);
@@ -275,7 +275,7 @@ ThreadObjCmd(
} else {
result = NULL;
}
- return ThreadCancel(interp, (Tcl_ThreadId) id, result, flags);
+ return ThreadCancel(interp, (Tcl_ThreadId) (size_t) id, result, flags);
}
case THREAD_CREATE: {
const char *script;
@@ -339,11 +339,11 @@ ThreadObjCmd(
*/
if (objc == 2) {
- idObj = Tcl_NewLongObj((long) Tcl_GetCurrentThread());
+ idObj = Tcl_NewLongObj((long)(size_t)Tcl_GetCurrentThread());
} else if (objc == 3
&& strcmp("-main", Tcl_GetString(objv[2])) == 0) {
Tcl_MutexLock(&threadMutex);
- idObj = Tcl_NewLongObj((long) mainThreadId);
+ idObj = Tcl_NewLongObj((long)(size_t)mainThreadId);
Tcl_MutexUnlock(&threadMutex);
} else {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
@@ -368,13 +368,13 @@ ThreadObjCmd(
return TCL_ERROR;
}
- result = Tcl_JoinThread((Tcl_ThreadId) id, &status);
+ result = Tcl_JoinThread((Tcl_ThreadId)(size_t)id, &status);
if (result == TCL_OK) {
Tcl_SetIntObj(Tcl_GetObjResult(interp), status);
} else {
char buf[20];
- sprintf(buf, "%ld", id);
+ TclFormatInt(buf, id);
Tcl_AppendResult(interp, "cannot join thread ", buf, NULL);
}
return result;
@@ -410,7 +410,7 @@ ThreadObjCmd(
}
arg++;
script = Tcl_GetString(objv[arg]);
- return ThreadSend(interp, (Tcl_ThreadId) id, script, wait);
+ return ThreadSend(interp, (Tcl_ThreadId)(size_t)id, script, wait);
}
case THREAD_EVENT: {
if (objc > 2) {
@@ -526,7 +526,7 @@ ThreadCreate(
Tcl_ConditionWait(&ctrl.condWait, &threadMutex, NULL);
Tcl_MutexUnlock(&threadMutex);
Tcl_ConditionFinalize(&ctrl.condWait);
- Tcl_SetObjResult(interp, Tcl_NewLongObj((long)id));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj((long)(size_t)id));
return TCL_OK;
}
@@ -658,7 +658,7 @@ ThreadErrorProc(
char *script;
char buf[TCL_DOUBLE_SPACE+1];
- sprintf(buf, "%ld", (long) Tcl_GetCurrentThread());
+ TclFormatInt(buf, (size_t) Tcl_GetCurrentThread());
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
if (errorProcString == NULL) {
@@ -775,7 +775,7 @@ ThreadList(
Tcl_MutexLock(&threadMutex);
for (tsdPtr = threadList ; tsdPtr ; tsdPtr = tsdPtr->nextPtr) {
Tcl_ListObjAppendElement(interp, listPtr,
- Tcl_NewLongObj((long) tsdPtr->threadId));
+ Tcl_NewLongObj((long)(size_t)tsdPtr->threadId));
}
Tcl_MutexUnlock(&threadMutex);
Tcl_SetObjResult(interp, listPtr);