diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-08-31 08:06:14 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-08-31 08:06:14 (GMT) |
| commit | 03dabdc86efec1098f627c73814711d0c9c40dc0 (patch) | |
| tree | 74db502a0230aa9bd30a9f3af12fa05bb4e21d87 | |
| parent | 833487508bbaa17224fad03984984dd06a1fc9f0 (diff) | |
| download | tcl-03dabdc86efec1098f627c73814711d0c9c40dc0.zip tcl-03dabdc86efec1098f627c73814711d0c9c40dc0.tar.gz tcl-03dabdc86efec1098f627c73814711d0c9c40dc0.tar.bz2 | |
Make Tcl_GetBytesFromObj signature match documentation (not really a change since Tcl_Size == int). Update documentation
| -rw-r--r-- | doc/ByteArrObj.3 | 6 | ||||
| -rw-r--r-- | doc/Number.3 | 2 | ||||
| -rw-r--r-- | generic/tcl.decls | 2 | ||||
| -rw-r--r-- | generic/tclDecls.h | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3 index 639018c..285239d 100644 --- a/doc/ByteArrObj.3 +++ b/doc/ByteArrObj.3 @@ -43,7 +43,7 @@ overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR, to the value from which to extract an array of bytes. .AP Tcl_Interp *interp in Interpreter to use for error reporting. -.AP "ptrdiff_t | int" *numBytesPtr out +.AP "Tcl_Size | int" *numBytesPtr out Points to space where the number of bytes in the array may be written. Caller may pass NULL when it does not need this information. .BE @@ -154,10 +154,10 @@ and any string representation is invalidated. On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR write the number of bytes in the byte-array value of \fIobjPtr\fR to the space pointed to by \fInumBytesPtr\fR. This space may be of type -\fBptrdiff_t\fR or of type \fBint\fR. In Tcl 8, the largest number of +\fBTcl_Size\fR or of type \fBint\fR. In Tcl 8, the largest number of bytes possible is \fBINT_MAX\fR, so either type can receive the value. In codebases meant to migrate to Tcl 9, the option to write to a space -of type \fBptrdiff_t\fR may aid in the migration. +of type \fBTcl_Size\fR may aid in the migration. .PP \fBTcl_SetByteArrayLength\fR enables a caller to change the size of a byte-array in the internal representation of an unshared \fIobjPtr\fR to diff --git a/doc/Number.3 b/doc/Number.3 index d0dbb2f..696dd80 100644 --- a/doc/Number.3 +++ b/doc/Number.3 @@ -27,7 +27,7 @@ When non-NULL, error information is recorded here when the value is not in any of the numeric formats recognized by Tcl. .AP "const char" *bytes in Points to first byte of the string value to be examined. -.AP ptrdiff_t numBytes in +.AP Tcl_Size numBytes in The number of bytes, starting at \fIbytes\fR, that should be examined. If the value \fBTCL_INDEX_NONE\fR is provided, then all bytes should be examined until the first \fBNUL\fR byte terminates examination. diff --git a/generic/tcl.decls b/generic/tcl.decls index 5cf0f34..7cc1dd9 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2409,7 +2409,7 @@ declare 648 { # TIP #568 declare 649 { unsigned char *Tcl_GetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, - Tcl_Size *numBytesPtr) + int *numBytesPtr) } # TIP #575 diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 6feb639..ab00a4e 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1933,7 +1933,7 @@ EXTERN int * Tcl_UtfToUniCharDString(const char *src, Tcl_Size length, Tcl_DString *dsPtr); /* 649 */ EXTERN unsigned char * Tcl_GetBytesFromObj(Tcl_Interp *interp, - Tcl_Obj *objPtr, Tcl_Size *numBytesPtr); + Tcl_Obj *objPtr, int *numBytesPtr); /* Slot 650 is reserved */ /* Slot 651 is reserved */ /* Slot 652 is reserved */ @@ -2697,7 +2697,7 @@ typedef struct TclStubs { Tcl_Size (*tcl_UtfToUniChar) (const char *src, int *chPtr); /* 646 */ char * (*tcl_UniCharToUtfDString) (const int *uniStr, Tcl_Size uniLength, Tcl_DString *dsPtr); /* 647 */ int * (*tcl_UtfToUniCharDString) (const char *src, Tcl_Size length, Tcl_DString *dsPtr); /* 648 */ - unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Size *numBytesPtr); /* 649 */ + unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *numBytesPtr); /* 649 */ void (*reserved650)(void); void (*reserved651)(void); void (*reserved652)(void); |
