summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-07-24 21:54:38 (GMT)
committernijtmans <nijtmans>2008-07-24 21:54:38 (GMT)
commit7f55ab2959b7ec3cac71c72171f20aed26c8f016 (patch)
treed6af35eba3a72d32359fa5a28abd6fe83823567d /generic
parent7b1a1c06d6d6cdf4035ef5b35802f85862b27088 (diff)
downloadtcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.zip
tcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.tar.gz
tcl-7f55ab2959b7ec3cac71c72171f20aed26c8f016.tar.bz2
CONSTified 4 functions in the Notifier which all have a Tcl_Time* in it which is
supposed to be a constant, but this was not reflected in the API: Tcl_SetTimer Tcl_WaitForEvent Tcl_ConditionWait Tcl_SetMaxBlockTime Introduced a CONST86, so extensions which have their own Notifier (are there any?) can be modified to compile against both Tcl 8.5 and Tcl 8.6. This change complies with TIP #24
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls10
-rw-r--r--generic/tcl.h14
-rw-r--r--generic/tclDecls.h19
-rw-r--r--generic/tclNotify.c4
-rw-r--r--generic/tclThread.c8
5 files changed, 29 insertions, 26 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 60d85fa..f5cc117 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -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: tcl.decls,v 1.137 2008/07/21 21:02:15 ferrieux Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.138 2008/07/24 21:54:39 nijtmans Exp $
library tcl
@@ -72,13 +72,13 @@ declare 10 unix {
void Tcl_DeleteFileHandler(int fd)
}
declare 11 generic {
- void Tcl_SetTimer(Tcl_Time *timePtr)
+ void Tcl_SetTimer(CONST86 Tcl_Time *timePtr)
}
declare 12 generic {
void Tcl_Sleep(int ms)
}
declare 13 generic {
- int Tcl_WaitForEvent(Tcl_Time *timePtr)
+ int Tcl_WaitForEvent(CONST86 Tcl_Time *timePtr)
}
declare 14 generic {
int Tcl_AppendAllObjTypes(Tcl_Interp *interp, Tcl_Obj *objPtr)
@@ -813,7 +813,7 @@ declare 228 generic {
void Tcl_SetErrorCode(Tcl_Interp *interp, ...)
}
declare 229 generic {
- void Tcl_SetMaxBlockTime(Tcl_Time *timePtr)
+ void Tcl_SetMaxBlockTime(CONST86 Tcl_Time *timePtr)
}
declare 230 generic {
void Tcl_SetPanicProc(Tcl_PanicProc *panicProc)
@@ -1119,7 +1119,7 @@ declare 310 generic {
}
declare 311 generic {
void Tcl_ConditionWait(Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr,
- Tcl_Time *timePtr)
+ CONST86 Tcl_Time *timePtr)
}
declare 312 generic {
int Tcl_NumUtfChars(CONST char *src, int length)
diff --git a/generic/tcl.h b/generic/tcl.h
index ef6d360..6b539ea 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.261 2008/07/18 13:46:43 msofer Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.262 2008/07/24 21:54:38 nijtmans Exp $
*/
#ifndef _TCL
@@ -145,7 +145,7 @@ extern "C" {
*
* The following TCL_VARARGS* macros are to support old extensions
* written for older versions of Tcl where the macros permitted
- * support for the varargs.h system as well as stdarg.h .
+ * support for the varargs.h system as well as stdarg.h .
*
* New code should just directly be written to use stdarg.h conventions.
*/
@@ -167,7 +167,7 @@ extern "C" {
* Note: when building static but linking dynamically to MSVCRT we must still
* correctly decorate the C library imported function. Use CRTIMPORT
* for this purpose. _DLL is defined by the compiler when linking to
- * MSVCRT.
+ * MSVCRT.
*/
#if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
@@ -261,6 +261,8 @@ extern "C" {
# endif
#endif
+#define CONST86 CONST84
+
/*
* Make sure EXTERN isn't defined elsewhere
*/
@@ -987,7 +989,7 @@ typedef struct Tcl_DString {
* stack for the script in progress to be
* completely unwound.
* TCL_EVAL_NOERR: Do no exception reporting at all, just return
- * as the caller will report.
+ * as the caller will report.
*/
#define TCL_NO_EVAL 0x10000
#define TCL_EVAL_GLOBAL 0x20000
@@ -1341,8 +1343,8 @@ typedef struct Tcl_Time {
long usec; /* Microseconds. */
} Tcl_Time;
-typedef void (Tcl_SetTimerProc) _ANSI_ARGS_((Tcl_Time *timePtr));
-typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((Tcl_Time *timePtr));
+typedef void (Tcl_SetTimerProc) _ANSI_ARGS_((CONST86 Tcl_Time *timePtr));
+typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((CONST86 Tcl_Time *timePtr));
/*
* TIP #233 (Virtualized Time)
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 53ed4c6..1603726 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.139 2008/07/22 23:01:31 das Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.140 2008/07/24 21:54:39 nijtmans Exp $
*/
#ifndef _TCLDECLS
@@ -122,7 +122,7 @@ EXTERN void Tcl_DeleteFileHandler (int fd);
#ifndef Tcl_SetTimer_TCL_DECLARED
#define Tcl_SetTimer_TCL_DECLARED
/* 11 */
-EXTERN void Tcl_SetTimer (Tcl_Time * timePtr);
+EXTERN void Tcl_SetTimer (CONST86 Tcl_Time * timePtr);
#endif
#ifndef Tcl_Sleep_TCL_DECLARED
#define Tcl_Sleep_TCL_DECLARED
@@ -132,7 +132,7 @@ EXTERN void Tcl_Sleep (int ms);
#ifndef Tcl_WaitForEvent_TCL_DECLARED
#define Tcl_WaitForEvent_TCL_DECLARED
/* 13 */
-EXTERN int Tcl_WaitForEvent (Tcl_Time * timePtr);
+EXTERN int Tcl_WaitForEvent (CONST86 Tcl_Time * timePtr);
#endif
#ifndef Tcl_AppendAllObjTypes_TCL_DECLARED
#define Tcl_AppendAllObjTypes_TCL_DECLARED
@@ -1440,7 +1440,7 @@ EXTERN void Tcl_SetErrorCode (Tcl_Interp * interp, ...);
#ifndef Tcl_SetMaxBlockTime_TCL_DECLARED
#define Tcl_SetMaxBlockTime_TCL_DECLARED
/* 229 */
-EXTERN void Tcl_SetMaxBlockTime (Tcl_Time * timePtr);
+EXTERN void Tcl_SetMaxBlockTime (CONST86 Tcl_Time * timePtr);
#endif
#ifndef Tcl_SetPanicProc_TCL_DECLARED
#define Tcl_SetPanicProc_TCL_DECLARED
@@ -1931,7 +1931,8 @@ EXTERN void Tcl_ConditionNotify (Tcl_Condition * condPtr);
#define Tcl_ConditionWait_TCL_DECLARED
/* 311 */
EXTERN void Tcl_ConditionWait (Tcl_Condition * condPtr,
- Tcl_Mutex * mutexPtr, Tcl_Time * timePtr);
+ Tcl_Mutex * mutexPtr,
+ CONST86 Tcl_Time * timePtr);
#endif
#ifndef Tcl_NumUtfChars_TCL_DECLARED
#define Tcl_NumUtfChars_TCL_DECLARED
@@ -3601,9 +3602,9 @@ typedef struct TclStubs {
#ifdef MAC_OSX_TCL /* MACOSX */
void (*tcl_DeleteFileHandler) (int fd); /* 10 */
#endif /* MACOSX */
- void (*tcl_SetTimer) (Tcl_Time * timePtr); /* 11 */
+ void (*tcl_SetTimer) (CONST86 Tcl_Time * timePtr); /* 11 */
void (*tcl_Sleep) (int ms); /* 12 */
- int (*tcl_WaitForEvent) (Tcl_Time * timePtr); /* 13 */
+ int (*tcl_WaitForEvent) (CONST86 Tcl_Time * timePtr); /* 13 */
int (*tcl_AppendAllObjTypes) (Tcl_Interp * interp, Tcl_Obj * objPtr); /* 14 */
void (*tcl_AppendStringsToObj) (Tcl_Obj * objPtr, ...); /* 15 */
void (*tcl_AppendToObj) (Tcl_Obj* objPtr, CONST char* bytes, int length); /* 16 */
@@ -3851,7 +3852,7 @@ typedef struct TclStubs {
int (*tcl_SetCommandInfo) (Tcl_Interp * interp, CONST char * cmdName, CONST Tcl_CmdInfo * infoPtr); /* 226 */
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp * interp, ...); /* 228 */
- void (*tcl_SetMaxBlockTime) (Tcl_Time * timePtr); /* 229 */
+ void (*tcl_SetMaxBlockTime) (CONST86 Tcl_Time * timePtr); /* 229 */
void (*tcl_SetPanicProc) (Tcl_PanicProc * panicProc); /* 230 */
int (*tcl_SetRecursionLimit) (Tcl_Interp * interp, int depth); /* 231 */
void (*tcl_SetResult) (Tcl_Interp * interp, char * result, Tcl_FreeProc * freeProc); /* 232 */
@@ -3933,7 +3934,7 @@ typedef struct TclStubs {
void (*tcl_MutexLock) (Tcl_Mutex * mutexPtr); /* 308 */
void (*tcl_MutexUnlock) (Tcl_Mutex * mutexPtr); /* 309 */
void (*tcl_ConditionNotify) (Tcl_Condition * condPtr); /* 310 */
- void (*tcl_ConditionWait) (Tcl_Condition * condPtr, Tcl_Mutex * mutexPtr, Tcl_Time * timePtr); /* 311 */
+ void (*tcl_ConditionWait) (Tcl_Condition * condPtr, Tcl_Mutex * mutexPtr, CONST86 Tcl_Time * timePtr); /* 311 */
int (*tcl_NumUtfChars) (CONST char * src, int length); /* 312 */
int (*tcl_ReadChars) (Tcl_Channel channel, Tcl_Obj * objPtr, int charsToRead, int appendFlag); /* 313 */
void (*tcl_RestoreResult) (Tcl_Interp * interp, Tcl_SavedResult * statePtr); /* 314 */
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index 0e13379..e6c4d40 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.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: tclNotify.c,v 1.27 2008/06/13 05:45:14 mistachkin Exp $
+ * RCS: @(#) $Id: tclNotify.c,v 1.28 2008/07/24 21:54:38 nijtmans Exp $
*/
#include "tclInt.h"
@@ -794,7 +794,7 @@ Tcl_SetServiceMode(
void
Tcl_SetMaxBlockTime(
- Tcl_Time *timePtr) /* Specifies a maximum elapsed time for the
+ const Tcl_Time *timePtr) /* Specifies a maximum elapsed time for the
* next blocking operation in the event
* tsdPtr-> */
{
diff --git a/generic/tclThread.c b/generic/tclThread.c
index 1a544e3..0feba5b 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.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: tclThread.c,v 1.20 2008/05/09 04:58:54 georgeps Exp $
+ * RCS: @(#) $Id: tclThread.c,v 1.21 2008/07/24 21:54:39 nijtmans Exp $
*/
#include "tclInt.h"
@@ -125,7 +125,7 @@ Tcl_GetThreadData(
void *
TclThreadDataKeyGet(
Tcl_ThreadDataKey *keyPtr) /* Identifier for the data chunk. */
-
+
{
#ifdef TCL_THREADS
return TclThreadStorageKeyGet(keyPtr);
@@ -405,7 +405,7 @@ TclFinalizeSynchronization(void)
}
keyRecord.max = 0;
keyRecord.num = 0;
-
+
#ifdef TCL_THREADS
/*
* Call thread storage master cleanup.
@@ -496,7 +496,7 @@ void
Tcl_ConditionWait(
Tcl_Condition *condPtr, /* Really (pthread_cond_t **) */
Tcl_Mutex *mutexPtr, /* Really (pthread_mutex_t **) */
- Tcl_Time *timePtr) /* Timeout on waiting period */
+ const Tcl_Time *timePtr) /* Timeout on waiting period */
{
}