summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/ByteArrObj.310
-rw-r--r--generic/tclBinary.c8
-rw-r--r--generic/tclZipfs.c23
3 files changed, 16 insertions, 25 deletions
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3
index 13aa012..cf033f8 100644
--- a/doc/ByteArrObj.3
+++ b/doc/ByteArrObj.3
@@ -74,14 +74,14 @@ string representation of a byte-array value (by calling
\fBTcl_GetStringFromObj\fR) produces this string in Tcl's usual
Modified UTF-8 encoding.
.PP
-\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR
+\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR
create a new value or overwrite an existing unshared value, respectively,
to hold a byte-array value of \fInumBytes\fR bytes. When a caller
-passes a non-NULL value of \fIbytes\fR, it must point to memory from
+passes a non-NULL value of \fIbytes\fR, it must point to memory from
which \fInumBytes\fR bytes can be read. These routines
allocate \fInumBytes\fR bytes of memory, copy \fInumBytes\fR
bytes from \fIbytes\fR into it, and keep the result in the internal
-representation of the new or overwritten value.
+representation of the new or overwritten value.
When the caller passes a NULL value of \fIbytes\fR, the data copying
step is skipped, and the bytes stored in the value are undefined.
A \fIbytes\fR value of NULL is useful only when the caller will arrange
@@ -115,11 +115,11 @@ string value that does not include any character codepoints outside
the range (U+0000 - U+00FF) will successfully translate to a unique
byte-array value. With the created byte-array, the routine returns
as before. For any string representation which does contain
-a forbidden character codepoint, the conversion fails, and
+a forbidden character codepoint, the conversion fails, and
\fBTcl_GetBytesFromObj\fR returns NULL to signal that failure. On
failure, nothing will be written to \fInumBytesPtr\fR, and if
the \fIinterp\fR argument is non-NULL, then error messages and
-codes are left in it recording the error.
+codes are left in it recording the error.
.PP
\fBTcl_GetByteArrayFromObj\fR performs nearly the same function as
\fBTcl_GetBytesFromObj\fR. They differ only in the circumstance when
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 24f085b..7b12f4c 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -180,7 +180,7 @@ static const EnsembleImplMap decodeMap[] = {
* question arises what to do with strings outside that subset? That is,
* those Tcl strings containing at least one codepoint greater than 255? The
* obviously correct answer is to raise an error! That string value does not
- * represent any valid bytearray value.
+ * represent any valid bytearray value.
*
* Unfortunately this was not the path taken by the authors of the original
* tclByteArrayType. They chose to accept all Tcl string values as acceptable
@@ -211,11 +211,11 @@ static const EnsembleImplMap decodeMap[] = {
* what the retained "tclByteArrayType" provides. In those unusual
* circumstances where we convert an invalid bytearray value to a bytearray
* type, it is to this legacy type. Essentially any time this legacy type
- * shows up, it's a signal of a bug being ignored.
- *
+ * shows up, it's a signal of a bug being ignored.
+ *
* In Tcl 9, the incompatibility in the behavior of these public routines
* has been approved, and the legacy internal rep is no longer retained.
- * The internal changes seen below are the limit of what can be done
+ * The internal changes seen below are the limit of what can be done
* in a Tcl 8.* release. They provide a great expansion of the histories
* over which bytearray values can be useful.
*/
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index f649588..60d77f4 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -308,13 +308,11 @@ static inline int ListMountPoints(Tcl_Interp *interp);
static void SerializeCentralDirectoryEntry(
const unsigned char *start,
const unsigned char *end, unsigned char *buf,
- ZipEntry *z, size_t nameLength,
- long long dataStartOffset);
+ ZipEntry *z, size_t nameLength);
static void SerializeCentralDirectorySuffix(
const unsigned char *start,
const unsigned char *end, unsigned char *buf,
- int entryCount, long long dataStartOffset,
- long long directoryStartOffset,
+ int entryCount, long long directoryStartOffset,
long long suffixStartOffset);
static void SerializeLocalEntryHeader(
const unsigned char *start,
@@ -1191,7 +1189,7 @@ ZipFSFindTOC(
const unsigned char *p, *q;
const unsigned char *start = zf->data;
const unsigned char *end = zf->data + zf->length;
-
+
/*
* Scan backwards from the end of the file for the signature. This is
* necessary because ZIP archives aren't the only things that get tagged
@@ -1294,7 +1292,7 @@ ZipFSFindTOC(
}
zf->passOffset = minoff + zf->baseOffset;
-
+
/*
* If there's also an encoded password, extract that too (but don't decode
* yet).
@@ -3005,8 +3003,6 @@ ZipFSMkZipOrImg(
Tcl_Channel out;
int pwlen = 0, slen = 0, count, ret = TCL_ERROR, lobjc;
size_t len, i = 0;
- long long dataStartOffset; /* The overall file offset of the start of the
- * data section of the file. */
long long directoryStartOffset;
/* The overall file offset of the start of the
* central directory. */
@@ -3183,7 +3179,6 @@ ZipFSMkZipOrImg(
*/
Tcl_InitHashTable(&fileHash, TCL_STRING_KEYS);
- dataStartOffset = Tcl_Tell(out);
if (mappingList == NULL && stripPrefix != NULL) {
strip = Tcl_GetStringFromObj(stripPrefix, &slen);
if (!slen) {
@@ -3224,7 +3219,7 @@ ZipFSMkZipOrImg(
name = Tcl_UtfToExternalDString(ZipFS.utf8, z->name, -1, &ds);
len = Tcl_DStringLength(&ds);
SerializeCentralDirectoryEntry(start, end, (unsigned char *) buf,
- z, len, dataStartOffset);
+ z, len);
if ((Tcl_Write(out, buf, ZIP_CENTRAL_HEADER_LEN)
!= ZIP_CENTRAL_HEADER_LEN)
|| ((size_t) Tcl_Write(out, name, len) != len)) {
@@ -3244,7 +3239,7 @@ ZipFSMkZipOrImg(
Tcl_Flush(out);
suffixStartOffset = Tcl_Tell(out);
SerializeCentralDirectorySuffix(start, end, (unsigned char *) buf,
- count, dataStartOffset, directoryStartOffset, suffixStartOffset);
+ count, directoryStartOffset, suffixStartOffset);
if (Tcl_Write(out, buf, ZIP_CENTRAL_END_LEN) != ZIP_CENTRAL_END_LEN) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"write error: %s", Tcl_PosixError(interp)));
@@ -3401,9 +3396,7 @@ SerializeCentralDirectoryEntry(
const unsigned char *end, /* The end of writable memory. */
unsigned char *buf, /* Where to serialize to */
ZipEntry *z, /* The description of what to serialize. */
- size_t nameLength, /* The length of the name. */
- long long dataStartOffset) /* The overall file offset of the start of the
- * data section of the file. */
+ size_t nameLength) /* The length of the name. */
{
ZipWriteInt(start, end, buf + ZIP_CENTRAL_SIG_OFFS,
ZIP_CENTRAL_HEADER_SIG);
@@ -3437,8 +3430,6 @@ SerializeCentralDirectorySuffix(
const unsigned char *end, /* The end of writable memory. */
unsigned char *buf, /* Where to serialize to */
int entryCount, /* The number of entries in the directory */
- long long dataStartOffset, /* The overall file offset of the start of the
- * data section of the file. */
long long directoryStartOffset,
/* The overall file offset of the start of the
* central directory. */