Tcl Source Code

Artifact [bf6ae9093f]
Login

Artifact bf6ae9093fba9bb3d0cc77ac6756e7327d926ceb:

Attachment "tip27.patch" to ticket [464674ffff] added by dgp 2001-09-25 09:39:29.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.631
diff -u -r1.631 ChangeLog
--- ChangeLog	2001/09/24 21:10:32	1.631
+++ ChangeLog	2001/09/25 02:21:43
@@ -1,5 +1,13 @@
 2001-09-24  Don Porter  <[email protected]>
 
+	* doc/GetInt.3:
+	* generic/tclInt.h (TclGetLong deleted):
+	* generic/tcl{,Int}.decls:
+	* generic/tclGet.c:  Updated APIs in generic/tclGet.c
+	according to the guidelines of TIP 27.  [Patch]
+
+	* generic/tcl{Int}Decls.h: make genstubs
+
 	* doc/{Concat,DString,SplitList}.3:
 	* generic/tclInt.h (TclCheckBadOctal):
 	* generic/tcl{,Int}.decls:
Index: doc/GetInt.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/GetInt.3,v
retrieving revision 1.3
diff -u -r1.3 GetInt.3
--- doc/GetInt.3	2000/04/14 23:01:51	1.3
+++ doc/GetInt.3	2001/09/25 02:21:44
@@ -28,7 +28,7 @@
 .AS Tcl_Interp *doublePtr
 .AP Tcl_Interp *interp in
 Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
 Textual value to be converted.
 .AP int *intPtr out
 Points to place to store integer value converted from \fIstring\fR.
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.59
diff -u -r1.59 tcl.decls
--- generic/tcl.decls	2001/09/24 21:10:32	1.59
+++ generic/tcl.decls	2001/09/25 02:22:01
@@ -136,7 +136,7 @@
     void TclFreeObj(Tcl_Obj *objPtr)
 }
 declare 31 generic {
-    int Tcl_GetBoolean(Tcl_Interp *interp, char *str, int *boolPtr)
+    int Tcl_GetBoolean(Tcl_Interp *interp, CONST char *str, int *boolPtr)
 }
 declare 32 generic {
     int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \
@@ -146,7 +146,7 @@
     unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr)
 }
 declare 34 generic {
-    int Tcl_GetDouble(Tcl_Interp *interp, char *str, double *doublePtr)
+    int Tcl_GetDouble(Tcl_Interp *interp, CONST char *str, double *doublePtr)
 }
 declare 35 generic {
     int Tcl_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \
@@ -157,7 +157,7 @@
 	    char **tablePtr, char *msg, int flags, int *indexPtr)
 }
 declare 37 generic {
-    int Tcl_GetInt(Tcl_Interp *interp, char *str, int *intPtr)
+    int Tcl_GetInt(Tcl_Interp *interp, CONST char *str, int *intPtr)
 }
 declare 38 generic {
     int Tcl_GetIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr)
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.59
diff -u -r1.59 tclDecls.h
--- generic/tclDecls.h	2001/09/24 21:10:32	1.59
+++ generic/tclDecls.h	2001/09/25 02:22:44
@@ -120,7 +120,7 @@
 EXTERN void		TclFreeObj _ANSI_ARGS_((Tcl_Obj * objPtr));
 /* 31 */
 EXTERN int		Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * str, int * boolPtr));
+				CONST char * str, int * boolPtr));
 /* 32 */
 EXTERN int		Tcl_GetBooleanFromObj _ANSI_ARGS_((
 				Tcl_Interp * interp, Tcl_Obj * objPtr, 
@@ -130,7 +130,7 @@
 				Tcl_Obj * objPtr, int * lengthPtr));
 /* 34 */
 EXTERN int		Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * str, double * doublePtr));
+				CONST char * str, double * doublePtr));
 /* 35 */
 EXTERN int		Tcl_GetDoubleFromObj _ANSI_ARGS_((
 				Tcl_Interp * interp, Tcl_Obj * objPtr, 
@@ -141,7 +141,7 @@
 				char * msg, int flags, int * indexPtr));
 /* 37 */
 EXTERN int		Tcl_GetInt _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * str, int * intPtr));
+				CONST char * str, int * intPtr));
 /* 38 */
 EXTERN int		Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp * interp, 
 				Tcl_Obj * objPtr, int * intPtr));
@@ -1563,13 +1563,13 @@
     Tcl_Obj * (*tcl_DbNewStringObj) _ANSI_ARGS_((CONST char * bytes, int length, CONST char * file, int line)); /* 28 */
     Tcl_Obj * (*tcl_DuplicateObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 29 */
     void (*tclFreeObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 30 */
-    int (*tcl_GetBoolean) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * boolPtr)); /* 31 */
+    int (*tcl_GetBoolean) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * boolPtr)); /* 31 */
     int (*tcl_GetBooleanFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * boolPtr)); /* 32 */
     unsigned char * (*tcl_GetByteArrayFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 33 */
-    int (*tcl_GetDouble) _ANSI_ARGS_((Tcl_Interp * interp, char * str, double * doublePtr)); /* 34 */
+    int (*tcl_GetDouble) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, double * doublePtr)); /* 34 */
     int (*tcl_GetDoubleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, double * doublePtr)); /* 35 */
     int (*tcl_GetIndexFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, char ** tablePtr, char * msg, int flags, int * indexPtr)); /* 36 */
-    int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * intPtr)); /* 37 */
+    int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * intPtr)); /* 37 */
     int (*tcl_GetIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * intPtr)); /* 38 */
     int (*tcl_GetLongFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * longPtr)); /* 39 */
     Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((char * typeName)); /* 40 */
Index: generic/tclGet.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclGet.c,v
retrieving revision 1.6
diff -u -r1.6 tclGet.c
--- generic/tclGet.c	2000/03/31 19:39:42	1.6
+++ generic/tclGet.c	2001/09/25 02:22:46
@@ -41,11 +41,12 @@
 int
 Tcl_GetInt(interp, string, intPtr)
     Tcl_Interp *interp;		/* Interpreter to use for error reporting. */
-    char *string;		/* String containing a (possibly signed)
+    CONST char *string;		/* String containing a (possibly signed)
 				 * integer in a form acceptable to strtol. */
     int *intPtr;		/* Place to store converted result. */
 {
-    char *end, *p;
+    char *end;
+    CONST char *p;
     long i;
 
     /*
@@ -128,12 +129,13 @@
 TclGetLong(interp, string, longPtr)
     Tcl_Interp *interp;		/* Interpreter used for error reporting
 				 * if not NULL. */
-    char *string;		/* String containing a (possibly signed)
+    CONST char *string;		/* String containing a (possibly signed)
 				 * long integer in a form acceptable to
 				 * strtoul. */
     long *longPtr;		/* Place to store converted long result. */
 {
-    char *end, *p;
+    char *end;
+    CONST char *p;
     long i;
 
     /*
@@ -205,7 +207,7 @@
 int
 Tcl_GetDouble(interp, string, doublePtr)
     Tcl_Interp *interp;		/* Interpreter used for error reporting. */
-    char *string;		/* String containing a floating-point number
+    CONST char *string;		/* String containing a floating-point number
 				 * in a form acceptable to strtod. */
     double *doublePtr;		/* Place to store converted result. */
 {
@@ -262,7 +264,7 @@
 int
 Tcl_GetBoolean(interp, string, boolPtr)
     Tcl_Interp *interp;		/* Interpreter used for error reporting. */
-    char *string;		/* String containing a boolean number
+    CONST char *string;		/* String containing a boolean number
 				 * specified either as 1/0 or true/false or
 				 * yes/no. */
     int *boolPtr;		/* Place to store converted result, which
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.32
diff -u -r1.32 tclInt.decls
--- generic/tclInt.decls	2001/09/24 21:10:32	1.32
+++ generic/tclInt.decls	2001/09/25 02:22:54
@@ -154,7 +154,7 @@
 	    int flags)
 }
 declare 36 generic {
-    int TclGetLong(Tcl_Interp *interp, char *str, long *longPtr)
+    int TclGetLong(Tcl_Interp *interp, CONST char *str, long *longPtr)
 }
 declare 37 generic {
     int TclGetLoadedPackages(Tcl_Interp *interp, char *targetName)
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.65
diff -u -r1.65 tclInt.h
--- generic/tclInt.h	2001/09/24 21:10:32	1.65
+++ generic/tclInt.h	2001/09/25 02:23:20
@@ -1690,8 +1690,6 @@
 			    Tcl_Obj *objPtr, int endValue, int *indexPtr));
 EXTERN Tcl_Obj *	TclGetIndexedScalar _ANSI_ARGS_((Tcl_Interp *interp,
 			    int localIndex, int flags));
-EXTERN int		TclGetLong _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *string, long *longPtr));
 EXTERN int		TclGetLoadedPackages _ANSI_ARGS_((
 			    Tcl_Interp *interp, char *targetName));
 EXTERN int		TclGetNamespaceForQualName _ANSI_ARGS_((
Index: generic/tclIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntDecls.h,v
retrieving revision 1.27
diff -u -r1.27 tclIntDecls.h
--- generic/tclIntDecls.h	2001/09/24 21:10:32	1.27
+++ generic/tclIntDecls.h	2001/09/25 02:23:34
@@ -140,7 +140,7 @@
 				int localIndex, int flags));
 /* 36 */
 EXTERN int		TclGetLong _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * str, long * longPtr));
+				CONST char * str, long * longPtr));
 /* 37 */
 EXTERN int		TclGetLoadedPackages _ANSI_ARGS_((
 				Tcl_Interp * interp, char * targetName));
@@ -546,7 +546,7 @@
     TclCmdProcType (*tclGetInterpProc) _ANSI_ARGS_((void)); /* 33 */
     int (*tclGetIntForIndex) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int endValue, int * indexPtr)); /* 34 */
     Tcl_Obj * (*tclGetIndexedScalar) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, int flags)); /* 35 */
-    int (*tclGetLong) _ANSI_ARGS_((Tcl_Interp * interp, char * str, long * longPtr)); /* 36 */
+    int (*tclGetLong) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, long * longPtr)); /* 36 */
     int (*tclGetLoadedPackages) _ANSI_ARGS_((Tcl_Interp * interp, char * targetName)); /* 37 */
     int (*tclGetNamespaceForQualName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * qualName, Namespace * cxtNsPtr, int flags, Namespace ** nsPtrPtr, Namespace ** altNsPtrPtr, Namespace ** actualCxtPtrPtr, CONST char ** simpleNamePtr)); /* 38 */
     TclObjCmdProcType (*tclGetObjInterpProc) _ANSI_ARGS_((void)); /* 39 */