From c0f753dfae6d69344ff84eb052f91971f304e652 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 29 Sep 2023 11:19:46 +0000 Subject: Start on zipfs finalization panic --- generic/tclZipfs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 7b3911c..befcc7d 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1678,9 +1678,15 @@ ZipFSOpenArchive( ZIPFS_POSIX_ERROR(interp, "file read error"); goto error; } - Tcl_Close(interp, zf->chan); - zf->chan = NULL; } + /* + * Close the Tcl channel. If the file was mapped, the mapping is + * unaffected. It is important to close the channel otherwise there is a + * potential chicken and egg issue at finalization time as the channels + * are closed before the file systems are dismounted. + */ + Tcl_Close(interp, zf->chan); + zf->chan = NULL; return ZipFSFindTOC(interp, needZip, zf); /* -- cgit v0.12 From f6a9b261bca58dedf85b9aeecb7c25bacac3f74f Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 29 Sep 2023 11:42:38 +0000 Subject: Disable password based zipfs tests on MacOS --- tests/zipfs.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index e7f8de9..a05b23f 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1213,23 +1213,23 @@ namespace eval test_ns_zipfs { } -body { set fd [open [file join $defaultMountPoint $filename]] gets $fd - } -result $result {*}$args + } -result $result {*}$args -constraints bbe7c6ff9e } # The bug bbe7c6ff9e only manifests on macos - testConstraint bug-bbe7c6ff9e [expr {$::tcl_platform(os) ne "Darwin"}] + testConstraint bbe7c6ff9e [expr {$::tcl_platform(os) ne "Darwin"}] # NOTE: test-password.zip is the DOS time based encryption header validity check (infozip style) # test-password2.zip is the CRC based encryption header validity check (pkware style) testpasswordr plain test-password.zip plain.txt password plaintext testpasswordr plain-nopass test-password.zip plain.txt "" plaintext testpasswordr plain-badpass test-password.zip plain.txt badpassword plaintext - testpasswordr cipher-1 test-password.zip cipher.bin password ciphertext -constraints bug-bbe7c6ff9e - testpasswordr cipher-2 test-password2.zip cipher.bin password ciphertext -constraints bug-bbe7c6ff9e + testpasswordr cipher-1 test-password.zip cipher.bin password ciphertext + testpasswordr cipher-2 test-password2.zip cipher.bin password ciphertext testpasswordr cipher-nopass-1 test-password.zip cipher.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-nopass-2 test-password2.zip cipher.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-badpass-1 test-password.zip cipher.bin badpassword "invalid password" -returnCodes error testpasswordr cipher-badpass-2 test-password2.zip cipher.bin badpassword "invalid password" -returnCodes error - testpasswordr cipher-deflate test-password.zip cipher-deflate.bin password [lseq 100] -constraints bug-bbe7c6ff9e + testpasswordr cipher-deflate test-password.zip cipher-deflate.bin password [lseq 100] testpasswordr cipher-deflate-nopass test-password.zip cipher-deflate.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-deflate-badpass test-password.zip cipher-deflate.bin badpassword "invalid password" -returnCodes error @@ -1259,7 +1259,7 @@ namespace eval test_ns_zipfs { close $fd } cleanup - } -body $body -result $result {*}$args + } -body $body -result $result {*}$args -constraints bbe7c6ff9e } # NOTE: test-password.zip is the DOS time based encryption header validity check (infozip style) # test-password2.zip is the CRC based encryption header validity check (pkware style) -- cgit v0.12 From 175280f0b6b58f352e476d8c930d42c2b5bb2fc4 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 29 Sep 2023 12:48:58 +0000 Subject: dup test names --- tests/zipfs.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index a05b23f..64ce1eb 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -964,7 +964,7 @@ namespace eval test_ns_zipfs { } testzipfsread stored test.zip test test - testzipfsread stored teststored.zip aaaaaaaaaaaaaa + testzipfsread stored-1 teststored.zip aaaaaaaaaaaaaa testzipfsread deflate testdeflated2.zip aaaaaaaaaaaaaa testzipfsread bug-23dd83ce7c empty.zip {} empty.txt # Test open modes - see bug [4645658689] -- cgit v0.12 From 5d2cc9aa8096c724098eaa68d33bdbdbf11fda3c Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 29 Sep 2023 16:39:33 +0000 Subject: Refactor zipfs finalization --- generic/tclIO.c | 3 +- generic/tclInt.h | 5 ++- generic/tclZipfs.c | 114 ++++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 91 insertions(+), 31 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 1527dc0..2e25d2d 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -706,8 +706,9 @@ TclFinalizeIOSubsystem(void) TclpFinalizeSockets(); TclpFinalizePipes(); + TclZipfsFinalize(); } - + /* *---------------------------------------------------------------------- * diff --git a/generic/tclInt.h b/generic/tclInt.h index a336a53..399d83c 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3476,8 +3476,9 @@ MODULE_SCOPE void * TclpThreadGetGlobalTSD(void *tsdKeyPtr); MODULE_SCOPE void TclErrorStackResetIf(Tcl_Interp *interp, const char *msg, Tcl_Size length); /* Tip 430 */ -MODULE_SCOPE int TclZipfs_Init(Tcl_Interp *interp); -MODULE_SCOPE int TclIsZipfsPath(const char *path); +MODULE_SCOPE int TclZipfs_Init(Tcl_Interp *interp); +MODULE_SCOPE int TclIsZipfsPath(const char *path); +MODULE_SCOPE void TclZipfsFinalize(void); MODULE_SCOPE int *TclGetUnicodeFromObj(Tcl_Obj *, int *); MODULE_SCOPE Tcl_Obj *TclNewUnicodeObj(const int *, int); diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index befcc7d..14da083 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -319,10 +319,12 @@ static int InitWritableChannel(Tcl_Interp *interp, ZipChannel *info, ZipEntry *z, int trunc); static int ListMountPoints(Tcl_Interp *interp); static int ContainsMountPoint(const char *path, int pathLen); -static void SerializeCentralDirectoryEntry( - const unsigned char *start, - const unsigned char *end, unsigned char *buf, - ZipEntry *z, size_t nameLength); +static void CleanupMount(ZipFile *zf); +static void SerializeCentralDirectoryEntry(const unsigned char *start, + const unsigned char *end, + unsigned char *buf, + ZipEntry *z, + size_t nameLength); static void SerializeCentralDirectorySuffix( const unsigned char *start, const unsigned char *end, unsigned char *buf, @@ -364,10 +366,7 @@ static int ZipFSLoadFile(Tcl_Interp *interp, Tcl_Obj *path, Tcl_FSUnloadFileProc **unloadProcPtr, int flags); static int ZipMapArchive(Tcl_Interp *interp, ZipFile *zf, void *handle); -static void ZipfsExitHandler(void *clientData); -static void ZipfsMountExitHandler(void *clientData); static void ZipfsSetup(void); -static void ZipfsFinalize(void); static int ZipChannelClose(void *instanceData, Tcl_Interp *interp, int flags); static Tcl_DriverGetHandleProc ZipChannelGetFile; @@ -1906,7 +1905,6 @@ ZipFSCatalogFilesystem( */ zf->mountPoint = (char *) Tcl_GetHashKey(&ZipFS.zipHash, hPtr); - Tcl_CreateExitHandler(ZipfsMountExitHandler, zf); zf->mountPointLen = strlen(zf->mountPoint); zf->nameLength = strlen(zipname); @@ -2154,7 +2152,6 @@ ZipfsSetup(void) ckalloc(strlen(ZIPFS_FALLBACK_ENCODING) + 1); strcpy(ZipFS.fallbackEntryEncoding, ZIPFS_FALLBACK_ENCODING); ZipFS.initialized = 1; - Tcl_CreateExitHandler(ZipfsExitHandler, NULL); } /* @@ -2208,6 +2205,41 @@ ListMountPoints( } /* + *------------------------------------------------------------------------ + * + * CleanupMount -- + * + * Releases all resources associated with a mounted archive. There + * must not be any open files in the archive. + * + * Caller MUST be holding WriteLock() before calling this function. + * + * Results: + * None. + * + * Side effects: + * Memory associated with the mounted archive is deallocated. + *------------------------------------------------------------------------ + */ +static void +CleanupMount(ZipFile *zf) /* Mount point */ +{ + ZipEntry *z, *znext; + Tcl_HashEntry *hPtr; + for (z = zf->entries; z; z = znext) { + znext = z->next; + hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, z->name); + if (hPtr) { + Tcl_DeleteHashEntry(hPtr); + } + if (z->data) { + ckfree(z->data); + } + ckfree(z); + } +} + +/* *------------------------------------------------------------------------- * * DescribeMounted -- @@ -2349,6 +2381,7 @@ TclZipfs_MountBuffer( { ZipFile *zf; + /* TODO - how come a *read* lock suffices for initialzing ? */ ReadLock(); if (!ZipFS.initialized) { ZipfsSetup(); @@ -2439,7 +2472,6 @@ TclZipfs_Unmount( const char *mountPoint) /* Mount point path. */ { ZipFile *zf; - ZipEntry *z, *znext; Tcl_HashEntry *hPtr; Tcl_DString dsm; int ret = TCL_OK, unmounted = 0; @@ -2477,19 +2509,9 @@ TclZipfs_Unmount( * still cleaning things up. */ - for (z = zf->entries; z; z = znext) { - znext = z->next; - hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, z->name); - if (hPtr) { - Tcl_DeleteHashEntry(hPtr); - } - if (z->data) { - ckfree(z->data); - } - ckfree(z); - } + CleanupMount(zf); ZipFSCloseArchive(interp, zf); - Tcl_DeleteExitHandler(ZipfsMountExitHandler, zf); + ckfree(zf); unmounted = 1; @@ -6203,6 +6225,7 @@ ZipfsAppHookFindTclInit( return TCL_ERROR; } #endif +#ifdef OBSOLETE static void ZipfsExitHandler( @@ -6222,15 +6245,49 @@ ZipfsExitHandler( } } } +#endif -static void -ZipfsFinalize(void) { - Tcl_FSUnregister(&zipfsFilesystem); - Tcl_DeleteHashTable(&ZipFS.fileHash); - ckfree(ZipFS.fallbackEntryEncoding); - ZipFS.initialized = -1; +void TclZipfsFinalize(void) +{ + /* + * Finalization steps: + * For every mounted archive, if it no longer has any open handles + * clean up the mount and associated zip file entries. + * If there are no more mounted archives, clean up and free the + * ZipFS.fileHash and ZipFS.zipHash tables. + */ + WriteLock(); + + Tcl_HashEntry *hPtr; + Tcl_HashSearch zipSearch; + for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); hPtr; + hPtr = Tcl_NextHashEntry(&zipSearch)) { + ZipFile *zf = (ZipFile *) Tcl_GetHashValue(hPtr); + if (zf->numOpen == 0) { + Tcl_DeleteHashEntry(hPtr); + CleanupMount(zf); + ZipFSCloseArchive(NULL, zf); + ckfree(zf); + } + } + + hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &zipSearch); + if (hPtr == NULL) { + hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); + if (hPtr == NULL) { + /* Both hash tables empty. Free them */ + Tcl_DeleteHashTable(&ZipFS.fileHash); + Tcl_DeleteHashTable(&ZipFS.zipHash); + Tcl_FSUnregister(&zipfsFilesystem); + ckfree(ZipFS.fallbackEntryEncoding); + ZipFS.initialized = -1; + } + } + + Unlock(); } +#ifdef OBSOLETE static void ZipfsMountExitHandler( void *clientData) @@ -6250,6 +6307,7 @@ ZipfsMountExitHandler( } } +#endif /* *------------------------------------------------------------------------- -- cgit v0.12 From 99e1b20c806fb795368afb3512e472bd93931313 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 29 Sep 2023 17:17:11 +0000 Subject: Add test for crash --- tests/zipfs.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/zipfs.test b/tests/zipfs.test index 64ce1eb..583a4d8 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1509,6 +1509,19 @@ namespace eval test_ns_zipfs { list [catch {read $fd} message] [close $fd] $message close $fd } -result {file size error (may be zip64)} -returnCodes error + + test bug-8259d74a64 "Crash exiting with open files" -setup { + set path [zippath test.zip] + set script "zipfs mount $path /\n" + append script {open [zipfs root]test} \n + append script "exit\n" + } -body { + set fd [open |[info nameofexecutable] r+] + puts $fd $script + flush $fd + read $fd + close $fd + } -result "" } -- cgit v0.12 From d7cff9067558c62d7c8259e7fe885c5fa8d5f438 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 30 Sep 2023 02:58:33 +0000 Subject: Remove obsolete code --- generic/tclZipfs.c | 61 ++++++++---------------------------------------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 14da083..0cc46a0 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -16,7 +16,7 @@ * projects. * * Helpful docs: - * https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT + * https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT * https://libzip.org/specifications/appnote_iz.txt */ @@ -320,11 +320,10 @@ static int InitWritableChannel(Tcl_Interp *interp, static int ListMountPoints(Tcl_Interp *interp); static int ContainsMountPoint(const char *path, int pathLen); static void CleanupMount(ZipFile *zf); -static void SerializeCentralDirectoryEntry(const unsigned char *start, - const unsigned char *end, - unsigned char *buf, - ZipEntry *z, - size_t nameLength); +static void SerializeCentralDirectoryEntry( + const unsigned char *start, + const unsigned char *end, unsigned char *buf, + ZipEntry *z, size_t nameLength); static void SerializeCentralDirectorySuffix( const unsigned char *start, const unsigned char *end, unsigned char *buf, @@ -2237,6 +2236,7 @@ CleanupMount(ZipFile *zf) /* Mount point */ } ckfree(z); } + zf->entries = NULL; } /* @@ -6225,27 +6225,6 @@ ZipfsAppHookFindTclInit( return TCL_ERROR; } #endif -#ifdef OBSOLETE - -static void -ZipfsExitHandler( - TCL_UNUSED(void *) -) -{ - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - if (ZipFS.initialized != -1) { - hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); - if (hPtr == NULL) { - ZipfsFinalize(); - } else { - /* ZipFS.fallbackEntryEncoding was already freed by - * ZipfsMountExitHandler - */ - } - } -} -#endif void TclZipfsFinalize(void) { @@ -6275,40 +6254,18 @@ void TclZipfsFinalize(void) if (hPtr == NULL) { hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); if (hPtr == NULL) { - /* Both hash tables empty. Free them */ + /* Both hash tables empty. Free all resources */ + Tcl_FSUnregister(&zipfsFilesystem); Tcl_DeleteHashTable(&ZipFS.fileHash); Tcl_DeleteHashTable(&ZipFS.zipHash); - Tcl_FSUnregister(&zipfsFilesystem); ckfree(ZipFS.fallbackEntryEncoding); - ZipFS.initialized = -1; + ZipFS.initialized = 0; } } Unlock(); } -#ifdef OBSOLETE -static void -ZipfsMountExitHandler( - void *clientData) -{ - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - - ZipFile *zf = (ZipFile *) clientData; - - if (TCL_OK != TclZipfs_Unmount(NULL, zf->mountPoint)) { - Tcl_Panic("tried to unmount busy filesystem"); - } - - hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); - if (hPtr == NULL) { - ZipfsFinalize(); - } - -} -#endif - /* *------------------------------------------------------------------------- * -- cgit v0.12 From 5763cd3970d32d646f7a798a69196e70743375b5 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 30 Sep 2023 16:17:28 +0000 Subject: Start on tests and fixes for file commands for zipfs --- doc/file.n | 3 + doc/filename.n | 8 ++- generic/tclIOUtil.c | 24 ++++++-- generic/tclZipfs.c | 21 +++++-- tests/zipfs.test | 171 ++++++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 203 insertions(+), 24 deletions(-) diff --git a/doc/file.n b/doc/file.n index bb6a7d3..36f0415 100644 --- a/doc/file.n +++ b/doc/file.n @@ -31,6 +31,8 @@ for the file. The time is measured in the standard POSIX fashion as seconds from a fixed starting time (often January 1, 1970). If the file does not exist or its access time cannot be queried or set then an error is generated. On Windows, FAT file systems do not support access time. +On \fBzipfs\fR file systems, access time is mapped to the modification +time. .TP \fBfile attributes \fIname\fR .TP @@ -295,6 +297,7 @@ the file (equivalent to Unix \fBtouch\fR). The time is measured in the standard POSIX fashion as seconds from a fixed starting time (often January 1, 1970). If the file does not exist or its modified time cannot be queried or set then an error is generated. +On \fBzipfs\fR file systems, modification time cannot be explicitly set. .TP \fBfile nativename \fIname\fR . diff --git a/doc/filename.n b/doc/filename.n index 335d8c7..d236b7f 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -119,6 +119,12 @@ Volume-relative path to a file \fBfoo\fR in the root directory of the current volume. This is not a valid UNC path, so the assumption is that the extra backslashes are superfluous. .RE +.TP +\fBZipfs\fR +On all platforms where \fBzipfs\fR support is enabled, paths within mounted +ZIP archives begin with the string returned by the \fBzipfs root\fR command +and otherwise follow the rules for the Unix paths. +.RE .SH "TILDE SUBSTITUTION" .PP In addition to the file name rules described above, Tcl also supports @@ -171,7 +177,7 @@ or dots with trailing characters .QW .....abc is illegal. .SH "SEE ALSO" -file(n), glob(n) +file(n), glob(n), zipfs(n) .SH KEYWORDS current directory, absolute file name, relative file name, volume-relative file name, portability diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index f665e0f..7bbb9cd 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -2281,11 +2281,17 @@ Tcl_FSUtime( * times to use. Should not be modified. */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); + int err; - if (fsPtr != NULL && fsPtr->utimeProc != NULL) { - return fsPtr->utimeProc(pathPtr, tval); + if (fsPtr == NULL) { + err = ENOENT; + } else { + if (fsPtr->utimeProc != NULL) { + return fsPtr->utimeProc(pathPtr, tval); + } + err = ENOTSUP; } - /* TODO: set errno here? Tcl_SetErrno(ENOENT); */ + Tcl_SetErrno(err); return -1; } @@ -4340,11 +4346,17 @@ Tcl_FSCreateDirectory( Tcl_Obj *pathPtr) /* Pathname of directory to create (UTF-8). */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); + int err; - if (fsPtr != NULL && fsPtr->createDirectoryProc != NULL) { - return fsPtr->createDirectoryProc(pathPtr); + if (fsPtr == NULL) { + err = ENOENT; + } else { + if (fsPtr->createDirectoryProc != NULL) { + return fsPtr->createDirectoryProc(pathPtr); + } + err = ENOTSUP; } - Tcl_SetErrno(ENOENT); + Tcl_SetErrno(err); return -1; } diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 0cc46a0..23b3f3c 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1937,6 +1937,9 @@ ZipFSCatalogFilesystem( if (!strcmp(z->name, ZIPFS_VOLUME)) { z->flags |= ZE_F_VOLUME; /* Mark as root volume */ } + Tcl_Time t; + Tcl_GetTime(&t); + z->timestamp = t.sec; z->next = zf->entries; zf->entries = z; } @@ -4696,11 +4699,13 @@ ZipChannelOpen( WriteLock(); z = ZipFSLookup(filename); if (!z) { - Tcl_SetErrno(ENOENT); + Tcl_SetErrno(wr ? ENOTSUP : ENOENT); if (interp) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "file not found \"%s\": %s", filename, - Tcl_PosixError(interp))); + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("file \"%s\" not %s: %s", + filename, + wr ? "created" : "found", + Tcl_PosixError(interp))); } goto error; } @@ -5187,7 +5192,7 @@ ZipEntryStat( Tcl_StatBuf *buf) { ZipEntry *z; - int ret = -1; + int ret; ReadLock(); z = ZipFSLookup(path); @@ -5206,8 +5211,14 @@ ZipEntryStat( } else if (ContainsMountPoint(path, -1)) { /* An intermediate dir under which a mount exists */ memset(buf, 0, sizeof(Tcl_StatBuf)); + Tcl_Time t; + Tcl_GetTime(&t); + buf->st_atime = buf->st_mtime = buf->st_ctime = t.sec; buf->st_mode = S_IFDIR | 0555; ret = 0; + } else { + Tcl_SetErrno(ENOENT); + ret = -1; } Unlock(); return ret; diff --git a/tests/zipfs.test b/tests/zipfs.test index 583a4d8..57fb5c9 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -975,7 +975,7 @@ namespace eval test_ns_zipfs { testzipfsread stored-ar teststored.zip {} abac-repeat.txt a+ testzipfsread deflate-ar testdeflated2.zip {} abac-repeat.txt a+ - testzipfsread nosuch test.zip "file not found \"//zipfs:/testmount/nosuchfile\": no such file or directory" nosuchfile {} -returnCodes error + testzipfsread enoent test.zip "file \"//zipfs:/testmount/nosuchfile\" not found: no such file or directory" nosuchfile {} -returnCodes error testzipfsread deflate-error broken.zip {decompression error} deflatezliberror {} -returnCodes error testzipfsread bzip2 testbzip2.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread lzma testfile-lzma.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error @@ -1031,10 +1031,10 @@ namespace eval test_ns_zipfs { } -body $body -result $result {*}$args } - testzipfswrite create-w test.zip "file not found \"//zipfs:/testmount/newfile\": no such file or directory" newfile w -returnCodes error - testzipfswrite create-w+ test.zip "file not found \"//zipfs:/testmount/newfile\": no such file or directory" newfile w+ -returnCodes error + testzipfswrite create-w test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w -returnCodes error + testzipfswrite create-w+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w+ -returnCodes error testzipfswrite create-a test.zip "append mode not supported: permission denied" newfile a -returnCodes error - testzipfswrite create-a+ test.zip "file not found \"//zipfs:/testmount/newfile\": no such file or directory" newfile a+ -returnCodes error + testzipfswrite create-a+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile a+ -returnCodes error testzipfswrite store-w teststored.zip "xyz" abac-repeat.txt w testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w testzipfswrite store-w+ teststored.zip "xyz" abac-repeat.txt w+ @@ -1329,7 +1329,7 @@ namespace eval test_ns_zipfs { foreach key {atime ctime mtime} { # ZIP files have no TZ info so zipfs uses mktime which is localtime set time [dict get $stat $key] - if {$time ne "0"} { + if {[regexp {^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d} $time]} { dict set stat $key [clock scan [dict get $stat $key] -format "%Y-%m-%d %H:%M:%S"] } } @@ -1366,25 +1366,25 @@ namespace eval test_ns_zipfs { mount [zippath test.zip] } -cleanup cleanup -body { lsort -stride 2 [file stat $defaultMountPoint] - } -result [fixupstat {atime 0 ctime 0 dev 0 gid 0 ino 0 mode 16749 mtime 0 nlink 0 size 0 type directory uid 0}] + } -result [fixupstat [list atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0]] -match regexp test zipfs-file-stat-root-mount "Read stat of root" -setup { mount [zippath test.zip] [zipfs root] } -cleanup cleanup -body { lsort -stride 2 [file stat [zipfs root]] - } -result [fixupstat {atime 0 ctime 0 dev 0 gid 0 ino 0 mode 16749 mtime 0 nlink 0 size 0 type directory uid 0}] + } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp test zipfs-file-stat-root-subdir-mount "Read stat of root when mount is subdir" -setup { mount [zippath test.zip] } -cleanup cleanup -body { lsort -stride 2 [file stat [zipfs root]] - } -result [fixupstat {atime 0 ctime 0 dev 0 gid 0 ino 0 mode 16749 mtime 0 nlink 0 size 0 type directory uid 0}] + } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp test zipfs-file-stat-level3 "Stat on a directory that is intermediary in a mount point" -setup { mount [zippath test.zip] [file join $defaultMountPoint mt2] } -cleanup cleanup -body { lsort -stride 2 [file stat $defaultMountPoint] - } -result [fixupstat {atime 0 ctime 0 dev 0 gid 0 ino 0 mode 16749 mtime 0 nlink 0 size 0 type directory uid 0}] + } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp # # glob of zipfs file @@ -1432,9 +1432,13 @@ namespace eval test_ns_zipfs { [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 0 -permissions 0o555 -uncompsize 0] testzipfsfileattr mezzo [file join $defaultMountPoint a b] {} [file join $defaultMountPoint a b c] -constraints bug-4af110a6a1 - - # - # TODO - file copy, file rename etc. + foreach attr {-uncompsize -compsize -offset -mount -archive -permissions -crc} { + test zipfs-file-attrs-set$attr "Set zipfs file attribute $attr" -setup { + mount [zippath test.zip] + } -cleanup cleanup \ + -body "file attributes [file join $defaultMountPoint test] $attr {}" \ + -result "unsupported operation" -returnCodes error + } # # file normalize @@ -1490,6 +1494,149 @@ namespace eval test_ns_zipfs { testzipfsnormalize relative-13 dir/../../../a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-14 a [file join [zipfs root] testdir a] [file join [zipfs root] testdir] + # + # file copy + test zipfs-file-copy-tozip-new {Copy native file to archive} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file copy [makeFile "" source.tmp] [file join $defaultMountPoint X] + } -result "error copying \"*source.tmp\" to \"[file join $defaultMountPoint X]\": operation not supported" \ + -match glob -returnCodes error + test zipfs-file-copy-tozip-existing {Copy native file to archive} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file copy [makeFile "newtext" source.tmp] [file join $defaultMountPoint test] + } -result "error copying *: file exists" -match glob -returnCodes error + test zipfs-file-copy-tozip-existing-force {Copy native file to archive} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file copy -force [makeFile "newtext" source.tmp] [file join $defaultMountPoint test] + } -result "newtext" + test zipfs-file-copy-tozipdir {Copy native file to archive directory} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file copy [makeFile "" source.tmp] [file join $defaultMountPoint testdir] + } -result "error copying \"*source.tmp\" to \"[file join $defaultMountPoint testdir]/source.tmp\": operation not supported" \ + -match glob -returnCodes error + test zipfs-file-copydir-tozipdir {Copy native dir to archive directory} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file copy [temporaryDirectory] [file join $defaultMountPoint testdir] + } -result "can't create directory *: operation not supported" \ + -match glob -returnCodes error + test zipfs-file-copy-fromzip-new {Copy archive file to native} -setup { + mount [zippath test.zip] + set dst [file join [temporaryDirectory] dst.tmp] + file delete $dst + } -cleanup { + file delete $dst + cleanup + } -body { + file copy [file join $defaultMountPoint test] $dst + readbin $dst + } -result "test\n" + + + # + # file mkdir + test zipfs-file-mkdir {Make a directory in zip archive} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + file mkdir [file join $defaultMountPoint newdir] + } -result "can't create directory \"[file join $defaultMountPoint newdir]\": operation not supported" -returnCodes error + + # Standard paths for file command tests. Because code paths are different, + # we need tests for... + set targetMountParent $defaultMountPoint; # Parent of mount directory + set targetMount [file join $targetMountParent mt] ; # Mount directory + set targetFile [file join $targetMount test]; # Normal file + set targetDir [file join $targetMount testdir]; # Directory + set targetEnoent [file join $targetMount enoent]; # Non-existing path + + proc testzipfsfile {id cmdargs result args} { + variable targetMount + test zipfs-file-$id "file $id on zipfs" -setup { + zipfs mount [zippath test.zip] $targetMount + } -cleanup cleanup -body { + file {*}$cmdargs + } -result $result {*}$args + } + proc testzipfsenotsup {id cmdargs args} { + testzipfsfile $id $cmdargs "*: operation not supported" -match glob -returnCodes error + } + + # + # file atime + + testzipfsfile atime-get-file [list atime $targetFile] 1065435402 + testzipfsfile atime-get-dir [list atime $targetDir] 1105450434 + testzipfsfile atime-get-mount [list atime $targetMount] {\d+} -match regexp + testzipfsfile atime-get-mezzo [list atime $targetMountParent] {\d+} -match regexp + testzipfsfile atime-get-root [list atime [zipfs root]] {\d+} -match regexp + testzipfsfile atime-get-enoent [list atime $targetEnoent] \ + "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + + set t [clock seconds] + testzipfsenotsup atime-set-file [list atime $targetFile $t] + testzipfsenotsup atime-set-dir [list atime $targetDir $t] + testzipfsenotsup atime-set-mount [list atime $targetMount $t] + testzipfsenotsup atime-set-mezzo [list atime $targetMountParent $t] + testzipfsenotsup atime-set-root [list atime [zipfs root] $t] + testzipfsfile atime-set-enoent [list atime $targetEnoent $t] \ + "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + + # + # file isdirectory + testzipfsfile isdirectory-file [list isdirectory $targetFile] 0 + testzipfsfile isdirectory-dir [list isdirectory $targetDir] 1 + testzipfsfile isdirectory-mount [list isdirectory $targetMount] 1 + testzipfsfile isdirectory-mezzo [list isdirectory $targetMountParent] 1 + testzipfsfile isdirectory-root [list isdirectory [zipfs root]] 1 + testzipfsfile isdirectory-enoent [list isdirectory $targetEnoent] 0 + + # + # file isfile + testzipfsfile isfile-file [list isfile $targetFile] 1 + testzipfsfile isfile-dir [list isfile $targetDir] 0 + testzipfsfile isfile-mount [list isfile $targetMount] 0 + testzipfsfile isfile-mezzo [list isfile $targetMountParent] 0 + testzipfsfile isfile-root [list isfile [zipfs root]] 0 + testzipfsfile isfile-enoent [list isfile $targetEnoent] 0 + + # + # file mtime + + testzipfsfile mtime-get-file [list mtime $targetFile] 1065435402 + testzipfsfile mtime-get-dir [list mtime $targetDir] 1105450434 + testzipfsfile mtime-get-mount [list mtime $targetMount] {\d+} -match regexp + testzipfsfile mtime-get-mezzo [list mtime $targetMountParent] {\d+} -match regexp + testzipfsfile mtime-get-root [list mtime [zipfs root]] {\d+} -match regexp + testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ + "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + + set t [clock seconds] + testzipfsenotsup mtime-set-file [list mtime $targetFile $t] + testzipfsenotsup mtime-set-dir [list mtime $targetDir $t] + testzipfsenotsup mtime-set-mount [list mtime $targetMount $t] + testzipfsenotsup mtime-set-mezzo [list mtime $targetMountParent $t] + testzipfsenotsup mtime-set-root [list mtime [zipfs root] $t] + testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ + "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + + + # TODO - mkkey, mkimg, mkzip, lmkimg, lmkzip testnumargs "zipfs mkkey" "password" "" -constraints zipfs testnumargs "zipfs mkimg" "outfile indir" "?strip? ?password? ?infile?" -- cgit v0.12 From 681022822bad59620701b978831cd95e25b9e21f Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 1 Oct 2023 16:58:59 +0000 Subject: More file ensemble tests for zipfs --- doc/FileSystem.3 | 2 +- generic/tclCmdAH.c | 15 ++++++ generic/tclIOUtil.c | 20 +++++-- generic/tclZipfs.c | 23 +++++--- tests/zipfs.test | 152 ++++++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 190 insertions(+), 22 deletions(-) diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 7cbbded..cc19ea8 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -649,7 +649,7 @@ filesystem object. It returns 1 if the paths are equal, and 0 if they are different. If either path is NULL, 0 is always returned. .PP -\fBTcl_FSGetNormalizedPath\fR this important function attempts to extract +\fBTcl_FSGetNormalizedPath\fR attempts to extract from the given Tcl_Obj a unique normalized path representation, whose string value can be used as a unique identifier for the file. .PP diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 429b673..c983109 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1790,6 +1790,21 @@ FileAttrIsOwnedCmd( Tcl_WrongNumArgs(interp, 1, objv, "name"); return TCL_ERROR; } + + Tcl_Obj *normPathPtr = Tcl_FSGetNormalizedPath(interp, objv[1]); + /* Note normPathPtr owned by Tcl, no need to free it */ + if (normPathPtr) { + if (TclIsZipfsPath(Tcl_GetString(normPathPtr))) { + return CheckAccess(interp, objv[1], F_OK); + } + /* Not zipfs, try native. */ + } + + /* + * Note use objv[1] below, NOT normPathPtr even if not NULL because + * for native paths we may not want links to be resolved. + */ + #if defined(_WIN32) value = TclWinFileOwned(objv[1]); #else diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 7bbb9cd..c74eb00 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -4315,11 +4315,17 @@ Tcl_FSDeleteFile( Tcl_Obj *pathPtr) /* Pathname of file to be removed (UTF-8). */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); - - if (fsPtr != NULL && fsPtr->deleteFileProc != NULL) { - return fsPtr->deleteFileProc(pathPtr); + int err; + + if (fsPtr == NULL) { + err = ENOENT; + } else { + if (fsPtr->deleteFileProc != NULL) { + return fsPtr->deleteFileProc(pathPtr); + } + err = ENOTSUP; } - Tcl_SetErrno(ENOENT); + Tcl_SetErrno(err); return -1; } @@ -4437,10 +4443,14 @@ Tcl_FSRemoveDirectory( { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); - if (fsPtr == NULL || fsPtr->removeDirectoryProc == NULL) { + if (fsPtr == NULL) { Tcl_SetErrno(ENOENT); return -1; } + if (fsPtr->removeDirectoryProc == NULL) { + Tcl_SetErrno(ENOTSUP); + return -1; + } if (recursive) { Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL); diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 23b3f3c..aac5659 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -4496,10 +4496,13 @@ ZipChannelWrite( ZipChannel *info = (ZipChannel *) instanceData; unsigned long nextpos; - if (toWrite == 0 || !info->isWriting) { + if (!info->isWriting) { *errloc = EINVAL; return -1; } + if (toWrite == 0) { + return 0; + } assert(info->maxWrite >= info->numRead); if (toWrite > (int) (info->maxWrite - info->numRead)) { /* Don't do partial writes in error case. Or should we? */ @@ -5246,18 +5249,26 @@ ZipEntryAccess( char *path, int mode) { - if (mode & 3) { + if (mode & X_OK) { return -1; } ReadLock(); int access; ZipEntry *z = ZipFSLookup(path); - /* Could a real zip entry or an intermediate directory of a mount point */ - if (z || ContainsMountPoint(path, -1)) { - access = 0; + if (z) { + /* Currently existing files read/write but dirs are read-only */ + access = (z->isDirectory && (mode & W_OK)) ? -1 : 0; } else { - access = -1; + if (mode & W_OK) { + access = -1; + } else { + /* + * Even if entry does not exist, could be intermediate dir + * containing a mount point + */ + access = ContainsMountPoint(path, -1) ? 0 : -1; + } } Unlock(); return access; diff --git a/tests/zipfs.test b/tests/zipfs.test index 57fb5c9..693e4da 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1325,13 +1325,18 @@ namespace eval test_ns_zipfs { # # file stat + proc fixuptime {t} { + # To compensate for the lack of timezone in zip, all dates + # expressed as strings and translated to local time + if {[regexp {^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d} $t]} { + return [clock scan $t -format "%Y-%m-%d %H:%M:%S"] + } + return $t + } proc fixupstat {stat} { foreach key {atime ctime mtime} { # ZIP files have no TZ info so zipfs uses mktime which is localtime - set time [dict get $stat $key] - if {[regexp {^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d} $time]} { - dict set stat $key [clock scan [dict get $stat $key] -format "%Y-%m-%d %H:%M:%S"] - } + dict set stat $key [fixuptime [dict get $stat $key]] } if {$::tcl_platform(platform) ne "windows"} { dict set stat blksize 0 @@ -1516,8 +1521,10 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - file copy -force [makeFile "newtext" source.tmp] [file join $defaultMountPoint test] - } -result "newtext" + set to [file join $defaultMountPoint test] + file copy -force [makeFile "newtext" source.tmp] $to + readbin $to + } -result "newtext\n" test zipfs-file-copy-tozipdir {Copy native file to archive directory} -setup { mount [zippath test.zip] } -cleanup { @@ -1545,7 +1552,71 @@ namespace eval test_ns_zipfs { file copy [file join $defaultMountPoint test] $dst readbin $dst } -result "test\n" + test zipfs-file-copydir-fromzip-1 {Copy archive dir to native} -setup { + mount [zippath test.zip] + set dst [file join [temporaryDirectory] dstdir.tmp] + file delete -force $dst + } -cleanup { + file delete -force $dst + cleanup + } -body { + file copy [file join $defaultMountPoint testdir] $dst + zipfs find $dst + } -result [file join [temporaryDirectory] dstdir.tmp test2] + test zipfs-file-copymount-fromzip-new {Copy archive mount to native} -setup { + mount [zippath test.zip] + set dst [file join [temporaryDirectory] dstdir2.tmp] + file delete -force $dst + } -cleanup { + file delete -force $dst + cleanup + } -body { + file copy $defaultMountPoint $dst + list [file isfile [file join $dst test]] \ + [file isdirectory [file join $dst testdir]] \ + [file isfile [file join $dst testdir test2]] + } -result {1 1 1} + + # + # file delete + test zipfs-file-delete "Delete file in zip archive" -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set file [file join $defaultMountPoint test] + list \ + [file exists $file] \ + [catch {file delete $file} msg] \ + $msg \ + [file exists $file] + } -result [list 1 1 {error deleting "//zipfs:/testmount/test": operation not supported} 1] + + test zipfs-file-delete-enoent "Delete nonexisting path in zip archive" -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set file [file join $defaultMountPoint enoent] + list \ + [file exists $file] \ + [catch {file delete $file} msg] \ + $msg \ + [file exists $file] + } -result [list 0 0 {} 0] + test zipfs-file-delete-dir "Delete dir in zip archive" -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set dir [file join $defaultMountPoint testdir] + list \ + [file isdirectory $dir] \ + [catch {file delete -force $dir} msg] \ + $msg \ + [file isdirectory $dir] + } -result [list 1 1 {error deleting unknown file: operation not supported} 1] # # file mkdir @@ -1556,6 +1627,15 @@ namespace eval test_ns_zipfs { } -body { file mkdir [file join $defaultMountPoint newdir] } -result "can't create directory \"[file join $defaultMountPoint newdir]\": operation not supported" -returnCodes error + test zipfs-file-mkdir-existing {Make a an existing directory in zip archive} -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set dir [file join $defaultMountPoint testdir] + file mkdir $dir + file isdirectory $dir + } -result 1 # Standard paths for file command tests. Because code paths are different, # we need tests for... @@ -1580,8 +1660,8 @@ namespace eval test_ns_zipfs { # # file atime - testzipfsfile atime-get-file [list atime $targetFile] 1065435402 - testzipfsfile atime-get-dir [list atime $targetDir] 1105450434 + testzipfsfile atime-get-file [list atime $targetFile] [fixuptime {2003-10-06 15:46:42}] + testzipfsfile atime-get-dir [list atime $targetDir] [fixuptime {2005-01-11 19:03:54}] testzipfsfile atime-get-mount [list atime $targetMount] {\d+} -match regexp testzipfsfile atime-get-mezzo [list atime $targetMountParent] {\d+} -match regexp testzipfsfile atime-get-root [list atime [zipfs root]] {\d+} -match regexp @@ -1598,6 +1678,33 @@ namespace eval test_ns_zipfs { "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # + # file dirname + testzipfsfile dirname-file [list dirname $targetFile] $targetMount + testzipfsfile dirname-dir [list dirname $targetDir] $targetMount + testzipfsfile dirname-mount [list dirname $targetMount] $targetMountParent + testzipfsfile dirname-mezzo [list dirname $targetMountParent] [zipfs root] + testzipfsfile dirname-root [list dirname [zipfs root]] [zipfs root] + testzipfsfile dirname-enoent [list dirname $targetEnoent] $targetMount + + # + # file executable + testzipfsfile executable-file [list executable $targetFile] 0 + testzipfsfile executable-dir [list executable $targetDir] 0 + testzipfsfile executable-mount [list executable $targetMount] 0 + testzipfsfile executable-mezzo [list executable $targetMountParent] 0 + testzipfsfile executable-root [list executable [zipfs root]] 0 + testzipfsfile executable-enoent [list executable $targetEnoent] 0 + + # + # file exists + testzipfsfile exists-file [list exists $targetFile] 1 + testzipfsfile exists-dir [list exists $targetDir] 1 + testzipfsfile exists-mount [list exists $targetMount] 1 + testzipfsfile exists-mezzo [list exists $targetMountParent] 1 + testzipfsfile exists-root [list exists [zipfs root]] 1 + testzipfsfile exists-enoent [list exists $targetEnoent] 0 + + # # file isdirectory testzipfsfile isdirectory-file [list isdirectory $targetFile] 0 testzipfsfile isdirectory-dir [list isdirectory $targetDir] 1 @@ -1618,8 +1725,8 @@ namespace eval test_ns_zipfs { # # file mtime - testzipfsfile mtime-get-file [list mtime $targetFile] 1065435402 - testzipfsfile mtime-get-dir [list mtime $targetDir] 1105450434 + testzipfsfile mtime-get-file [list mtime $targetFile] [fixuptime {2003-10-06 15:46:42}] + testzipfsfile mtime-get-dir [list mtime $targetDir] [fixuptime {2005-01-11 19:03:54}] testzipfsfile mtime-get-mount [list mtime $targetMount] {\d+} -match regexp testzipfsfile mtime-get-mezzo [list mtime $targetMountParent] {\d+} -match regexp testzipfsfile mtime-get-root [list mtime [zipfs root]] {\d+} -match regexp @@ -1635,7 +1742,32 @@ namespace eval test_ns_zipfs { testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + # + # file owned + testzipfsfile owned-file [list owned $targetFile] 1 + testzipfsfile owned-dir [list owned $targetDir] 1 + testzipfsfile owned-mount [list owned $targetMount] 1 + testzipfsfile owned-mezzo [list owned $targetMountParent] 1 + testzipfsfile owned-root [list owned [zipfs root]] 1 + testzipfsfile owned-enoent [list owned $targetEnoent] 0 + # + # file readable + testzipfsfile readable-file [list readable $targetFile] 1 + testzipfsfile readable-dir [list readable $targetDir] 1 + testzipfsfile readable-mount [list readable $targetMount] 1 + testzipfsfile readable-mezzo [list readable $targetMountParent] 1 + testzipfsfile readable-root [list readable [zipfs root]] 1 + testzipfsfile readable-enoent [list readable $targetEnoent] 0 + + # + # file writable + testzipfsfile writable-file [list writable $targetFile] 1 + testzipfsfile writable-dir [list writable $targetDir] 0 + testzipfsfile writable-mount [list writable $targetMount] 0 + testzipfsfile writable-mezzo [list writable $targetMountParent] 0 + testzipfsfile writable-root [list writable [zipfs root]] 0 + testzipfsfile writable-enoent [list writable $targetEnoent] 0 # TODO - mkkey, mkimg, mkzip, lmkimg, lmkzip testnumargs "zipfs mkkey" "password" "" -constraints zipfs -- cgit v0.12 From 9220b96d3c8ec555212d8aee0f81f1c898c75190 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Oct 2023 19:06:33 +0000 Subject: Fix [7371b6270b]: AddressSanitizer use-after-return detection breaks NRE tests, coroutines. (patch by chrstphrchvz, with some minor modifications) --- generic/tclBasic.c | 39 +++++++++++++++++++++++++++++++++++++-- generic/tclInt.decls | 6 +++++- generic/tclIntDecls.h | 8 +++++--- generic/tclStubInit.c | 2 +- generic/tclTest.c | 14 +++++++------- 5 files changed, 55 insertions(+), 14 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 26530c3..096ce20 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -23,7 +23,42 @@ #include "tommath.h" #include #include + +/* + * Bug 7371b6270b: to check C call stack depth, prefer an approach which is + * compatible with AddressSanitizer (ASan) use-after-return detection. + */ + +#if defined(HAVE_INTRIN_H) +#include /* for _AddressOfReturnAddress() */ +#endif + +/* + * As suggested by + * https://clang.llvm.org/docs/LanguageExtensions.html#has-builtin + */ +#ifndef __has_builtin +#define __has_builtin(x) 0 /* for non-clang compilers */ +#endif +void * +TclGetCStackPtr(void) +{ +#if defined(HAVE_INTRIN_H) + return _AddressOfReturnAddress(); +#elif __GNUC__ || __has_builtin(__builtin_frame_address) + return __builtin_frame_address(0); +#else + int unused = 0; + /* + * LLVM recommends using volatile: + * https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0-rc1/clang/lib/Basic/Stack.cpp#L31 + */ + int *volatile stackLevel = &unused; + return (void *)stackLevel; +#endif +} + #define INTERP_STACK_INITIAL_SIZE 2000 #define CORO_STACK_INITIAL_SIZE 200 @@ -8824,8 +8859,8 @@ TclNRCoroutineActivateCallback( { CoroutineData *corPtr = (CoroutineData *)data[0]; int type = PTR2INT(data[1]); - int numLevels, unused; - int *stackLevel = &unused; + int numLevels; + void *stackLevel = TclGetCStackPtr(); if (!corPtr->stackLevel) { /* diff --git a/generic/tclInt.decls b/generic/tclInt.decls index ca122f7..993cc5d 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -540,6 +540,11 @@ declare 218 { } # for use in tclTest.c + +# Bug 7371b6270b +declare 223 { + void *TclGetCStackPtr(void) +} declare 224 { TclPlatformType *TclGetPlatform(void) } @@ -586,7 +591,6 @@ declare 235 { void TclInitVarHashTable(TclVarHashTable *tablePtr, Namespace *nsPtr) } - # TIP 337 made this one public declare 236 { void TclBackgroundException(Tcl_Interp *interp, int code) diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index e958733..cb13327 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -532,7 +532,8 @@ EXTERN void TclPopStackFrame(Tcl_Interp *interp); /* Slot 220 is reserved */ /* Slot 221 is reserved */ /* Slot 222 is reserved */ -/* Slot 223 is reserved */ +/* 223 */ +EXTERN void * TclGetCStackPtr(void); /* 224 */ EXTERN TclPlatformType * TclGetPlatform(void); /* 225 */ @@ -875,7 +876,7 @@ typedef struct TclIntStubs { void (*reserved220)(void); void (*reserved221)(void); void (*reserved222)(void); - void (*reserved223)(void); + void * (*tclGetCStackPtr) (void); /* 223 */ TclPlatformType * (*tclGetPlatform) (void); /* 224 */ Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, int keyc, Tcl_Obj *const keyv[], int flags); /* 225 */ int (*tclObjBeingDeleted) (Tcl_Obj *objPtr); /* 226 */ @@ -1289,7 +1290,8 @@ extern const TclIntStubs *tclIntStubsPtr; /* Slot 220 is reserved */ /* Slot 221 is reserved */ /* Slot 222 is reserved */ -/* Slot 223 is reserved */ +#define TclGetCStackPtr \ + (tclIntStubsPtr->tclGetCStackPtr) /* 223 */ #define TclGetPlatform \ (tclIntStubsPtr->tclGetPlatform) /* 224 */ #define TclTraceDictPath \ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 9dc3ca0..34bf824 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -720,7 +720,7 @@ static const TclIntStubs tclIntStubs = { 0, /* 220 */ 0, /* 221 */ 0, /* 222 */ - 0, /* 223 */ + TclGetCStackPtr, /* 223 */ TclGetPlatform, /* 224 */ TclTraceDictPath, /* 225 */ TclObjBeingDeleted, /* 226 */ diff --git a/generic/tclTest.c b/generic/tclTest.c index 0061da6..d05ef7d 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -7390,23 +7390,23 @@ NREUnwind_callback( Tcl_Interp *interp, int result) { - int none; + void *cStackPtr = TclGetCStackPtr(); (void)result; if (data[0] == INT2PTR(-1)) { - Tcl_NRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1), + Tcl_NRAddCallback(interp, NREUnwind_callback, cStackPtr, INT2PTR(-1), INT2PTR(-1), NULL); } else if (data[1] == INT2PTR(-1)) { - Tcl_NRAddCallback(interp, NREUnwind_callback, data[0], &none, + Tcl_NRAddCallback(interp, NREUnwind_callback, data[0], cStackPtr, INT2PTR(-1), NULL); } else if (data[2] == INT2PTR(-1)) { Tcl_NRAddCallback(interp, NREUnwind_callback, data[0], data[1], - &none, NULL); + cStackPtr, NULL); } else { Tcl_Obj *idata[3]; idata[0] = Tcl_NewIntObj((int) ((char *) data[1] - (char *) data[0])); idata[1] = Tcl_NewIntObj((int) ((char *) data[2] - (char *) data[0])); - idata[2] = Tcl_NewIntObj((int) ((char *) &none - (char *) data[0])); + idata[2] = Tcl_NewIntObj((int) ((char *) cStackPtr - (char *) data[0])); Tcl_SetObjResult(interp, Tcl_NewListObj(3, idata)); } return TCL_OK; @@ -7452,10 +7452,10 @@ TestNRELevels( (void)objv; if (refDepth == NULL) { - refDepth = &depth; + refDepth = (ptrdiff_t *)TclGetCStackPtr(); } - depth = (refDepth - &depth); + depth = (refDepth - (ptrdiff_t *)TclGetCStackPtr()); levels[0] = Tcl_NewIntObj(depth); levels[1] = Tcl_NewIntObj(iPtr->numLevels); -- cgit v0.12 From 6c67bd02861aa2363f0e2ef8dd4639566a114351 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Oct 2023 19:24:38 +0000 Subject: Fix [7b31677235]: tclOO.c: initialize fakeObject.refCount --- generic/tclOO.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclOO.c b/generic/tclOO.c index c8937ef..4efdd9e 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -398,6 +398,7 @@ InitFoundation( */ fakeCls.thisPtr = &fakeObject; + fakeObject.refCount = 0; /* Do not increment an uninitialized value. */ fPtr->objectCls = TclOOAllocClass(interp, AllocObject(interp, "object", (Namespace *)fPtr->ooNs, NULL)); -- cgit v0.12 From c218617559dba472de85c71f15b43080d2c6ab10 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 2 Oct 2023 06:17:12 +0000 Subject: More relatively minor fixes for file ensemble on zipfs --- generic/tclIOUtil.c | 9 +++- generic/tclZipfs.c | 21 ++++---- tests/zipfs.test | 134 +++++++++++++++++++++++++++++++--------------------- 3 files changed, 100 insertions(+), 64 deletions(-) diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index c74eb00..9b77a1c 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3737,8 +3737,13 @@ Tcl_FSLink( { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); - if (fsPtr != NULL && fsPtr->linkProc != NULL) { - return fsPtr->linkProc(pathPtr, toPtr, linkAction); + if (fsPtr) { + if (fsPtr->linkProc == NULL) { + Tcl_SetErrno(ENOTSUP); + return NULL; + } else { + return fsPtr->linkProc(pathPtr, toPtr, linkAction); + } } /* diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index aac5659..0f4d268 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5896,34 +5896,39 @@ ZipFSFileAttrsGetProc( path = TclGetStringFromObj(pathPtr, &len); ReadLock(); z = ZipFSLookup(path); - if (!z) { + if (!z && !ContainsMountPoint(path, -1)) { Tcl_SetErrno(ENOENT); ZIPFS_POSIX_ERROR(interp, "file not found"); ret = TCL_ERROR; goto done; } + /* z == NULL for intermediate directories that are ancestors of mounts */ switch (index) { case ZIP_ATTR_UNCOMPSIZE: - TclNewIntObj(*objPtrRef, z->numBytes); + TclNewIntObj(*objPtrRef, z ? z->numBytes : 0); break; case ZIP_ATTR_COMPSIZE: - TclNewIntObj(*objPtrRef, z->numCompressedBytes); + TclNewIntObj(*objPtrRef, z ? z->numCompressedBytes : 0); break; case ZIP_ATTR_OFFSET: - TclNewIntObj(*objPtrRef, z->offset); + TclNewIntObj(*objPtrRef, z ? z->offset : 0); break; case ZIP_ATTR_MOUNT: - *objPtrRef = Tcl_NewStringObj(z->zipFilePtr->mountPoint, - z->zipFilePtr->mountPointLen); + if (z) { + *objPtrRef = Tcl_NewStringObj(z->zipFilePtr->mountPoint, + z->zipFilePtr->mountPointLen); + } else { + *objPtrRef = Tcl_NewStringObj("", 0); + } break; case ZIP_ATTR_ARCHIVE: - *objPtrRef = Tcl_NewStringObj(z->zipFilePtr->name, -1); + *objPtrRef = Tcl_NewStringObj(z ? z->zipFilePtr->name : "", -1); break; case ZIP_ATTR_PERMISSIONS: *objPtrRef = Tcl_NewStringObj("0o555", -1); break; case ZIP_ATTR_CRC: - TclNewIntObj(*objPtrRef, z->crc32); + TclNewIntObj(*objPtrRef, z ? z->crc32 : 0); break; default: ZIPFS_ERROR(interp, "unknown attribute"); diff --git a/tests/zipfs.test b/tests/zipfs.test index 693e4da..dbcf093 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -968,12 +968,12 @@ namespace eval test_ns_zipfs { testzipfsread deflate testdeflated2.zip aaaaaaaaaaaaaa testzipfsread bug-23dd83ce7c empty.zip {} empty.txt # Test open modes - see bug [4645658689] - testzipfsread stored-rw teststored.zip aaaaaaaaaaaaaa abac-repeat.txt r+ - testzipfsread deflate-rw testdeflated2.zip aaaaaaaaaaaaaa abac-repeat.txt r+ - testzipfsread stored-wr teststored.zip {} abac-repeat.txt w+ -constraints bug-00018ec7a0 - testzipfsread deflate-wr testdeflated2.zip {} abac-repeat.txt w+ -constraints bug-00018ec7a0 - testzipfsread stored-ar teststored.zip {} abac-repeat.txt a+ - testzipfsread deflate-ar testdeflated2.zip {} abac-repeat.txt a+ + testzipfsread stored-r+ teststored.zip aaaaaaaaaaaaaa abac-repeat.txt r+ + testzipfsread deflate-r+ testdeflated2.zip aaaaaaaaaaaaaa abac-repeat.txt r+ + testzipfsread stored-w+ teststored.zip {} abac-repeat.txt w+ + testzipfsread deflate-w+ testdeflated2.zip {} abac-repeat.txt w+ + testzipfsread stored-a+ teststored.zip {} abac-repeat.txt a+ + testzipfsread deflate-a+ testdeflated2.zip {} abac-repeat.txt a+ testzipfsread enoent test.zip "file \"//zipfs:/testmount/nosuchfile\" not found: no such file or directory" nosuchfile {} -returnCodes error testzipfsread deflate-error broken.zip {decompression error} deflatezliberror {} -returnCodes error @@ -1324,7 +1324,7 @@ namespace eval test_ns_zipfs { } -result 1 # - # file stat + # file stat,lstat proc fixuptime {t} { # To compensate for the lack of timezone in zip, all dates # expressed as strings and translated to local time @@ -1344,52 +1344,27 @@ namespace eval test_ns_zipfs { } return [lsort -stride 2 $stat] } - test zipfs-file-stat-nosuchfile "Read stat of nonexistent file" -setup { - mount [zippath test.zip] - } -cleanup cleanup -body { - file stat [file join $defaultMountPoint nosuchfile] - } -result "could not read \"[file join $defaultMountPoint nosuchfile]\": *" -match glob -returnCodes error - - test zipfs-file-stat-nosuchmount "Read stat of nonexistent mount" -body { - file stat [file join $defaultMountPoint nosuchfile] - } -result "could not read \"[file join $defaultMountPoint nosuchfile]\": no such file or directory" -returnCodes error - - test zipfs-file-stat-file "Read stat of file" -setup { - mount [zippath test.zip] - } -cleanup cleanup -body { - lsort -stride 2 [file stat [file join $defaultMountPoint test]] - } -result [fixupstat {atime {2003-10-06 15:46:42} ctime {2003-10-06 15:46:42} dev 0 gid 0 ino 0 mode 33133 mtime {2003-10-06 15:46:42} nlink 0 size - 5 type file uid 0}] - - test zipfs-file-stat-dir "Read stat of dir" -setup { - mount [zippath test.zip] - } -cleanup cleanup -body { - lsort -stride 2 [file stat [file join $defaultMountPoint testdir]] - } -result [fixupstat {atime {2005-01-11 19:03:54} ctime {2005-01-11 19:03:54} dev 0 gid 0 ino 0 mode 16749 mtime {2005-01-11 19:03:54} nlink 0 size 0 type directory uid 0}] - - test zipfs-file-stat-mount "Read stat of mount point" -setup { - mount [zippath test.zip] - } -cleanup cleanup -body { - lsort -stride 2 [file stat $defaultMountPoint] - } -result [fixupstat [list atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0]] -match regexp - - test zipfs-file-stat-root-mount "Read stat of root" -setup { - mount [zippath test.zip] [zipfs root] - } -cleanup cleanup -body { - lsort -stride 2 [file stat [zipfs root]] - } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp - - test zipfs-file-stat-root-subdir-mount "Read stat of root when mount is subdir" -setup { - mount [zippath test.zip] - } -cleanup cleanup -body { - lsort -stride 2 [file stat [zipfs root]] - } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + # Wraps stat and lstat + proc testzipfsstat {id mountpoint target result args} { + test zipfs-file-stat-$id "file stat $id" -setup { + zipfs mount [zippath test.zip] $mountpoint + } -cleanup cleanup -body { + lsort -stride 2 [file stat [file join $mountpoint $target]] + } -result $result {*}$args - test zipfs-file-stat-level3 "Stat on a directory that is intermediary in a mount point" -setup { - mount [zippath test.zip] [file join $defaultMountPoint mt2] - } -cleanup cleanup -body { - lsort -stride 2 [file stat $defaultMountPoint] - } -result [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + test zipfs-file-lstat-$id "file lstat $id" -setup { + mount [zippath test.zip] + } -cleanup cleanup -body { + lsort -stride 2 [file lstat [file join $mountpoint $target]] + } -result $result {*}$args + } + testzipfsstat enoent $defaultMountPoint enoent "could not read \"[file join $defaultMountPoint enoent]\": no such file or directory" -returnCodes error + testzipfsstat nosuchmount $defaultMountPoint //zipfs:/notamount/test "could not read \"//zipfs:/notamount/test\": no such file or directory" -returnCodes error + testzipfsstat file $defaultMountPoint test [fixupstat {atime {2003-10-06 15:46:42} ctime {2003-10-06 15:46:42} dev 0 gid 0 ino 0 mode 33133 mtime {2003-10-06 15:46:42} nlink 0 size 5 type file uid 0}] + testzipfsstat dir $defaultMountPoint testdir [fixupstat {atime {2005-01-11 19:03:54} ctime {2005-01-11 19:03:54} dev 0 gid 0 ino 0 mode 16749 mtime {2005-01-11 19:03:54} nlink 0 size 0 type directory uid 0}] + testzipfsstat root-mount [zipfs root] [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + testzipfsstat root-subdir-mount $defaultMountPoint [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + testzipfsstat mezzo [file join $defaultMountPoint mt2] $defaultMountPoint [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp # # glob of zipfs file @@ -1432,10 +1407,10 @@ namespace eval test_ns_zipfs { [list -archive [zippath test.zip] -compsize 5 -crc [expr 0x3BB935C6] -mount $defaultMountPoint -offset 55 -permissions 0o555 -uncompsize 5] testzipfsfileattr dir [file join $defaultMountPoint testdir] \ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 119 -permissions 0o555 -uncompsize 0] - testzipfsfileattr root [zipfs root] {} {} -constraints bug-4af110a6a1 + testzipfsfileattr root [zipfs root] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} testzipfsfileattr mountpoint $defaultMountPoint \ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 0 -permissions 0o555 -uncompsize 0] - testzipfsfileattr mezzo [file join $defaultMountPoint a b] {} [file join $defaultMountPoint a b c] -constraints bug-4af110a6a1 + testzipfsfileattr mezzo [file join $defaultMountPoint a b] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} [file join $defaultMountPoint a b c] foreach attr {-uncompsize -compsize -offset -mount -archive -permissions -crc} { test zipfs-file-attrs-set$attr "Set zipfs file attribute $attr" -setup { @@ -1619,6 +1594,12 @@ namespace eval test_ns_zipfs { } -result [list 1 1 {error deleting unknown file: operation not supported} 1] # + # file join + test zipfs-file-join-1 "Ensure file join recognizes zipfs path as absolute" -body { + file join /abc [zipfs root]a/b/c + } -result [zipfs root]a/b/c + + # # file mkdir test zipfs-file-mkdir {Make a directory in zip archive} -setup { mount [zippath test.zip] @@ -1723,6 +1704,12 @@ namespace eval test_ns_zipfs { testzipfsfile isfile-enoent [list isfile $targetEnoent] 0 # + # file link + testzipfsfile link-read-enoent [list link [file join $targetDir l]] {could not read link "//zipfs:/testmount/mt/testdir/l": operation not supported} -returnCodes error + testzipfsfile link-read-notalink [list link $targetFile] {could not read link "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error + testzipfsfile link-write [list link [file join $targetDir l] $targetFile] {could not create new link "//zipfs:/testmount/mt/testdir/l" pointing to "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error + + # # file mtime testzipfsfile mtime-get-file [list mtime $targetFile] [fixuptime {2003-10-06 15:46:42}] @@ -1752,6 +1739,10 @@ namespace eval test_ns_zipfs { testzipfsfile owned-enoent [list owned $targetEnoent] 0 # + # file pathtype + testzipfsfile pathtype [list pathtype $targetFile] absolute + + # # file readable testzipfsfile readable-file [list readable $targetFile] 1 testzipfsfile readable-dir [list readable $targetDir] 1 @@ -1761,6 +1752,41 @@ namespace eval test_ns_zipfs { testzipfsfile readable-enoent [list readable $targetEnoent] 0 # + # file separator + testzipfsfile separator [list separator $targetFile] / + + # + # file size + testzipfsfile size-file [list size $targetFile] 5 + testzipfsfile size-dir [list size $targetDir] 0 + testzipfsfile size-mount [list size $targetMount] 0 + testzipfsfile size-mezzo [list size $targetMountParent] 0 + testzipfsfile size-root [list size [zipfs root]] 0 + testzipfsfile size-enoent [list size $targetEnoent] \ + "could not read \"$targetEnoent\": no such file or directory" -returnCodes error + + # + # file split + testzipfsfile split-file [list split $targetFile] [list [zipfs root] testmount mt test] + testzipfsfile split-root [list split [zipfs root]] [list [zipfs root]] + testzipfsfile split-enoent [list split $targetEnoent] [list [zipfs root] testmount mt enoent] + + # + # file system + testzipfsfile system-file [list system $targetFile] {zipfs zip} + testzipfsfile system-root [list system [zipfs root]] {zipfs zip} + testzipfsfile system-enoent [list system $targetEnoent] {zipfs zip} + + # + # file type + testzipfsfile type-file [list type $targetFile] file + testzipfsfile type-dir [list type $targetDir] directory + testzipfsfile type-mount [list type $targetMount] directory + testzipfsfile type-mezzo [list type $targetMountParent] directory + testzipfsfile type-root [list type [zipfs root]] directory + testzipfsfile type-enoent [list type $targetEnoent] {could not read "//zipfs:/testmount/mt/enoent": no such file or directory} -returnCodes error + + # # file writable testzipfsfile writable-file [list writable $targetFile] 1 testzipfsfile writable-dir [list writable $targetDir] 0 -- cgit v0.12 From c1f780ebaa95f29ffa895e434f7dd0b694017c59 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 2 Oct 2023 16:31:45 +0000 Subject: Start on zipfs glob/find bugs --- generic/tclZipfs.c | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 0f4d268..dcec11c 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5531,6 +5531,8 @@ ZipFSMatchInDirectoryProc( } } + int foundInHash = (z != NULL); + /* * We've got to work for our supper and do the actual globbing. And all * we've got really is an undifferentiated pile of all the filenames we've @@ -5550,18 +5552,36 @@ ZipFSMatchInDirectoryProc( memcpy(pat + len, pattern, l + 1); scnt = CountSlashes(pat); - for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); - hPtr; hPtr = Tcl_NextHashEntry(&search)) { - z = (ZipEntry *) Tcl_GetHashValue(hPtr); + if (foundInHash) { + for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); hPtr; + hPtr = Tcl_NextHashEntry(&search)) { + z = (ZipEntry *)Tcl_GetHashValue(hPtr); - if ((dirOnly >= 0) && ((dirOnly && !z->isDirectory) - || (!dirOnly && z->isDirectory))) { - continue; + if ((dirOnly >= 0) && ((dirOnly && !z->isDirectory) || + (!dirOnly && z->isDirectory))) { + continue; + } + if ((z->depth == scnt) && + ((z->flags & ZE_F_VOLUME) == 0) /* Bug 14db54d81e */ + && Tcl_StringCaseMatch(z->name, pat, 0)) { + AppendWithPrefix(result, prefixBuf, z->name + strip, -1); + } } - if ((z->depth == scnt) && - ((z->flags & ZE_F_VOLUME) == 0) /* Bug 14db54d81e */ - && Tcl_StringCaseMatch(z->name, pat, 0)) { - AppendWithPrefix(result, prefixBuf, z->name + strip, -1); + } else if (dirOnly) { + /* Not found in hash. May be a path that is the ancestor of a mount */ + Tcl_HashEntry *hPtr; + Tcl_HashSearch search; + for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr; + hPtr = Tcl_NextHashEntry(&search)) { + ZipFile *zf = (ZipFile *)Tcl_GetHashValue(hPtr); + if (Tcl_StringCaseMatch(zf->mountPoint, pat, 0)) { + const char *tail = zf->mountPoint + len; + const char *end = strchr(tail, '/'); + AppendWithPrefix(result, + prefixBuf, + zf->mountPoint + strip, + end ? (int)(end - zf->mountPoint) : -1); + } } } ckfree(pat); -- cgit v0.12 From 378391ae59eec7ab4b82def4d0f317da7577eb6a Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 3 Oct 2023 03:28:03 +0000 Subject: Fix [8259d74a64] fix --- generic/tclZipfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 0f4d268..1aec819 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -6263,6 +6263,10 @@ void TclZipfsFinalize(void) * ZipFS.fileHash and ZipFS.zipHash tables. */ WriteLock(); + if (!ZipFS.initialized) { + Unlock(); + return; + } Tcl_HashEntry *hPtr; Tcl_HashSearch zipSearch; @@ -6285,7 +6289,10 @@ void TclZipfsFinalize(void) Tcl_FSUnregister(&zipfsFilesystem); Tcl_DeleteHashTable(&ZipFS.fileHash); Tcl_DeleteHashTable(&ZipFS.zipHash); - ckfree(ZipFS.fallbackEntryEncoding); + if (ZipFS.fallbackEntryEncoding) { + ckfree(ZipFS.fallbackEntryEncoding); + ZipFS.fallbackEntryEncoding = NULL; + } ZipFS.initialized = 0; } } -- cgit v0.12 -- cgit v0.12 From 6171301d1c4af6c76cb7765edee365af95729a6b Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 3 Oct 2023 05:46:17 +0000 Subject: Locking patch from chw --- generic/tclZipfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 80aab6f..f55fa9d 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1882,7 +1882,6 @@ ZipFSCatalogFilesystem( Tcl_Free(zf); return TCL_ERROR; } - Unlock(); /* * Convert to a real archive descriptor. @@ -2098,8 +2097,8 @@ ZipFSCatalogFilesystem( } Tcl_DStringFree(&fpBuf); Tcl_DStringFree(&ds); - Tcl_FSMountsChanged(NULL); Unlock(); + Tcl_FSMountsChanged(NULL); return TCL_OK; } @@ -4336,6 +4335,7 @@ ZipChannelClose( info->isEncrypted = 0; memset(info->keys, 0, sizeof(info->keys)); } + WriteLock(); if (info->isWriting) { /* * Copy channel data back into original file in archive. @@ -4370,7 +4370,6 @@ ZipChannelClose( z->offset = 0; z->crc32 = 0; } - WriteLock(); info->zipFilePtr->numOpen--; Unlock(); if (info->ubufToFree) { -- cgit v0.12 From 13bccc613010fcef78026aa046fe0a888e0c01d5 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 3 Oct 2023 06:38:06 +0000 Subject: Backport locking patch from chw --- generic/tclZipfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 1aec819..57021bd 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1897,7 +1897,6 @@ ZipFSCatalogFilesystem( ckfree(zf); return TCL_ERROR; } - Unlock(); /* * Convert to a real archive descriptor. @@ -2113,8 +2112,8 @@ ZipFSCatalogFilesystem( } Tcl_DStringFree(&fpBuf); Tcl_DStringFree(&ds); - Tcl_FSMountsChanged(NULL); Unlock(); + Tcl_FSMountsChanged(NULL); return TCL_OK; } @@ -4350,6 +4349,7 @@ ZipChannelClose( info->isEncrypted = 0; memset(info->keys, 0, sizeof(info->keys)); } + WriteLock(); if (info->isWriting) { /* * Copy channel data back into original file in archive. @@ -4384,7 +4384,6 @@ ZipChannelClose( z->offset = 0; z->crc32 = 0; } - WriteLock(); info->zipFilePtr->numOpen--; Unlock(); if (info->ubufToFree) { -- cgit v0.12 From 7c5632f03d6a29b10e0df07f022f5cf3ad826ce1 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 3 Oct 2023 16:39:56 +0000 Subject: Some fixes, some tests --- generic/tclFileName.c | 8 ++++++-- generic/tclZipfs.c | 36 ++++++++++++++++++++++++++++++------ tests/zipfs.test | 46 ++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 74 insertions(+), 16 deletions(-) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index ac0dfa3..f23b468 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1399,11 +1399,15 @@ Tcl_GlobObjCmd( * We must ensure that we haven't cut off too much, and turned * a valid path like '/' or 'C:/' into an incorrect path like * '' or 'C:'. The way we do this is to add a separator if - * there are none presently in the prefix. + * there are none presently in the prefix. Similar treatment + * for the zipfs volume. */ - if (strpbrk(Tcl_GetString(pathOrDir), "\\/") == NULL) { + const char *temp = Tcl_GetString(pathOrDir); + if (strpbrk(temp, "\\/") == NULL) { Tcl_AppendToObj(pathOrDir, last-1, 1); + } else if (!strcmp(temp, "//zipfs:")) { + Tcl_AppendToObj(pathOrDir, "/", 1); } } diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 103c246..ffa46d6 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5551,6 +5551,10 @@ ZipFSMatchInDirectoryProc( memcpy(pat + len, pattern, l + 1); scnt = CountSlashes(pat); + Tcl_HashTable duplicates; + int notDuplicate; + Tcl_InitHashTable(&duplicates, TCL_STRING_KEYS); + if (foundInHash) { for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); hPtr; hPtr = Tcl_NextHashEntry(&search)) { @@ -5563,26 +5567,46 @@ ZipFSMatchInDirectoryProc( if ((z->depth == scnt) && ((z->flags & ZE_F_VOLUME) == 0) /* Bug 14db54d81e */ && Tcl_StringCaseMatch(z->name, pat, 0)) { + Tcl_CreateHashEntry(&duplicates, z->name + strip, ¬Duplicate); + assert(notDuplicate); AppendWithPrefix(result, prefixBuf, z->name + strip, -1); } } - } else if (dirOnly) { - /* Not found in hash. May be a path that is the ancestor of a mount */ + } + if (dirOnly) { + /* + * Not found in hash. May be a path that is the ancestor of a mount. + * e.g. glob //zipfs:/a/* with mount at //zipfs:/a/b/c. Also have + * to be careful about duplicates, such as when another mount is + * //zipfs:/a/b/d + */ Tcl_HashEntry *hPtr; Tcl_HashSearch search; + Tcl_DString ds; + Tcl_DStringInit(&ds); for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr; hPtr = Tcl_NextHashEntry(&search)) { ZipFile *zf = (ZipFile *)Tcl_GetHashValue(hPtr); if (Tcl_StringCaseMatch(zf->mountPoint, pat, 0)) { const char *tail = zf->mountPoint + len; + if (*tail == '\0') + continue; const char *end = strchr(tail, '/'); - AppendWithPrefix(result, - prefixBuf, - zf->mountPoint + strip, - end ? (int)(end - zf->mountPoint) : -1); + Tcl_DStringAppend(&ds, + zf->mountPoint + strip, + end ? (Tcl_Size)(end - zf->mountPoint) : -1); + const char *matchedPath = Tcl_DStringValue(&ds); + Tcl_HashEntry *dupTableEntry = + Tcl_CreateHashEntry(&duplicates, matchedPath, ¬Duplicate); + if (notDuplicate) { + AppendWithPrefix( + result, prefixBuf, matchedPath, Tcl_DStringLength(&ds)); + } + Tcl_DStringFree(&ds); } } } + Tcl_DeleteHashTable(&duplicates); ckfree(pat); end: diff --git a/tests/zipfs.test b/tests/zipfs.test index dbcf093..75a1651 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -412,7 +412,7 @@ namespace eval test_ns_zipfs { # list of paths -> list of paths under [zipfs root] proc zipfspaths {args} { - return [lmap path $args {file join [zipfs root] $path}] + return [lsort [lmap path $args {file join [zipfs root] $path}]] } proc cleanup {} { @@ -706,7 +706,7 @@ namespace eval test_ns_zipfs { testzipfslist no-pattern-mount-on-empty "" {test.zip {}} {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-root "" [list test.zip [zipfs root]] {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-slash "" [list test.zip /] {{} test testdir testdir/test2} -constraints !zipfslib - testzipfslist no-pattern-mount-on-level3 "" [list test.zip testmt/a/b] {{} testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2} -constraints {knownBug !zipfslib} + testzipfslist no-pattern-mount-on-mezzo "" [list test.zip testmt/a/b] {{} testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2} -constraints {knownBug !zipfslib} testzipfslist no-pattern-multiple "" {test.zip testmountA test.zip testmountB/subdir} { testmountA testmountA/test testmountA/testdir testmountA/testdir/test2 testmountB/subdir testmountB/subdir/test testmountB/subdir/testdir testmountB/subdir/testdir/test2 @@ -745,8 +745,8 @@ namespace eval test_ns_zipfs { testzipfsexists dir [file join $defaultMountPoint testdir] 1 testzipfsexists mountpoint $defaultMountPoint 1 testzipfsexists root [zipfs root] 1 $defaultMountPoint - testzipfsexists level3 [file join $defaultMountPoint a b] 1 [file join $defaultMountPoint a b c] - testzipfsexists level3-enoent [file join $defaultMountPoint a c] 0 [file join $defaultMountPoint a b c] + testzipfsexists mezzo [file join $defaultMountPoint a b] 1 [file join $defaultMountPoint a b c] + testzipfsexists mezzo-enoent [file join $defaultMountPoint a c] 0 [file join $defaultMountPoint a b c] # # zipfs find @@ -804,13 +804,13 @@ namespace eval test_ns_zipfs { # bug-6183f535c8 testzipfsfind root-path [zipfs root] { test.zip {} test.zip testmountB/subdir - } [zipfspaths test testdir testdir/test2] -constraints !zipfslib + } [zipfspaths test testdir testdir/test2 testmountB testmountB/subdir testmountB/subdir/test testmountB/subdir/testdir testmountB/subdir/testdir/test2] -constraints !zipfslib - testzipfsfind level3 [file join [zipfs root] testmt a] { + testzipfsfind mezzo [file join [zipfs root] testmt a] { test.zip testmt/a/b } [zipfspaths testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] - testzipfsfind level3-root [zipfs root] { + testzipfsfind mezzo-root [zipfs root] { test.zip testmt/a/b } [zipfspaths testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] \ -constraints bug-9e039ee0b9 @@ -888,7 +888,7 @@ namespace eval test_ns_zipfs { zipfs info $defaultMountPoint } -result [list [zippath junk-at-start.zip] 0 0 4] - test zipfs-info-level3 "zipfs info on mount point - verify correct offset of zip content" -setup { + test zipfs-info-mezzo "zipfs info on mount point - verify correct offset of zip content" -setup { # zip starts at offset 4 mount [zippath junk-at-start.zip] /testmt/a/b } -cleanup { @@ -1368,6 +1368,36 @@ namespace eval test_ns_zipfs { # # glob of zipfs file + proc xxx {id mounts cmdopts resultpaths args} { + set setup { + foreach {zippath mountpoint} $mounts { + zipfs mount [zippath $zippath] [file join [zipfs root] $mountpoint] + } + } + if {[dict exists $args -setup]} { + append setup \n[dict get $args -setup] + dict unset args -setup + } + set cleanup cleanup + if {[dict exists $args -cleanup]} { + set cleanup "[dict get $args -cleanup]\n$cleanup" + dict unset args -cleanup + } + set resultpaths [lsort $resultpaths] + test zipfs-xxx-$id "zipfs glob $id $cmdopts" -body { + lsort [glob {*}$cmdopts] + } -setup $setup -cleanup $cleanup -result $resultpaths {*}$args + } + xxx root {test.zip /} [list [zipfs root]*] [zipfspaths test testdir] + xxx root-pat {test.zip /} [list [zipfs root]*d*] [zipfspaths testdir] + xxx root-deep {test.zip /} [list [zipfs root]*/*] [zipfspaths testdir/test2] + xxx root-dir {test.zip /} [list -dir [zipfs root] *] [zipfspaths test testdir] + xxx root-dir-tails {test.zip /} [list -tails -dir [zipfs root] *] [list test testdir] + xxx root-type-d {test.zip /} [list -type d [zipfs root]*] [zipfspaths testdir] + xxx root-type-f {test.zip /} [list -type f [zipfs root]*] [zipfspaths test] + xxx root-path {test.zip /} [list -path [zipfs root]t *d*] [zipfspaths testdir] + + proc testzipfsglob {id mountpoint pat result {globopt {}} args} { test zipfs-glob-$id "zipfs glob $id" -setup { mount [zippath test.zip] $mountpoint -- cgit v0.12 From d65d3e5a4e9083feb8074c9dceec7ef13baf769f Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 4 Oct 2023 06:48:59 +0000 Subject: Fix gcc unused var warning --- generic/tclZipfs.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index ffa46d6..f04614a 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5448,8 +5448,6 @@ ZipFSMatchInDirectoryProc( const char *pattern, /* What names we are looking for. */ Tcl_GlobTypeData *types) /* What types we are looking for. */ { - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; Tcl_Obj *normPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); int scnt, l, dirOnly = -1, mounts = 0; Tcl_Size prefixLen, len, strip = 0; @@ -5552,9 +5550,11 @@ ZipFSMatchInDirectoryProc( scnt = CountSlashes(pat); Tcl_HashTable duplicates; - int notDuplicate; + int notDuplicate = 0; Tcl_InitHashTable(&duplicates, TCL_STRING_KEYS); + Tcl_HashEntry *hPtr; + Tcl_HashSearch search; if (foundInHash) { for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); hPtr; hPtr = Tcl_NextHashEntry(&search)) { @@ -5576,12 +5576,10 @@ ZipFSMatchInDirectoryProc( if (dirOnly) { /* * Not found in hash. May be a path that is the ancestor of a mount. - * e.g. glob //zipfs:/a/* with mount at //zipfs:/a/b/c. Also have + * e.g. glob //zipfs:/a/? with mount at //zipfs:/a/b/c. Also have * to be careful about duplicates, such as when another mount is * //zipfs:/a/b/d */ - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; Tcl_DString ds; Tcl_DStringInit(&ds); for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr; @@ -5596,8 +5594,8 @@ ZipFSMatchInDirectoryProc( zf->mountPoint + strip, end ? (Tcl_Size)(end - zf->mountPoint) : -1); const char *matchedPath = Tcl_DStringValue(&ds); - Tcl_HashEntry *dupTableEntry = - Tcl_CreateHashEntry(&duplicates, matchedPath, ¬Duplicate); + (void)Tcl_CreateHashEntry( + &duplicates, matchedPath, ¬Duplicate); if (notDuplicate) { AppendWithPrefix( result, prefixBuf, matchedPath, Tcl_DStringLength(&ds)); -- cgit v0.12 From 0783fdffc6987e4aa29d3f7a5765d2b3d5452bc9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 4 Oct 2023 07:34:06 +0000 Subject: Done with glob tests --- doc/zipfs.n | 4 +- tests/zipfs.test | 390 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 203 insertions(+), 191 deletions(-) diff --git a/doc/zipfs.n b/doc/zipfs.n index f9cbdc5..2a29a67 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -92,7 +92,9 @@ the \fBstring match\fR command. Alternatively, the \fB-regexp\fR option may be used to specify matching \fBpattern\fR as a regular expression. The file names are returned in arbitrary order. Note that path separators are treated as ordinary characters in the matching. Thus forward slashes should be used -as path separators in the pattern. +as path separators in the pattern. The returned paths only include those +actually in the archive and does not include intermediate directories in +mount paths. .TP \fBzipfs mount\fR .TP diff --git a/tests/zipfs.test b/tests/zipfs.test index 75a1651..6ef723e 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -6,9 +6,11 @@ # # Copyright © 1996-1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. +# Copyright © 2023 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. +# if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 @@ -385,7 +387,7 @@ namespace eval test_ns_zipfs { namespace import ::tcltest::test namespace path ::tcltests variable zipTestDir [file normalize [file join [file dirname [info script]] zipfiles]] - variable defaultMountPoint [file join [zipfs root] testmount] + variable defMountPt [file join [zipfs root] testmount] proc readbin {path} { set fd [open $path rb] @@ -396,7 +398,7 @@ namespace eval test_ns_zipfs { # Wrapper to ease transition if Tcl changes order of argument to zipfs mount # or the zipfs prefix - proc mount [list zippath [list mountpoint $defaultMountPoint]] { + proc mount [list zippath [list mountpoint $defMountPt]] { zipfs mount $zippath $mountpoint } @@ -410,9 +412,14 @@ namespace eval test_ns_zipfs { } } + # list of paths -> list of paths under mount point mt + proc zipfspathsmt {mt args} { + return [lsort [lmap path $args {file join $mt $path}]] + } + # list of paths -> list of paths under [zipfs root] proc zipfspaths {args} { - return [lsort [lmap path $args {file join [zipfs root] $path}]] + return [zipfspathsmt [zipfs root] {*}$args] } proc cleanup {} { @@ -437,12 +444,12 @@ namespace eval test_ns_zipfs { # zipfs mount proc testbadmount {id zippath messagePattern args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] test zipfs-mount-$id $id -body { list [catch {mount $zippath} message] \ [string match $messagePattern $message] \ - [mounttarget $defaultMountPoint] + [mounttarget $defMountPt] } -cleanup { # In case mount succeeded when it should not cleanup @@ -453,9 +460,9 @@ namespace eval test_ns_zipfs { } set data [readbin $zippath] test zipfs-mount_data-$id $id -body { - list [catch {zipfs mount_data $data $defaultMountPoint} message] \ + list [catch {zipfs mount_data $data $defMountPt} message] \ [string match $messagePattern $message] \ - [mounttarget $defaultMountPoint] + [mounttarget $defMountPt] } -cleanup { # In case mount succeeded when it should not cleanup @@ -500,15 +507,15 @@ namespace eval test_ns_zipfs { testbadmount bad-file-count-high incons-file-count-high.zip "truncated directory" testbadmount bad-file-count-low incons-file-count-low.zip "short file count" - testmount basic test.zip testdir/test2 $defaultMountPoint + testmount basic test.zip testdir/test2 $defMountPt testmount basic-on-default test.zip testdir/test2 "" testmount basic-on-root test.zip testdir/test2 [zipfs root] testmount basic-on-slash test.zip testdir/test2 / testmount basic-on-relative test.zip testdir/test2 testmount testmount basic-on-absolute test.zip testdir/test2 /testmount - testmount zip-at-end junk-at-start.zip testdir/test2 $defaultMountPoint - testmount zip-at-start junk-at-end.zip testdir/test2 $defaultMountPoint - testmount zip-in-zip [file join [zipfs root] test2 test.zip] testdir/test2 $defaultMountPoint -setup { + testmount zip-at-end junk-at-start.zip testdir/test2 $defMountPt + testmount zip-at-start junk-at-end.zip testdir/test2 $defMountPt + testmount zip-in-zip [file join [zipfs root] test2 test.zip] testdir/test2 $defMountPt -setup { mount [zippath test-zip-in-zip.zip] [file join [zipfs root] test2] } -cleanup { zipfs unmount $mountpoint @@ -521,8 +528,8 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - zipfs mount [zippath testfile-cp437.zip] $defaultMountPoint - } -result "[zippath test.zip] is already mounted on $defaultMountPoint" -returnCodes error + zipfs mount [zippath testfile-cp437.zip] $defMountPt + } -result "[zippath test.zip] is already mounted on $defMountPt" -returnCodes error test zipfs-mount-no-args-1 "mount - get mount list" -setup { mount [zippath test.zip] @@ -530,15 +537,15 @@ namespace eval test_ns_zipfs { cleanup } -body { set mounts [zipfs mount] - lsearch -inline -stride 2 $mounts $defaultMountPoint - } -result [list $defaultMountPoint [zippath test.zip]] + lsearch -inline -stride 2 $mounts $defMountPt + } -result [list $defMountPt [zippath test.zip]] test zipfs-mount-one-arg-1 "mount - get mount target - absolute path" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { - zipfs mount $defaultMountPoint + zipfs mount $defMountPt } -result [zippath test.zip] test zipfs-mount-one-arg-2 "mount - get mount target - relative path" -setup { @@ -548,21 +555,21 @@ namespace eval test_ns_zipfs { cleanup file delete ./test.zip } -body { - zipfs mount $defaultMountPoint + zipfs mount $defMountPt } -result [file normalize ./test.zip] test zipfs-mount-password-1 "mount - verify plaintext readable without password" -body { - zipfs mount [zippath test-password.zip] $defaultMountPoint - readbin [file join $defaultMountPoint plain.txt] + zipfs mount [zippath test-password.zip] $defMountPt + readbin [file join $defMountPt plain.txt] } -cleanup { cleanup } -result plaintext test zipfs-mount-password-2 "mount - verify uncompressed cipher unreadable without password" -body { - zipfs mount [zippath test-password.zip] $defaultMountPoint + zipfs mount [zippath test-password.zip] $defMountPt set chans [lsort [chan names]]; # Want to ensure open does not leave dangling channel set result [list ] - lappend result [catch {open [file join $defaultMountPoint cipher.bin]} message] + lappend result [catch {open [file join $defMountPt cipher.bin]} message] lappend result $message lappend result [string equal $chans [lsort [chan names]]] } -cleanup { @@ -570,10 +577,10 @@ namespace eval test_ns_zipfs { } -result {1 {decryption failed - no password provided} 1} test zipfs-mount-password-3 "mount - verify compressed cipher unreadable without password" -body { - zipfs mount [zippath test-password.zip] $defaultMountPoint + zipfs mount [zippath test-password.zip] $defMountPt set chans [lsort [chan names]]; # Want to ensure open does not leave dangling channel set result [list ] - lappend result [catch {open [file join $defaultMountPoint cipher-deflate.bin]} message] + lappend result [catch {open [file join $defMountPt cipher-deflate.bin]} message] lappend result $message lappend result [string equal $chans [lsort [chan names]]] } -cleanup { @@ -585,10 +592,10 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set newmount [file join $defaultMountPoint newdir] + set newmount [file join $defMountPt newdir] mount [zippath test-overlay.zip] $newmount list \ - [lsort [glob -tails -dir $defaultMountPoint *]] \ + [lsort [glob -tails -dir $defMountPt *]] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{newdir test testdir} {test2 test3} test2-overlay} @@ -598,13 +605,13 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set newmount [file join $defaultMountPoint testdir] + set newmount [file join $defMountPt testdir] mount [zippath test-overlay.zip] $newmount # Note - file from existing mount is preserved (testdir/test2) # Not clear this is desired but defined as such by the # current implementation list \ - [lsort [glob -tails -dir $defaultMountPoint *]] \ + [lsort [glob -tails -dir $defMountPt *]] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result [list {test testdir} {test2 test3} test\n] @@ -620,12 +627,12 @@ namespace eval test_ns_zipfs { test zipfs-unmount-2 "Unmount mount with open files" -setup { mount [zippath test.zip] - set fd [open [file join $defaultMountPoint test]] + set fd [open [file join $defMountPt test]] } -cleanup { close $fd cleanup } -body { - zipfs unmount $defaultMountPoint + zipfs unmount $defMountPt } -result {filesystem is busy} -returnCodes error test zipfs-unmount-3 "Unmount mount with current directory" -setup { @@ -634,9 +641,9 @@ namespace eval test_ns_zipfs { cleanup } -body { set cwd [pwd] - cd [file join $defaultMountPoint testdir] - list [pwd] [zipfs unmount $defaultMountPoint] [string equal [pwd] $cwd] - } -result [list [file join $defaultMountPoint testdir] {} 1] + cd [file join $defMountPt testdir] + list [pwd] [zipfs unmount $defMountPt] [string equal [pwd] $cwd] + } -result [list [file join $defMountPt testdir] {} 1] test zipfs-unmount-nested-1 "unmount parent of nested mount on new directory should not affect nested mount" -setup { mount [zippath test.zip] @@ -645,9 +652,9 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - zipfs unmount $defaultMountPoint + zipfs unmount $defMountPt list \ - [zipfs mount $defaultMountPoint] \ + [zipfs mount $defMountPt] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{} {test2 test3} test2-overlay} @@ -662,9 +669,9 @@ namespace eval test_ns_zipfs { # KNOWN BUG. The test2 file is also present in parent mount. # After the unmount, the test2 in the nested mount is not # made available. - zipfs unmount $defaultMountPoint + zipfs unmount $defMountPt list \ - [zipfs mount $defaultMountPoint] \ + [zipfs mount $defMountPt] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{} {test2 test3} test2-overlay} @@ -701,13 +708,13 @@ namespace eval test_ns_zipfs { } -result $resultpaths {*}$args } # Some tests have !zipfslib constraint because otherwise they dump the entire Tcl library which is mounted on root - testzipfslist no-mounts "" {} {} -constraints !zipfslib - testzipfslist no-pattern "" {test.zip testmountA} {testmountA testmountA/test testmountA/testdir testmountA/testdir/test2} -constraints !zipfslib + testzipfslist no-mounts "" {} {} -constraints !zipfslib + testzipfslist no-pattern "" {test.zip testmountA} {testmountA testmountA/test testmountA/testdir testmountA/testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-empty "" {test.zip {}} {{} test testdir testdir/test2} -constraints !zipfslib - testzipfslist no-pattern-mount-on-root "" [list test.zip [zipfs root]] {{} test testdir testdir/test2} -constraints !zipfslib + testzipfslist no-pattern-mount-on-root "" [list test.zip [zipfs root]] {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-slash "" [list test.zip /] {{} test testdir testdir/test2} -constraints !zipfslib - testzipfslist no-pattern-mount-on-mezzo "" [list test.zip testmt/a/b] {{} testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2} -constraints {knownBug !zipfslib} - testzipfslist no-pattern-multiple "" {test.zip testmountA test.zip testmountB/subdir} { + testzipfslist no-pattern-mount-on-mezzo "" [list test.zip testmt/a/b] {testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2} -constraints {!zipfslib} + testzipfslist no-pattern-multiple "" {test.zip testmountA test.zip testmountB/subdir} { testmountA testmountA/test testmountA/testdir testmountA/testdir/test2 testmountB/subdir testmountB/subdir/test testmountB/subdir/testdir testmountB/subdir/testdir/test2 } -constraints !zipfslib @@ -729,7 +736,7 @@ namespace eval test_ns_zipfs { testnumargs "zipfs exists" "filename" "" # Generates tests for zipfs exists - proc testzipfsexists [list id path result [list mountpoint $defaultMountPoint] args] { + proc testzipfsexists [list id path result [list mountpoint $defMountPt] args] { test zipfs-exists-$id "zipfs exists $id" -body { zipfs exists $path } -setup { @@ -739,14 +746,14 @@ namespace eval test_ns_zipfs { cleanup } -result $result {*}$args } - testzipfsexists native-file [info nameofexecutable] 0 - testzipfsexists enoent [file join $defaultMountPoint nosuchfile] 0 - testzipfsexists file [file join $defaultMountPoint test] 1 - testzipfsexists dir [file join $defaultMountPoint testdir] 1 - testzipfsexists mountpoint $defaultMountPoint 1 - testzipfsexists root [zipfs root] 1 $defaultMountPoint - testzipfsexists mezzo [file join $defaultMountPoint a b] 1 [file join $defaultMountPoint a b c] - testzipfsexists mezzo-enoent [file join $defaultMountPoint a c] 0 [file join $defaultMountPoint a b c] + testzipfsexists native-file [info nameofexecutable] 0 + testzipfsexists enoent [file join $defMountPt nosuchfile] 0 + testzipfsexists file [file join $defMountPt test] 1 + testzipfsexists dir [file join $defMountPt testdir] 1 + testzipfsexists mountpoint $defMountPt 1 + testzipfsexists root [zipfs root] 1 $defMountPt + testzipfsexists mezzo [file join $defMountPt a b] 1 [file join $defMountPt a b c] + testzipfsexists mezzo-enoent [file join $defMountPt a c] 0 [file join $defMountPt a b c] # # zipfs find @@ -812,8 +819,7 @@ namespace eval test_ns_zipfs { testzipfsfind mezzo-root [zipfs root] { test.zip testmt/a/b - } [zipfspaths testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] \ - -constraints bug-9e039ee0b9 + } [zipfspaths testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] -constraints !zipfslib test zipfs-find-native-absolute "zipfs find on native file system" -setup { set dir [makeDirectory zipfs-native-absolute] @@ -860,15 +866,15 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - zipfs info [file join $defaultMountPoint nosuchfile] - } -result "path \"[file join $defaultMountPoint nosuchfile]\" not found in any zipfs volume" -returnCodes error + zipfs info [file join $defMountPt nosuchfile] + } -result "path \"[file join $defMountPt nosuchfile]\" not found in any zipfs volume" -returnCodes error test zipfs-info-file "zipfs info file within mounted archive" -setup { mount [zippath testdeflated2.zip] } -cleanup { cleanup } -body { - zipfs info [file join $defaultMountPoint abac-repeat.txt] + zipfs info [file join $defMountPt abac-repeat.txt] } -result [list [zippath testdeflated2.zip] 60 17 108] test zipfs-info-dir "zipfs info dir within mounted archive" -setup { @@ -876,7 +882,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - zipfs info [file join $defaultMountPoint testdir] + zipfs info [file join $defMountPt testdir] } -result [list [zippath test.zip] 0 0 119] test zipfs-info-mountpoint "zipfs info on mount point - verify correct offset of zip content" -setup { @@ -885,7 +891,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - zipfs info $defaultMountPoint + zipfs info $defMountPt } -result [list [zippath junk-at-start.zip] 0 0 4] test zipfs-info-mezzo "zipfs info on mount point - verify correct offset of zip content" -setup { @@ -912,14 +918,14 @@ namespace eval test_ns_zipfs { -body [list zipfs canonical {*}$cmdargs] \ -result $result {*}$args } - testzipfscanonical basic-relative PATH [file join [zipfs root] PATH] - testzipfscanonical basic-absolute /PATH [file join [zipfs root] PATH] - testzipfscanonical mountpoint-relative {MT PATH} [file join [zipfs root] MT PATH] - testzipfscanonical mountpoint-absolute {MT /PATH} [file join [zipfs root] PATH] - testzipfscanonical mountpoint-trailslash-relative {MT/ PATH} [file join [zipfs root] MT PATH] - testzipfscanonical mountpoint-trailslash-absolute {MT/ /PATH} [file join [zipfs root] PATH] - testzipfscanonical mountpoint-root-relative [list [zipfs root] PATH] [file join [zipfs root] PATH] - testzipfscanonical mountpoint-root-absolute [list [zipfs root] /PATH] [file join [zipfs root] PATH] + testzipfscanonical basic-relative PATH [file join [zipfs root] PATH] + testzipfscanonical basic-absolute /PATH [file join [zipfs root] PATH] + testzipfscanonical mountpoint-relative {MT PATH} [file join [zipfs root] MT PATH] + testzipfscanonical mountpoint-absolute {MT /PATH} [file join [zipfs root] PATH] + testzipfscanonical mountpoint-trailslash-relative {MT/ PATH} [file join [zipfs root] MT PATH] + testzipfscanonical mountpoint-trailslash-absolute {MT/ /PATH} [file join [zipfs root] PATH] + testzipfscanonical mountpoint-root-relative [list [zipfs root] PATH] [file join [zipfs root] PATH] + testzipfscanonical mountpoint-root-absolute [list [zipfs root] /PATH] [file join [zipfs root] PATH] testzipfscanonical mountpoint-empty-relative {{} PATH} [file join [zipfs root] PATH] testzipfscanonical driveletter X: [zipfs root] -constraints win @@ -931,11 +937,11 @@ namespace eval test_ns_zipfs { # # Read/uncompress proc testzipfsread {id zippath result {filename abac-repeat.txt} {openopts {}} args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] test zipfs-read-$id "zipfs read $id" -setup { unset -nocomplain fd - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -943,14 +949,14 @@ namespace eval test_ns_zipfs { } cleanup } -body { - set fd [open [file join $defaultMountPoint $filename] {*}$openopts] + set fd [open [file join $defMountPt $filename] {*}$openopts] gets $fd } -result $result {*}$args set data [readbin $zippath] test zipfs-read-memory-$id "zipfs read in-memory $id" -setup { unset -nocomplain fd - zipfs mount_data $data $defaultMountPoint + zipfs mount_data $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -958,14 +964,14 @@ namespace eval test_ns_zipfs { } cleanup } -body { - set fd [open [file join $defaultMountPoint $filename] {*}$openopts] + set fd [open [file join $defMountPt $filename] {*}$openopts] gets $fd } -result $result {*}$args } - testzipfsread stored test.zip test test + testzipfsread stored test.zip test test testzipfsread stored-1 teststored.zip aaaaaaaaaaaaaa - testzipfsread deflate testdeflated2.zip aaaaaaaaaaaaaa + testzipfsread deflate testdeflated2.zip aaaaaaaaaaaaaa testzipfsread bug-23dd83ce7c empty.zip {} empty.txt # Test open modes - see bug [4645658689] testzipfsread stored-r+ teststored.zip aaaaaaaaaaaaaa abac-repeat.txt r+ @@ -976,11 +982,11 @@ namespace eval test_ns_zipfs { testzipfsread deflate-a+ testdeflated2.zip {} abac-repeat.txt a+ testzipfsread enoent test.zip "file \"//zipfs:/testmount/nosuchfile\" not found: no such file or directory" nosuchfile {} -returnCodes error - testzipfsread deflate-error broken.zip {decompression error} deflatezliberror {} -returnCodes error testzipfsread bzip2 testbzip2.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread lzma testfile-lzma.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread xz testfile-xz.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread zstd testfile-zstd.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error + testzipfsread deflate-error broken.zip {decompression error} deflatezliberror {} -returnCodes error test zipfs-read-unwritable "Writes not allowed on file opened for read" -setup { mount [zippath test.zip] @@ -988,16 +994,16 @@ namespace eval test_ns_zipfs { close $fd cleanup } -body { - set fd [open [file join $defaultMountPoint test]] + set fd [open [file join $defMountPt test]] puts $fd blah } -result {channel "*" wasn't opened for writing} -match glob -returnCodes error # # Write proc testzipfswrite {id zippath result filename mode args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] - set path [file join $defaultMountPoint $filename] + set path [file join $defMountPt $filename] set body { set fd [open $path $mode] fconfigure $fd -translation binary @@ -1009,7 +1015,7 @@ namespace eval test_ns_zipfs { } test zipfs-write-$id "zipfs write $id" -setup { unset -nocomplain fd - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -1021,7 +1027,7 @@ namespace eval test_ns_zipfs { set data [readbin $zippath] test zipfs-write-memory-$id "zipfs write in-memory $id" -setup { unset -nocomplain fd - zipfs mount_data $data $defaultMountPoint + zipfs mount_data $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -1031,17 +1037,17 @@ namespace eval test_ns_zipfs { } -body $body -result $result {*}$args } - testzipfswrite create-w test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w -returnCodes error - testzipfswrite create-w+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w+ -returnCodes error - testzipfswrite create-a test.zip "append mode not supported: permission denied" newfile a -returnCodes error - testzipfswrite create-a+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile a+ -returnCodes error - testzipfswrite store-w teststored.zip "xyz" abac-repeat.txt w - testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w - testzipfswrite store-w+ teststored.zip "xyz" abac-repeat.txt w+ + testzipfswrite create-w test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w -returnCodes error + testzipfswrite create-w+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w+ -returnCodes error + testzipfswrite create-a test.zip "append mode not supported: permission denied" newfile a -returnCodes error + testzipfswrite create-a+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile a+ -returnCodes error + testzipfswrite store-w teststored.zip "xyz" abac-repeat.txt w + testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w + testzipfswrite store-w+ teststored.zip "xyz" abac-repeat.txt w+ testzipfswrite deflate-w+ testdeflated2.zip "xyz" abac-repeat.txt w+ - testzipfswrite stored-a teststored.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error - testzipfswrite deflate-a testdeflated2.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error - testzipfswrite store-a+ teststored.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nxyz" abac-repeat.txt a+ + testzipfswrite stored-a teststored.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error + testzipfswrite deflate-a testdeflated2.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error + testzipfswrite store-a+ teststored.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nxyz" abac-repeat.txt a+ testzipfswrite deflate-a+ testdeflated2.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nxyz" abac-repeat.txt a+ testzipfswrite bug-23dd83ce7c-w empty.zip "xyz" empty.txt w @@ -1051,7 +1057,7 @@ namespace eval test_ns_zipfs { close $fd cleanup } -body { - set fd [open [file join $defaultMountPoint test] w] + set fd [open [file join $defMountPt test] w] read $fd } -result {channel "*" wasn't opened for reading} -match glob -returnCodes error @@ -1060,14 +1066,14 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set path [file join $defaultMountPoint test] + set path [file join $defMountPt test] set fd [open $path w] puts -nonewline $fd newtext close $fd set fd [open $path] set result [list [read $fd]] close $fd - zipfs unmount $defaultMountPoint + zipfs unmount $defMountPt mount [zippath test.zip] set fd [open $path] lappend result [read $fd] @@ -1084,7 +1090,7 @@ namespace eval test_ns_zipfs { cleanup } -body { set ::tcl::zipfs::wrmax 10 - set fd [open [file join $defaultMountPoint test] w] + set fd [open [file join $defMountPt test] w] puts $fd [string repeat x 11] flush $fd } -result {error flushing *: file too large} -match glob -returnCodes error @@ -1097,7 +1103,7 @@ namespace eval test_ns_zipfs { cleanup } -body { set ::tcl::zipfs::wrmax 10 - set fd [open [file join $defaultMountPoint test] w] + set fd [open [file join $defMountPt test] w] puts $fd [string repeat x 11] close $fd } -result {file too large} -match glob -returnCodes error @@ -1107,10 +1113,10 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set fd [open [file join $defaultMountPoint test] w] + set fd [open [file join $defMountPt test] w] puts -nonewline $fd [string repeat x $::tcl::zipfs::wrmax] close $fd - file size [file join $defaultMountPoint test] + file size [file join $defMountPt test] } -result $::tcl::zipfs::wrmax test zipfs-write-size-limit-3 "Writes disallowed" -setup { @@ -1121,15 +1127,15 @@ namespace eval test_ns_zipfs { cleanup } -body { set ::tcl::zipfs::wrmax -1 - open [file join $defaultMountPoint test] w + open [file join $defMountPt test] w } -result {write access not supported: permission denied} -returnCodes error # # read/seek/write proc testzipfsrw {id zippath expected filename mode args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] - set path [file join $defaultMountPoint $filename] + set path [file join $defMountPt $filename] set body { set result "" set fd [open $path $mode] @@ -1150,7 +1156,7 @@ namespace eval test_ns_zipfs { } test zipfs-rw-$id "zipfs read/seek/write $id" -setup { unset -nocomplain fd - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -1162,7 +1168,7 @@ namespace eval test_ns_zipfs { set data [readbin $zippath] test zipfs-rw-memory-$id "zipfs read/seek/write in-memory $id" -setup { unset -nocomplain fd - zipfs mount_data $data $defaultMountPoint + zipfs mount_data $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { @@ -1184,7 +1190,7 @@ namespace eval test_ns_zipfs { close $fd cleanup } -body { - set path [file join $defaultMountPoint test] + set path [file join $defMountPt test] set fd [open $path r+] puts -nonewline $fd X close $fd @@ -1195,14 +1201,14 @@ namespace eval test_ns_zipfs { # # Password protected proc testpasswordr {id zipfile filename password result args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zipfile] test zipfs-password-read-$id "zipfs password read $id" -setup { unset -nocomplain fd if {$password ne ""} { - zipfs mount $zippath $defaultMountPoint $password + zipfs mount $zippath $defMountPt $password } else { - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } } -cleanup { # In case open succeeded when it should not @@ -1211,7 +1217,7 @@ namespace eval test_ns_zipfs { } cleanup } -body { - set fd [open [file join $defaultMountPoint $filename]] + set fd [open [file join $defMountPt $filename]] gets $fd } -result $result {*}$args -constraints bbe7c6ff9e } @@ -1234,9 +1240,9 @@ namespace eval test_ns_zipfs { testpasswordr cipher-deflate-badpass test-password.zip cipher-deflate.bin badpassword "invalid password" -returnCodes error proc testpasswordw {id zippath filename password mode result args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] - set path [file join $defaultMountPoint $filename] + set path [file join $defMountPt $filename] set body { set fd [open $path $mode] fconfigure $fd -translation binary @@ -1249,9 +1255,9 @@ namespace eval test_ns_zipfs { test zipfs-password-write-$id "zipfs write $id" -setup { unset -nocomplain fd if {$password ne ""} { - zipfs mount $zippath $defaultMountPoint $password + zipfs mount $zippath $defMountPt $password } else { - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } } -cleanup { # In case open succeeded when it should not @@ -1283,11 +1289,11 @@ namespace eval test_ns_zipfs { # # CRC errors proc testcrc {id zippath filename result args} { - variable defaultMountPoint + variable defMountPt set zippath [zippath $zippath] test zipfs-crc-$id "zipfs crc $id" -setup { unset -nocomplain fd - zipfs mount $zippath $defaultMountPoint + zipfs mount $zippath $defMountPt } -cleanup { # In case mount succeeded when it should not if {[info exists fd]} { @@ -1295,16 +1301,16 @@ namespace eval test_ns_zipfs { } cleanup } -body { - set fd [open [file join $defaultMountPoint $filename]] + set fd [open [file join $defMountPt $filename]] } -result $result -returnCodes error {*}$args # Mount memory buffer test zipfs-crc-memory-$id "zipfs crc memory $id" -setup { - zipfs mount_data [readbin [zippath $zippath]] $defaultMountPoint + zipfs mount_data [readbin [zippath $zippath]] $defMountPt } -cleanup { cleanup } -body { - set fd [open [file join $defaultMountPoint $filename]] + set fd [open [file join $defMountPt $filename]] } -result $result -returnCodes error {*}$args } testcrc local incons-local-crc.zip a "invalid CRC" @@ -1358,17 +1364,17 @@ namespace eval test_ns_zipfs { lsort -stride 2 [file lstat [file join $mountpoint $target]] } -result $result {*}$args } - testzipfsstat enoent $defaultMountPoint enoent "could not read \"[file join $defaultMountPoint enoent]\": no such file or directory" -returnCodes error - testzipfsstat nosuchmount $defaultMountPoint //zipfs:/notamount/test "could not read \"//zipfs:/notamount/test\": no such file or directory" -returnCodes error - testzipfsstat file $defaultMountPoint test [fixupstat {atime {2003-10-06 15:46:42} ctime {2003-10-06 15:46:42} dev 0 gid 0 ino 0 mode 33133 mtime {2003-10-06 15:46:42} nlink 0 size 5 type file uid 0}] - testzipfsstat dir $defaultMountPoint testdir [fixupstat {atime {2005-01-11 19:03:54} ctime {2005-01-11 19:03:54} dev 0 gid 0 ino 0 mode 16749 mtime {2005-01-11 19:03:54} nlink 0 size 0 type directory uid 0}] - testzipfsstat root-mount [zipfs root] [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp - testzipfsstat root-subdir-mount $defaultMountPoint [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp - testzipfsstat mezzo [file join $defaultMountPoint mt2] $defaultMountPoint [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + testzipfsstat enoent $defMountPt enoent "could not read \"[file join $defMountPt enoent]\": no such file or directory" -returnCodes error + testzipfsstat nosuchmount $defMountPt //zipfs:/notamount/test "could not read \"//zipfs:/notamount/test\": no such file or directory" -returnCodes error + testzipfsstat file $defMountPt test [fixupstat {atime {2003-10-06 15:46:42} ctime {2003-10-06 15:46:42} dev 0 gid 0 ino 0 mode 33133 mtime {2003-10-06 15:46:42} nlink 0 size 5 type file uid 0}] + testzipfsstat dir $defMountPt testdir [fixupstat {atime {2005-01-11 19:03:54} ctime {2005-01-11 19:03:54} dev 0 gid 0 ino 0 mode 16749 mtime {2005-01-11 19:03:54} nlink 0 size 0 type directory uid 0}] + testzipfsstat root-mount [zipfs root] [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + testzipfsstat root-subdir-mount $defMountPt [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp + testzipfsstat mezzo [file join $defMountPt mt2] $defMountPt [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp # # glob of zipfs file - proc xxx {id mounts cmdopts resultpaths args} { + proc testzipfsglob {id mounts cmdopts result args} { set setup { foreach {zippath mountpoint} $mounts { zipfs mount [zippath $zippath] [file join [zipfs root] $mountpoint] @@ -1383,70 +1389,74 @@ namespace eval test_ns_zipfs { set cleanup "[dict get $args -cleanup]\n$cleanup" dict unset args -cleanup } - set resultpaths [lsort $resultpaths] - test zipfs-xxx-$id "zipfs glob $id $cmdopts" -body { + test zipfs-glob-$id "zipfs glob $id $cmdopts" -body { lsort [glob {*}$cmdopts] - } -setup $setup -cleanup $cleanup -result $resultpaths {*}$args + } -setup $setup -cleanup $cleanup -result $result {*}$args } - xxx root {test.zip /} [list [zipfs root]*] [zipfspaths test testdir] - xxx root-pat {test.zip /} [list [zipfs root]*d*] [zipfspaths testdir] - xxx root-deep {test.zip /} [list [zipfs root]*/*] [zipfspaths testdir/test2] - xxx root-dir {test.zip /} [list -dir [zipfs root] *] [zipfspaths test testdir] - xxx root-dir-tails {test.zip /} [list -tails -dir [zipfs root] *] [list test testdir] - xxx root-type-d {test.zip /} [list -type d [zipfs root]*] [zipfspaths testdir] - xxx root-type-f {test.zip /} [list -type f [zipfs root]*] [zipfspaths test] - xxx root-path {test.zip /} [list -path [zipfs root]t *d*] [zipfspaths testdir] - - - proc testzipfsglob {id mountpoint pat result {globopt {}} args} { - test zipfs-glob-$id "zipfs glob $id" -setup { - mount [zippath test.zip] $mountpoint - } -cleanup { - cleanup - } -body { - lsort [glob {*}$globopt $pat] - } -result $result {*}$args - } - # Bug 14db54d81e - testzipfsglob root-dir [zipfs root] * {//zipfs:/test //zipfs:/testdir} [list -dir [zipfs root]] -constraints !zipfslib - testzipfsglob root [zipfs root] [file join [zipfs root] *] {//zipfs:/test //zipfs:/testdir} {} -constraints !zipfslib - testzipfsglob pattern $defaultMountPoint [file join $defaultMountPoint testdir t*] \ - [file join $defaultMountPoint testdir test2] - testzipfsglob files $defaultMountPoint [file join $defaultMountPoint t*] \ - [list [file join $defaultMountPoint test]] {-type f} - testzipfsglob dirs $defaultMountPoint [file join $defaultMountPoint t*] \ - [list [file join $defaultMountPoint testdir]] {-type d} - testzipfsglob no-match $defaultMountPoint [file join $defaultMountPoint testdir x*] \ - {no files matched glob pattern "//zipfs:/testmount/testdir/x*"} {} -returnCodes error - testzipfsglob no-match-nocomplain $defaultMountPoint [file join $defaultMountPoint testdir x*] {} {-nocomplain} - testzipfsglob mountpoint $defaultMountPoint [file join [zipfs root] *] \ - [list $defaultMountPoint] {} -constraints !zipfslib + + set basicMounts [list test.zip $defMountPt] + testzipfsglob basic $basicMounts [list $defMountPt/*] [zipfspathsmt $defMountPt test testdir] + testzipfsglob basic-pat $basicMounts [list $defMountPt/t*d*] [zipfspathsmt $defMountPt testdir] + testzipfsglob basic-deep $basicMounts [list $defMountPt/tes*/*] [zipfspathsmt $defMountPt testdir/test2] + testzipfsglob basic-dir $basicMounts [list -directory $defMountPt *] [zipfspathsmt $defMountPt test testdir] + testzipfsglob basic-dir-tails $basicMounts [list -tails -dir $defMountPt *] [list test testdir] + testzipfsglob basic-type-d $basicMounts [list -type d $defMountPt/*] [zipfspathsmt $defMountPt testdir] + testzipfsglob basic-type-f $basicMounts [list -type f $defMountPt/*] [zipfspathsmt $defMountPt test] + testzipfsglob basic-path $basicMounts [list -path $defMountPt/t *d*] [zipfspathsmt $defMountPt testdir] + testzipfsglob basic-enoent $basicMounts [list $defMountPt/x*] "no files matched glob pattern \"$defMountPt/x*\"" -returnCodes error + testzipfsglob basic-enoent-ok $basicMounts [list -nocomplain $defMountPt/x*] {} + + # NOTE: test root mounts separately because some bugs only showed up on these + set rootMounts [list test.zip /] + testzipfsglob root-1 $rootMounts [list [zipfs root]*] [zipfspaths lib test testdir] -constraints zipfslib + testzipfsglob root-2 $rootMounts [list [zipfs root]*] [zipfspaths test testdir] -constraints !zipfslib + testzipfsglob root-pat $rootMounts [list [zipfs root]t*d*] [zipfspaths testdir] + testzipfsglob root-deep $rootMounts [list [zipfs root]tes*/*] [zipfspaths testdir/test2] + testzipfsglob root-dir-1 $rootMounts [list -directory [zipfs root] *] [zipfspaths lib test testdir] -constraints zipfslib + testzipfsglob root-dir-2 $rootMounts [list -directory [zipfs root] *] [zipfspaths test testdir] -constraints !zipfslib + testzipfsglob root-dir-tails-1 $rootMounts [list -tails -dir [zipfs root] *] [list lib test testdir] -constraints zipfslib + testzipfsglob root-dir-tails-2 $rootMounts [list -tails -dir [zipfs root] *] [list test testdir] -constraints !zipfslib + testzipfsglob root-type-d-1 $rootMounts [list -type d [zipfs root]*] [zipfspaths lib testdir] -constraints zipfslib + testzipfsglob root-type-d-2 $rootMounts [list -type d [zipfs root]*] [zipfspaths testdir] -constraints !zipfslib + testzipfsglob root-type-f $rootMounts [list -type f [zipfs root]*] [zipfspaths test] + testzipfsglob root-path $rootMounts [list -path [zipfs root]t *d*] [zipfspaths testdir] + testzipfsglob root-enoent $rootMounts [list [zipfs root]x*] {no files matched glob pattern "//zipfs:/x*"} -returnCodes error + testzipfsglob root-enoent-ok $rootMounts [list -nocomplain [zipfs root]x*] {} + + # glob operations on intermediate directories (mezzo) in mount + # paths is another source of bugs + set mezzoMounts [list test.zip $defMountPt/a/b test-overlay.zip $defMountPt/a/c] + testzipfsglob mezzo-root-1 $mezzoMounts [list [zipfs root]*] [list [zipfs root]lib $defMountPt] -constraints zipfslib + testzipfsglob mezzo-root-2 $mezzoMounts [list [zipfs root]*] [list $defMountPt] -constraints !zipfslib + testzipfsglob mezzo-mountgrandparent $mezzoMounts [list $defMountPt/*] [list $defMountPt/a] + testzipfsglob mezzo-mountparent $mezzoMounts [list $defMountPt/a/*] [zipfspathsmt $defMountPt/a b c] + testzipfsglob mezzo-overlay [list test.zip $defMountPt/a/b test-overlay.zip $defMountPt/a] [list $defMountPt/a/*] [zipfspathsmt $defMountPt/a b test2 test3] # # file attributes - proc testzipfsfileattr [list id path result [list mountpoint $defaultMountPoint] args] { + proc testzipfsfileattr [list id path result [list mountpoint $defMountPt] args] { test zipfs-file-attrs-$id "zipfs file attrs $id" -setup { mount [zippath test.zip] $mountpoint } -cleanup cleanup -body { lsort -stride 2 [file attributes $path] } -result $result {*}$args } - testzipfsfileattr noent [file join $defaultMountPoint nosuchfile] \ - {file not found: no such file or directory} $defaultMountPoint -returnCodes error - testzipfsfileattr file [file join $defaultMountPoint test] \ - [list -archive [zippath test.zip] -compsize 5 -crc [expr 0x3BB935C6] -mount $defaultMountPoint -offset 55 -permissions 0o555 -uncompsize 5] - testzipfsfileattr dir [file join $defaultMountPoint testdir] \ - [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 119 -permissions 0o555 -uncompsize 0] + testzipfsfileattr noent [file join $defMountPt nosuchfile] \ + {file not found: no such file or directory} $defMountPt -returnCodes error + testzipfsfileattr file [file join $defMountPt test] \ + [list -archive [zippath test.zip] -compsize 5 -crc [expr 0x3BB935C6] -mount $defMountPt -offset 55 -permissions 0o555 -uncompsize 5] + testzipfsfileattr dir [file join $defMountPt testdir] \ + [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defMountPt -offset 119 -permissions 0o555 -uncompsize 0] testzipfsfileattr root [zipfs root] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} - testzipfsfileattr mountpoint $defaultMountPoint \ - [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 0 -permissions 0o555 -uncompsize 0] - testzipfsfileattr mezzo [file join $defaultMountPoint a b] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} [file join $defaultMountPoint a b c] + testzipfsfileattr mountpoint $defMountPt \ + [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defMountPt -offset 0 -permissions 0o555 -uncompsize 0] + testzipfsfileattr mezzo [file join $defMountPt a b] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} [file join $defMountPt a b c] foreach attr {-uncompsize -compsize -offset -mount -archive -permissions -crc} { test zipfs-file-attrs-set$attr "Set zipfs file attribute $attr" -setup { mount [zippath test.zip] } -cleanup cleanup \ - -body "file attributes [file join $defaultMountPoint test] $attr {}" \ + -body "file attributes [file join $defMountPt test] $attr {}" \ -result "unsupported operation" -returnCodes error } @@ -1511,22 +1521,22 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defaultMountPoint X] - } -result "error copying \"*source.tmp\" to \"[file join $defaultMountPoint X]\": operation not supported" \ + file copy [makeFile "" source.tmp] [file join $defMountPt X] + } -result "error copying \"*source.tmp\" to \"[file join $defMountPt X]\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-tozip-existing {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { - file copy [makeFile "newtext" source.tmp] [file join $defaultMountPoint test] + file copy [makeFile "newtext" source.tmp] [file join $defMountPt test] } -result "error copying *: file exists" -match glob -returnCodes error test zipfs-file-copy-tozip-existing-force {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { - set to [file join $defaultMountPoint test] + set to [file join $defMountPt test] file copy -force [makeFile "newtext" source.tmp] $to readbin $to } -result "newtext\n" @@ -1535,15 +1545,15 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defaultMountPoint testdir] - } -result "error copying \"*source.tmp\" to \"[file join $defaultMountPoint testdir]/source.tmp\": operation not supported" \ + file copy [makeFile "" source.tmp] [file join $defMountPt testdir] + } -result "error copying \"*source.tmp\" to \"[file join $defMountPt testdir]/source.tmp\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copydir-tozipdir {Copy native dir to archive directory} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { - file copy [temporaryDirectory] [file join $defaultMountPoint testdir] + file copy [temporaryDirectory] [file join $defMountPt testdir] } -result "can't create directory *: operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-fromzip-new {Copy archive file to native} -setup { @@ -1554,7 +1564,7 @@ namespace eval test_ns_zipfs { file delete $dst cleanup } -body { - file copy [file join $defaultMountPoint test] $dst + file copy [file join $defMountPt test] $dst readbin $dst } -result "test\n" test zipfs-file-copydir-fromzip-1 {Copy archive dir to native} -setup { @@ -1565,7 +1575,7 @@ namespace eval test_ns_zipfs { file delete -force $dst cleanup } -body { - file copy [file join $defaultMountPoint testdir] $dst + file copy [file join $defMountPt testdir] $dst zipfs find $dst } -result [file join [temporaryDirectory] dstdir.tmp test2] test zipfs-file-copymount-fromzip-new {Copy archive mount to native} -setup { @@ -1576,7 +1586,7 @@ namespace eval test_ns_zipfs { file delete -force $dst cleanup } -body { - file copy $defaultMountPoint $dst + file copy $defMountPt $dst list [file isfile [file join $dst test]] \ [file isdirectory [file join $dst testdir]] \ [file isfile [file join $dst testdir test2]] @@ -1589,7 +1599,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set file [file join $defaultMountPoint test] + set file [file join $defMountPt test] list \ [file exists $file] \ [catch {file delete $file} msg] \ @@ -1602,7 +1612,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set file [file join $defaultMountPoint enoent] + set file [file join $defMountPt enoent] list \ [file exists $file] \ [catch {file delete $file} msg] \ @@ -1615,7 +1625,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set dir [file join $defaultMountPoint testdir] + set dir [file join $defMountPt testdir] list \ [file isdirectory $dir] \ [catch {file delete -force $dir} msg] \ @@ -1636,21 +1646,21 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - file mkdir [file join $defaultMountPoint newdir] - } -result "can't create directory \"[file join $defaultMountPoint newdir]\": operation not supported" -returnCodes error + file mkdir [file join $defMountPt newdir] + } -result "can't create directory \"[file join $defMountPt newdir]\": operation not supported" -returnCodes error test zipfs-file-mkdir-existing {Make a an existing directory in zip archive} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { - set dir [file join $defaultMountPoint testdir] + set dir [file join $defMountPt testdir] file mkdir $dir file isdirectory $dir } -result 1 # Standard paths for file command tests. Because code paths are different, # we need tests for... - set targetMountParent $defaultMountPoint; # Parent of mount directory + set targetMountParent $defMountPt; # Parent of mount directory set targetMount [file join $targetMountParent mt] ; # Mount directory set targetFile [file join $targetMount test]; # Normal file set targetDir [file join $targetMount testdir]; # Directory @@ -1735,9 +1745,9 @@ namespace eval test_ns_zipfs { # # file link - testzipfsfile link-read-enoent [list link [file join $targetDir l]] {could not read link "//zipfs:/testmount/mt/testdir/l": operation not supported} -returnCodes error - testzipfsfile link-read-notalink [list link $targetFile] {could not read link "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error - testzipfsfile link-write [list link [file join $targetDir l] $targetFile] {could not create new link "//zipfs:/testmount/mt/testdir/l" pointing to "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error + testzipfsfile link-read-enoent [list link [file join $targetDir l]] {could not read link "//zipfs:/testmount/mt/testdir/l": operation not supported} -returnCodes error + testzipfsfile link-read-notalink [list link $targetFile] {could not read link "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error + testzipfsfile link-write [list link [file join $targetDir l] $targetFile] {could not create new link "//zipfs:/testmount/mt/testdir/l" pointing to "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error # # file mtime @@ -1840,7 +1850,7 @@ namespace eval test_ns_zipfs { } -cleanup { cleanup } -body { - set fd [open [file join $defaultMountPoint -]] + set fd [open [file join $defMountPt -]] list [catch {read $fd} message] [close $fd] $message close $fd } -result {file size error (may be zip64)} -returnCodes error -- cgit v0.12 From 06ae8c6d9e8de0918c8fdaef03556e07aef9de1d Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 4 Oct 2023 10:00:00 +0000 Subject: Misc fixes in zipfs manpage --- doc/file.n | 13 +++++++++++++ doc/zipfs.n | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/file.n b/doc/file.n index 36f0415..16b8a77 100644 --- a/doc/file.n +++ b/doc/file.n @@ -83,6 +83,19 @@ clears the readonly attribute of the file. \fB\-rsrclength\fR gives the length of the resource fork of the file, this attribute can only be set to the value 0, which results in the resource fork being stripped off the file. +.PP +On all platforms, files in \fBzipfs\fR mounted archives return the following +attributes. These are all read-only and cannot be directly set. +\fB-archive\fR gives the path of the mounted ZIP archive containing the file. +\fB-compsize\fR gives the compressed size of the file within the archive. +This is \fB0\fR for directories. +\fB-crc\fR gives the CRC of the file if present, else \fB0\fR. +\fB-mount\fR gives the path where the containing archive is mounted. +\fB-offset\fR gives the offset of the file within the archive. +\fB-uncompsize\fR gives the uncompressed size of the file. +This is \fB0\fR for directories. +Other attributes may be present in the returned list. These should +be ignored. .RE .TP \fBfile channels\fR ?\fIpattern\fR? diff --git a/doc/zipfs.n b/doc/zipfs.n index 2a29a67..26b45a6 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -43,6 +43,10 @@ simple encryption, sufficient to prevent casual inspection of their contents but not able to prevent access by even a moderately determined attacker. Strong encryption, multi-part archives, platform metadata, zip64 formats and other compression methods like bzip2 are not supported. +.PP +Files within mounted archives can be written to but new files or directories +cannot be created. Further, modifications to files are limited to the +mounted archive in memory and are not persisted to disk. .TP \fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIinZipfs\fR? . @@ -116,7 +120,7 @@ In the third form, the command mounts the ZIP archive \fIzipfile\fR as a Tcl vir filesystem at \fImountpoint\fR. After this command executes, files contained in \fIzipfile\fR will appear to Tcl to be regular files at the mount point. If \fImountpoint\fR is -specified as an empty string, it is defaulted to the file path. +specified as an empty string, it is defaulted to the \fB[zipfs root]\fR. .PP \fBNB:\fR because the current working directory is a concept maintained by the operating system, using \fBcd\fR into a mounted archive will only work in the -- cgit v0.12 From 0dc647a301ee262934691ac630a1f16f1891ea12 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 4 Oct 2023 11:49:12 +0000 Subject: Start on zipfs append mode --- generic/tclZipfs.c | 53 ++++++++++++++++++++++++++++++++++++++--------------- tests/zipfs.test | 4 ++-- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index f04614a..b223306 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -260,9 +260,12 @@ typedef struct ZipChannel { int iscompr; /* True if data is compressed */ int isDirectory; /* Set to 1 if directory, or -1 if root */ int isEncrypted; /* True if data is encrypted */ - int isWriting; /* True if open for writing */ + int mode; /* O_WRITE, O_APPEND, O_TRUNC etc.*/ unsigned long keys[3]; /* Key for decryption */ } ZipChannel; +static inline int ZipChannelWritable(ZipChannel *info) { + return (info->mode & (O_WRONLY | O_RDWR)) != 0; +} /* * Global variables. @@ -4350,7 +4353,7 @@ ZipChannelClose( memset(info->keys, 0, sizeof(info->keys)); } WriteLock(); - if (info->isWriting) { + if (ZipChannelWritable(info)) { /* * Copy channel data back into original file in archive. * TODO - there seems to be no locking here to protect access from @@ -4495,11 +4498,15 @@ ZipChannelWrite( ZipChannel *info = (ZipChannel *) instanceData; unsigned long nextpos; - if (!info->isWriting) { + if (!ZipChannelWritable(info)) { *errloc = EINVAL; return -1; } + if (info->mode & O_APPEND) { + info->numRead = info->numBytes; + } if (toWrite == 0) { + *errloc = 0; return 0; } assert(info->maxWrite >= info->numRead); @@ -4544,7 +4551,7 @@ ZipChannelWideSeek( ZipChannel *info = (ZipChannel *) instanceData; size_t end; - if (!info->isWriting && (info->isDirectory < 0)) { + if (!ZipChannelWritable(info) && (info->isDirectory < 0)) { /* * Special case: when executable combined with ZIP archive file, seek * within front of ZIP, i.e. the executable itself. @@ -4573,7 +4580,7 @@ ZipChannelWideSeek( *errloc = EINVAL; return -1; } - if (info->isWriting) { + if (ZipChannelWritable(info)) { if ((size_t) offset > info->maxWrite) { *errloc = EINVAL; return -1; @@ -4684,16 +4691,28 @@ ZipChannelOpen( /* Check for unsupported modes. */ - if ((mode & O_APPEND) || ((ZipFS.wrmax <= 0) && wr)) { + if ((ZipFS.wrmax <= 0) && wr) { Tcl_SetErrno(EACCES); if (interp) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "%s not supported: %s", - mode & O_APPEND ? "append mode" : "write access", - Tcl_PosixError(interp))); + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("writes not permitted: %s", + Tcl_PosixError(interp))); } return NULL; } + + if ((mode & (O_APPEND|O_TRUNC)) && !wr) { + Tcl_SetErrno(EINVAL); + if (interp) { + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("Invalid flags 0x%x. O_APPEND and " + "O_TRUNC require write access: %s", + mode, + Tcl_PosixError(interp))); + } + return NULL; + } + /* * Is the file there? */ @@ -4776,7 +4795,7 @@ ZipChannelOpen( if (wr) { /* Set up a writable channel. */ - if (InitWritableChannel(interp, info, z, mode & O_TRUNC) == TCL_ERROR) { + if (InitWritableChannel(interp, info, z, mode) == TCL_ERROR) { ckfree(info); goto error; } @@ -4857,7 +4876,7 @@ InitWritableChannel( ZipChannel *info, /* The channel to set up. */ ZipEntry *z, /* The zipped file that the channel will write * to. */ - int trunc) /* Whether to truncate the data. */ + int mode) /* O_APPEND, O_TRUNC */ { int i, ch; unsigned char *cbuf = NULL; @@ -4866,7 +4885,7 @@ InitWritableChannel( * Set up a writable channel. */ - info->isWriting = 1; + info->mode = mode; info->maxWrite = ZipFS.wrmax; info->ubufToFree = @@ -4887,7 +4906,7 @@ InitWritableChannel( } } - if (trunc) { + if (mode & O_TRUNC) { /* * Truncate; nothing there. */ @@ -4983,8 +5002,11 @@ InitWritableChannel( } memset(info->keys, 0, sizeof(info->keys)); } + if (mode & O_APPEND) { + info->numRead = info->numBytes; + } - assert(info->numBytes == 0 || (int) info->numBytes == z->numBytes); + assert(info->numBytes == 0 || (int)info->numBytes == z->numBytes); return TCL_OK; memoryError: @@ -5048,6 +5070,7 @@ InitReadableChannel( info->ubufToFree = NULL; /* ubuf memory not allocated */ info->isDirectory = z->isDirectory; info->isEncrypted = z->isEncrypted; + info->mode = O_RDONLY; /* Caller must validate - bug [6ed3447a7e] */ assert(z->numBytes >= 0 && z->numCompressedBytes >= 0); diff --git a/tests/zipfs.test b/tests/zipfs.test index 6ef723e..d652f05 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1039,7 +1039,7 @@ namespace eval test_ns_zipfs { } testzipfswrite create-w test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w -returnCodes error testzipfswrite create-w+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w+ -returnCodes error - testzipfswrite create-a test.zip "append mode not supported: permission denied" newfile a -returnCodes error + testzipfswrite create-a test.zip "file \"$defMountPt/newfile\" not created: operation not supported" newfile a -returnCodes error testzipfswrite create-a+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile a+ -returnCodes error testzipfswrite store-w teststored.zip "xyz" abac-repeat.txt w testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w @@ -1128,7 +1128,7 @@ namespace eval test_ns_zipfs { } -body { set ::tcl::zipfs::wrmax -1 open [file join $defMountPt test] w - } -result {write access not supported: permission denied} -returnCodes error + } -result {writes not permitted: permission denied} -returnCodes error # # read/seek/write -- cgit v0.12 From 36db68b9d446670328287e35e8959adf3f555bc0 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 4 Oct 2023 12:57:08 +0000 Subject: Update tests for zipfs append. --- generic/tclZipfs.c | 43 +++++++++++++++++++++---------------------- tests/zipfs.test | 12 +++++++----- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index b223306..cd75e67 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -251,8 +251,7 @@ typedef struct ZipChannel { ZipEntry *zipEntryPtr; /* Pointer back to virtual file */ size_t maxWrite; /* Maximum size for write */ size_t numBytes; /* Number of bytes of uncompressed data */ - size_t numRead; /* Position of next byte to be read from the - * channel */ + size_t cursor; /* Seek position for next read or write*/ unsigned char *ubuf; /* Pointer to the uncompressed data */ unsigned char *ubufToFree; /* NULL if ubuf points to memory that does not need freeing. Else memory to free (ubuf @@ -4431,16 +4430,16 @@ ZipChannelRead( * data in front of ZIP, i.e. the executable itself. */ - nextpos = info->numRead + toRead; + nextpos = info->cursor + toRead; if (nextpos > info->zipFilePtr->baseOffset) { - toRead = info->zipFilePtr->baseOffset - info->numRead; + toRead = info->zipFilePtr->baseOffset - info->cursor; nextpos = info->zipFilePtr->baseOffset; } if (toRead == 0) { return 0; } memcpy(buf, info->zipFilePtr->data, toRead); - info->numRead = nextpos; + info->cursor = nextpos; *errloc = 0; return toRead; } @@ -4448,9 +4447,9 @@ ZipChannelRead( *errloc = EISDIR; return -1; } - nextpos = info->numRead + toRead; + nextpos = info->cursor + toRead; if (nextpos > info->numBytes) { - toRead = info->numBytes - info->numRead; + toRead = info->numBytes - info->cursor; nextpos = info->numBytes; } if (toRead == 0) { @@ -4460,14 +4459,14 @@ ZipChannelRead( int i; for (i = 0; i < toRead; i++) { - int ch = info->ubuf[i + info->numRead]; + int ch = info->ubuf[i + info->cursor]; buf[i] = zdecode(info->keys, crc32tab, ch); } } else { - memcpy(buf, info->ubuf + info->numRead, toRead); + memcpy(buf, info->ubuf + info->cursor, toRead); } - info->numRead = nextpos; + info->cursor = nextpos; *errloc = 0; return toRead; } @@ -4503,23 +4502,23 @@ ZipChannelWrite( return -1; } if (info->mode & O_APPEND) { - info->numRead = info->numBytes; + info->cursor = info->numBytes; } if (toWrite == 0) { *errloc = 0; return 0; } - assert(info->maxWrite >= info->numRead); - if (toWrite > (int) (info->maxWrite - info->numRead)) { + assert(info->maxWrite >= info->cursor); + if (toWrite > (int) (info->maxWrite - info->cursor)) { /* Don't do partial writes in error case. Or should we? */ *errloc = EFBIG; return -1; } - nextpos = info->numRead + toWrite; - memcpy(info->ubuf + info->numRead, buf, toWrite); - info->numRead = nextpos; - if (info->numRead > info->numBytes) { - info->numBytes = info->numRead; + nextpos = info->cursor + toWrite; + memcpy(info->ubuf + info->cursor, buf, toWrite); + info->cursor = nextpos; + if (info->cursor > info->numBytes) { + info->numBytes = info->cursor; } *errloc = 0; return toWrite; @@ -4565,7 +4564,7 @@ ZipChannelWideSeek( } switch (mode) { case SEEK_CUR: - offset += info->numRead; + offset += info->cursor; break; case SEEK_END: offset += end; @@ -4592,8 +4591,8 @@ ZipChannelWideSeek( *errloc = EINVAL; return -1; } - info->numRead = (size_t) offset; - return info->numRead; + info->cursor = (size_t) offset; + return info->cursor; } #if !defined(TCL_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) @@ -5003,7 +5002,7 @@ InitWritableChannel( memset(info->keys, 0, sizeof(info->keys)); } if (mode & O_APPEND) { - info->numRead = info->numBytes; + info->cursor = info->numBytes; } assert(info->numBytes == 0 || (int)info->numBytes == z->numBytes); diff --git a/tests/zipfs.test b/tests/zipfs.test index d652f05..046e3b5 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1007,7 +1007,9 @@ namespace eval test_ns_zipfs { set body { set fd [open $path $mode] fconfigure $fd -translation binary - puts -nonewline $fd "xyz" + puts -nonewline $fd XYZ + seek $fd 0 + puts -nonewline $fd xyz close $fd set fd [open $path] fconfigure $fd -translation binary @@ -1045,10 +1047,10 @@ namespace eval test_ns_zipfs { testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w testzipfswrite store-w+ teststored.zip "xyz" abac-repeat.txt w+ testzipfswrite deflate-w+ testdeflated2.zip "xyz" abac-repeat.txt w+ - testzipfswrite stored-a teststored.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error - testzipfswrite deflate-a testdeflated2.zip "append mode not supported: permission denied" abac-repeat.txt a -returnCodes error - testzipfswrite store-a+ teststored.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nxyz" abac-repeat.txt a+ - testzipfswrite deflate-a+ testdeflated2.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nxyz" abac-repeat.txt a+ + testzipfswrite stored-a teststored.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZxyz" abac-repeat.txt a + testzipfswrite deflate-a testdeflated2.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZxyz" abac-repeat.txt a + testzipfswrite store-a+ teststored.zip "xyzaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZ" abac-repeat.txt a+ + testzipfswrite deflate-a+ testdeflated2.zip "xyzaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZ" abac-repeat.txt a+ testzipfswrite bug-23dd83ce7c-w empty.zip "xyz" empty.txt w test zipfs-write-unreadable "Reads not allowed on file opened for write" -setup { -- cgit v0.12 From aabe9cb3ab1a8cda4350da087a5a9b40f99d1551 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 4 Oct 2023 13:53:59 +0000 Subject: test suite hygiene --- tests/zipfs.test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index 046e3b5..17dcc78 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1521,33 +1521,37 @@ namespace eval test_ns_zipfs { test zipfs-file-copy-tozip-new {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defMountPt X] + file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt X] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt X]\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-tozip-existing {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "newtext" source.tmp] [file join $defMountPt test] + file copy [set _ [makeFile "newtext" source.tmp]] [file join $defMountPt test] } -result "error copying *: file exists" -match glob -returnCodes error test zipfs-file-copy-tozip-existing-force {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { set to [file join $defMountPt test] - file copy -force [makeFile "newtext" source.tmp] $to + file copy -force [set _ [makeFile "newtext" source.tmp]] $to readbin $to } -result "newtext\n" test zipfs-file-copy-tozipdir {Copy native file to archive directory} -setup { mount [zippath test.zip] } -cleanup { + removeFile $_ cleanup } -body { - file copy [makeFile "" source.tmp] [file join $defMountPt testdir] + file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt testdir] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt testdir]/source.tmp\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copydir-tozipdir {Copy native dir to archive directory} -setup { @@ -1768,7 +1772,7 @@ namespace eval test_ns_zipfs { testzipfsenotsup mtime-set-mount [list mtime $targetMount $t] testzipfsenotsup mtime-set-mezzo [list mtime $targetMountParent $t] testzipfsenotsup mtime-set-root [list mtime [zipfs root] $t] - testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ + testzipfsfile mtime-set-enoent-1 [list mtime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # -- cgit v0.12 From 1081ce3d811ca2df171d764f1611eb89d8a891b3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 4 Oct 2023 15:17:50 +0000 Subject: Move some (internal) stub entries to lower numbers --- generic/tclInt.decls | 28 ++++++++++++++------------ generic/tclIntDecls.h | 55 +++++++++++++++++++++++++++------------------------ generic/tclStubInit.c | 12 +++++------ 3 files changed, 50 insertions(+), 45 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 637ab3f..15d2cfa 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -530,8 +530,22 @@ declare 217 { declare 218 { void TclPopStackFrame(Tcl_Interp *interp) } +# TIP 431: temporary directory creation function +declare 219 { + Tcl_Obj *TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, + Tcl_Obj *basenameObj) +} # for use in tclTest.c + +# TIP 625: for unit testing - create list objects with span +declare 221 { + Tcl_Obj *TclListTestObj(size_t length, size_t leadingSpace, size_t endSpace) +} +# TIP 625: for unit testing - check list invariants +declare 222 { + void TclListObjValidate(Tcl_Interp *interp, Tcl_Obj *listObj) +} declare 224 { TclPlatformType *TclGetPlatform(void) } @@ -679,20 +693,8 @@ declare 257 { Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc) } -# TIP 431: temporary directory creation function -declare 258 { - Tcl_Obj *TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, - Tcl_Obj *basenameObj) -} - -# TIP 625: for unit testing - create list objects with span -declare 260 { - Tcl_Obj *TclListTestObj(size_t length, size_t leadingSpace, size_t endSpace) -} - -# TIP 625: for unit testing - check list invariants declare 261 { - void TclListObjValidate(Tcl_Interp *interp, Tcl_Obj *listObj) + void TclUnusedStubEntry(void) } ############################################################################## diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 78ee5e6..d8f3af8 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -542,10 +542,16 @@ EXTERN int TclPushStackFrame(Tcl_Interp *interp, int isProcCallFrame); /* 218 */ EXTERN void TclPopStackFrame(Tcl_Interp *interp); -/* Slot 219 is reserved */ +/* 219 */ +EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, + Tcl_Obj *basenameObj); /* Slot 220 is reserved */ -/* Slot 221 is reserved */ -/* Slot 222 is reserved */ +/* 221 */ +EXTERN Tcl_Obj * TclListTestObj(size_t length, size_t leadingSpace, + size_t endSpace); +/* 222 */ +EXTERN void TclListObjValidate(Tcl_Interp *interp, + Tcl_Obj *listObj); /* Slot 223 is reserved */ /* 224 */ EXTERN TclPlatformType * TclGetPlatform(void); @@ -656,16 +662,11 @@ EXTERN void TclStaticLibrary(Tcl_Interp *interp, const char *prefix, Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc); -/* 258 */ -EXTERN Tcl_Obj * TclpCreateTemporaryDirectory(Tcl_Obj *dirObj, - Tcl_Obj *basenameObj); +/* Slot 258 is reserved */ /* Slot 259 is reserved */ -/* 260 */ -EXTERN Tcl_Obj * TclListTestObj(size_t length, size_t leadingSpace, - size_t endSpace); +/* Slot 260 is reserved */ /* 261 */ -EXTERN void TclListObjValidate(Tcl_Interp *interp, - Tcl_Obj *listObj); +EXTERN void TclUnusedStubEntry(void); typedef struct TclIntStubs { int magic; @@ -890,10 +891,10 @@ typedef struct TclIntStubs { void (*tclStackFree) (Tcl_Interp *interp, void *freePtr); /* 216 */ int (*tclPushStackFrame) (Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 217 */ void (*tclPopStackFrame) (Tcl_Interp *interp); /* 218 */ - void (*reserved219)(void); + Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 219 */ void (*reserved220)(void); - void (*reserved221)(void); - void (*reserved222)(void); + Tcl_Obj * (*tclListTestObj) (size_t length, size_t leadingSpace, size_t endSpace); /* 221 */ + void (*tclListObjValidate) (Tcl_Interp *interp, Tcl_Obj *listObj); /* 222 */ void (*reserved223)(void); TclPlatformType * (*tclGetPlatform) (void); /* 224 */ Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, Tcl_Size keyc, Tcl_Obj *const keyv[], int flags); /* 225 */ @@ -929,10 +930,10 @@ typedef struct TclIntStubs { int (*tclPtrObjMakeUpvar) (Tcl_Interp *interp, Tcl_Var otherPtr, Tcl_Obj *myNamePtr, int myFlags); /* 255 */ int (*tclPtrUnsetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); /* 256 */ void (*tclStaticLibrary) (Tcl_Interp *interp, const char *prefix, Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc); /* 257 */ - Tcl_Obj * (*tclpCreateTemporaryDirectory) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj); /* 258 */ + void (*reserved258)(void); void (*reserved259)(void); - Tcl_Obj * (*tclListTestObj) (size_t length, size_t leadingSpace, size_t endSpace); /* 260 */ - void (*tclListObjValidate) (Tcl_Interp *interp, Tcl_Obj *listObj); /* 261 */ + void (*reserved260)(void); + void (*tclUnusedStubEntry) (void); /* 261 */ } TclIntStubs; extern const TclIntStubs *tclIntStubsPtr; @@ -1304,10 +1305,13 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclPushStackFrame) /* 217 */ #define TclPopStackFrame \ (tclIntStubsPtr->tclPopStackFrame) /* 218 */ -/* Slot 219 is reserved */ +#define TclpCreateTemporaryDirectory \ + (tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 219 */ /* Slot 220 is reserved */ -/* Slot 221 is reserved */ -/* Slot 222 is reserved */ +#define TclListTestObj \ + (tclIntStubsPtr->tclListTestObj) /* 221 */ +#define TclListObjValidate \ + (tclIntStubsPtr->tclListObjValidate) /* 222 */ /* Slot 223 is reserved */ #define TclGetPlatform \ (tclIntStubsPtr->tclGetPlatform) /* 224 */ @@ -1376,13 +1380,11 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclPtrUnsetVar) /* 256 */ #define TclStaticLibrary \ (tclIntStubsPtr->tclStaticLibrary) /* 257 */ -#define TclpCreateTemporaryDirectory \ - (tclIntStubsPtr->tclpCreateTemporaryDirectory) /* 258 */ +/* Slot 258 is reserved */ /* Slot 259 is reserved */ -#define TclListTestObj \ - (tclIntStubsPtr->tclListTestObj) /* 260 */ -#define TclListObjValidate \ - (tclIntStubsPtr->tclListObjValidate) /* 261 */ +/* Slot 260 is reserved */ +#define TclUnusedStubEntry \ + (tclIntStubsPtr->tclUnusedStubEntry) /* 261 */ #endif /* defined(USE_TCL_STUBS) */ @@ -1418,6 +1420,7 @@ extern const TclIntStubs *tclIntStubsPtr; # define Tcl_StaticLibrary (tclIntStubsPtr->tclStaticLibrary) #endif +#undef TclUnusedStubEntry #undef TclGuessPackageName #undef TclSetPreInitScript #undef TclObjInterpProc diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 059ae76..dfe25c5 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -999,10 +999,10 @@ static const TclIntStubs tclIntStubs = { TclStackFree, /* 216 */ TclPushStackFrame, /* 217 */ TclPopStackFrame, /* 218 */ - 0, /* 219 */ + TclpCreateTemporaryDirectory, /* 219 */ 0, /* 220 */ - 0, /* 221 */ - 0, /* 222 */ + TclListTestObj, /* 221 */ + TclListObjValidate, /* 222 */ 0, /* 223 */ TclGetPlatform, /* 224 */ TclTraceDictPath, /* 225 */ @@ -1038,10 +1038,10 @@ static const TclIntStubs tclIntStubs = { TclPtrObjMakeUpvar, /* 255 */ TclPtrUnsetVar, /* 256 */ TclStaticLibrary, /* 257 */ - TclpCreateTemporaryDirectory, /* 258 */ + 0, /* 258 */ 0, /* 259 */ - TclListTestObj, /* 260 */ - TclListObjValidate, /* 261 */ + 0, /* 260 */ + TclUnusedStubEntry, /* 261 */ }; static const TclIntPlatStubs tclIntPlatStubs = { -- cgit v0.12 From 6448870574f9e15b2ee1f55431ad34ec758ddc26 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 4 Oct 2023 19:20:37 +0000 Subject: Fix TclObjInterpProc2 when compiling for Tcl 8.7 --- generic/tclIntDecls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 369830b..5186955 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -1290,6 +1290,8 @@ extern const TclIntStubs *tclIntStubsPtr; #undef TclpGetSeconds #define TclpGetSeconds() \ ((unsigned long)tclIntStubsPtr->tclpGetSeconds()) +#undef TclGetObjInterpProc2 +#define TclGetObjInterpProc2 TclGetObjInterpProc #endif #undef TclUnusedStubEntry -- cgit v0.12 From 0305895d047badbfb753c5303b67728a4ac8c107 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 4 Oct 2023 20:12:13 +0000 Subject: Make TclObjInterpProc() MODULE_SCOPE. Not needed any more in stub table --- generic/tclInt.decls | 4 ---- generic/tclInt.h | 3 +++ generic/tclIntDecls.h | 11 +++-------- generic/tclStubInit.c | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index a79da4d..1e1e11b 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -162,10 +162,6 @@ declare 61 { declare 62 { int TclObjCommandComplete(Tcl_Obj *cmdPtr) } -declare 63 { - int TclObjInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) -} declare 64 { int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags) diff --git a/generic/tclInt.h b/generic/tclInt.h index 5f84621..7720981 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3553,6 +3553,9 @@ MODULE_SCOPE Tcl_Size TclTrimLeft(const char *bytes, Tcl_Size numBytes, MODULE_SCOPE Tcl_Size TclTrimRight(const char *bytes, Tcl_Size numBytes, const char *trim, Tcl_Size numTrim); MODULE_SCOPE const char*TclGetCommandTypeName(Tcl_Command command); +MODULE_SCOPE int TclObjInterpProc(void *clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); MODULE_SCOPE void TclRegisterCommandTypeName( Tcl_ObjCmdProc *implementationProc, const char *nameStr); diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 5186955..dcbf3b6 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -168,10 +168,7 @@ EXTERN int TclNeedSpace(const char *start, const char *end); EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); /* 62 */ EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr); -/* 63 */ -EXTERN int TclObjInterpProc(void *clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); +/* Slot 63 is reserved */ /* 64 */ EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); @@ -653,7 +650,7 @@ typedef struct TclIntStubs { int (*tclNeedSpace) (const char *start, const char *end); /* 60 */ Tcl_Obj * (*tclNewProcBodyObj) (Proc *procPtr); /* 61 */ int (*tclObjCommandComplete) (Tcl_Obj *cmdPtr); /* 62 */ - int (*tclObjInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 63 */ + void (*reserved63)(void); int (*tclObjInvoke) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 64 */ void (*reserved65)(void); void (*reserved66)(void); @@ -962,8 +959,7 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclNewProcBodyObj) /* 61 */ #define TclObjCommandComplete \ (tclIntStubsPtr->tclObjCommandComplete) /* 62 */ -#define TclObjInterpProc \ - (tclIntStubsPtr->tclObjInterpProc) /* 63 */ +/* Slot 63 is reserved */ #define TclObjInvoke \ (tclIntStubsPtr->tclObjInvoke) /* 64 */ /* Slot 65 is reserved */ @@ -1295,7 +1291,6 @@ extern const TclIntStubs *tclIntStubsPtr; #endif #undef TclUnusedStubEntry -#undef TclObjInterpProc #define TclObjInterpProc TclGetObjInterpProc() #define TclObjInterpProc2 TclGetObjInterpProc2() diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index ec15568..30b174e 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -468,7 +468,7 @@ static const TclIntStubs tclIntStubs = { TclNeedSpace, /* 60 */ TclNewProcBodyObj, /* 61 */ TclObjCommandComplete, /* 62 */ - TclObjInterpProc, /* 63 */ + 0, /* 63 */ TclObjInvoke, /* 64 */ 0, /* 65 */ 0, /* 66 */ -- cgit v0.12 From d3bc39b312a859e514b2a851e2fe411b5e434049 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 5 Oct 2023 10:00:41 +0000 Subject: Fix mingw build (broke by prev. commit) --- generic/tclBasic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 8827d17..9d84de2 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -29,7 +29,7 @@ * compatible with AddressSanitizer (ASan) use-after-return detection. */ -#if defined(HAVE_INTRIN_H) +#if defined(_MSC_VER) && defined(HAVE_INTRIN_H) #include /* for _AddressOfReturnAddress() */ #endif @@ -44,10 +44,10 @@ void * TclGetCStackPtr(void) { -#if defined(HAVE_INTRIN_H) - return _AddressOfReturnAddress(); -#elif __GNUC__ || __has_builtin(__builtin_frame_address) +#if __GNUC__ || __has_builtin(__builtin_frame_address) return __builtin_frame_address(0); +#elif defined(_MSC_VER) && defined(HAVE_INTRIN_H) + return _AddressOfReturnAddress(); #else size_t unused = 0; /* -- cgit v0.12 From 071958ae7fb8f972146687e66362d23f4cde7ae5 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Thu, 5 Oct 2023 10:43:42 +0000 Subject: zipfs file write - remove size limit, do not preallocate --- generic/tclZipfs.c | 138 ++++++++++++++++++++++++++++++++++++----------------- tests/zipfs.test | 21 +++++++- 2 files changed, 112 insertions(+), 47 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index cd75e67..41ac732 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -162,7 +162,8 @@ static const z_crc_t* crc32tab; #define ZIP_PASSWORD_END_SIG 0x5a5a4b50 -#define DEFAULT_WRITE_MAX_SIZE (2 * 1024 * 1024) +#define ZIP_MAX_FILE_SIZE INT_MAX +#define DEFAULT_WRITE_MAX_SIZE ZIP_MAX_FILE_SIZE /* * Windows drive letters. @@ -243,19 +244,31 @@ typedef struct ZipEntry { } ZipEntry; /* - * File channel for file contained in mounted ZIP archive. + * File channel for file contained in mounted ZIP archive. + * + * Regarding data buffers: + * For READ-ONLY files that are not encrypted and not compressed (zip STORE + * method), ubuf points directly to the mapped zip file data in memory. No + * additional storage is allocated and so ubufToFree is NULL. + * + * In all other combinations of compression and encryption or if channel is + * writable, storage is allocated for the decrypted and/or uncompressed data + * and a pointer to it is stored in ubufToFree and ubuf. When channel is + * closed, ubufToFree is freed if not NULL. ubuf is irrelevant since it may + * or may not point to allocated storage as above. */ typedef struct ZipChannel { ZipFile *zipFilePtr; /* The ZIP file holding this channel */ ZipEntry *zipEntryPtr; /* Pointer back to virtual file */ - size_t maxWrite; /* Maximum size for write */ - size_t numBytes; /* Number of bytes of uncompressed data */ - size_t cursor; /* Seek position for next read or write*/ + Tcl_Size maxWrite; /* Maximum size for write */ + Tcl_Size numBytes; /* Number of bytes of uncompressed data */ + Tcl_Size cursor; /* Seek position for next read or write*/ unsigned char *ubuf; /* Pointer to the uncompressed data */ unsigned char *ubufToFree; /* NULL if ubuf points to memory that does not need freeing. Else memory to free (ubuf may point *inside* the block) */ + Tcl_Size ubufSize; /* Size of allocated ubufToFree */ int iscompr; /* True if data is compressed */ int isDirectory; /* Set to 1 if directory, or -1 if root */ int isEncrypted; /* True if data is encrypted */ @@ -1735,6 +1748,11 @@ ZipMapArchive( ZIPFS_POSIX_ERROR(interp, "truncated file"); return TCL_ERROR; } + if (zf->length > TCL_SIZE_MAX) { + Tcl_SetErrno(EFBIG); + ZIPFS_POSIX_ERROR(interp, "zip archive too big"); + return TCL_ERROR; + } /* * Map the file. @@ -4355,9 +4373,6 @@ ZipChannelClose( if (ZipChannelWritable(info)) { /* * Copy channel data back into original file in archive. - * TODO - there seems to be no locking here to protect access from - * multiple threads. The channel (info) may be thread specific (?) - * but the ZipEntry is not afaict */ ZipEntry *z = info->zipEntryPtr; assert(info->ubufToFree && info->ubuf); @@ -4371,12 +4386,13 @@ ZipChannelClose( } info->ubufToFree = NULL; /* Now newdata! */ info->ubuf = NULL; + info->ubufSize = 0; /* Replace old content */ if (z->data) { ckfree(z->data); } - z->data = newdata; /* May be NULL */ + z->data = newdata; /* May be NULL when ubufToFree was NULL */ z->numBytes = z->numCompressedBytes = info->numBytes; assert(z->data || z->numBytes == 0); z->compressMethod = ZIP_COMPMETH_STORED; @@ -4393,6 +4409,7 @@ ZipChannelClose( ckfree(info->ubufToFree); info->ubuf = NULL; info->ubufToFree = NULL; + info->ubufSize = 0; } ckfree(info); return TCL_OK; @@ -4422,7 +4439,7 @@ ZipChannelRead( int *errloc) { ZipChannel *info = (ZipChannel *) instanceData; - unsigned long nextpos; + Tcl_Size nextpos; if (info->isDirectory < 0) { /* @@ -4431,7 +4448,7 @@ ZipChannelRead( */ nextpos = info->cursor + toRead; - if (nextpos > info->zipFilePtr->baseOffset) { + if ((size_t)nextpos > info->zipFilePtr->baseOffset) { toRead = info->zipFilePtr->baseOffset - info->cursor; nextpos = info->zipFilePtr->baseOffset; } @@ -4457,7 +4474,11 @@ ZipChannelRead( } if (info->isEncrypted) { int i; - + /* + * TODO - when is this code ever exercised? Cannot reach it from + * tests. In particular, decryption is always done at channel open + * to allow for seeks and random reads. + */ for (i = 0; i < toRead; i++) { int ch = info->ubuf[i + info->cursor]; @@ -4501,19 +4522,48 @@ ZipChannelWrite( *errloc = EINVAL; return -1; } - if (info->mode & O_APPEND) { - info->cursor = info->numBytes; - } + + assert(info->ubuf == info->ubufToFree); + assert(info->ubufToFree && info->ubufSize > 0); + assert(info->ubufSize <= info->maxWrite); + assert(info->numBytes <= info->ubufSize); + assert(info->cursor <= info->numBytes); + if (toWrite == 0) { *errloc = 0; return 0; } - assert(info->maxWrite >= info->cursor); - if (toWrite > (int) (info->maxWrite - info->cursor)) { + + if (info->mode & O_APPEND) { + info->cursor = info->numBytes; + } + + if (toWrite > (info->maxWrite - info->cursor)) { + /* File would grow beyond max size permitted */ /* Don't do partial writes in error case. Or should we? */ *errloc = EFBIG; return -1; } + + if (toWrite > (info->ubufSize - info->cursor)) { + /* grow the buffer. We have already checked will not exceed maxWrite */ + Tcl_Size needed = info->cursor + toWrite; + /* Tack on a bit for future growth. */ + if (needed < (info->maxWrite - needed/2)) { + needed += needed / 2; + } else { + needed = info->maxWrite; + } + unsigned char *newBuf = + (unsigned char *)attemptckrealloc(info->ubufToFree, needed); + if (newBuf == NULL) { + *errloc = ENOMEM; + return -1; + } + info->ubufToFree = newBuf; + info->ubuf = info->ubufToFree; + info->ubufSize = needed; + } nextpos = info->cursor + toWrite; memcpy(info->ubuf + info->cursor, buf, toWrite); info->cursor = nextpos; @@ -4548,7 +4598,7 @@ ZipChannelWideSeek( int *errloc) { ZipChannel *info = (ZipChannel *) instanceData; - size_t end; + Tcl_Size end; if (!ZipChannelWritable(info) && (info->isDirectory < 0)) { /* @@ -4575,23 +4625,23 @@ ZipChannelWideSeek( *errloc = EINVAL; return -1; } - if (offset < 0) { + if (offset < 0 || offset > TCL_SIZE_MAX) { *errloc = EINVAL; return -1; } if (ZipChannelWritable(info)) { - if ((size_t) offset > info->maxWrite) { + if (offset > info->maxWrite) { *errloc = EINVAL; return -1; } - if ((size_t) offset > info->numBytes) { + if (offset > info->numBytes) { info->numBytes = offset; } - } else if ((size_t) offset > end) { + } else if (offset > end) { *errloc = EINVAL; return -1; } - info->cursor = (size_t) offset; + info->cursor = (Tcl_Size) offset; return info->cursor; } @@ -4738,9 +4788,7 @@ ZipChannelOpen( goto error; } - /* - * Do we support opening the file that way? - */ + /* Do we support opening the file that way? */ if (wr && z->isDirectory) { Tcl_SetErrno(EISDIR); @@ -4804,6 +4852,7 @@ ZipChannelOpen( info->numBytes = z->numBytes; info->ubuf = z->data; info->ubufToFree = NULL; /* Not dynamically allocated */ + info->ubufSize = 0; } else { /* * Set up a readable channel. @@ -4829,6 +4878,7 @@ ZipChannelOpen( ZIPFS_ERROR_CODE(interp, "CRC_FAILED"); if (info->ubufToFree) { ckfree(info->ubufToFree); + info->ubufSize = 0; } ckfree(info); goto error; @@ -4887,14 +4937,12 @@ InitWritableChannel( info->mode = mode; info->maxWrite = ZipFS.wrmax; - info->ubufToFree = - (unsigned char *)attemptckalloc(info->maxWrite ? info->maxWrite : 1); + info->ubufSize = z->numBytes ? z->numBytes : 1; + info->ubufToFree = (unsigned char *)attemptckalloc(info->ubufSize); info->ubuf = info->ubufToFree; - if (!info->ubuf) { + if (info->ubufToFree == NULL) { goto memoryError; } - /* TODO - why is the memset necessary? Not cheap for default maxWrite. */ - memset(info->ubuf, 0, info->maxWrite); if (z->isEncrypted) { assert(z->numCompressedBytes >= 12); /* caller should have checked*/ @@ -4916,9 +4964,7 @@ InitWritableChannel( /* * Already got uncompressed data. */ - if (z->numBytes > (int) info->maxWrite) - goto tooBigError; - + assert(info->ubufSize >= z->numBytes); memcpy(info->ubuf, z->data, z->numBytes); info->numBytes = z->numBytes; } else { @@ -4961,7 +5007,7 @@ InitWritableChannel( stream.next_in = zbuf; } stream.next_out = info->ubuf; - stream.avail_out = info->maxWrite; + stream.avail_out = info->ubufSize; if (inflateInit2(&stream, -15) != Z_OK) { goto corruptionError; } @@ -4986,6 +5032,7 @@ InitWritableChannel( (z->numCompressedBytes - 12) != z->numBytes) goto corruptionError; int len = z->numCompressedBytes - 12; + assert(len <= info->ubufSize); for (i = 0; i < len; i++) { ch = zbuf[i]; info->ubuf[i] = zdecode(info->keys, crc32tab, ch); @@ -4996,6 +5043,7 @@ InitWritableChannel( /* * Simple stored data. Copy into our working buffer. */ + assert(info->ubufSize >= z->numBytes); memcpy(info->ubuf, zbuf, z->numBytes); info->numBytes = z->numBytes; } @@ -5005,18 +5053,12 @@ InitWritableChannel( info->cursor = info->numBytes; } - assert(info->numBytes == 0 || (int)info->numBytes == z->numBytes); return TCL_OK; memoryError: ZIPFS_MEM_ERROR(interp); goto error_cleanup; - tooBigError: - Tcl_SetErrno(EFBIG); - ZIPFS_POSIX_ERROR(interp, "file size exceeds max writable"); - goto error_cleanup; - corruptionError: if (cbuf) { memset(info->keys, 0, sizeof(info->keys)); @@ -5030,6 +5072,7 @@ InitWritableChannel( ckfree(info->ubufToFree); info->ubufToFree = NULL; info->ubuf = NULL; + info->ubufSize = 0; } return TCL_ERROR; } @@ -5067,6 +5110,7 @@ InitReadableChannel( info->iscompr = (z->compressMethod == ZIP_COMPMETH_DEFLATED); info->ubuf = z->zipFilePtr->data + z->offset; info->ubufToFree = NULL; /* ubuf memory not allocated */ + info->ubufSize = 0; info->isDirectory = z->isDirectory; info->isEncrypted = z->isEncrypted; info->mode = O_RDONLY; @@ -5089,7 +5133,9 @@ InitReadableChannel( unsigned int j; /* - * Data to decode is compressed, and possibly encrpyted too. + * Data to decode is compressed, and possibly encrpyted too. If + * encrypted, local variable ubuf is used to hold the decrypted but + * still compressed data. */ memset(&stream, 0, sizeof(z_stream)); @@ -5113,8 +5159,9 @@ InitReadableChannel( } else { stream.next_in = info->ubuf; } - info->ubufToFree = (unsigned char *) - attemptckalloc(info->numBytes ? info->numBytes : 1); + + info->ubufSize = info->numBytes ? info->numBytes : 1; + info->ubufToFree = (unsigned char *)attemptckalloc(info->ubufSize); info->ubuf = info->ubufToFree; stream.next_out = info->ubuf; if (!info->ubuf) { @@ -5145,7 +5192,6 @@ InitReadableChannel( memset(info->keys, 0, sizeof(info->keys)); ckfree(ubuf); } - return TCL_OK; } else if (info->isEncrypted) { unsigned int j, len; @@ -5164,6 +5210,7 @@ InitReadableChannel( ch = info->ubuf[j]; ubuf[j] = zdecode(info->keys, crc32tab, ch); } + info->ubufSize = len; info->ubufToFree = ubuf; info->ubuf = info->ubufToFree; ubuf = NULL; /* So it does not inadvertently get free on future changes */ @@ -5188,6 +5235,7 @@ InitReadableChannel( ckfree(info->ubufToFree); info->ubufToFree = NULL; info->ubuf = NULL; + info->ubufSize = 0; } return TCL_ERROR; diff --git a/tests/zipfs.test b/tests/zipfs.test index 17dcc78..ea81825 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1111,17 +1111,34 @@ namespace eval test_ns_zipfs { } -result {file too large} -match glob -returnCodes error test zipfs-write-size-limit-2 "Writes max size" -setup { + set origlimit $::tcl::zipfs::wrmax + set ::tcl::zipfs::wrmax 10000000 mount [zippath test.zip] } -cleanup { + set ::tcl::zipfs::wrmax $origlimit cleanup } -body { set fd [open [file join $defMountPt test] w] puts -nonewline $fd [string repeat x $::tcl::zipfs::wrmax] close $fd file size [file join $defMountPt test] - } -result $::tcl::zipfs::wrmax + } -result 10000000 + + test zipfs-write-size-limit-3 "Writes incrementally - buffer growth" -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set fd [open [file join $defMountPt test] w] + fconfigure $fd -buffering none + for {set i 0} {$i < 100000} {incr i} { + puts -nonewline $fd 0123456789 + } + close $fd + readbin [file join $defMountPt test] + } -result [string repeat 0123456789 100000] - test zipfs-write-size-limit-3 "Writes disallowed" -setup { + test zipfs-write-size-limit-4 "Writes disallowed" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { -- cgit v0.12 From 4b569468795a078b7d5b24e6f7274827c8114b2c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 5 Oct 2023 12:09:24 +0000 Subject: int -> Tcl_Size for 2 internal functions --- generic/tclBasic.c | 2 +- generic/tclInt.decls | 4 ++-- generic/tclIntDecls.h | 8 ++++---- generic/tclProc.c | 13 +++++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 83f6b4e..714bb6f 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6712,7 +6712,7 @@ int TclObjInvoke( Tcl_Interp *interp, /* Interpreter in which command is to be * invoked. */ - int objc, /* Count of arguments. */ + Tcl_Size objc, /* Count of arguments. */ Tcl_Obj *const objv[], /* Argument objects; objv[0] points to the * name of the command to invoke. */ int flags) /* Combination of flags controlling the call: diff --git a/generic/tclInt.decls b/generic/tclInt.decls index a76afbf..f539532 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -163,7 +163,7 @@ declare 62 { int TclObjCommandComplete(Tcl_Obj *cmdPtr) } declare 64 { - int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], + int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags) } declare 69 { @@ -623,7 +623,7 @@ declare 237 { # include NRE.h too. declare 238 { int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) + Tcl_Size objc, Tcl_Obj *const objv[]) } declare 239 { int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 21f4e91..afc429d 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -170,7 +170,7 @@ EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr); /* Slot 63 is reserved */ /* 64 */ -EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc, +EXTERN int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* Slot 65 is reserved */ /* Slot 66 is reserved */ @@ -510,7 +510,7 @@ EXTERN void TclInitVarHashTable(TclVarHashTable *tablePtr, EXTERN int TclResetCancellation(Tcl_Interp *interp, int force); /* 238 */ EXTERN int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); /* 239 */ EXTERN int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, @@ -652,7 +652,7 @@ typedef struct TclIntStubs { Tcl_Obj * (*tclNewProcBodyObj) (Proc *procPtr); /* 61 */ int (*tclObjCommandComplete) (Tcl_Obj *cmdPtr); /* 62 */ void (*reserved63)(void); - int (*tclObjInvoke) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 64 */ + int (*tclObjInvoke) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* 64 */ void (*reserved65)(void); void (*reserved66)(void); void (*reserved67)(void); @@ -826,7 +826,7 @@ typedef struct TclIntStubs { void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */ void (*reserved236)(void); int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */ - int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */ + int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 238 */ int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, ProcErrorProc *errorProc); /* 239 */ int (*tclNRRunCallbacks) (Tcl_Interp *interp, int result, struct NRE_callback *rootPtr); /* 240 */ int (*tclNREvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 241 */ diff --git a/generic/tclProc.c b/generic/tclProc.c index 85e5c6f..ab47eaa 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -51,6 +51,7 @@ static int SetLambdaFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static Tcl_NRPostProc ApplyNR2; static Tcl_NRPostProc InterpProcNR2; static Tcl_NRPostProc Uplevel_Callback; +static Tcl_ObjCmdProc NRInterpProc; /* * The ProcBodyObjType type @@ -208,7 +209,7 @@ Tcl_ProcObjCmd( } cmd = TclNRCreateCommandInNs(interp, simpleName, (Tcl_Namespace *) nsPtr, - TclObjInterpProc, TclNRInterpProc, procPtr, TclProcDeleteProc); + TclObjInterpProc, NRInterpProc, procPtr, TclProcDeleteProc); /* * Now initialize the new procedure's cmdPtr field. This will be used @@ -1610,7 +1611,7 @@ TclObjInterpProc( * Not used much in the core; external interface for iTcl */ - return Tcl_NRCallObjProc(interp, TclNRInterpProc, clientData, objc, objv); + return Tcl_NRCallObjProc(interp, NRInterpProc, clientData, objc, objv); } int @@ -1619,7 +1620,7 @@ TclNRInterpProc( * interpreted. */ Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int objc, /* Count of number of arguments to this + Tcl_Size objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1633,12 +1634,12 @@ TclNRInterpProc( } static int -NRInterpProc2( +NRInterpProc( void *clientData, /* Record describing procedure to be * interpreted. */ Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ - Tcl_Size objc, /* Count of number of arguments to this + int objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1665,7 +1666,7 @@ ObjInterpProc2( * Not used much in the core; external interface for iTcl */ - return Tcl_NRCallObjProc2(interp, NRInterpProc2, clientData, objc, objv); + return Tcl_NRCallObjProc2(interp, TclNRInterpProc, clientData, objc, objv); } -- cgit v0.12 From a301bc01d00d922c1ce15fa37add27a26d7e17b9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Thu, 5 Oct 2023 15:39:05 +0000 Subject: Claim all paths under //zipfs:/ as zipfs paths --- doc/zipfs.n | 4 +-- generic/tclZipfs.c | 98 +++++------------------------------------------------- tests/zipfs.test | 10 ++++-- 3 files changed, 16 insertions(+), 96 deletions(-) diff --git a/doc/zipfs.n b/doc/zipfs.n index 26b45a6..7cb050e 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -141,9 +141,7 @@ on most platforms. \fBzipfs unmount \fImountpoint\fR . Unmounts a previously mounted ZIP archive mounted to \fImountpoint\fR. -If the current directory is located within the mounted archive, -the directory that was previously the current directory is restored -on the unmount. The command will fail with an error exception if +The command will fail with an error exception if there are any files within the mounted archive are open. .SS "ZIP CREATION COMMANDS" This package also provides several commands to aid the creation of ZIP diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index a50c692..78c3cb6 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -5645,9 +5645,9 @@ ZipFSMatchInDirectoryProc( } if (dirOnly) { /* - * Not found in hash. May be a path that is the ancestor of a mount. - * e.g. glob //zipfs:/a/? with mount at //zipfs:/a/b/c. Also have - * to be careful about duplicates, such as when another mount is + * Also check paths that are ancestors of a mount. e.g. glob + * //zipfs:/a/? with mount at //zipfs:/a/b/c. Also have to be + * careful about duplicates, such as when another mount is * //zipfs:/a/b/d */ Tcl_DString ds; @@ -5796,8 +5796,6 @@ ZipFSPathInFilesystemProc( Tcl_Obj *pathPtr, TCL_UNUSED(void **)) { - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; Tcl_Size len; char *path; @@ -5806,93 +5804,13 @@ ZipFSPathInFilesystemProc( return -1; } path = TclGetStringFromObj(pathPtr, &len); + /* - * TODO - why not make ZIPFS_VOLUME both necessary AND sufficient? - * Currently we only claim ownership if there is a matching mount. + * Claim any path under ZIPFS_VOLUME as ours. This is both a necessary + * and sufficient condition as zipfs mounts at arbitrary paths are + * not permitted (unlike Androwish). */ - if (strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) != 0) { - return -1; - } else if (len == ZIPFS_VOLUME_LEN && ZipFS.zipHash.numEntries != 0) { - /* zipfs root and at least one entry */ - return TCL_OK; - } - - int ret = TCL_OK; - - ReadLock(); - hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, path); - if (hPtr) { - goto endloop; - } - - /* - * Not in hash table but still could be owned by zipfs in two other cases: - * Assuming there is a mount point //zipfs:/a/b/c, - * 1. The path is under the mount point, e.g. //zipfs:/a/b/c/f but that - * file does not exist. - * 2. The path is an intermediate directory in a mount point, e.g. - * //zipfs:/a/b - */ - - for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr; - hPtr = Tcl_NextHashEntry(&search)) { - ZipFile *zf = (ZipFile *) Tcl_GetHashValue(hPtr); - - if (zf->mountPointLen == 0) { - /* - * Mounted on the root (/) - * TODO - a holdover from androwish? Tcl does not allow mounting - * outside of the //zipfs:/ area. - */ - ZipEntry *z; - - for (z = zf->topEnts; z != NULL; z = z->tnext) { - if (strncmp(path, z->name, len) == 0) { - int lenz = (int)strlen(z->name); - if (len == lenz) { - /* Would have been in hash table? But nm ... */ - goto endloop; - } else if (len > lenz) { - /* Case 1 above */ - if (path[lenz] == '/') { - goto endloop; - } - } else { /* len < lenz */ - /* Case 2 above */ - if (z->name[len] == '/') { - goto endloop; - } - } - } - - } - } else { - /* Not mounted on root - the norm in Tcl core */ - - /* Lengths are known so check them before strnmp for efficiency*/ - assert(len != ZIPFS_VOLUME_LEN); /* Else already handled at top */ - if (len == zf->mountPointLen) { - /* A non-root or root mount. */ - goto endloop; - } else if (len > zf->mountPointLen) { - /* Case 1 above */ - if (path[zf->mountPointLen] == '/' && - strncmp(path, zf->mountPoint, zf->mountPointLen) == 0) { - goto endloop; - } - } else { /* len < zf->mountPointLen */ - if (zf->mountPoint[len] == '/' && - strncmp(path, zf->mountPoint, len) == 0) { - goto endloop; - } - } - } - } - ret = -1; /* Not our file */ - - endloop: - Unlock(); - return ret; + return strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) ? -1 : TCL_OK; } /* diff --git a/tests/zipfs.test b/tests/zipfs.test index b72e431..6dbf834 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -636,13 +636,17 @@ namespace eval test_ns_zipfs { } -result {filesystem is busy} -returnCodes error test zipfs-unmount-3 "Unmount mount with current directory" -setup { + set cwd [pwd] mount [zippath test.zip] } -cleanup { + cd $cwd cleanup } -body { - set cwd [pwd] - cd [file join $defMountPt testdir] - list [pwd] [zipfs unmount $defMountPt] [string equal [pwd] $cwd] + # Current directory does not change on unmount. + # This is the same behavior as when USB pen drive is unmounted + set cwd2 [file join $defMountPt testdir] + cd $cwd2 + list [pwd] [zipfs unmount $defMountPt] [string equal [pwd] $cwd2] } -result [list [file join $defMountPt testdir] {} 1] test zipfs-unmount-nested-1 "unmount parent of nested mount on new directory should not affect nested mount" -setup { -- cgit v0.12 From 07279b85ab489decd93b6f3bddeec091b8b43869 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Oct 2023 08:29:21 +0000 Subject: Mark (internal) symbols which are going to be removed in 9.0 with "deprecated" --- generic/tclInt.decls | 52 +++++++++++----------- generic/tclIntDecls.h | 119 +++++++++++++++++++++++++++++--------------------- generic/tclProc.c | 8 ++-- 3 files changed, 100 insertions(+), 79 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 218df69..62f7580 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -94,7 +94,7 @@ declare 34 {deprecated {Use Tcl_GetIntForIndex}} { int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr) } -declare 37 { +declare 37 {deprecated {}} { int TclGetLoadedPackages(Tcl_Interp *interp, const char *targetName) } declare 38 { @@ -115,7 +115,7 @@ declare 41 { declare 42 { const char *TclpGetUserHome(const char *name, Tcl_DString *bufferPtr) } -declare 44 { +declare 44 {deprecated {}} { int TclGuessPackageName(const char *fileName, Tcl_DString *bufPtr) } declare 45 { @@ -124,20 +124,20 @@ declare 45 { declare 46 { int TclInExit(void) } -declare 50 { +declare 50 {deprecated {}} { void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr) } declare 51 { int TclInterpInit(Tcl_Interp *interp) } -declare 53 { +declare 53 {deprecated {}} { int TclInvokeObjectCommand(void *clientData, Tcl_Interp *interp, - int argc, const char **argv) + Tcl_Size argc, const char **argv) } -declare 54 { +declare 54 {deprecated {}} { int TclInvokeStringCommand(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) + Tcl_Size objc, Tcl_Obj *const objv[]) } declare 55 { Proc *TclIsProc(Command *cmdPtr) @@ -156,12 +156,12 @@ declare 61 { declare 62 { int TclObjCommandComplete(Tcl_Obj *cmdPtr) } -declare 63 { +declare 63 {deprecated {}} { int TclObjInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) + Tcl_Size objc, Tcl_Obj *const objv[]) } declare 64 { - int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], + int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags) } declare 69 { @@ -211,7 +211,7 @@ declare 97 { declare 98 { int TclServiceIdle(void) } -declare 101 { +declare 101 {deprecated {Use Tcl_SetPreInitScript}} { const char *TclSetPreInitScript(const char *string) } declare 102 { @@ -242,26 +242,26 @@ declare 111 { Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc) } -declare 112 { +declare 112 {deprecated {Use Tcl_AppendExportList}} { int TclAppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr) } -declare 113 { +declare 113 {deprecated {Use Tcl_CreateNamespace}} { Tcl_Namespace *TclCreateNamespace(Tcl_Interp *interp, const char *name, void *clientData, Tcl_NamespaceDeleteProc *deleteProc) } -declare 114 { +declare 114 {deprecated {Use Tcl_DeleteNamespace}} { void TclDeleteNamespace(Tcl_Namespace *nsPtr) } -declare 115 { +declare 115 {deprecated {Use Tcl_Export}} { int TclExport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst) } -declare 116 { +declare 116 {deprecated {Use Tcl_FindCommand}} { Tcl_Command TclFindCommand(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags) } -declare 117 { +declare 117 {deprecated {Use Tcl_FindNamespace}} { Tcl_Namespace *TclFindNamespace(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags) } @@ -277,28 +277,28 @@ declare 120 { Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags) } -declare 121 { +declare 121 {deprecated {Use Tcl_ForgetImport}} { int TclForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern) } -declare 122 { +declare 122 {deprecated {Use Tcl_GetCommandFromObj}} { Tcl_Command TclGetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } -declare 123 { +declare 123 {deprecated {Use Tcl_GetCommandFullName}} { void TclGetCommandFullName(Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr) } -declare 124 { +declare 124 {deprecated {Use Tcl_GetCurrentNamespace}} { Tcl_Namespace *TclGetCurrentNamespace_(Tcl_Interp *interp) } -declare 125 { +declare 125 {deprecated {Use Tcl_GetGlobalNamespace}} { Tcl_Namespace *TclGetGlobalNamespace_(Tcl_Interp *interp) } declare 126 { void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr) } -declare 127 { +declare 127 {deprecated {Use }} { int TclImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite) } @@ -458,10 +458,10 @@ declare 177 { void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason) } -declare 178 { +declare 178 {deprecated {}} { void TclSetStartupScript(Tcl_Obj *pathPtr, const char *encodingName) } -declare 179 { +declare 179 {deprecated {}} { Tcl_Obj *TclGetStartupScript(const char **encodingNamePtr) } declare 182 {deprecated {}} { @@ -608,7 +608,7 @@ declare 237 { # include NRE.h too. declare 238 { int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]) + Tcl_Size objc, Tcl_Obj *const objv[]) } declare 239 { int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index a72f615..3ebe2eb 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -137,7 +137,8 @@ int TclGetIntForIndex(Tcl_Interp *interp, /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* 37 */ -EXTERN int TclGetLoadedPackages(Tcl_Interp *interp, +TCL_DEPRECATED("") +int TclGetLoadedPackages(Tcl_Interp *interp, const char *targetName); /* 38 */ EXTERN int TclGetNamespaceForQualName(Tcl_Interp *interp, @@ -158,7 +159,8 @@ EXTERN const char * TclpGetUserHome(const char *name, Tcl_DString *bufferPtr); /* Slot 43 is reserved */ /* 44 */ -EXTERN int TclGuessPackageName(const char *fileName, +TCL_DEPRECATED("") +int TclGuessPackageName(const char *fileName, Tcl_DString *bufPtr); /* 45 */ EXTERN int TclHideUnsafeCommands(Tcl_Interp *interp); @@ -168,18 +170,21 @@ EXTERN int TclInExit(void); /* Slot 48 is reserved */ /* Slot 49 is reserved */ /* 50 */ -EXTERN void TclInitCompiledLocals(Tcl_Interp *interp, +TCL_DEPRECATED("") +void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 51 */ EXTERN int TclInterpInit(Tcl_Interp *interp); /* Slot 52 is reserved */ /* 53 */ -EXTERN int TclInvokeObjectCommand(void *clientData, - Tcl_Interp *interp, int argc, +TCL_DEPRECATED("") +int TclInvokeObjectCommand(void *clientData, + Tcl_Interp *interp, Tcl_Size argc, const char **argv); /* 54 */ -EXTERN int TclInvokeStringCommand(void *clientData, - Tcl_Interp *interp, int objc, +TCL_DEPRECATED("") +int TclInvokeStringCommand(void *clientData, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 55 */ EXTERN Proc * TclIsProc(Command *cmdPtr); @@ -198,11 +203,12 @@ EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); /* 62 */ EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr); /* 63 */ -EXTERN int TclObjInterpProc(void *clientData, - Tcl_Interp *interp, int objc, +TCL_DEPRECATED("") +int TclObjInterpProc(void *clientData, + Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 64 */ -EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc, +EXTERN int TclObjInvoke(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* Slot 65 is reserved */ /* Slot 66 is reserved */ @@ -265,7 +271,8 @@ EXTERN int TclServiceIdle(void); /* Slot 99 is reserved */ /* Slot 100 is reserved */ /* 101 */ -EXTERN const char * TclSetPreInitScript(const char *string); +TCL_DEPRECATED("Use Tcl_SetPreInitScript") +const char * TclSetPreInitScript(const char *string); /* 102 */ EXTERN void TclSetupEnv(Tcl_Interp *interp); /* 103 */ @@ -290,22 +297,28 @@ EXTERN void Tcl_AddInterpResolvers(Tcl_Interp *interp, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 112 */ -EXTERN int TclAppendExportList(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_AppendExportList") +int TclAppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 113 */ -EXTERN Tcl_Namespace * TclCreateNamespace(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_CreateNamespace") +Tcl_Namespace * TclCreateNamespace(Tcl_Interp *interp, const char *name, void *clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 114 */ -EXTERN void TclDeleteNamespace(Tcl_Namespace *nsPtr); +TCL_DEPRECATED("Use Tcl_DeleteNamespace") +void TclDeleteNamespace(Tcl_Namespace *nsPtr); /* 115 */ -EXTERN int TclExport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +TCL_DEPRECATED("Use Tcl_Export") +int TclExport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 116 */ -EXTERN Tcl_Command TclFindCommand(Tcl_Interp *interp, const char *name, +TCL_DEPRECATED("Use Tcl_FindCommand") +Tcl_Command TclFindCommand(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */ -EXTERN Tcl_Namespace * TclFindNamespace(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_FindNamespace") +Tcl_Namespace * TclFindNamespace(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 118 */ @@ -320,23 +333,29 @@ EXTERN Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 121 */ -EXTERN int TclForgetImport(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_ForgetImport") +int TclForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 122 */ -EXTERN Tcl_Command TclGetCommandFromObj(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_GetCommandFromObj") +Tcl_Command TclGetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 123 */ -EXTERN void TclGetCommandFullName(Tcl_Interp *interp, +TCL_DEPRECATED("Use Tcl_GetCommandFullName") +void TclGetCommandFullName(Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 124 */ -EXTERN Tcl_Namespace * TclGetCurrentNamespace_(Tcl_Interp *interp); +TCL_DEPRECATED("Use Tcl_GetCurrentNamespace") +Tcl_Namespace * TclGetCurrentNamespace_(Tcl_Interp *interp); /* 125 */ -EXTERN Tcl_Namespace * TclGetGlobalNamespace_(Tcl_Interp *interp); +TCL_DEPRECATED("Use Tcl_GetGlobalNamespace") +Tcl_Namespace * TclGetGlobalNamespace_(Tcl_Interp *interp); /* 126 */ EXTERN void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr); /* 127 */ -EXTERN int TclImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +TCL_DEPRECATED("Use ") +int TclImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 128 */ EXTERN void Tcl_PopCallFrame(Tcl_Interp *interp); @@ -467,10 +486,12 @@ EXTERN void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason); /* 178 */ -EXTERN void TclSetStartupScript(Tcl_Obj *pathPtr, +TCL_DEPRECATED("") +void TclSetStartupScript(Tcl_Obj *pathPtr, const char *encodingName); /* 179 */ -EXTERN Tcl_Obj * TclGetStartupScript(const char **encodingNamePtr); +TCL_DEPRECATED("") +Tcl_Obj * TclGetStartupScript(const char **encodingNamePtr); /* Slot 180 is reserved */ /* Slot 181 is reserved */ /* 182 */ @@ -595,7 +616,7 @@ void TclBackgroundException(Tcl_Interp *interp, int code); EXTERN int TclResetCancellation(Tcl_Interp *interp, int force); /* 238 */ EXTERN int TclNRInterpProc(void *clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); /* 239 */ EXTERN int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, @@ -710,24 +731,24 @@ typedef struct TclIntStubs { TCL_DEPRECATED_API("Use Tcl_GetIntForIndex") int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 34 */ void (*reserved35)(void); void (*reserved36)(void); - int (*tclGetLoadedPackages) (Tcl_Interp *interp, const char *targetName); /* 37 */ + TCL_DEPRECATED_API("") int (*tclGetLoadedPackages) (Tcl_Interp *interp, const char *targetName); /* 37 */ int (*tclGetNamespaceForQualName) (Tcl_Interp *interp, const char *qualName, Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr, Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr, const char **simpleNamePtr); /* 38 */ Tcl_ObjCmdProc * (*tclGetObjInterpProc) (void); /* 39 */ int (*tclGetOpenMode) (Tcl_Interp *interp, const char *str, int *seekFlagPtr); /* 40 */ Tcl_Command (*tclGetOriginalCommand) (Tcl_Command command); /* 41 */ const char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */ void (*reserved43)(void); - int (*tclGuessPackageName) (const char *fileName, Tcl_DString *bufPtr); /* 44 */ + TCL_DEPRECATED_API("") int (*tclGuessPackageName) (const char *fileName, Tcl_DString *bufPtr); /* 44 */ int (*tclHideUnsafeCommands) (Tcl_Interp *interp); /* 45 */ int (*tclInExit) (void); /* 46 */ void (*reserved47)(void); void (*reserved48)(void); void (*reserved49)(void); - void (*tclInitCompiledLocals) (Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 50 */ + TCL_DEPRECATED_API("") void (*tclInitCompiledLocals) (Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 50 */ int (*tclInterpInit) (Tcl_Interp *interp); /* 51 */ void (*reserved52)(void); - int (*tclInvokeObjectCommand) (void *clientData, Tcl_Interp *interp, int argc, const char **argv); /* 53 */ - int (*tclInvokeStringCommand) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 54 */ + TCL_DEPRECATED_API("") int (*tclInvokeObjectCommand) (void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char **argv); /* 53 */ + TCL_DEPRECATED_API("") int (*tclInvokeStringCommand) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 54 */ Proc * (*tclIsProc) (Command *cmdPtr); /* 55 */ void (*reserved56)(void); void (*reserved57)(void); @@ -736,8 +757,8 @@ typedef struct TclIntStubs { int (*tclNeedSpace) (const char *start, const char *end); /* 60 */ Tcl_Obj * (*tclNewProcBodyObj) (Proc *procPtr); /* 61 */ int (*tclObjCommandComplete) (Tcl_Obj *cmdPtr); /* 62 */ - int (*tclObjInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 63 */ - int (*tclObjInvoke) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 64 */ + TCL_DEPRECATED_API("") int (*tclObjInterpProc) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 63 */ + int (*tclObjInvoke) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* 64 */ void (*reserved65)(void); void (*reserved66)(void); void (*reserved67)(void); @@ -774,7 +795,7 @@ typedef struct TclIntStubs { int (*tclServiceIdle) (void); /* 98 */ void (*reserved99)(void); void (*reserved100)(void); - const char * (*tclSetPreInitScript) (const char *string); /* 101 */ + TCL_DEPRECATED_API("Use Tcl_SetPreInitScript") const char * (*tclSetPreInitScript) (const char *string); /* 101 */ void (*tclSetupEnv) (Tcl_Interp *interp); /* 102 */ int (*tclSockGetPort) (Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); /* 103 */ TCL_DEPRECATED_API("") int (*tclSockMinimumBuffersOld) (int sock, int size); /* 104 */ @@ -785,22 +806,22 @@ typedef struct TclIntStubs { int (*tclUpdateReturnInfo) (Interp *iPtr); /* 109 */ int (*tclSockMinimumBuffers) (void *sock, Tcl_Size size); /* 110 */ void (*tcl_AddInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 111 */ - int (*tclAppendExportList) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 112 */ - Tcl_Namespace * (*tclCreateNamespace) (Tcl_Interp *interp, const char *name, void *clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 113 */ - void (*tclDeleteNamespace) (Tcl_Namespace *nsPtr); /* 114 */ - int (*tclExport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 115 */ - Tcl_Command (*tclFindCommand) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 116 */ - Tcl_Namespace * (*tclFindNamespace) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */ + TCL_DEPRECATED_API("Use Tcl_AppendExportList") int (*tclAppendExportList) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 112 */ + TCL_DEPRECATED_API("Use Tcl_CreateNamespace") Tcl_Namespace * (*tclCreateNamespace) (Tcl_Interp *interp, const char *name, void *clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 113 */ + TCL_DEPRECATED_API("Use Tcl_DeleteNamespace") void (*tclDeleteNamespace) (Tcl_Namespace *nsPtr); /* 114 */ + TCL_DEPRECATED_API("Use Tcl_Export") int (*tclExport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 115 */ + TCL_DEPRECATED_API("Use Tcl_FindCommand") Tcl_Command (*tclFindCommand) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 116 */ + TCL_DEPRECATED_API("Use Tcl_FindNamespace") Tcl_Namespace * (*tclFindNamespace) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */ int (*tcl_GetInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolverInfo *resInfo); /* 118 */ int (*tcl_GetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolverInfo *resInfo); /* 119 */ Tcl_Var (*tcl_FindNamespaceVar) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 120 */ - int (*tclForgetImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 121 */ - Tcl_Command (*tclGetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 122 */ - void (*tclGetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 123 */ - Tcl_Namespace * (*tclGetCurrentNamespace_) (Tcl_Interp *interp); /* 124 */ - Tcl_Namespace * (*tclGetGlobalNamespace_) (Tcl_Interp *interp); /* 125 */ + TCL_DEPRECATED_API("Use Tcl_ForgetImport") int (*tclForgetImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 121 */ + TCL_DEPRECATED_API("Use Tcl_GetCommandFromObj") Tcl_Command (*tclGetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 122 */ + TCL_DEPRECATED_API("Use Tcl_GetCommandFullName") void (*tclGetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 123 */ + TCL_DEPRECATED_API("Use Tcl_GetCurrentNamespace") Tcl_Namespace * (*tclGetCurrentNamespace_) (Tcl_Interp *interp); /* 124 */ + TCL_DEPRECATED_API("Use Tcl_GetGlobalNamespace") Tcl_Namespace * (*tclGetGlobalNamespace_) (Tcl_Interp *interp); /* 125 */ void (*tcl_GetVariableFullName) (Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr); /* 126 */ - int (*tclImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 127 */ + TCL_DEPRECATED_API("Use ") int (*tclImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 127 */ void (*tcl_PopCallFrame) (Tcl_Interp *interp); /* 128 */ int (*tcl_PushCallFrame) (Tcl_Interp *interp, Tcl_CallFrame *framePtr, Tcl_Namespace *nsPtr, int isProcCallFrame); /* 129 */ int (*tcl_RemoveInterpResolvers) (Tcl_Interp *interp, const char *name); /* 130 */ @@ -851,8 +872,8 @@ typedef struct TclIntStubs { int (*tclCallVarTraces) (Interp *iPtr, Var *arrayPtr, Var *varPtr, const char *part1, const char *part2, int flags, int leaveErrMsg); /* 175 */ void (*tclCleanupVar) (Var *varPtr, Var *arrayPtr); /* 176 */ void (*tclVarErrMsg) (Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason); /* 177 */ - void (*tclSetStartupScript) (Tcl_Obj *pathPtr, const char *encodingName); /* 178 */ - Tcl_Obj * (*tclGetStartupScript) (const char **encodingNamePtr); /* 179 */ + TCL_DEPRECATED_API("") void (*tclSetStartupScript) (Tcl_Obj *pathPtr, const char *encodingName); /* 178 */ + TCL_DEPRECATED_API("") Tcl_Obj * (*tclGetStartupScript) (const char **encodingNamePtr); /* 179 */ void (*reserved180)(void); void (*reserved181)(void); TCL_DEPRECATED_API("") struct tm * (*tclpLocaltime) (const time_t *clock); /* 182 */ @@ -911,7 +932,7 @@ typedef struct TclIntStubs { void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */ TCL_DEPRECATED_API("use Tcl_BackgroundException") void (*tclBackgroundException) (Tcl_Interp *interp, int code); /* 236 */ int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */ - int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */ + int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 238 */ int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, ProcErrorProc *errorProc); /* 239 */ int (*tclNRRunCallbacks) (Tcl_Interp *interp, int result, struct NRE_callback *rootPtr); /* 240 */ int (*tclNREvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 241 */ diff --git a/generic/tclProc.c b/generic/tclProc.c index 4bf1593..95523a8 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -266,7 +266,7 @@ Tcl_ProcObjCmd( cfPtr->level = -1; cfPtr->type = contextPtr->type; - cfPtr->line = (int *)ckalloc(sizeof(int)); + cfPtr->line = (Tcl_Size *)ckalloc(sizeof(Tcl_Size)); cfPtr->line[0] = contextPtr->line[3]; cfPtr->nline = 1; cfPtr->framePtr = NULL; @@ -1671,7 +1671,7 @@ TclNRInterpProc( * interpreted. */ Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int objc, /* Count of number of arguments to this + Tcl_Size objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -2556,7 +2556,7 @@ SetLambdaFromAny( if (contextPtr->line && (contextPtr->nline >= 2) && (contextPtr->line[1] >= 0)) { - int buf[2]; + Tcl_Size buf[2]; /* * Move from approximation (line of list cmd word) to actual @@ -2568,7 +2568,7 @@ SetLambdaFromAny( cfPtr->level = -1; cfPtr->type = contextPtr->type; - cfPtr->line = (int *)ckalloc(sizeof(int)); + cfPtr->line = (Tcl_Size *)ckalloc(sizeof(Tcl_Size)); cfPtr->line[0] = buf[1]; cfPtr->nline = 1; cfPtr->framePtr = NULL; -- cgit v0.12 From 78ce902c188a9283191521f9e72d423b2a4fb090 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Oct 2023 09:40:23 +0000 Subject: Even better: Remove TclInvokeObjectCommand completely: it isn't supposed to be called by anyone --- generic/tclBasic.c | 74 +++--------------------------------------------------- 1 file changed, 4 insertions(+), 70 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index f46c2bf..1c1556f 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -213,7 +213,6 @@ static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected, static Tcl_NRPostProc NRCoroutineCallerCallback; static Tcl_NRPostProc NRCoroutineExitCallback; static Tcl_NRPostProc NRCommand; -static Tcl_CmdProc InvokeObjectCommand; static void ProcessUnexpectedResult(Tcl_Interp *interp, int returnCode); @@ -1072,8 +1071,8 @@ Tcl_CreateInterp(void) * but no Tcl_ObjCmdProc, set the Tcl_ObjCmdProc to * InvokeStringCommand. This is an object-based wrapper function that * extracts strings, calls the string function, and creates an object for - * the result. Similarly, if a command has a Tcl_ObjCmdProc but no - * Tcl_CmdProc, set the Tcl_CmdProc to InvokeObjectCommand. + * the result. If a command has a Tcl_ObjCmdProc but no + * Tcl_CmdProc, set the Tcl_CmdProc to NULL. */ for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) { @@ -1092,7 +1091,7 @@ Tcl_CreateInterp(void) cmdPtr->refCount = 1; cmdPtr->cmdEpoch = 0; cmdPtr->compileProc = cmdInfoPtr->compileProc; - cmdPtr->proc = InvokeObjectCommand; + cmdPtr->proc = NULL; cmdPtr->clientData = cmdPtr; cmdPtr->objProc = cmdInfoPtr->objProc; cmdPtr->objClientData = NULL; @@ -2912,7 +2911,7 @@ TclCreateObjCommandInNs( cmdPtr->compileProc = NULL; cmdPtr->objProc = proc; cmdPtr->objClientData = clientData; - cmdPtr->proc = InvokeObjectCommand; + cmdPtr->proc = NULL; cmdPtr->clientData = cmdPtr; cmdPtr->deleteProc = deleteProc; cmdPtr->deleteData = clientData; @@ -3001,71 +3000,6 @@ InvokeStringCommand( /* *---------------------------------------------------------------------- * - * InvokeObjectCommand -- - * - * "Wrapper" Tcl_CmdProc used to call an existing object-based - * Tcl_ObjCmdProc if no string-based function exists for a command. A - * pointer to this function is stored as the Tcl_CmdProc in a Command - * structure. It simply turns around and calls the object Tcl_ObjCmdProc - * in the Command structure. - * - * Results: - * A standard Tcl result value. - * - * Side effects: - * Besides those side effects of the called Tcl_ObjCmdProc, - * InvokeObjectCommand allocates and frees storage. - * - *---------------------------------------------------------------------- - */ - -int -InvokeObjectCommand( - void *clientData, /* Points to command's Command structure. */ - Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ - const char **argv) /* Argument strings. */ -{ - Command *cmdPtr = ( Command *) clientData; - Tcl_Obj *objPtr; - int i, length, result; - Tcl_Obj **objv = (Tcl_Obj **) - TclStackAlloc(interp, (argc * sizeof(Tcl_Obj *))); - - for (i = 0; i < argc; i++) { - length = strlen(argv[i]); - TclNewStringObj(objPtr, argv[i], length); - Tcl_IncrRefCount(objPtr); - objv[i] = objPtr; - } - - /* - * Invoke the command's object-based Tcl_ObjCmdProc. - */ - - if (cmdPtr->objProc != NULL) { - result = cmdPtr->objProc(cmdPtr->objClientData, interp, argc, objv); - } else { - result = Tcl_NRCallObjProc(interp, cmdPtr->nreProc, - cmdPtr->objClientData, argc, objv); - } - - /* - * Decrement the ref counts for the argument objects created above, then - * free the objv array if malloc'ed storage was used. - */ - - for (i = 0; i < argc; i++) { - objPtr = objv[i]; - Tcl_DecrRefCount(objPtr); - } - TclStackFree(interp, objv); - return result; -} - -/* - *---------------------------------------------------------------------- - * * TclRenameCommand -- * * Called to give an existing Tcl command a different name. Both the old -- cgit v0.12 From 1366e9444caa38d97e21abfcb7e87f69923a4e94 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 8 Oct 2023 13:44:54 +0000 Subject: Start on fixing Unix testing of zipfs configs --- unix/Makefile.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unix/Makefile.in b/unix/Makefile.in index f21c4af..c52f622 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -878,9 +878,14 @@ topDirName: # tcltest executable gets the build directory burned into its ld search path. # This keeps tcltest from picking up an already installed version of the Tcl # library. +ifeq ($(ZIPFS_BUILD), 0) SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ TCLLIBPATH="@abs_builddir@/pkgs" \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}" +else +SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ + TCLLIBPATH="@abs_builddir@/pkgs" +endif ${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} $(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`" -- cgit v0.12 From dbc1062eae4fff52787fd004adf4a788c84d1b76 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 8 Oct 2023 16:32:07 +0000 Subject: Rework to use configure as prior solution presumed Gnu make --- unix/Makefile.in | 18 +- unix/configure | 6420 ++++++++++++++++++++++++----------------------------- unix/configure.ac | 8 +- 3 files changed, 2874 insertions(+), 3572 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index c52f622..29a28eb 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -235,7 +235,7 @@ PKGS_DIR = $(TOP_DIR)/pkgs # Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below. DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest # Must be absolute to so the corresponding tcltest's tcl_library is absolute. -TCL_BUILDTIME_LIBRARY = @TCL_SRC_DIR@/library +TCL_BUILDTIME_LIBRARY = @TCL_BUILDTIME_LIBRARY@ ZLIB_DIR = ${COMPAT_DIR}/zlib ZLIB_INCLUDE = @ZLIB_INCLUDE@ @@ -878,22 +878,26 @@ topDirName: # tcltest executable gets the build directory burned into its ld search path. # This keeps tcltest from picking up an already installed version of the Tcl # library. -ifeq ($(ZIPFS_BUILD), 0) SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ TCLLIBPATH="@abs_builddir@/pkgs" \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}" -else -SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ - TCLLIBPATH="@abs_builddir@/pkgs" -endif -${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} +${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} ${TCL_ZIP_FILE} $(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`" tcltest-real: ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} \ @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ ${CC_SEARCH_FLAGS} -o ${TCLTEST_EXE} + @if test "${ZIPFS_BUILD}" = "2" ; then \ + if test "x$(MACHER)" = "x" ; then \ + cat ${TCL_ZIP_FILE} >> ${TCLTEST_EXE}; \ + else $(MACHER) append ${TCLTEST_EXE} ${TCL_ZIP_FILE} /tmp/macher_output; \ + mv /tmp/macher_output ${TCLTEST_EXE}; chmod u+x ${TCLTEST_EXE}; \ + fi; \ + ${NATIVE_ZIP} -A ${TCLTEST_EXE} \ + || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ + fi # Note, in the targets below TCL_LIBRARY needs to be set or else "make test" # won't work in the case where the compilation directory isn't the same as the diff --git a/unix/configure b/unix/configure index eb63649..42148a6 100755 --- a/unix/configure +++ b/unix/configure @@ -1,10 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for tcl 8.7. +# Generated by GNU Autoconf 2.69 for tcl 8.7. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, -# Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -15,16 +14,14 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -34,46 +31,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -82,6 +79,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -90,12 +94,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -107,10 +107,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -132,22 +152,20 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop +else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -167,53 +185,42 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -else \$as_nop +else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : + if (eval "$as_required") 2>/dev/null; then : as_have_required=yes -else $as_nop +else as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -else $as_nop +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base + as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi @@ -221,21 +228,14 @@ fi esac as_found=false done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi +fi; } +IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x -then : + if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -253,19 +253,18 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -292,7 +291,6 @@ as_fn_unset () } as_unset=as_fn_unset - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -310,14 +308,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -332,7 +322,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -341,7 +331,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -380,13 +370,12 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -398,27 +387,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -430,9 +410,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -459,7 +439,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -503,7 +483,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -517,10 +497,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -534,13 +510,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -615,36 +584,41 @@ PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include #endif -#ifdef HAVE_STDLIB_H +#ifdef STDC_HEADERS # include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif #endif #ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_c_list= +ac_header_list= ac_subst_vars='DLTEST_SUFFIX DLTEST_LD EXTRA_TCLSH_LIBS @@ -691,6 +665,7 @@ TCL_PATCH_LEVEL TCL_MINOR_VERSION TCL_MAJOR_VERSION TCL_VERSION +TCL_BUILDTIME_LIBRARY INSTALL_MSGS INSTALL_LIBRARIES TCL_ZIP_FILE @@ -894,6 +869,8 @@ do *) ac_optarg=yes ;; esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -934,9 +911,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -960,9 +937,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1173,9 +1150,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1189,9 +1166,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1235,9 +1212,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1253,7 +1230,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1317,7 +1294,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1505,9 +1482,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1535,8 +1512,7 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. + # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1544,7 +1520,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1554,9 +1530,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tcl configure 8.7 -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.69 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1573,14 +1549,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam + rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1588,15 +1564,14 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext -then : + } && test -s conftest.$ac_objext; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1606,39 +1581,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1651,7 +1593,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1659,15 +1601,14 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } -then : + }; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1677,20 +1618,180 @@ fi } # ac_fn_c_try_cpp +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1698,18 +1799,17 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - } -then : + }; then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1730,12 +1830,11 @@ fi ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1743,9 +1842,16 @@ else $as_nop #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1763,51 +1869,47 @@ choke me #endif int -main (void) +main () { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" -else $as_nop +else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () +# accordingly. +ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { #ifndef $as_decl_name #ifdef __cplusplus @@ -1821,22 +1923,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" -else $as_nop +else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_check_decl +} # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- @@ -1845,18 +1944,17 @@ printf "%s\n" "$ac_res" >&6; } ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { if (sizeof ($2)) return 0; @@ -1864,13 +1962,12 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main (void) +main () { if (sizeof (($2))) return 0; @@ -1878,66 +1975,22 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -else $as_nop +else eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that -# executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -1945,17 +1998,16 @@ fi ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -printf %s "checking for $2.$3... " >&6; } -if eval test \${$4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main (void) +main () { static $2 ac_aggr; if (ac_aggr.$3) @@ -1964,15 +2016,14 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main (void) +main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -1981,50 +2032,29 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" -else $as_nop +else eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tcl $as_me 8.7, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was - $ $0$ac_configure_args_raw + $ $0 $@ _ACEOF exec 5>>config.log @@ -2057,12 +2087,8 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -2097,7 +2123,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2132,13 +2158,11 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - printf "%s\n" "## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2149,8 +2173,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2174,7 +2198,7 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ) echo - printf "%s\n" "## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2182,14 +2206,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2197,15 +2221,15 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - printf "%s\n" "## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2213,8 +2237,8 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} echo fi test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2228,48 +2252,63 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -printf "%s\n" "/* confdefs.h */" > confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi - -for ac_site_file in $ac_site_files +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2279,337 +2318,20 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_list " sys/time.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2620,12 +2342,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2634,24 +2356,24 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2661,12 +2383,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' - and start over" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2733,63 +2454,60 @@ TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 -printf %s "checking whether to use symlinks for manpages... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 +$as_echo_n "checking whether to use symlinks for manpages... " >&6; } # Check whether --enable-man-symlinks was given. -if test ${enable_man_symlinks+y} -then : +if test "${enable_man_symlinks+set}" = set; then : enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" -else $as_nop +else enableval="no" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -printf "%s\n" "$enableval" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 -printf %s "checking whether to compress the manpages... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 +$as_echo_n "checking whether to compress the manpages... " >&6; } # Check whether --enable-man-compression was given. -if test ${enable_man_compression+y} -then : +if test "${enable_man_compression+set}" = set; then : enableval=$enable_man_compression; case $enableval in yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac -else $as_nop +else enableval="no" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -printf "%s\n" "$enableval" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } if test "$enableval" != "no"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 -printf %s "checking for compressed file suffix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 +$as_echo_n "checking for compressed file suffix... " >&6; } touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 -printf "%s\n" "$Z" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 +$as_echo "$Z" >&6; } fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 -printf %s "checking whether to add a package name suffix for the manpages... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 +$as_echo_n "checking whether to add a package name suffix for the manpages... " >&6; } # Check whether --enable-man-suffix was given. -if test ${enable_man_suffix+y} -then : +if test "${enable_man_suffix+set}" = set; then : enableval=$enable_man_suffix; case $enableval in yes) enableval="tcl" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac -else $as_nop +else enableval="no" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -printf "%s\n" "$enableval" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } @@ -2804,15 +2522,6 @@ if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi - - - - - - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2821,12 +2530,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2834,15 +2542,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2853,11 +2557,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2866,12 +2570,11 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2879,15 +2582,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2898,11 +2597,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2910,8 +2609,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2924,12 +2623,11 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2937,15 +2635,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2956,11 +2650,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2969,12 +2663,11 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2983,19 +2676,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3011,18 +2700,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3033,12 +2722,11 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3046,15 +2734,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3065,11 +2749,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3082,12 +2766,11 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3095,15 +2778,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3114,11 +2793,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3130,8 +2809,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3139,129 +2818,25 @@ esac fi fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do +for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3271,7 +2846,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3279,7 +2854,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -3291,9 +2866,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3314,12 +2889,11 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3336,7 +2910,7 @@ do # certainly right. break;; *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3352,46 +2926,44 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop +else ac_file='' fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3405,15 +2977,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3422,7 +2994,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3434,8 +3006,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3443,10 +3015,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3454,40 +3026,39 @@ printf "%s\n" "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; @@ -3501,12 +3072,11 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3515,32 +3085,31 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { #ifndef __GNUC__ choke me @@ -3550,33 +3119,29 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes -else $as_nop +else ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+y} +ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3585,60 +3150,57 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else $as_nop +else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : -else $as_nop +else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3653,144 +3215,94 @@ else CFLAGS= fi fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext conftest.beam +rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC -fi -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + fi ac_ext=c @@ -3800,34 +3312,32 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -printf %s "checking for inline... " >&6; } -if test ${ac_cv_c_inline+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo (void) {return 0; } -$ac_kw foo_t foo (void) {return 0; } +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -printf "%s\n" "$ac_cv_c_inline" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -3855,70 +3365,45 @@ esac # Do this early, otherwise an autoconf bug throws errors on configure #-------------------------------------------------------------------- -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : -else $as_nop +else # Broken: fails on valid input. continue fi @@ -3930,11 +3415,10 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue -else $as_nop +else # Passes both tests. ac_preproc_ok=: break @@ -3944,8 +3428,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : +if $ac_preproc_ok; then : break fi @@ -3957,24 +3440,29 @@ fi else ac_cv_prog_CPP=$CPP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : -else $as_nop +else # Broken: fails on valid input. continue fi @@ -3986,11 +3474,10 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue -else $as_nop +else # Passes both tests. ac_preproc_ok=: break @@ -4000,12 +3487,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : +if $ac_preproc_ok; then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -4017,12 +3503,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4030,15 +3515,10 @@ else $as_nop for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4047,13 +3527,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - printf %s 0123456789 >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4081,17 +3561,16 @@ else fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -4102,15 +3581,10 @@ else $as_nop for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -4119,13 +3593,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - printf %s 0123456789 >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4154,33 +3628,161 @@ fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include - ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = xyes -then : +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes; then : tcl_ok=1 -else $as_nop +else tcl_ok=0 fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1 -then : + $EGREP "strstr" >/dev/null 2>&1; then : -else $as_nop +else tcl_ok=0 fi -rm -rf conftest* +rm -f conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4188,13 +3790,12 @@ rm -rf conftest* _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1 -then : + $EGREP "strerror" >/dev/null 2>&1; then : -else $as_nop +else tcl_ok=0 fi -rm -rf conftest* +rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be @@ -4202,39 +3803,44 @@ rm -rf conftest* if test $tcl_ok = 0; then -printf "%s\n" "#define NO_STRING_H 1" >>confdefs.h +$as_echo "#define NO_STRING_H 1" >>confdefs.h fi - ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_wait_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_SYS_WAIT_H 1" >>confdefs.h +$as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h fi - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = xyes -then : -else $as_nop + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + +else -printf "%s\n" "#define NO_DLFCN_H 1" >>confdefs.h +$as_echo "#define NO_DLFCN_H 1" >>confdefs.h fi + # OS/390 lacks sys/param.h (and doesn't need it, by chance). - ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + for ac_header in sys/param.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PARAM_H 1 +_ACEOF fi +done + #-------------------------------------------------------------------- @@ -4249,36 +3855,34 @@ fi #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 -printf %s "checking if the compiler understands -pipe... " >&6; } -if test ${tcl_cv_cc_pipe+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 +$as_echo_n "checking if the compiler understands -pipe... " >&6; } +if ${tcl_cv_cc_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_pipe=yes -else $as_nop +else tcl_cv_cc_pipe=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 -printf "%s\n" "$tcl_cv_cc_pipe" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 +$as_echo "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi @@ -4291,19 +3895,20 @@ fi # Check whether --with-encoding was given. -if test ${with_encoding+y} -then : +if test "${with_encoding+set}" = set; then : withval=$with_encoding; with_tcencoding=${withval} fi if test x"${with_tcencoding}" != x ; then -printf "%s\n" "#define TCL_CFGVAL_ENCODING \"${with_tcencoding}\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define TCL_CFGVAL_ENCODING "${with_tcencoding}" +_ACEOF else -printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h +$as_echo "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi @@ -4312,86 +3917,6 @@ printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h # Look for libraries that we will need when compiling the Tcl shell #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac - #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is @@ -4399,10 +3924,9 @@ esac #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" -if test "x$ac_cv_func_sin" = xyes -then : +if test "x$ac_cv_func_sin" = xyes; then : MATH_LIBS="" -else $as_nop +else MATH_LIBS="-lm" fi @@ -4412,12 +3936,11 @@ fi # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 -printf %s "checking for main in -linet... " >&6; } -if test ${ac_cv_lib_inet_main+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 +$as_echo_n "checking for main in -linet... " >&6; } +if ${ac_cv_lib_inet_main+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4425,40 +3948,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int -main (void) +main () { return main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_main=yes -else $as_nop +else ac_cv_lib_inet_main=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 -printf "%s\n" "$ac_cv_lib_inet_main" >&6; } -if test "x$ac_cv_lib_inet_main" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 +$as_echo "$ac_cv_lib_inet_main" >&6; } +if test "x$ac_cv_lib_inet_main" = xyes; then : LIBS="$LIBS -linet" fi - ac_fn_c_check_header_compile "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_net_errno_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_net_errno_h" = xyes; then : -printf "%s\n" "#define HAVE_NET_ERRNO_H 1" >>confdefs.h +$as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h fi + #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right @@ -4479,25 +4000,22 @@ fi tcl_checkBoth=0 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = xyes -then : +if test "x$ac_cv_func_connect" = xyes; then : tcl_checkSocket=0 -else $as_nop +else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" -if test "x$ac_cv_func_setsockopt" = xyes -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 -printf %s "checking for setsockopt in -lsocket... " >&6; } -if test ${ac_cv_lib_socket_setsockopt+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_setsockopt" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } +if ${ac_cv_lib_socket_setsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4506,31 +4024,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char setsockopt (); int -main (void) +main () { return setsockopt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_setsockopt=yes -else $as_nop +else ac_cv_lib_socket_setsockopt=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 -printf "%s\n" "$ac_cv_lib_socket_setsockopt" >&6; } -if test "x$ac_cv_lib_socket_setsockopt" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : LIBS="$LIBS -lsocket" -else $as_nop +else tcl_checkBoth=1 fi @@ -4541,25 +4060,22 @@ fi tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" -if test "x$ac_cv_func_accept" = xyes -then : +if test "x$ac_cv_func_accept" = xyes; then : tcl_checkNsl=0 -else $as_nop +else LIBS=$tk_oldLibs fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes -then : - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -printf %s "checking for gethostbyname in -lnsl... " >&6; } -if test ${ac_cv_lib_nsl_gethostbyname+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4568,29 +4084,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char gethostbyname (); int -main (void) +main () { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes -else $as_nop +else ac_cv_lib_nsl_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : LIBS="$LIBS -lnsl" fi @@ -4598,17 +4115,16 @@ fi -printf "%s\n" "#define _REENTRANT 1" >>confdefs.h +$as_echo "#define _REENTRANT 1" >>confdefs.h -printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 -printf %s "checking for pthread_mutex_init in -lpthread... " >&6; } -if test ${ac_cv_lib_pthread_pthread_mutex_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4617,31 +4133,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_mutex_init (); int -main (void) +main () { return pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes -else $as_nop +else ac_cv_lib_pthread_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi @@ -4651,12 +4168,11 @@ fi # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 -printf %s "checking for __pthread_mutex_init in -lpthread... " >&6; } -if test ${ac_cv_lib_pthread___pthread_mutex_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } +if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4665,31 +4181,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char __pthread_mutex_init (); int -main (void) +main () { return __pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_mutex_init=yes -else $as_nop +else ac_cv_lib_pthread___pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -printf "%s\n" "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi @@ -4699,12 +4216,11 @@ fi # The space is needed THREADS_LIBS=" -lpthread" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 -printf %s "checking for pthread_mutex_init in -lpthreads... " >&6; } -if test ${ac_cv_lib_pthreads_pthread_mutex_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } +if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4713,31 +4229,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_mutex_init (); int -main (void) +main () { return pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_mutex_init=yes -else $as_nop +else ac_cv_lib_pthreads_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -printf "%s\n" "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : _ok=yes -else $as_nop +else tcl_ok=no fi @@ -4745,12 +4262,11 @@ fi # The space is needed THREADS_LIBS=" -lpthreads" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 -printf %s "checking for pthread_mutex_init in -lc... " >&6; } -if test ${ac_cv_lib_c_pthread_mutex_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } +if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4759,41 +4275,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_mutex_init (); int -main (void) +main () { return pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_pthread_mutex_init=yes -else $as_nop +else ac_cv_lib_c_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -printf "%s\n" "$ac_cv_lib_c_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi if test "$tcl_ok" = "no"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 -printf %s "checking for pthread_mutex_init in -lc_r... " >&6; } -if test ${ac_cv_lib_c_r_pthread_mutex_init+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4802,31 +4318,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char pthread_mutex_init (); int -main (void) +main () { return pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_mutex_init=yes -else $as_nop +else ac_cv_lib_c_r_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -printf "%s\n" "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi @@ -4834,8 +4351,8 @@ fi # The space is needed THREADS_LIBS=" -pthread" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5 -printf "%s\n" "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5 +$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;} fi fi fi @@ -4846,35 +4363,35 @@ printf "%s\n" "$as_me: WARNING: Don't know how to find pthread lib on your syste ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" - ac_fn_c_check_func "$LINENO" "pthread_attr_setstacksize" "ac_cv_func_pthread_attr_setstacksize" -if test "x$ac_cv_func_pthread_attr_setstacksize" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork" -if test "x$ac_cv_func_pthread_atfork" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_ATFORK 1" >>confdefs.h + for ac_func in pthread_attr_setstacksize pthread_atfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done LIBS=$ac_saved_libs # TIP #509 - ac_fn_check_decl "$LINENO" "PTHREAD_MUTEX_RECURSIVE" "ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" = xyes -then : + ac_fn_c_check_decl "$LINENO" "PTHREAD_MUTEX_RECURSIVE" "ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" "#include +" +if test "x$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE $ac_have_decl" >>confdefs.h -if test $ac_have_decl = 1 -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi @@ -4884,26 +4401,25 @@ fi LIBS="$LIBS$THREADS_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 -printf %s "checking how to build libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 +$as_echo_n "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. -if test ${enable_shared+y} -then : +if test "${enable_shared+set}" = set; then : enableval=$enable_shared; tcl_ok=$enableval -else $as_nop +else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 -printf "%s\n" "shared" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 +$as_echo "shared" >&6; } SHARED_BUILD=1 else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 -printf "%s\n" "static" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 +$as_echo "static" >&6; } SHARED_BUILD=0 -printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h +$as_echo "#define STATIC_BUILD 1" >>confdefs.h fi @@ -4916,12 +4432,11 @@ printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h #-------------------------------------------------------------------- - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 -printf %s "checking for tclsh... " >&6; } - if test ${ac_cv_path_tclsh+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } + if ${ac_cv_path_tclsh+:} false; then : + $as_echo_n "(cached) " >&6 +else search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do @@ -4941,13 +4456,13 @@ fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 -printf "%s\n" "$TCLSH_PROG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 +$as_echo "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 -printf "%s\n" "No tclsh found on PATH" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 +$as_echo "No tclsh found on PATH" >&6; } fi @@ -4960,33 +4475,30 @@ fi #------------------------------------------------------------------------ zlib_ok=yes -ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes -then : +ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : ac_fn_c_check_type "$LINENO" "gz_header" "ac_cv_type_gz_header" "#include " -if test "x$ac_cv_type_gz_header" = xyes -then : +if test "x$ac_cv_type_gz_header" = xyes; then : -else $as_nop +else zlib_ok=no fi -else $as_nop +else zlib_ok=no fi -if test $zlib_ok = yes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing deflateSetHeader" >&5 -printf %s "checking for library containing deflateSetHeader... " >&6; } -if test ${ac_cv_search_deflateSetHeader+y} -then : - printf %s "(cached) " >&6 -else $as_nop +if test $zlib_ok = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflateSetHeader" >&5 +$as_echo_n "checking for library containing deflateSetHeader... " >&6; } +if ${ac_cv_search_deflateSetHeader+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4994,59 +4506,56 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char deflateSetHeader (); int -main (void) +main () { return deflateSetHeader (); ; return 0; } _ACEOF -for ac_lib in '' z -do +for ac_lib in '' z; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO" -then : + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_deflateSetHeader=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test ${ac_cv_search_deflateSetHeader+y} -then : + if ${ac_cv_search_deflateSetHeader+:} false; then : break fi done -if test ${ac_cv_search_deflateSetHeader+y} -then : +if ${ac_cv_search_deflateSetHeader+:} false; then : -else $as_nop +else ac_cv_search_deflateSetHeader=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateSetHeader" >&5 -printf "%s\n" "$ac_cv_search_deflateSetHeader" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateSetHeader" >&5 +$as_echo "$ac_cv_search_deflateSetHeader" >&6; } ac_res=$ac_cv_search_deflateSetHeader -if test "$ac_res" != no -then : +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -else $as_nop +else zlib_ok=no fi fi -if test $zlib_ok = no -then : +if test $zlib_ok = no; then : ZLIB_OBJS=\${ZLIB_OBJS} @@ -5057,7 +4566,7 @@ then : fi -printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h #------------------------------------------------------------------------ @@ -5066,39 +4575,35 @@ printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h libtommath_ok=yes # Check whether --with-system-libtommath was given. -if test ${with_system_libtommath+y} -then : +if test "${with_system_libtommath+set}" = set; then : withval=$with_system_libtommath; libtommath_ok=${withval} fi if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then - ac_fn_c_check_header_compile "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default" -if test "x$ac_cv_header_tommath_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default" +if test "x$ac_cv_header_tommath_h" = xyes; then : ac_fn_c_check_type "$LINENO" "mp_int" "ac_cv_type_mp_int" "#include " -if test "x$ac_cv_type_mp_int" = xyes -then : +if test "x$ac_cv_type_mp_int" = xyes; then : -else $as_nop +else libtommath_ok=no fi -else $as_nop +else libtommath_ok=no fi - if test $libtommath_ok = yes -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mp_log_u32 in -ltommath" >&5 -printf %s "checking for mp_log_u32 in -ltommath... " >&6; } -if test ${ac_cv_lib_tommath_mp_log_u32+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if test $libtommath_ok = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mp_log_u32 in -ltommath" >&5 +$as_echo_n "checking for mp_log_u32 in -ltommath... " >&6; } +if ${ac_cv_lib_tommath_mp_log_u32+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ltommath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5107,49 +4612,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char mp_log_u32 (); int -main (void) +main () { return mp_log_u32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tommath_mp_log_u32=yes -else $as_nop +else ac_cv_lib_tommath_mp_log_u32=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tommath_mp_log_u32" >&5 -printf "%s\n" "$ac_cv_lib_tommath_mp_log_u32" >&6; } -if test "x$ac_cv_lib_tommath_mp_log_u32" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tommath_mp_log_u32" >&5 +$as_echo "$ac_cv_lib_tommath_mp_log_u32" >&6; } +if test "x$ac_cv_lib_tommath_mp_log_u32" = xyes; then : MATH_LIBS="$MATH_LIBS -ltommath" -else $as_nop +else libtommath_ok=no fi fi fi -if test $libtommath_ok = yes -then : +if test $libtommath_ok = yes; then : TCL_PC_REQUIRES_PRIVATE='libtommath >= 1.2.0,' TCL_PC_CFLAGS='-DTCL_WITH_EXTERNAL_TOMMATH' -printf "%s\n" "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h +$as_echo "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h -else $as_nop +else TOMMATH_OBJS=\${TOMMATH_OBJS} @@ -5169,12 +4674,11 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -5182,15 +4686,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5201,11 +4701,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5214,12 +4714,11 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -5227,15 +4726,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5246,11 +4741,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5258,8 +4753,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5272,48 +4767,44 @@ fi # Step 0.a: Enable 64 bit support? - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 -printf %s "checking if 64bit support is requested... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 +$as_echo_n "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. -if test ${enable_64bit+y} -then : +if test "${enable_64bit+set}" = set; then : enableval=$enable_64bit; do64bit=$enableval -else $as_nop +else do64bit=no fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 -printf "%s\n" "$do64bit" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 +$as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 -printf %s "checking if 64bit Sparc VIS support is requested... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 +$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. -if test ${enable_64bit_vis+y} -then : +if test "${enable_64bit_vis+set}" = set; then : enableval=$enable_64bit_vis; do64bitVIS=$enableval -else $as_nop +else do64bitVIS=no fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 -printf "%s\n" "$do64bitVIS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 +$as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS - if test "$do64bitVIS" = "yes" -then : + if test "$do64bitVIS" = "yes"; then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 -printf %s "checking if compiler supports visibility \"hidden\"... " >&6; } -if test ${tcl_cv_cc_visibility_hidden+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 +$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } +if ${tcl_cv_cc_visibility_hidden+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5322,70 +4813,66 @@ else $as_nop extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int -main (void) +main () { f(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes -else $as_nop +else tcl_cv_cc_visibility_hidden=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 -printf "%s\n" "$tcl_cv_cc_visibility_hidden" >&6; } - if test $tcl_cv_cc_visibility_hidden = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 +$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } + if test $tcl_cv_cc_visibility_hidden = yes; then : -printf "%s\n" "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h +$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h -printf "%s\n" "#define HAVE_HIDDEN 1" >>confdefs.h +$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h fi # Step 0.d: Disable -rpath support? - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 -printf %s "checking if rpath support is requested... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 +$as_echo_n "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. -if test ${enable_rpath+y} -then : +if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; doRpath=$enableval -else $as_nop +else doRpath=yes fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 -printf "%s\n" "$doRpath" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 +$as_echo "$doRpath" >&6; } # Step 1: set the variable "system" to hold the name and version number # for the system. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 -printf %s "checking system version... " >&6; } -if test ${tcl_cv_sys_version+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 +$as_echo_n "checking system version... " >&6; } +if ${tcl_cv_sys_version+:} false; then : + $as_echo_n "(cached) " >&6 +else if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 -printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 +$as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then @@ -5398,20 +4885,19 @@ printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 -printf "%s\n" "$tcl_cv_sys_version" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 +$as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5420,31 +4906,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char dlopen (); int -main (void) +main () { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes -else $as_nop +else ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes -else $as_nop +else have_dl=no fi @@ -5468,8 +4955,7 @@ fi ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" @@ -5482,7 +4968,7 @@ then : esac -else $as_nop +else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" @@ -5491,12 +4977,11 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -5504,15 +4989,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5523,11 +5004,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5536,12 +5017,11 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -5549,15 +5029,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5568,11 +5044,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -5580,8 +5056,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -5595,14 +5071,12 @@ fi PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" - if test "x${SHLIB_VERSION}" = x -then : + if test "x${SHLIB_VERSION}" = x; then : SHLIB_VERSION="1.0" fi case $system in AIX-*) - if test "$GCC" != "yes" -then : + if test "$GCC" != "yes"; then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in @@ -5614,8 +5088,8 @@ then : CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 -printf "%s\n" "Using $CC for compiling with threads" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 +$as_echo "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" @@ -5630,16 +5104,14 @@ fi LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes -then : + if test "$do64bit" = yes; then : - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} -else $as_nop +else do64bit_ok=yes CFLAGS="$CFLAGS -q64" @@ -5652,33 +5124,30 @@ fi fi - if test "`uname -m`" = ia64 -then : + if test "`uname -m`" = ia64; then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' -else $as_nop +else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' -else $as_nop +else - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared -Wl,-bexpall' -else $as_nop +else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" @@ -5703,12 +5172,11 @@ fi # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 -printf %s "checking for inet_ntoa in -lbind... " >&6; } -if test ${ac_cv_lib_bind_inet_ntoa+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 +$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } +if ${ac_cv_lib_bind_inet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5717,29 +5185,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char inet_ntoa (); int -main (void) +main () { return inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes -else $as_nop +else ac_cv_lib_bind_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 -printf "%s\n" "$ac_cv_lib_bind_inet_ntoa" >&6; } -if test "x$ac_cv_lib_bind_inet_ntoa" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } +if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi @@ -5773,12 +5242,11 @@ fi DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 -printf %s "checking for Cygwin version of gcc... " >&6; } -if test ${ac_cv_cygwin+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 +$as_echo_n "checking for Cygwin version of gcc... " >&6; } +if ${ac_cv_cygwin+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5787,24 +5255,23 @@ else $as_nop #endif int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cygwin=no -else $as_nop +else ac_cv_cygwin=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 -printf "%s\n" "$ac_cv_cygwin" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 +$as_echo "$ac_cv_cygwin" >&6; } if test "$ac_cv_cygwin" = "no"; then as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 fi @@ -5836,12 +5303,11 @@ printf "%s\n" "$ac_cv_cygwin" >&6; } SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 -printf %s "checking for inet_ntoa in -lnetwork... " >&6; } -if test ${ac_cv_lib_network_inet_ntoa+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 +$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } +if ${ac_cv_lib_network_inet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5850,29 +5316,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char inet_ntoa (); int -main (void) +main () { return inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes -else $as_nop +else ac_cv_lib_network_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 -printf "%s\n" "$ac_cv_lib_network_inet_ntoa" >&6; } -if test "x$ac_cv_lib_network_inet_ntoa" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } +if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi @@ -5880,29 +5347,27 @@ fi HP-UX-*.11.*) # Use updated header definitions where possible -printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h +$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h -printf "%s\n" "#define _XOPEN_SOURCE 1" >>confdefs.h +$as_echo "#define _XOPEN_SOURCE 1" >>confdefs.h LIBS="$LIBS -lxnet" # Use the XOPEN network library - if test "`uname -m`" = ia64 -then : + if test "`uname -m`" = ia64; then : SHLIB_SUFFIX=".so" -else $as_nop +else SHLIB_SUFFIX=".sl" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -printf %s "checking for shl_load in -ldld... " >&6; } -if test ${ac_cv_lib_dld_shl_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5911,36 +5376,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load (); int -main (void) +main () { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes -else $as_nop +else ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi - if test "$tcl_ok" = yes -then : + if test "$tcl_ok" = yes; then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5952,13 +5417,12 @@ then : LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} -else $as_nop +else CFLAGS="$CFLAGS -z" @@ -5968,31 +5432,28 @@ fi #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" -then : + if test "$do64bit" = "yes"; then : - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac -else $as_nop +else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" @@ -6003,12 +5464,11 @@ fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -printf %s "checking for shl_load in -ldld... " >&6; } -if test ${ac_cv_lib_dld_shl_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6017,36 +5477,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load (); int -main (void) +main () { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes -else $as_nop +else ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi - if test "$tcl_ok" = yes -then : + if test "$tcl_ok" = yes; then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -6071,8 +5531,7 @@ fi ;; ;; esac - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' @@ -6090,19 +5549,17 @@ fi ;; esac - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" -else $as_nop +else case $system in IRIX-6.3) @@ -6129,8 +5586,7 @@ fi ;; esac - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' @@ -6138,16 +5594,14 @@ fi # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes -then : + if test "$do64bit" = yes; then : - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} -else $as_nop +else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" @@ -6175,8 +5629,7 @@ fi case $system in DragonFly-*|FreeBSD-*) - if test "${TCL_THREADS}" = "1" -then : + if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` @@ -6186,25 +5639,21 @@ fi ;; esac - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" -then : + if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi - if test $do64bit = yes -then : + if test $do64bit = yes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 -printf %s "checking if compiler accepts -m64 flag... " >&6; } -if test ${tcl_cv_cc_m64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 +$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } +if ${tcl_cv_cc_m64+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" @@ -6212,27 +5661,25 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes -else $as_nop +else tcl_cv_cc_m64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 -printf "%s\n" "$tcl_cv_cc_m64" >&6; } - if test $tcl_cv_cc_m64 = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 +$as_echo "$tcl_cv_cc_m64" >&6; } + if test $tcl_cv_cc_m64 = yes; then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes @@ -6247,8 +5694,7 @@ fi # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x -then : + if test x"${USE_COMPAT}" != x; then : CFLAGS="$CFLAGS -fno-inline" fi ;; @@ -6260,8 +5706,7 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' @@ -6281,8 +5726,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi @@ -6306,8 +5750,7 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi @@ -6329,17 +5772,15 @@ fi CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes -then : + if test $do64bit = yes; then : case `arch` in ppc) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 -printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; } -if test ${tcl_cv_cc_arch_ppc64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } +if ${tcl_cv_cc_arch_ppc64+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" @@ -6347,39 +5788,36 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes -else $as_nop +else tcl_cv_cc_arch_ppc64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 -printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; } - if test $tcl_cv_cc_arch_ppc64 = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 +$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } + if test $tcl_cv_cc_arch_ppc64 = yes; then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386|x86_64) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 -printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; } -if test ${tcl_cv_cc_arch_x86_64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } +if ${tcl_cv_cc_arch_x86_64+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" @@ -6387,39 +5825,36 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes -else $as_nop +else tcl_cv_cc_arch_x86_64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 -printf "%s\n" "$tcl_cv_cc_arch_x86_64" >&6; } - if test $tcl_cv_cc_arch_x86_64 = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 +$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } + if test $tcl_cv_cc_arch_x86_64 = yes; then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; arm64) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64 flag" >&5 -printf %s "checking if compiler accepts -arch arm64 flag... " >&6; } -if test ${tcl_cv_cc_arch_arm64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch arm64 flag... " >&6; } +if ${tcl_cv_cc_arch_arm64+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch arm64" @@ -6427,55 +5862,51 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_arm64=yes -else $as_nop +else tcl_cv_cc_arch_arm64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64" >&5 -printf "%s\n" "$tcl_cv_cc_arch_arm64" >&6; } - if test $tcl_cv_cc_arch_arm64 = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64" >&5 +$as_echo "$tcl_cv_cc_arch_arm64" >&6; } + if test $tcl_cv_cc_arch_arm64 = yes; then : CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes fi;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac -else $as_nop +else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) ' -then : + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi fi SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 -printf %s "checking if ld accepts -single_module flag... " >&6; } -if test ${tcl_cv_ld_single_module+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 +$as_echo_n "checking if ld accepts -single_module flag... " >&6; } +if ${tcl_cv_ld_single_module+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" @@ -6483,27 +5914,25 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { int i; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes -else $as_nop +else tcl_cv_ld_single_module=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 -printf "%s\n" "$tcl_cv_ld_single_module" >&6; } - if test $tcl_cv_ld_single_module = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 +$as_echo "$tcl_cv_ld_single_module" >&6; } + if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" @@ -6512,12 +5941,11 @@ fi DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="$LDFLAGS -headerpad_max_install_names" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 -printf %s "checking if ld accepts -search_paths_first flag... " >&6; } -if test ${tcl_cv_ld_search_paths_first+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 +$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } +if ${tcl_cv_ld_search_paths_first+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" @@ -6525,36 +5953,33 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { int i; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes -else $as_nop +else tcl_cv_ld_search_paths_first=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 -printf "%s\n" "$tcl_cv_ld_search_paths_first" >&6; } - if test $tcl_cv_ld_search_paths_first = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 +$as_echo "$tcl_cv_ld_search_paths_first" >&6; } + if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - if test "$tcl_cv_cc_visibility_hidden" != yes -then : + if test "$tcl_cv_cc_visibility_hidden" != yes; then : -printf "%s\n" "#define MODULE_SCOPE __private_extern__" >>confdefs.h +$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes @@ -6563,35 +5988,31 @@ fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH" -printf "%s\n" "#define MAC_OSX_TCL 1" >>confdefs.h +$as_echo "#define MAC_OSX_TCL 1" >>confdefs.h PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 -printf %s "checking whether to use CoreFoundation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 +$as_echo_n "checking whether to use CoreFoundation... " >&6; } # Check whether --enable-corefoundation was given. -if test ${enable_corefoundation+y} -then : +if test "${enable_corefoundation+set}" = set; then : enableval=$enable_corefoundation; tcl_corefoundation=$enableval -else $as_nop +else tcl_corefoundation=yes fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 -printf "%s\n" "$tcl_corefoundation" >&6; } - if test $tcl_corefoundation = yes -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 +$as_echo "$tcl_corefoundation" >&6; } + if test $tcl_corefoundation = yes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 -printf %s "checking for CoreFoundation.framework... " >&6; } -if test ${tcl_cv_lib_corefoundation+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 +$as_echo_n "checking for CoreFoundation.framework... " >&6; } +if ${tcl_cv_lib_corefoundation+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_libs=$LIBS - if test "$fat_32_64" = yes -then : + if test "$fat_32_64" = yes; then : for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit @@ -6606,23 +6027,21 @@ fi /* end confdefs.h. */ #include int -main (void) +main () { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_corefoundation=yes -else $as_nop +else tcl_cv_lib_corefoundation=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$fat_32_64" = yes -then : + if test "$fat_32_64" = yes; then : for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' @@ -6630,28 +6049,25 @@ then : fi LIBS=$hold_libs fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 -printf "%s\n" "$tcl_cv_lib_corefoundation" >&6; } - if test $tcl_cv_lib_corefoundation = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 +$as_echo "$tcl_cv_lib_corefoundation" >&6; } + if test $tcl_cv_lib_corefoundation = yes; then : LIBS="$LIBS -framework CoreFoundation" -printf "%s\n" "#define HAVE_COREFOUNDATION 1" >>confdefs.h +$as_echo "#define HAVE_COREFOUNDATION 1" >>confdefs.h -else $as_nop +else tcl_corefoundation=no fi - if test "$fat_32_64" = yes -a $tcl_corefoundation = yes -then : + if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 -printf %s "checking for 64-bit CoreFoundation... " >&6; } -if test ${tcl_cv_lib_corefoundation_64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 +$as_echo_n "checking for 64-bit CoreFoundation... " >&6; } +if ${tcl_cv_lib_corefoundation_64+:} false; then : + $as_echo_n "(cached) " >&6 +else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' @@ -6660,32 +6076,30 @@ else $as_nop /* end confdefs.h. */ #include int -main (void) +main () { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_corefoundation_64=yes -else $as_nop +else tcl_cv_lib_corefoundation_64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 -printf "%s\n" "$tcl_cv_lib_corefoundation_64" >&6; } - if test $tcl_cv_lib_corefoundation_64 = no -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 +$as_echo "$tcl_cv_lib_corefoundation_64" >&6; } + if test $tcl_cv_lib_corefoundation_64 = no; then : -printf "%s\n" "#define NO_COREFOUNDATION_64 1" >>confdefs.h +$as_echo "#define NO_COREFOUNDATION_64 1" >>confdefs.h LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" @@ -6699,18 +6113,17 @@ fi SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy -printf "%s\n" "#define _OE_SOCKETS 1" >>confdefs.h +$as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = 1 -then : + if test "$SHARED_BUILD" = 1; then : SHLIB_LD='${CC} -shared' -else $as_nop +else SHLIB_LD='${CC} -non_shared' @@ -6718,16 +6131,14 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes -then : + if test $doRpath = yes; then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mieee" -else $as_nop +else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi @@ -6735,12 +6146,11 @@ fi CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : LIBS="$LIBS -lpthread -lmach -lexc" -else $as_nop +else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" @@ -6763,13 +6173,12 @@ fi # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" -else $as_nop +else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" @@ -6790,24 +6199,23 @@ fi # won't define thread-safe library routines. -printf "%s\n" "#define _REENTRANT 1" >>confdefs.h +$as_echo "#define _REENTRANT 1" >>confdefs.h -printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} -else $as_nop +else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' @@ -6820,32 +6228,28 @@ fi # won't define thread-safe library routines. -printf "%s\n" "#define _REENTRANT 1" >>confdefs.h +$as_echo "#define _REENTRANT 1" >>confdefs.h -printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes -then : + if test "$do64bit" = yes; then : arch=`isainfo` - if test "$arch" = "sparcv9 sparc" -then : + if test "$arch" = "sparcv9 sparc"; then : - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : - if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3 -then : + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} -else $as_nop +else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" @@ -6854,16 +6258,15 @@ else $as_nop fi -else $as_nop +else do64bit_ok=yes - if test "$do64bitVIS" = yes -then : + if test "$do64bitVIS" = yes; then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" -else $as_nop +else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" @@ -6874,12 +6277,10 @@ fi fi -else $as_nop - if test "$arch" = "amd64 i386" -then : +else + if test "$arch" = "amd64 i386"; then : - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) @@ -6887,11 +6288,11 @@ then : CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac -else $as_nop +else do64bit_ok=yes case $system in @@ -6905,9 +6306,9 @@ else $as_nop fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 -printf "%s\n" "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi @@ -6917,32 +6318,30 @@ fi # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : use_sunmath=no -else $as_nop +else arch=`isainfo` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 -printf %s "checking whether to use -lsunmath for fp rounding control... " >&6; } - if test "$arch" = "amd64 i386" -o "$arch" = "i386" -then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 +$as_echo_n "checking whether to use -lsunmath for fp rounding control... " >&6; } + if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } MATH_LIBS="-lsunmath $MATH_LIBS" - ac_fn_c_check_header_compile "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" -if test "x$ac_cv_header_sunmath_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" +if test "x$ac_cv_header_sunmath_h" = xyes; then : fi + use_sunmath=yes -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } use_sunmath=no fi @@ -6951,17 +6350,14 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes -then : + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = yes -then : + if test "$do64bit_ok" = yes; then : - if test "$arch" = "sparcv9 sparc" -then : + if test "$arch" = "sparcv9 sparc"; then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. @@ -6971,9 +6367,8 @@ then : #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" -else $as_nop - if test "$arch" = "amd64 i386" -then : +else + if test "$arch" = "amd64 i386"; then : SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" @@ -6982,12 +6377,11 @@ fi fi -else $as_nop +else - if test "$use_sunmath" = yes -then : + if test "$use_sunmath" = yes; then : textmode=textoff -else $as_nop +else textmode=text fi case $system in @@ -7010,12 +6404,11 @@ fi DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 -printf %s "checking for ld accepts -Bexport flag... " >&6; } -if test ${tcl_cv_ld_Bexport+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 +$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } +if ${tcl_cv_ld_Bexport+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" @@ -7023,27 +6416,25 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { int i; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_Bexport=yes -else $as_nop +else tcl_cv_ld_Bexport=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 -printf "%s\n" "$tcl_cv_ld_Bexport" >&6; } - if test $tcl_cv_ld_Bexport = yes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 +$as_echo "$tcl_cv_ld_Bexport" >&6; } + if test $tcl_cv_ld_Bexport = yes; then : LDFLAGS="$LDFLAGS -Wl,-Bexport" @@ -7053,19 +6444,17 @@ fi ;; esac - if test "$do64bit" = yes -a "$do64bit_ok" = no -then : + if test "$do64bit" = yes -a "$do64bit_ok" = no; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -printf "%s\n" "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi - if test "$do64bit" = yes -a "$do64bit_ok" = yes -then : + if test "$do64bit" = yes -a "$do64bit_ok" = yes; then : -printf "%s\n" "#define TCL_CFG_DO64BIT 1" >>confdefs.h +$as_echo "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi @@ -7075,25 +6464,22 @@ fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load was given. -if test ${enable_load+y} -then : +if test "${enable_load+set}" = set; then : enableval=$enable_load; tcl_ok=$enableval -else $as_nop +else tcl_ok=yes fi - if test "$tcl_ok" = no -then : + if test "$tcl_ok" = no; then : DL_OBJS="" fi - if test "x$DL_OBJS" != x -then : + if test "x$DL_OBJS" != x; then : BUILD_DLTEST="\$(DLTEST_TARGETS)" -else $as_nop +else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 -printf "%s\n" "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" @@ -7111,8 +6497,7 @@ fi # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. - if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes -then : + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then : case $system in AIX-*) ;; @@ -7129,54 +6514,48 @@ then : esac fi - if test "$tcl_cv_cc_visibility_hidden" != yes -then : + if test "$tcl_cv_cc_visibility_hidden" != yes; then : -printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h +$as_echo "#define MODULE_SCOPE extern" >>confdefs.h fi - if test "$SHARED_LIB_SUFFIX" = "" -then : + if test "$SHARED_LIB_SUFFIX" = ""; then : SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi - if test "$UNSHARED_LIB_SUFFIX" = "" -then : + if test "$UNSHARED_LIB_SUFFIX" = ""; then : UNSHARED_LIB_SUFFIX='${VERSION}.a' fi DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" - if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != "" -then : + if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then : LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - if test "${SHLIB_SUFFIX}" = ".dll" -then : + if test "${SHLIB_SUFFIX}" = ".dll"; then : INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" -else $as_nop +else INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi -else $as_nop +else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - if test "$RANLIB" = "" -then : + if test "$RANLIB" = ""; then : MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' -else $as_nop +else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' @@ -7186,12 +6565,11 @@ fi fi # Stub lib does not depend on shared/static configuration - if test "$RANLIB" = "" -then : + if test "$RANLIB" = ""; then : MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' -else $as_nop +else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' @@ -7201,8 +6579,7 @@ fi # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. - if test "x${TCL_LIBS}" = x -then : + if test "x${TCL_LIBS}" = x; then : TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi @@ -7212,17 +6589,16 @@ fi # This is used to stop gcc from printing a compiler # warning when initializing a union member. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 -printf %s "checking for cast to union support... " >&6; } -if test ${tcl_cv_cast_to_union+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 +$as_echo_n "checking for cast to union support... " >&6; } +if ${tcl_cv_cast_to_union+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { union foo { int i; double d; }; @@ -7232,125 +6608,107 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes -else $as_nop +else tcl_cv_cast_to_union=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 -printf "%s\n" "$tcl_cv_cast_to_union" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 +$as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then -printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h +$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 -printf %s "checking for working -fno-lto... " >&6; } -if test ${ac_cv_nolto+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 +$as_echo_n "checking for working -fno-lto... " >&6; } +if ${ac_cv_nolto+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_nolto=yes -else $as_nop +else ac_cv_nolto=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 -printf "%s\n" "$ac_cv_nolto" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 +$as_echo "$ac_cv_nolto" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5 -printf %s "checking if the compiler understands -finput-charset... " >&6; } -if test ${tcl_cv_cc_input_charset+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5 +$as_echo_n "checking if the compiler understands -finput-charset... " >&6; } +if ${tcl_cv_cc_input_charset+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_input_charset=yes -else $as_nop +else tcl_cv_cc_input_charset=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5 -printf "%s\n" "$tcl_cv_cc_input_charset" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5 +$as_echo "$tcl_cv_cc_input_charset" >&6; } if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi - ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" -if test "x$ac_cv_header_stdbool_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes; then : -printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi - # Check for vfork, posix_spawnp() and friends unconditionally - ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" -if test "x$ac_cv_func_vfork" = xyes -then : - printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" -if test "x$ac_cv_func_posix_spawnp" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2" -if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags" -if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes -then : - printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h + # Check for vfork, posix_spawnp() and friends unconditionally + for ac_func in vfork posix_spawnp posix_spawn_file_actions_adddup2 posix_spawnattr_setflags +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done # FIXME: This subst was left in only because the TCL_DL_LIBS @@ -7382,7 +6740,9 @@ fi -printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define TCL_SHLIB_EXT "${SHLIB_SUFFIX}" +_ACEOF @@ -7394,13 +6754,12 @@ printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 -printf %s "checking for build with symbols... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 +$as_echo_n "checking for build with symbols... " >&6; } # Check whether --enable-symbols was given. -if test ${enable_symbols+y} -then : +if test "${enable_symbols+set}" = set; then : enableval=$enable_symbols; tcl_ok=$enableval -else $as_nop +else tcl_ok=no fi @@ -7409,19 +6768,19 @@ fi CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' -printf "%s\n" "#define NDEBUG 1" >>confdefs.h +$as_echo "#define NDEBUG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h +$as_echo "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 -printf "%s\n" "yes (standard debugging)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 +$as_echo "yes (standard debugging)" >&6; } fi fi @@ -7429,32 +6788,32 @@ printf "%s\n" "yes (standard debugging)" >&6; } if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h +$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then -printf "%s\n" "#define TCL_COMPILE_DEBUG 1" >>confdefs.h +$as_echo "#define TCL_COMPILE_DEBUG 1" >>confdefs.h -printf "%s\n" "#define TCL_COMPILE_STATS 1" >>confdefs.h +$as_echo "#define TCL_COMPILE_STATS 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 -printf "%s\n" "enabled symbols mem compile debugging" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 +$as_echo "enabled symbols mem compile debugging" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 -printf "%s\n" "enabled $tcl_ok debugging" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 +$as_echo "enabled $tcl_ok debugging" >&6; } fi fi -printf "%s\n" "#define MP_PREC 4" >>confdefs.h +$as_echo "#define MP_PREC 4" >>confdefs.h #-------------------------------------------------------------------- @@ -7462,125 +6821,118 @@ printf "%s\n" "#define MP_PREC 4" >>confdefs.h #-------------------------------------------------------------------- - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 -printf %s "checking for required early compiler flags... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 +$as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" - if test ${tcl_cv_flag__isoc99_source+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${tcl_cv_flag__isoc99_source+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int -main (void) +main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes -else $as_nop +else tcl_cv_flag__isoc99_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then -printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h +$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - if test ${tcl_cv_flag__largefile64_source+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${tcl_cv_flag__largefile64_source+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int -main (void) +main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=yes -else $as_nop +else tcl_cv_flag__largefile64_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then -printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h +$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 -printf "%s\n" "${tcl_flags}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 +$as_echo "${tcl_flags}" >&6; } fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5 -printf %s "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; } - if test ${tcl_cv_type_64bit+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5 +$as_echo_n "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; } + if ${tcl_cv_type_64bit+:} false; then : + $as_echo_n "(cached) " >&6 +else tcl_cv_type_64bit=none # See if we could use long anyway Note that we substitute in the @@ -7590,7 +6942,7 @@ else $as_nop /* end confdefs.h. */ int -main (void) +main () { switch (0) { case 1: case (sizeof(long long)==sizeof(long)): ; @@ -7599,71 +6951,67 @@ switch (0) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit="long long" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then -printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h +$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } # Now check for auxiliary declarations - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 -printf %s "checking for struct dirent64... " >&6; } -if test ${tcl_cv_struct_dirent64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 +$as_echo_n "checking for struct dirent64... " >&6; } +if ${tcl_cv_struct_dirent64+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { struct dirent64 p; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes -else $as_nop +else tcl_cv_struct_dirent64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 -printf "%s\n" "$tcl_cv_struct_dirent64" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 +$as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then -printf "%s\n" "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h +$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5 -printf %s "checking for DIR64... " >&6; } -if test ${tcl_cv_DIR64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5 +$as_echo_n "checking for DIR64... " >&6; } +if ${tcl_cv_DIR64+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d); @@ -7671,34 +7019,32 @@ struct dirent64 *p; DIR64 d = opendir64("."); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_DIR64=yes -else $as_nop +else tcl_cv_DIR64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 -printf "%s\n" "$tcl_cv_DIR64" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 +$as_echo "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then -printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h +$as_echo "#define HAVE_DIR64 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 -printf %s "checking for struct stat64... " >&6; } -if test ${tcl_cv_struct_stat64+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 +$as_echo_n "checking for struct stat64... " >&6; } +if ${tcl_cv_struct_stat64+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct stat64 p; @@ -7706,47 +7052,44 @@ struct stat64 p; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes -else $as_nop +else tcl_cv_struct_stat64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 -printf "%s\n" "$tcl_cv_struct_stat64" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 +$as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then -printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h +$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi - ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" -if test "x$ac_cv_func_open64" = xyes -then : - printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64" -if test "x$ac_cv_func_lseek64" = xyes -then : - printf "%s\n" "#define HAVE_LSEEK64 1" >>confdefs.h + for ac_func in open64 lseek64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 -printf %s "checking for off64_t... " >&6; } - if test ${tcl_cv_type_off64_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 +$as_echo_n "checking for off64_t... " >&6; } + if ${tcl_cv_type_off64_t+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { off64_t offset; @@ -7754,26 +7097,25 @@ off64_t offset; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes -else $as_nop +else tcl_cv_type_off64_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then -printf "%s\n" "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h +$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -7783,12 +7125,11 @@ printf "%s\n" "no" >&6; } # Tcl_UniChar strings to memcmp on big-endian systems. #-------------------------------------------------------------------- - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -printf %s "checking whether byte ordering is bigendian... " >&6; } -if test ${ac_cv_c_bigendian+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7799,8 +7140,7 @@ else $as_nop typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -7824,7 +7164,7 @@ then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7833,7 +7173,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext #include int -main (void) +main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -7845,8 +7185,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7854,7 +7193,7 @@ then : #include int -main (void) +main () { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -7864,15 +7203,14 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes -else $as_nop +else ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -7881,7 +7219,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext #include int -main (void) +main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -7891,15 +7229,14 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { #ifndef _BIG_ENDIAN not big endian @@ -7909,33 +7246,31 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes -else $as_nop +else ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes -then : + if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -unsigned short int ascii_mm[] = +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - unsigned short int ascii_ii[] = + short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - unsigned short int ebcdic_ii[] = + short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - unsigned short int ebcdic_mm[] = + short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -7943,15 +7278,14 @@ unsigned short int ascii_mm[] = extern int foo; int -main (void) +main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -7964,13 +7298,13 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main (void) +main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -7986,10 +7320,9 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no -else $as_nop +else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -7998,17 +7331,17 @@ fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -printf "%s\n" "$ac_cv_c_bigendian" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -8023,30 +7356,29 @@ printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h #-------------------------------------------------------------------- # Check if Posix compliant getcwd exists, if not we'll use getwd. - - for ac_func in getcwd +for ac_func in getcwd do : ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" -if test "x$ac_cv_func_getcwd" = xyes -then : - printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h +if test "x$ac_cv_func_getcwd" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETCWD 1 +_ACEOF -else $as_nop +else -printf "%s\n" "#define USEGETWD 1" >>confdefs.h +$as_echo "#define USEGETWD 1" >>confdefs.h fi - done + # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" -if test "x$ac_cv_func_mkstemp" = xyes -then : - printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h +if test "x$ac_cv_func_mkstemp" = xyes; then : + $as_echo "#define HAVE_MKSTEMP 1" >>confdefs.h -else $as_nop +else case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" @@ -8054,12 +7386,12 @@ else $as_nop esac fi + ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" -if test "x$ac_cv_func_waitpid" = xyes -then : - printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h +if test "x$ac_cv_func_waitpid" = xyes; then : + $as_echo "#define HAVE_WAITPID 1" >>confdefs.h -else $as_nop +else case " $LIBOBJS " in *" waitpid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" @@ -8068,73 +7400,67 @@ esac fi + ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : +if test "x$ac_cv_func_strerror" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_STRERROR 1" >>confdefs.h +$as_echo "#define NO_STRERROR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" -if test "x$ac_cv_func_getwd" = xyes -then : +if test "x$ac_cv_func_getwd" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_GETWD 1" >>confdefs.h +$as_echo "#define NO_GETWD 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" -if test "x$ac_cv_func_wait3" = xyes -then : +if test "x$ac_cv_func_wait3" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_WAIT3 1" >>confdefs.h +$as_echo "#define NO_WAIT3 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" -if test "x$ac_cv_func_fork" = xyes -then : +if test "x$ac_cv_func_fork" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_FORK 1" >>confdefs.h +$as_echo "#define NO_FORK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod" -if test "x$ac_cv_func_mknod" = xyes -then : +if test "x$ac_cv_func_mknod" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_MKNOD 1" >>confdefs.h +$as_echo "#define NO_MKNOD 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain" -if test "x$ac_cv_func_tcdrain" = xyes -then : +if test "x$ac_cv_func_tcdrain" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_TCDRAIN 1" >>confdefs.h +$as_echo "#define NO_TCDRAIN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" -if test "x$ac_cv_func_uname" = xyes -then : +if test "x$ac_cv_func_uname" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_UNAME 1" >>confdefs.h +$as_echo "#define NO_UNAME 1" >>confdefs.h fi @@ -8146,34 +7472,31 @@ if test "`uname -s`" = "Darwin" && \ ac_cv_func_realpath=no fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" -if test "x$ac_cv_func_realpath" = xyes -then : +if test "x$ac_cv_func_realpath" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_REALPATH 1" >>confdefs.h +$as_echo "#define NO_REALPATH 1" >>confdefs.h fi NEED_FAKE_RFC2553=0 - - for ac_func in getnameinfo getaddrinfo freeaddrinfo gai_strerror + for ac_func in getnameinfo getaddrinfo freeaddrinfo gai_strerror do : - as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else $as_nop +else NEED_FAKE_RFC2553=1 fi - done + ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #include #include @@ -8181,13 +7504,14 @@ done #include " -if test "x$ac_cv_type_struct_addrinfo" = xyes -then : +if test "x$ac_cv_type_struct_addrinfo" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_ADDRINFO 1 +_ACEOF -else $as_nop +else NEED_FAKE_RFC2553=1 fi ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " @@ -8197,13 +7521,14 @@ ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " #include " -if test "x$ac_cv_type_struct_in6_addr" = xyes -then : +if test "x$ac_cv_type_struct_in6_addr" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_IN6_ADDR 1 +_ACEOF -else $as_nop +else NEED_FAKE_RFC2553=1 fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " @@ -8213,13 +7538,14 @@ ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_i #include " -if test "x$ac_cv_type_struct_sockaddr_in6" = xyes -then : +if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_IN6 1 +_ACEOF -else $as_nop +else NEED_FAKE_RFC2553=1 fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " @@ -8229,19 +7555,20 @@ ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockad #include " -if test "x$ac_cv_type_struct_sockaddr_storage" = xyes -then : +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +_ACEOF -else $as_nop +else NEED_FAKE_RFC2553=1 fi if test "x$NEED_FAKE_RFC2553" = "x1"; then -printf "%s\n" "#define NEED_FAKE_RFC2553 1" >>confdefs.h +$as_echo "#define NEED_FAKE_RFC2553 1" >>confdefs.h case " $LIBOBJS " in *" fake-rfc2553.$ac_objext "* ) ;; @@ -8250,8 +7577,7 @@ printf "%s\n" "#define NEED_FAKE_RFC2553 1" >>confdefs.h esac ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" -if test "x$ac_cv_func_strlcpy" = xyes -then : +if test "x$ac_cv_func_strlcpy" = xyes; then : fi @@ -8263,15 +7589,13 @@ fi #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" -if test "x$ac_cv_func_getpwuid_r" = xyes -then : +if test "x$ac_cv_func_getpwuid_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 5 args" >&5 -printf %s "checking for getpwuid_r with 5 args... " >&6; } -if test ${tcl_cv_api_getpwuid_r_5+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 5 args" >&5 +$as_echo_n "checking for getpwuid_r with 5 args... " >&6; } +if ${tcl_cv_api_getpwuid_r_5+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8280,7 +7604,7 @@ else $as_nop #include int -main (void) +main () { uid_t uid; @@ -8294,28 +7618,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getpwuid_r_5=yes -else $as_nop +else tcl_cv_api_getpwuid_r_5=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_5" >&5 -printf "%s\n" "$tcl_cv_api_getpwuid_r_5" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_5" >&5 +$as_echo "$tcl_cv_api_getpwuid_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_5 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWUID_R_5 1" >>confdefs.h +$as_echo "#define HAVE_GETPWUID_R_5 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 4 args" >&5 -printf %s "checking for getpwuid_r with 4 args... " >&6; } -if test ${tcl_cv_api_getpwuid_r_4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 4 args" >&5 +$as_echo_n "checking for getpwuid_r with 4 args... " >&6; } +if ${tcl_cv_api_getpwuid_r_4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8324,7 +7646,7 @@ else $as_nop #include int -main (void) +main () { uid_t uid; @@ -8338,41 +7660,38 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getpwuid_r_4=yes -else $as_nop +else tcl_cv_api_getpwuid_r_4=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_4" >&5 -printf "%s\n" "$tcl_cv_api_getpwuid_r_4" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_4" >&5 +$as_echo "$tcl_cv_api_getpwuid_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_4 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWUID_R_4 1" >>confdefs.h +$as_echo "#define HAVE_GETPWUID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h +$as_echo "#define HAVE_GETPWUID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r" -if test "x$ac_cv_func_getpwnam_r" = xyes -then : +if test "x$ac_cv_func_getpwnam_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 5 args" >&5 -printf %s "checking for getpwnam_r with 5 args... " >&6; } -if test ${tcl_cv_api_getpwnam_r_5+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 5 args" >&5 +$as_echo_n "checking for getpwnam_r with 5 args... " >&6; } +if ${tcl_cv_api_getpwnam_r_5+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8381,7 +7700,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8395,28 +7714,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getpwnam_r_5=yes -else $as_nop +else tcl_cv_api_getpwnam_r_5=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_5" >&5 -printf "%s\n" "$tcl_cv_api_getpwnam_r_5" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_5" >&5 +$as_echo "$tcl_cv_api_getpwnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_5 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWNAM_R_5 1" >>confdefs.h +$as_echo "#define HAVE_GETPWNAM_R_5 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 4 args" >&5 -printf %s "checking for getpwnam_r with 4 args... " >&6; } -if test ${tcl_cv_api_getpwnam_r_4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 4 args" >&5 +$as_echo_n "checking for getpwnam_r with 4 args... " >&6; } +if ${tcl_cv_api_getpwnam_r_4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8425,7 +7742,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8439,41 +7756,38 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getpwnam_r_4=yes -else $as_nop +else tcl_cv_api_getpwnam_r_4=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_4" >&5 -printf "%s\n" "$tcl_cv_api_getpwnam_r_4" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_4" >&5 +$as_echo "$tcl_cv_api_getpwnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_4 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWNAM_R_4 1" >>confdefs.h +$as_echo "#define HAVE_GETPWNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h +$as_echo "#define HAVE_GETPWNAM_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" -if test "x$ac_cv_func_getgrgid_r" = xyes -then : +if test "x$ac_cv_func_getgrgid_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 5 args" >&5 -printf %s "checking for getgrgid_r with 5 args... " >&6; } -if test ${tcl_cv_api_getgrgid_r_5+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 5 args" >&5 +$as_echo_n "checking for getgrgid_r with 5 args... " >&6; } +if ${tcl_cv_api_getgrgid_r_5+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8482,7 +7796,7 @@ else $as_nop #include int -main (void) +main () { gid_t gid; @@ -8496,28 +7810,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getgrgid_r_5=yes -else $as_nop +else tcl_cv_api_getgrgid_r_5=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_5" >&5 -printf "%s\n" "$tcl_cv_api_getgrgid_r_5" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_5" >&5 +$as_echo "$tcl_cv_api_getgrgid_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_5 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRGID_R_5 1" >>confdefs.h +$as_echo "#define HAVE_GETGRGID_R_5 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 4 args" >&5 -printf %s "checking for getgrgid_r with 4 args... " >&6; } -if test ${tcl_cv_api_getgrgid_r_4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 4 args" >&5 +$as_echo_n "checking for getgrgid_r with 4 args... " >&6; } +if ${tcl_cv_api_getgrgid_r_4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8526,7 +7838,7 @@ else $as_nop #include int -main (void) +main () { gid_t gid; @@ -8540,41 +7852,38 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getgrgid_r_4=yes -else $as_nop +else tcl_cv_api_getgrgid_r_4=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_4" >&5 -printf "%s\n" "$tcl_cv_api_getgrgid_r_4" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_4" >&5 +$as_echo "$tcl_cv_api_getgrgid_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_4 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRGID_R_4 1" >>confdefs.h +$as_echo "#define HAVE_GETGRGID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h +$as_echo "#define HAVE_GETGRGID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r" -if test "x$ac_cv_func_getgrnam_r" = xyes -then : +if test "x$ac_cv_func_getgrnam_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 5 args" >&5 -printf %s "checking for getgrnam_r with 5 args... " >&6; } -if test ${tcl_cv_api_getgrnam_r_5+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 5 args" >&5 +$as_echo_n "checking for getgrnam_r with 5 args... " >&6; } +if ${tcl_cv_api_getgrnam_r_5+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8583,7 +7892,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8597,28 +7906,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getgrnam_r_5=yes -else $as_nop +else tcl_cv_api_getgrnam_r_5=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_5" >&5 -printf "%s\n" "$tcl_cv_api_getgrnam_r_5" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_5" >&5 +$as_echo "$tcl_cv_api_getgrnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_5 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRNAM_R_5 1" >>confdefs.h +$as_echo "#define HAVE_GETGRNAM_R_5 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 4 args" >&5 -printf %s "checking for getgrnam_r with 4 args... " >&6; } -if test ${tcl_cv_api_getgrnam_r_4+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 4 args" >&5 +$as_echo_n "checking for getgrnam_r with 4 args... " >&6; } +if ${tcl_cv_api_getgrnam_r_4+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8627,7 +7934,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8641,26 +7948,25 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_getgrnam_r_4=yes -else $as_nop +else tcl_cv_api_getgrnam_r_4=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_4" >&5 -printf "%s\n" "$tcl_cv_api_getgrnam_r_4" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_4" >&5 +$as_echo "$tcl_cv_api_getgrnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_4 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRNAM_R_4 1" >>confdefs.h +$as_echo "#define HAVE_GETGRNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h +$as_echo "#define HAVE_GETGRNAM_R 1" >>confdefs.h fi @@ -8672,10 +7978,10 @@ if test "`uname -s`" = "Darwin" && \ # are actually MT-safe as they always return pointers # from TSD instead of static storage. -printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h +$as_echo "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h -printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h +$as_echo "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h elif test "`uname -s`" = "HP-UX" && \ @@ -8684,29 +7990,30 @@ elif test "`uname -s`" = "HP-UX" && \ # are actually MT-safe as they always return pointers # from TSD instead of static storage. -printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h +$as_echo "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h -printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h +$as_echo "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h else # Avoids picking hidden internal symbol from libc - ac_fn_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_gethostbyname_r" = xyes -then : + ac_fn_c_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include +" +if test "x$ac_cv_have_decl_gethostbyname_r" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl" >>confdefs.h -if test $ac_have_decl = 1 -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : tcl_cv_api_gethostbyname_r=yes -else $as_nop +else tcl_cv_api_gethostbyname_r=no fi @@ -8714,15 +8021,13 @@ fi if test "$tcl_cv_api_gethostbyname_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" -if test "x$ac_cv_func_gethostbyname_r" = xyes -then : +if test "x$ac_cv_func_gethostbyname_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 args" >&5 -printf %s "checking for gethostbyname_r with 6 args... " >&6; } -if test ${tcl_cv_api_gethostbyname_r_6+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 args" >&5 +$as_echo_n "checking for gethostbyname_r with 6 args... " >&6; } +if ${tcl_cv_api_gethostbyname_r_6+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8730,7 +8035,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8745,28 +8050,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_gethostbyname_r_6=yes -else $as_nop +else tcl_cv_api_gethostbyname_r_6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_6" >&5 -printf "%s\n" "$tcl_cv_api_gethostbyname_r_6" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_6" >&5 +$as_echo "$tcl_cv_api_gethostbyname_r_6" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_6 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 args" >&5 -printf %s "checking for gethostbyname_r with 5 args... " >&6; } -if test ${tcl_cv_api_gethostbyname_r_5+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 args" >&5 +$as_echo_n "checking for gethostbyname_r with 5 args... " >&6; } +if ${tcl_cv_api_gethostbyname_r_5+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8774,7 +8077,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8789,28 +8092,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_gethostbyname_r_5=yes -else $as_nop +else tcl_cv_api_gethostbyname_r_5=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_5" >&5 -printf "%s\n" "$tcl_cv_api_gethostbyname_r_5" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_5" >&5 +$as_echo "$tcl_cv_api_gethostbyname_r_5" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_5 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 3 args" >&5 -printf %s "checking for gethostbyname_r with 3 args... " >&6; } -if test ${tcl_cv_api_gethostbyname_r_3+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 3 args" >&5 +$as_echo_n "checking for gethostbyname_r with 3 args... " >&6; } +if ${tcl_cv_api_gethostbyname_r_3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8818,7 +8119,7 @@ else $as_nop #include int -main (void) +main () { char *name; @@ -8831,27 +8132,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_gethostbyname_r_3=yes -else $as_nop +else tcl_cv_api_gethostbyname_r_3=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_3" >&5 -printf "%s\n" "$tcl_cv_api_gethostbyname_r_3" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_3" >&5 +$as_echo "$tcl_cv_api_gethostbyname_r_3" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_3 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h fi fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h fi @@ -8861,20 +8161,21 @@ fi # Avoids picking hidden internal symbol from libc - ac_fn_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" "#include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes -then : + ac_fn_c_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" "#include +" +if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes; then : ac_have_decl=1 -else $as_nop +else ac_have_decl=0 fi -printf "%s\n" "#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl" >>confdefs.h -if test $ac_have_decl = 1 -then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : tcl_cv_api_gethostbyaddr_r=yes -else $as_nop +else tcl_cv_api_gethostbyaddr_r=no fi @@ -8882,15 +8183,13 @@ fi if test "$tcl_cv_api_gethostbyaddr_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r" -if test "x$ac_cv_func_gethostbyaddr_r" = xyes -then : +if test "x$ac_cv_func_gethostbyaddr_r" = xyes; then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 7 args" >&5 -printf %s "checking for gethostbyaddr_r with 7 args... " >&6; } -if test ${tcl_cv_api_gethostbyaddr_r_7+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 7 args" >&5 +$as_echo_n "checking for gethostbyaddr_r with 7 args... " >&6; } +if ${tcl_cv_api_gethostbyaddr_r_7+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8898,7 +8197,7 @@ else $as_nop #include int -main (void) +main () { char *addr; @@ -8916,28 +8215,26 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_gethostbyaddr_r_7=yes -else $as_nop +else tcl_cv_api_gethostbyaddr_r_7=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_7" >&5 -printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_7" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_7" >&5 +$as_echo "$tcl_cv_api_gethostbyaddr_r_7" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_7 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 8 args" >&5 -printf %s "checking for gethostbyaddr_r with 8 args... " >&6; } -if test ${tcl_cv_api_gethostbyaddr_r_8+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 8 args" >&5 +$as_echo_n "checking for gethostbyaddr_r with 8 args... " >&6; } +if ${tcl_cv_api_gethostbyaddr_r_8+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8945,7 +8242,7 @@ else $as_nop #include int -main (void) +main () { char *addr; @@ -8963,26 +8260,25 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_api_gethostbyaddr_r_8=yes -else $as_nop +else tcl_cv_api_gethostbyaddr_r_8=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_8" >&5 -printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_8" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_8" >&5 +$as_echo "$tcl_cv_api_gethostbyaddr_r_8" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_8 if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then -printf "%s\n" "#define HAVE_GETHOSTBYADDR_R 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTBYADDR_R 1" >>confdefs.h fi @@ -9001,27 +8297,42 @@ fi # sys/modem.h is needed on HP-UX. #--------------------------------------------------------------------------- -ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" -if test "x$ac_cv_header_termios_h" = xyes -then : - printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h +for ac_header in termios.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TERMIOS_H 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h +done + +for ac_header in sys/ioctl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_IOCTL_H 1 +_ACEOF fi -ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_modem_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h +done + +for ac_header in sys/modem.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_modem_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MODEM_H 1 +_ACEOF fi +done + #-------------------------------------------------------------------- # Include sys/select.h if it exists and if it supplies things @@ -9033,42 +8344,39 @@ fi # special flag. #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 -printf %s "checking for fd_set in sys/types... " >&6; } -if test ${tcl_cv_type_fd_set+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 +$as_echo_n "checking for fd_set in sys/types... " >&6; } +if ${tcl_cv_type_fd_set+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { fd_set readMask, writeMask; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_fd_set=yes -else $as_nop +else tcl_cv_type_fd_set=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 -printf "%s\n" "$tcl_cv_type_fd_set" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 +$as_echo "$tcl_cv_type_fd_set" >&6; } tcl_ok=$tcl_cv_type_fd_set if test $tcl_ok = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 -printf %s "checking for fd_mask in sys/select... " >&6; } -if test ${tcl_cv_grep_fd_mask+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 +$as_echo_n "checking for fd_mask in sys/select... " >&6; } +if ${tcl_cv_grep_fd_mask+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9076,62 +8384,59 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fd_mask" >/dev/null 2>&1 -then : + $EGREP "fd_mask" >/dev/null 2>&1; then : tcl_cv_grep_fd_mask=present -else $as_nop +else tcl_cv_grep_fd_mask=missing fi -rm -rf conftest* +rm -f conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 -printf "%s\n" "$tcl_cv_grep_fd_mask" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 +$as_echo "$tcl_cv_grep_fd_mask" >&6; } if test $tcl_cv_grep_fd_mask = present; then -printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h +$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h tcl_ok=yes fi fi if test $tcl_ok = no; then -printf "%s\n" "#define NO_FD_SET 1" >>confdefs.h +$as_echo "#define NO_FD_SET 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 -printf %s "checking for pselect... " >&6; } -if test ${tcl_cv_func_pselect+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 +$as_echo_n "checking for pselect... " >&6; } +if ${tcl_cv_func_pselect+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { void *func = pselect; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_func_pselect=yes -else $as_nop +else tcl_cv_func_pselect=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_func_pselect" >&5 -printf "%s\n" "$tcl_cv_func_pselect" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_func_pselect" >&5 +$as_echo "$tcl_cv_func_pselect" >&6; } tcl_ok=$tcl_cv_func_pselect if test $tcl_ok = yes; then -printf "%s\n" "#define HAVE_PSELECT 1" >>confdefs.h +$as_echo "#define HAVE_PSELECT 1" >>confdefs.h fi @@ -9140,70 +8445,73 @@ fi # kqueue(2) on {DragonFly,Free,Net,Open}BSD #------------------------------------------------------------------------ -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for advanced notifier support" >&5 -printf %s "checking for advanced notifier support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for advanced notifier support" >&5 +$as_echo_n "checking for advanced notifier support... " >&6; } case x`uname -s` in xLinux) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: epoll(7)" >&5 -printf "%s\n" "epoll(7)" >&6; } - for ac_header in sys/epoll.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: epoll(7)" >&5 +$as_echo "epoll(7)" >&6; } + for ac_header in sys/epoll.h do : - ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_epoll_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h + ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_epoll_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_EPOLL_H 1 +_ACEOF -printf "%s\n" "#define NOTIFIER_EPOLL 1" >>confdefs.h +$as_echo "#define NOTIFIER_EPOLL 1" >>confdefs.h fi done - for ac_header in sys/eventfd.h + + for ac_header in sys/eventfd.h do : - ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_eventfd_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h + ac_fn_c_check_header_mongrel "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_eventfd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_EVENTFD_H 1 +_ACEOF -printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h +$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h fi -done;; +done +;; xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue(2)" >&5 -printf "%s\n" "kqueue(2)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: kqueue(2)" >&5 +$as_echo "kqueue(2)" >&6; } # Messy because we want to check if *all* the headers are present, and not # just *any* tcl_kqueue_headers=x - for ac_header in sys/types.h sys/event.h sys/time.h + for ac_header in sys/types.h sys/event.h sys/time.h do : - as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes" -then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF tcl_kqueue_headers=${tcl_kqueue_headers}y fi done - if test $tcl_kqueue_headers = xyyy -then : + if test $tcl_kqueue_headers = xyyy; then : -printf "%s\n" "#define NOTIFIER_KQUEUE 1" >>confdefs.h + +$as_echo "#define NOTIFIER_KQUEUE 1" >>confdefs.h fi;; xDarwin) # Assume that we've got CoreFoundation present (checked elsewhere because # of wider impact). - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OSX" >&5 -printf "%s\n" "OSX" >&6; };; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OSX" >&5 +$as_echo "OSX" >&6; };; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; };; + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; };; esac #------------------------------------------------------------------------------ @@ -9212,100 +8520,112 @@ esac - ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi +done - ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" -if test "x$ac_cv_func_gmtime_r" = xyes -then : - printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" -if test "x$ac_cv_func_localtime_r" = xyes -then : - printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h + + for ac_header in sys/time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF fi -ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" -if test "x$ac_cv_func_mktime" = xyes -then : - printf "%s\n" "#define HAVE_MKTIME 1" >>confdefs.h + +done + + + + for ac_func in gmtime_r localtime_r mktime +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_tzadj in struct tm" >&5 -printf %s "checking tm_tzadj in struct tm... " >&6; } -if test ${tcl_cv_member_tm_tzadj+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking tm_tzadj in struct tm" >&5 +$as_echo_n "checking tm_tzadj in struct tm... " >&6; } +if ${tcl_cv_member_tm_tzadj+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct tm tm; (void)tm.tm_tzadj; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_member_tm_tzadj=yes -else $as_nop +else tcl_cv_member_tm_tzadj=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_tzadj" >&5 -printf "%s\n" "$tcl_cv_member_tm_tzadj" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_tzadj" >&5 +$as_echo "$tcl_cv_member_tm_tzadj" >&6; } if test $tcl_cv_member_tm_tzadj = yes ; then -printf "%s\n" "#define HAVE_TM_TZADJ 1" >>confdefs.h +$as_echo "#define HAVE_TM_TZADJ 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_gmtoff in struct tm" >&5 -printf %s "checking tm_gmtoff in struct tm... " >&6; } -if test ${tcl_cv_member_tm_gmtoff+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking tm_gmtoff in struct tm" >&5 +$as_echo_n "checking tm_gmtoff in struct tm... " >&6; } +if ${tcl_cv_member_tm_gmtoff+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { struct tm tm; (void)tm.tm_gmtoff; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_member_tm_gmtoff=yes -else $as_nop +else tcl_cv_member_tm_gmtoff=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_gmtoff" >&5 -printf "%s\n" "$tcl_cv_member_tm_gmtoff" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_gmtoff" >&5 +$as_echo "$tcl_cv_member_tm_gmtoff" >&6; } if test $tcl_cv_member_tm_gmtoff = yes ; then -printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h +$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi @@ -9313,19 +8633,18 @@ printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking long timezone variable" >&5 -printf %s "checking long timezone variable... " >&6; } -if test ${tcl_cv_timezone_long+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking long timezone variable" >&5 +$as_echo_n "checking long timezone variable... " >&6; } +if ${tcl_cv_timezone_long+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { extern long timezone; timezone += 1; @@ -9334,37 +8653,35 @@ extern long timezone; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_timezone_long=yes -else $as_nop +else tcl_cv_timezone_long=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_long" >&5 -printf "%s\n" "$tcl_cv_timezone_long" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_long" >&5 +$as_echo "$tcl_cv_timezone_long" >&6; } if test $tcl_cv_timezone_long = yes ; then -printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h +$as_echo "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking time_t timezone variable" >&5 -printf %s "checking time_t timezone variable... " >&6; } -if test ${tcl_cv_timezone_time+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking time_t timezone variable" >&5 +$as_echo_n "checking time_t timezone variable... " >&6; } +if ${tcl_cv_timezone_time+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { extern time_t timezone; timezone += 1; @@ -9373,19 +8690,18 @@ extern time_t timezone; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_timezone_time=yes -else $as_nop +else tcl_cv_timezone_time=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_time" >&5 -printf "%s\n" "$tcl_cv_timezone_time" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_time" >&5 +$as_echo "$tcl_cv_timezone_time" >&6; } if test $tcl_cv_timezone_time = yes ; then -printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h +$as_echo "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h fi fi @@ -9399,47 +8715,50 @@ printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h if test "$ac_cv_cygwin" != "yes"; then ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_rdev" = xyes -then : +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : -printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_RDEV 1 +_ACEOF fi fi ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "$ac_includes_default" -if test "x$ac_cv_type_blkcnt_t" = xyes -then : +if test "x$ac_cv_type_blkcnt_t" = xyes; then : -printf "%s\n" "#define HAVE_BLKCNT_T 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_BLKCNT_T 1 +_ACEOF fi ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs" -if test "x$ac_cv_func_fstatfs" = xyes -then : +if test "x$ac_cv_func_fstatfs" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_FSTATFS 1" >>confdefs.h +$as_echo "#define NO_FSTATFS 1" >>confdefs.h fi @@ -9451,16 +8770,15 @@ fi #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" -if test "x$ac_cv_func_memmove" = xyes -then : +if test "x$ac_cv_func_memmove" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_MEMMOVE 1" >>confdefs.h +$as_echo "#define NO_MEMMOVE 1" >>confdefs.h -printf "%s\n" "#define NO_STRING_H 1" >>confdefs.h +$as_echo "#define NO_STRING_H 1" >>confdefs.h fi @@ -9471,101 +8789,74 @@ fi #-------------------------------------------------------------------- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes -then : +if test "x$ac_cv_type_mode_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define mode_t int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF fi +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : - ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default -" -if test "x$ac_cv_type_pid_t" = xyes -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if defined _WIN64 && !defined __CYGWIN__ - LLP64 - #endif - -int -main (void) -{ - - ; - return 0; -} +else +cat >>confdefs.h <<_ACEOF +#define pid_t int _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - fi - ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : +if test "x$ac_cv_type_size_t" = xyes; then : -else $as_nop +else -printf "%s\n" "#define size_t unsigned int" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : + $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes -else $as_nop +else ac_cv_type_uid_t=no fi -rm -rf conftest* +rm -f conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -printf "%s\n" "#define uid_t int" >>confdefs.h +$as_echo "#define uid_t int" >>confdefs.h -printf "%s\n" "#define gid_t int" >>confdefs.h +$as_echo "#define gid_t int" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 -printf %s "checking for socklen_t... " >&6; } -if test ${tcl_cv_type_socklen_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if ${tcl_cv_type_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9574,7 +8865,7 @@ else $as_nop #include int -main (void) +main () { socklen_t foo; @@ -9583,19 +8874,18 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_socklen_t=yes -else $as_nop +else tcl_cv_type_socklen_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_socklen_t" >&5 -printf "%s\n" "$tcl_cv_type_socklen_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_socklen_t" >&5 +$as_echo "$tcl_cv_type_socklen_t" >&6; } if test $tcl_cv_type_socklen_t = no; then -printf "%s\n" "#define socklen_t int" >>confdefs.h +$as_echo "#define socklen_t int" >>confdefs.h fi @@ -9603,10 +8893,11 @@ ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" " #include " -if test "x$ac_cv_type_intptr_t" = xyes -then : +if test "x$ac_cv_type_intptr_t" = xyes; then : -printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_INTPTR_T 1 +_ACEOF fi @@ -9614,10 +8905,11 @@ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" " #include " -if test "x$ac_cv_type_uintptr_t" = xyes -then : +if test "x$ac_cv_type_uintptr_t" = xyes; then : -printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF fi @@ -9631,19 +8923,18 @@ fi # the trick. #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking union wait" >&5 -printf %s "checking union wait... " >&6; } -if test ${tcl_cv_union_wait+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking union wait" >&5 +$as_echo_n "checking union wait... " >&6; } +if ${tcl_cv_union_wait+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main (void) +main () { union wait x; @@ -9654,20 +8945,19 @@ WIFEXITED(x); /* Generates compiler error if WIFEXITED return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_union_wait=yes -else $as_nop +else tcl_cv_union_wait=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_union_wait" >&5 -printf "%s\n" "$tcl_cv_union_wait" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_union_wait" >&5 +$as_echo "$tcl_cv_union_wait" >&6; } if test $tcl_cv_union_wait = no; then -printf "%s\n" "#define NO_UNION_WAIT 1" >>confdefs.h +$as_echo "#define NO_UNION_WAIT 1" >>confdefs.h fi @@ -9678,20 +8968,18 @@ fi #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" -if test "x$ac_cv_func_strncasecmp" = xyes -then : +if test "x$ac_cv_func_strncasecmp" = xyes; then : tcl_ok=1 -else $as_nop +else tcl_ok=0 fi if test "$tcl_ok" = 0; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -lsocket" >&5 -printf %s "checking for strncasecmp in -lsocket... " >&6; } -if test ${ac_cv_lib_socket_strncasecmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -lsocket" >&5 +$as_echo_n "checking for strncasecmp in -lsocket... " >&6; } +if ${ac_cv_lib_socket_strncasecmp+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9700,42 +8988,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char strncasecmp (); int -main (void) +main () { return strncasecmp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_strncasecmp=yes -else $as_nop +else ac_cv_lib_socket_strncasecmp=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_strncasecmp" >&5 -printf "%s\n" "$ac_cv_lib_socket_strncasecmp" >&6; } -if test "x$ac_cv_lib_socket_strncasecmp" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_strncasecmp" >&5 +$as_echo "$ac_cv_lib_socket_strncasecmp" >&6; } +if test "x$ac_cv_lib_socket_strncasecmp" = xyes; then : tcl_ok=1 -else $as_nop +else tcl_ok=0 fi fi if test "$tcl_ok" = 0; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -linet" >&5 -printf %s "checking for strncasecmp in -linet... " >&6; } -if test ${ac_cv_lib_inet_strncasecmp+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -linet" >&5 +$as_echo_n "checking for strncasecmp in -linet... " >&6; } +if ${ac_cv_lib_inet_strncasecmp+:} false; then : + $as_echo_n "(cached) " >&6 +else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9744,31 +9032,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char strncasecmp (); int -main (void) +main () { return strncasecmp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_strncasecmp=yes -else $as_nop +else ac_cv_lib_inet_strncasecmp=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_strncasecmp" >&5 -printf "%s\n" "$ac_cv_lib_inet_strncasecmp" >&6; } -if test "x$ac_cv_lib_inet_strncasecmp" = xyes -then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_strncasecmp" >&5 +$as_echo "$ac_cv_lib_inet_strncasecmp" >&6; } +if test "x$ac_cv_lib_inet_strncasecmp" = xyes; then : tcl_ok=1 -else $as_nop +else tcl_ok=0 fi @@ -9793,23 +9082,21 @@ fi #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" -if test "x$ac_cv_func_gettimeofday" = xyes -then : +if test "x$ac_cv_func_gettimeofday" = xyes; then : -else $as_nop +else -printf "%s\n" "#define NO_GETTOD 1" >>confdefs.h +$as_echo "#define NO_GETTOD 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday declaration" >&5 -printf %s "checking for gettimeofday declaration... " >&6; } -if test ${tcl_cv_grep_gettimeofday+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday declaration" >&5 +$as_echo_n "checking for gettimeofday declaration... " >&6; } +if ${tcl_cv_grep_gettimeofday+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9817,20 +9104,19 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gettimeofday" >/dev/null 2>&1 -then : + $EGREP "gettimeofday" >/dev/null 2>&1; then : tcl_cv_grep_gettimeofday=present -else $as_nop +else tcl_cv_grep_gettimeofday=missing fi -rm -rf conftest* +rm -f conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_gettimeofday" >&5 -printf "%s\n" "$tcl_cv_grep_gettimeofday" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_gettimeofday" >&5 +$as_echo "$tcl_cv_grep_gettimeofday" >&6; } if test $tcl_cv_grep_gettimeofday = missing ; then -printf "%s\n" "#define GETTOD_NOT_DECLARED 1" >>confdefs.h +$as_echo "#define GETTOD_NOT_DECLARED 1" >>confdefs.h fi @@ -9840,17 +9126,16 @@ fi # properly generate sign-extended ints from character values. #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -printf %s "checking whether char is unsigned... " >&6; } -if test ${ac_cv_c_char_unsigned+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main (void) +main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; @@ -9860,33 +9145,31 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_char_unsigned=no -else $as_nop +else ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes; then - printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking signed char declarations" >&5 -printf %s "checking signed char declarations... " >&6; } -if test ${tcl_cv_char_signed+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking signed char declarations" >&5 +$as_echo_n "checking signed char declarations... " >&6; } +if ${tcl_cv_char_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { signed char *p; @@ -9896,19 +9179,18 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_char_signed=yes -else $as_nop +else tcl_cv_char_signed=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_char_signed" >&5 -printf "%s\n" "$tcl_cv_char_signed" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_char_signed" >&5 +$as_echo "$tcl_cv_char_signed" >&6; } if test $tcl_cv_char_signed = yes; then -printf "%s\n" "#define HAVE_SIGNED_CHAR 1" >>confdefs.h +$as_echo "#define HAVE_SIGNED_CHAR 1" >>confdefs.h fi @@ -9916,17 +9198,15 @@ fi # Does putenv() copy or not? We need to know to avoid memory leaks. #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a putenv() that copies the buffer" >&5 -printf %s "checking for a putenv() that copies the buffer... " >&6; } -if test ${tcl_cv_putenv_copy+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a putenv() that copies the buffer" >&5 +$as_echo_n "checking for a putenv() that copies the buffer... " >&6; } +if ${tcl_cv_putenv_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else - if test "$cross_compiling" = yes -then : + if test "$cross_compiling" = yes; then : tcl_cv_putenv_copy=no -else $as_nop +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9950,10 +9230,9 @@ else $as_nop } _ACEOF -if ac_fn_c_try_run "$LINENO" -then : +if ac_fn_c_try_run "$LINENO"; then : tcl_cv_putenv_copy=no -else $as_nop +else tcl_cv_putenv_copy=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -9961,11 +9240,11 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_putenv_copy" >&5 -printf "%s\n" "$tcl_cv_putenv_copy" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_putenv_copy" >&5 +$as_echo "$tcl_cv_putenv_copy" >&6; } if test $tcl_cv_putenv_copy = yes; then -printf "%s\n" "#define HAVE_PUTENV_THAT_COPIES 1" >>confdefs.h +$as_echo "#define HAVE_PUTENV_THAT_COPIES 1" >>confdefs.h fi @@ -9975,63 +9254,60 @@ fi # Check whether --enable-langinfo was given. -if test ${enable_langinfo+y} -then : +if test "${enable_langinfo+set}" = set; then : enableval=$enable_langinfo; langinfo_ok=$enableval -else $as_nop +else langinfo_ok=yes fi HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then - ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_langinfo_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes; then : langinfo_ok=yes -else $as_nop +else langinfo_ok=no fi + fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use nl_langinfo" >&5 -printf %s "checking whether to use nl_langinfo... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use nl_langinfo" >&5 +$as_echo_n "checking whether to use nl_langinfo... " >&6; } if test "$langinfo_ok" = "yes"; then - if test ${tcl_cv_langinfo_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${tcl_cv_langinfo_h+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main (void) +main () { nl_langinfo(CODESET); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_langinfo_h=yes -else $as_nop +else tcl_cv_langinfo_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_langinfo_h" >&5 -printf "%s\n" "$tcl_cv_langinfo_h" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_langinfo_h" >&5 +$as_echo "$tcl_cv_langinfo_h" >&6; } if test $tcl_cv_langinfo_h = yes; then -printf "%s\n" "#define HAVE_LANGINFO 1" >>confdefs.h +$as_echo "#define HAVE_LANGINFO 1" >>confdefs.h fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $langinfo_ok" >&5 -printf "%s\n" "$langinfo_ok" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $langinfo_ok" >&5 +$as_echo "$langinfo_ok" >&6; } fi @@ -10039,24 +9315,17 @@ printf "%s\n" "$langinfo_ok" >&6; } # Check for support of cfmakeraw, chflags and mkstemps functions #-------------------------------------------------------------------- -ac_fn_c_check_func "$LINENO" "cfmakeraw" "ac_cv_func_cfmakeraw" -if test "x$ac_cv_func_cfmakeraw" = xyes -then : - printf "%s\n" "#define HAVE_CFMAKERAW 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" -if test "x$ac_cv_func_chflags" = xyes -then : - printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "mkstemps" "ac_cv_func_mkstemps" -if test "x$ac_cv_func_mkstemps" = xyes -then : - printf "%s\n" "#define HAVE_MKSTEMPS 1" >>confdefs.h +for ac_func in cfmakeraw chflags mkstemps +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done #-------------------------------------------------------------------- @@ -10064,66 +9333,92 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then - ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" -if test "x$ac_cv_func_getattrlist" = xyes -then : - printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h + for ac_func in getattrlist +do : + ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" +if test "x$ac_cv_func_getattrlist" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETATTRLIST 1 +_ACEOF fi +done - ac_fn_c_check_header_compile "$LINENO" "copyfile.h" "ac_cv_header_copyfile_h" "$ac_includes_default" -if test "x$ac_cv_header_copyfile_h" = xyes -then : - printf "%s\n" "#define HAVE_COPYFILE_H 1" >>confdefs.h + for ac_header in copyfile.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "copyfile.h" "ac_cv_header_copyfile_h" "$ac_includes_default" +if test "x$ac_cv_header_copyfile_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_COPYFILE_H 1 +_ACEOF fi - ac_fn_c_check_func "$LINENO" "copyfile" "ac_cv_func_copyfile" -if test "x$ac_cv_func_copyfile" = xyes -then : - printf "%s\n" "#define HAVE_COPYFILE 1" >>confdefs.h +done + + for ac_func in copyfile +do : + ac_fn_c_check_func "$LINENO" "copyfile" "ac_cv_func_copyfile" +if test "x$ac_cv_func_copyfile" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_COPYFILE 1 +_ACEOF fi +done if test $tcl_corefoundation = yes; then - ac_fn_c_check_header_compile "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default" -if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBKERN_OSATOMIC_H 1" >>confdefs.h + for ac_header in libkern/OSAtomic.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default" +if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBKERN_OSATOMIC_H 1 +_ACEOF fi - ac_fn_c_check_func "$LINENO" "OSSpinLockLock" "ac_cv_func_OSSpinLockLock" -if test "x$ac_cv_func_OSSpinLockLock" = xyes -then : - printf "%s\n" "#define HAVE_OSSPINLOCKLOCK 1" >>confdefs.h +done + + for ac_func in OSSpinLockLock +do : + ac_fn_c_check_func "$LINENO" "OSSpinLockLock" "ac_cv_func_OSSpinLockLock" +if test "x$ac_cv_func_OSSpinLockLock" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OSSPINLOCKLOCK 1 +_ACEOF fi +done fi -printf "%s\n" "#define TCL_DEFAULT_ENCODING \"utf-8\"" >>confdefs.h +$as_echo "#define TCL_DEFAULT_ENCODING \"utf-8\"" >>confdefs.h -printf "%s\n" "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h +$as_echo "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h -printf "%s\n" "#define TCL_WIDE_CLICKS 1" >>confdefs.h +$as_echo "#define TCL_WIDE_CLICKS 1" >>confdefs.h - ac_fn_c_check_header_compile "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" -if test "x$ac_cv_header_AvailabilityMacros_h" = xyes -then : - printf "%s\n" "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h + for ac_header in AvailabilityMacros.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" +if test "x$ac_cv_header_AvailabilityMacros_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_AVAILABILITYMACROS_H 1 +_ACEOF fi +done + if test "$ac_cv_header_AvailabilityMacros_h" = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 -printf %s "checking if weak import is available... " >&6; } -if test ${tcl_cv_cc_weak_import+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 +$as_echo_n "checking if weak import is available... " >&6; } +if ${tcl_cv_cc_weak_import+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10139,36 +9434,34 @@ else $as_nop int rand(void) __attribute__((weak_import)); int -main (void) +main () { rand(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_weak_import=yes -else $as_nop +else tcl_cv_cc_weak_import=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 -printf "%s\n" "$tcl_cv_cc_weak_import" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 +$as_echo "$tcl_cv_cc_weak_import" >&6; } if test $tcl_cv_cc_weak_import = yes; then -printf "%s\n" "#define HAVE_WEAK_IMPORT 1" >>confdefs.h +$as_echo "#define HAVE_WEAK_IMPORT 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 -printf %s "checking if Darwin SUSv3 extensions are available... " >&6; } -if test ${tcl_cv_cc_darwin_c_source+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 +$as_echo_n "checking if Darwin SUSv3 extensions are available... " >&6; } +if ${tcl_cv_cc_darwin_c_source+:} false; then : + $as_echo_n "(cached) " >&6 +else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10185,27 +9478,26 @@ else $as_nop #include int -main (void) +main () { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" -then : +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_darwin_c_source=yes -else $as_nop +else tcl_cv_cc_darwin_c_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 -printf "%s\n" "$tcl_cv_cc_darwin_c_source" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 +$as_echo "$tcl_cv_cc_darwin_c_source" >&6; } if test $tcl_cv_cc_darwin_c_source = yes; then -printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h +$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h fi fi @@ -10221,12 +9513,11 @@ fi # Check for support of fts functions (readdir replacement) #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fts" >&5 -printf %s "checking for fts... " >&6; } -if test ${tcl_cv_api_fts+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fts" >&5 +$as_echo_n "checking for fts... " >&6; } +if ${tcl_cv_api_fts+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10236,7 +9527,7 @@ else $as_nop #include int -main (void) +main () { char*const p[2] = {"/", NULL}; @@ -10247,20 +9538,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_api_fts=yes -else $as_nop +else tcl_cv_api_fts=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_fts" >&5 -printf "%s\n" "$tcl_cv_api_fts" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_fts" >&5 +$as_echo "$tcl_cv_api_fts" >&6; } if test $tcl_cv_api_fts = yes; then -printf "%s\n" "#define HAVE_FTS 1" >>confdefs.h +$as_echo "#define HAVE_FTS 1" >>confdefs.h fi @@ -10271,35 +9561,44 @@ fi #-------------------------------------------------------------------- - ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + for ac_header in sys/ioctl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_IOCTL_H 1 +_ACEOF fi - ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_filio_h" = xyes -then : - printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h +done + + for ac_header in sys/filio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_filio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_FILIO_H 1 +_ACEOF fi +done + - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 -printf %s "checking system version... " >&6; } -if test ${tcl_cv_sys_version+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 +$as_echo_n "checking system version... " >&6; } +if ${tcl_cv_sys_version+:} false; then : + $as_echo_n "(cached) " >&6 +else if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 -printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 +$as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then @@ -10312,46 +9611,45 @@ printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 -printf "%s\n" "$tcl_cv_sys_version" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 +$as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 -printf %s "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 +$as_echo_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... " >&6; } case $system in OSF*) -printf "%s\n" "#define USE_FIONBIO 1" >>confdefs.h +$as_echo "#define USE_FIONBIO 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FIONBIO" >&5 -printf "%s\n" "FIONBIO" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: FIONBIO" >&5 +$as_echo "FIONBIO" >&6; } ;; *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: O_NONBLOCK" >&5 -printf "%s\n" "O_NONBLOCK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: O_NONBLOCK" >&5 +$as_echo "O_NONBLOCK" >&6; } ;; esac #------------------------------------------------------------------------ -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use dll unloading" >&5 -printf %s "checking whether to use dll unloading... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dll unloading" >&5 +$as_echo_n "checking whether to use dll unloading... " >&6; } # Check whether --enable-dll-unloading was given. -if test ${enable_dll_unloading+y} -then : +if test "${enable_dll_unloading+set}" = set; then : enableval=$enable_dll_unloading; tcl_ok=$enableval -else $as_nop +else tcl_ok=yes fi if test $tcl_ok = yes; then -printf "%s\n" "#define TCL_UNLOAD_DLLS 1" >>confdefs.h +$as_echo "#define TCL_UNLOAD_DLLS 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 -printf "%s\n" "$tcl_ok" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 +$as_echo "$tcl_ok" >&6; } #------------------------------------------------------------------------ # Check whether the timezone data is supplied by the OS or has @@ -10359,14 +9657,13 @@ printf "%s\n" "$tcl_ok" >&6; } # be overridden on the configure command line either way. #------------------------------------------------------------------------ -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5 -printf %s "checking for timezone data... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5 +$as_echo_n "checking for timezone data... " >&6; } # Check whether --with-tzdata was given. -if test ${with_tzdata+y} -then : +if test "${with_tzdata+set}" = set; then : withval=$with_tzdata; tcl_ok=$withval -else $as_nop +else tcl_ok=auto fi @@ -10376,17 +9673,16 @@ fi # case $tcl_ok in no) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by OS vendor" >&5 -printf "%s\n" "supplied by OS vendor" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: supplied by OS vendor" >&5 +$as_echo "supplied by OS vendor" >&6; } ;; yes) # nothing to do here ;; auto*) - if test ${tcl_cv_dir_zoneinfo+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if ${tcl_cv_dir_zoneinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else for dir in /usr/share/zoneinfo \ /usr/share/lib/zoneinfo \ @@ -10402,8 +9698,8 @@ fi if test -n "$tcl_cv_dir_zoneinfo"; then tcl_ok=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dir" >&5 -printf "%s\n" "$dir" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dir" >&5 +$as_echo "$dir" >&6; } else tcl_ok=yes fi @@ -10414,8 +9710,8 @@ printf "%s\n" "$dir" >&6; } esac if test $tcl_ok = yes then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by Tcl" >&5 -printf "%s\n" "supplied by Tcl" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: supplied by Tcl" >&5 +$as_echo "supplied by Tcl" >&6; } INSTALL_TZDATA=install-tzdata fi @@ -10424,32 +9720,30 @@ fi #-------------------------------------------------------------------- # Check whether --enable-dtrace was given. -if test ${enable_dtrace+y} -then : +if test "${enable_dtrace+set}" = set; then : enableval=$enable_dtrace; tcl_ok=$enableval -else $as_nop +else tcl_ok=no fi if test $tcl_ok = yes; then - ac_fn_c_check_header_compile "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sdt_h" = xyes -then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sdt_h" = xyes; then : tcl_ok=yes -else $as_nop +else tcl_ok=no fi + fi if test $tcl_ok = yes; then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_DTRACE+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DTRACE+:} false; then : + $as_echo_n "(cached) " >&6 +else case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. @@ -10460,15 +9754,11 @@ as_dummy="$PATH:/usr/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_DTRACE="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10480,22 +9770,22 @@ esac fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -printf "%s\n" "$DTRACE" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 +$as_echo "$DTRACE" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi test -z "$ac_cv_path_DTRACE" && tcl_ok=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable DTrace support" >&5 -printf %s "checking whether to enable DTrace support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DTrace support" >&5 +$as_echo_n "checking whether to enable DTrace support... " >&6; } MAKEFILE_SHELL='/bin/sh' if test $tcl_ok = yes; then -printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h +$as_echo "#define USE_DTRACE 1" >>confdefs.h DTRACE_SRC="\${DTRACE_SRC}" DTRACE_HDR="\${DTRACE_HDR}" @@ -10513,25 +9803,24 @@ printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h fi fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 -printf "%s\n" "$tcl_ok" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 +$as_echo "$tcl_ok" >&6; } #-------------------------------------------------------------------- # The check below checks whether the cpuid instruction is usable. #-------------------------------------------------------------------- -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cpuid instruction is usable" >&5 -printf %s "checking whether the cpuid instruction is usable... " >&6; } -if test ${tcl_cv_cpuid+y} -then : - printf %s "(cached) " >&6 -else $as_nop +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cpuid instruction is usable" >&5 +$as_echo_n "checking whether the cpuid instruction is usable... " >&6; } +if ${tcl_cv_cpuid+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main (void) +main () { int index,regsPtr[4]; @@ -10546,20 +9835,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cpuid=yes -else $as_nop +else tcl_cv_cpuid=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid" >&5 -printf "%s\n" "$tcl_cv_cpuid" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid" >&5 +$as_echo "$tcl_cv_cpuid" >&6; } if test $tcl_cv_cpuid = yes; then -printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h +$as_echo "#define HAVE_CPUID 1" >>confdefs.h fi @@ -10590,39 +9878,38 @@ HTML_DIR='$(DISTDIR)/html' if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 -printf %s "checking how to package libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 +$as_echo_n "checking how to package libraries... " >&6; } # Check whether --enable-framework was given. -if test ${enable_framework+y} -then : +if test "${enable_framework+set}" = set; then : enableval=$enable_framework; enable_framework=$enableval -else $as_nop +else enable_framework=no fi if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 -printf "%s\n" "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 +$as_echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 -printf "%s\n" "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 +$as_echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: framework" >&5 -printf "%s\n" "framework" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: framework" >&5 +$as_echo "framework" >&6; } FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 -printf "%s\n" "shared library" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 +$as_echo "shared library" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static library" >&5 -printf "%s\n" "static library" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static library" >&5 +$as_echo "static library" >&6; } fi FRAMEWORK_BUILD=0 fi @@ -10640,7 +9927,7 @@ fi if test "$FRAMEWORK_BUILD" = "1" ; then -printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h +$as_echo "#define TCL_FRAMEWORK 1" >>confdefs.h # Construct a fake local framework structure to make linking with # '-framework Tcl' and running of tcltest work @@ -10698,10 +9985,9 @@ VERSION=${TCL_VERSION} # Zipfs support - Tip 430 #-------------------------------------------------------------------- # Check whether --enable-zipfs was given. -if test ${enable_zipfs+y} -then : +if test "${enable_zipfs+set}" = set; then : enableval=$enable_zipfs; tcl_ok=$enableval -else $as_nop +else tcl_ok=yes fi @@ -10714,12 +10000,11 @@ if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5 -printf %s "checking for gcc... " >&6; } - if test ${ac_cv_path_cc+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5 +$as_echo_n "checking for gcc... " >&6; } + if ${ac_cv_path_cc+:} false; then : + $as_echo_n "(cached) " >&6 +else search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do @@ -10745,12 +10030,11 @@ fi OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5 -printf %s "checking for build system executable suffix... " >&6; } -if test ${bfd_cv_build_exeext+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5 +$as_echo_n "checking for build system executable suffix... " >&6; } +if ${bfd_cv_build_exeext+:} false; then : + $as_echo_n "(cached) " >&6 +else rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= @@ -10764,8 +10048,8 @@ else $as_nop rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5 -printf "%s\n" "$bfd_cv_build_exeext" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5 +$as_echo "$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi @@ -10780,12 +10064,11 @@ printf "%s\n" "$bfd_cv_build_exeext" >&6; } ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macher" >&5 -printf %s "checking for macher... " >&6; } - if test ${ac_cv_path_macher+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for macher" >&5 +$as_echo_n "checking for macher... " >&6; } + if ${ac_cv_path_macher+:} false; then : + $as_echo_n "(cached) " >&6 +else search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do @@ -10804,17 +10087,16 @@ fi if test -f "$ac_cv_path_macher" ; then MACHER_PROG="$ac_cv_path_macher" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHER_PROG" >&5 -printf "%s\n" "$MACHER_PROG" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Found macher in environment" >&5 -printf "%s\n" "Found macher in environment" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACHER_PROG" >&5 +$as_echo "$MACHER_PROG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found macher in environment" >&5 +$as_echo "Found macher in environment" >&6; } fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zip" >&5 -printf %s "checking for zip... " >&6; } - if test ${ac_cv_path_zip+y} -then : - printf %s "(cached) " >&6 -else $as_nop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zip" >&5 +$as_echo_n "checking for zip... " >&6; } + if ${ac_cv_path_zip+:} false; then : + $as_echo_n "(cached) " >&6 +else search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do @@ -10833,12 +10115,12 @@ fi if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5 -printf "%s\n" "$ZIP_PROG" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5 +$as_echo "$ZIP_PROG" >&6; } ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5 -printf "%s\n" "Found INFO Zip in environment" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5 +$as_echo "Found INFO Zip in environment" >&6; } # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. @@ -10847,8 +10129,8 @@ printf "%s\n" "Found INFO Zip in environment" >&6; } ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5 -printf "%s\n" "No zip found on PATH. Building minizip" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5 +$as_echo "No zip found on PATH. Building minizip" >&6; } fi @@ -10863,28 +10145,34 @@ else TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5 -printf %s "checking for building with zipfs... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5 +$as_echo_n "checking for building with zipfs... " >&6; } if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; -printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h +$as_echo "#define ZIPFS_BUILD 2" >>confdefs.h else -printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h +$as_echo "#define ZIPFS_BUILD 1" >>confdefs.h \ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi +# Point to tcl script library if we are not embedding it. +if test "${ZIPFS_BUILD}" = 0; then +TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library +fi + + @@ -11030,8 +10318,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -11061,15 +10349,15 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -11083,8 +10371,8 @@ printf "%s\n" "$as_me: updating cache $cache_file" >&6;} fi fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -11139,8 +10427,8 @@ CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -11163,16 +10451,14 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -11182,46 +10468,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -11230,6 +10516,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -11238,12 +10531,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -11255,10 +10544,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -11271,14 +10580,13 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -11305,20 +10613,18 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset - # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -11330,13 +10636,12 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -11367,7 +10672,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -11389,10 +10694,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -11406,12 +10707,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -11453,7 +10748,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -11462,7 +10757,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -11525,7 +10820,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by tcl $as_me 8.7, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -11578,16 +10873,14 @@ $config_commands Report bugs to the package provider." _ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ tcl config.status 8.7 -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -11624,21 +10917,21 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -11666,7 +10959,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -11680,7 +10973,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF @@ -11716,8 +11009,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -11945,7 +11238,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -11953,17 +11246,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -11980,7 +11273,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -12004,9 +11297,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -12059,8 +11352,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -12102,9 +11395,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -12116,8 +11409,8 @@ which seems to be undefined. Please make sure it is defined" >&2;} ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -12164,9 +11457,8 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi - diff --git a/unix/configure.ac b/unix/configure.ac index 0f06e62..99a096e 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -870,11 +870,17 @@ AC_MSG_RESULT([no]) INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi + +# Point to tcl script library if we are not embedding it. +if test "${ZIPFS_BUILD}" = 0; then +TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library +fi + AC_SUBST(ZIPFS_BUILD) AC_SUBST(TCL_ZIP_FILE) AC_SUBST(INSTALL_LIBRARIES) AC_SUBST(INSTALL_MSGS) - +AC_SUBST(TCL_BUILDTIME_LIBRARY) #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which -- cgit v0.12 From a70d5fb05ffc7e1e7cdade79a7205b8d82bda1a9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 9 Oct 2023 10:33:38 +0000 Subject: Fix test targets in mingw builds to not set TCL_LIBRARY when zipfs enabled --- win/Makefile.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/win/Makefile.in b/win/Makefile.in index 367ed79..0250911 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -126,10 +126,6 @@ ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)') MINIZIP_DIR_NATIVE = $(shell $(CYGPATH) '$(MINIZIP_DIR)') TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') -# Fully qualify library path so that `make test` -# does not depend on the current directory. -LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P) -LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ @@ -232,6 +228,14 @@ SHARED_BUILD = @SHARED_BUILD@ INSTALL_MSGS = @INSTALL_MSGS@ INSTALL_LIBRARIES = @INSTALL_LIBRARIES@ +# Fully qualify library path so that `make test` +# does not depend on the current directory. +# Only define these if not embedding the library +ifeq ($(ZIPFS_BUILD), 0) +LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P) +LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') +endif + # Minizip MINIZIP_OBJS = \ adler32.$(HOST_OBJEXT) \ -- cgit v0.12 From 8fcde163217c761abb7632d90df499b50a8cb5c1 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 9 Oct 2023 10:43:15 +0000 Subject: No need to fake embedded zip now that tcltest build is fixed --- tests/zipfs.test | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index 6dbf834..453bb43 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -19,7 +19,6 @@ if {"::tcltest" ni [namespace children]} { source [file join [file dirname [info script]] tcltests.tcl] testConstraint zipfs [expr {[llength [info commands zipfs]]}] -testConstraint zipfslib 1 set ziproot [zipfs root] @@ -34,20 +33,15 @@ test zipfs-0.1 {zipfs basics} -constraints zipfs -body { expr {${ziproot} in [file volumes]} } -result 1 -if {![string match ${ziproot}* $tcl_library]} { - ### - # "make test" does not map tcl_library from the dynamic library on Unix - # - # Hack the environment to pretend we did pull tcl_library from a zip - # archive - ### - set tclzip [file join $CWD libtcl[info patchlevel].zip] - testConstraint zipfslib [file isfile $tclzip] - if {[testConstraint zipfslib]} { - zipfs mount $tclzip /lib/tcl - set ::tcl_library ${ziproot}lib/tcl/tcl_library - } +if {[string match ${ziproot}* $tcl_library]} { + testConstraint zipfslib 1 + set zipLibTop [file tail [file join {*}[lrange [file split $tcl_library] 0 1]]] +} else { + set zipLibTop "" } +puts M:[zipfs mount] +puts L:$tcl_library +puts C:[testConstraint zipfslib] test zipfs-0.2 {zipfs basics} -constraints zipfslib -body { string match ${ziproot}* $tcl_library @@ -1431,15 +1425,15 @@ namespace eval test_ns_zipfs { # NOTE: test root mounts separately because some bugs only showed up on these set rootMounts [list test.zip /] - testzipfsglob root-1 $rootMounts [list [zipfs root]*] [zipfspaths lib test testdir] -constraints zipfslib + testzipfsglob root-1 $rootMounts [list [zipfs root]*] [zipfspaths $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-2 $rootMounts [list [zipfs root]*] [zipfspaths test testdir] -constraints !zipfslib testzipfsglob root-pat $rootMounts [list [zipfs root]t*d*] [zipfspaths testdir] testzipfsglob root-deep $rootMounts [list [zipfs root]tes*/*] [zipfspaths testdir/test2] - testzipfsglob root-dir-1 $rootMounts [list -directory [zipfs root] *] [zipfspaths lib test testdir] -constraints zipfslib + testzipfsglob root-dir-1 $rootMounts [list -directory [zipfs root] *] [zipfspaths $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-dir-2 $rootMounts [list -directory [zipfs root] *] [zipfspaths test testdir] -constraints !zipfslib - testzipfsglob root-dir-tails-1 $rootMounts [list -tails -dir [zipfs root] *] [list lib test testdir] -constraints zipfslib + testzipfsglob root-dir-tails-1 $rootMounts [list -tails -dir [zipfs root] *] [list $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-dir-tails-2 $rootMounts [list -tails -dir [zipfs root] *] [list test testdir] -constraints !zipfslib - testzipfsglob root-type-d-1 $rootMounts [list -type d [zipfs root]*] [zipfspaths lib testdir] -constraints zipfslib + testzipfsglob root-type-d-1 $rootMounts [list -type d [zipfs root]*] [zipfspaths $::zipLibTop testdir] -constraints zipfslib testzipfsglob root-type-d-2 $rootMounts [list -type d [zipfs root]*] [zipfspaths testdir] -constraints !zipfslib testzipfsglob root-type-f $rootMounts [list -type f [zipfs root]*] [zipfspaths test] testzipfsglob root-path $rootMounts [list -path [zipfs root]t *d*] [zipfspaths testdir] @@ -1449,7 +1443,7 @@ namespace eval test_ns_zipfs { # glob operations on intermediate directories (mezzo) in mount # paths is another source of bugs set mezzoMounts [list test.zip $defMountPt/a/b test-overlay.zip $defMountPt/a/c] - testzipfsglob mezzo-root-1 $mezzoMounts [list [zipfs root]*] [list [zipfs root]lib $defMountPt] -constraints zipfslib + testzipfsglob mezzo-root-1 $mezzoMounts [list [zipfs root]*] [zipfspaths $::zipLibTop $defMountPt] -constraints zipfslib testzipfsglob mezzo-root-2 $mezzoMounts [list [zipfs root]*] [list $defMountPt] -constraints !zipfslib testzipfsglob mezzo-mountgrandparent $mezzoMounts [list $defMountPt/*] [list $defMountPt/a] testzipfsglob mezzo-mountparent $mezzoMounts [list $defMountPt/a/*] [zipfspathsmt $defMountPt/a b c] -- cgit v0.12 From 635e02b568dbc69eb71a94ff3be6113422dff6e0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 9 Oct 2023 18:24:20 +0000 Subject: Update rules.vc --- win/rules.vc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win/rules.vc b/win/rules.vc index 3a95aab..bca056c 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -1530,6 +1530,10 @@ INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)" # cflags contains generic flags used for building practically all object files cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug) +!if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 +cflags = $(cflags) -DTcl_Size=int +!endif + # appcflags contains $(cflags) and flags for building the application # object files (e.g. tclsh, or wish) pkgcflags contains $(cflags) plus # flags used for building shared object files The two differ in the -- cgit v0.12 From 9fb523117884acb452a530daf5fa93a9d2f41cb2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 9 Oct 2023 20:37:52 +0000 Subject: Fix [d0d0749467]: TclFSUnloadTempFile() is unused --- generic/tclIOUtil.c | 93 ----------------------------------------------------- generic/tclInt.h | 1 - 2 files changed, 94 deletions(-) diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index ca11172..a4febaa 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3696,99 +3696,6 @@ Tcl_FSUnloadFile( } /* - *---------------------------------------------------------------------- - * - * TclFSUnloadTempFile -- - * - * This function is called when we loaded a library of code via an - * intermediate temporary file. This function ensures the library is - * correctly unloaded and the temporary file is correctly deleted. - * - * Results: - * None. - * - * Side effects: - * The effects of the 'unload' function called, and of course the - * temporary file will be deleted. - * - *---------------------------------------------------------------------- - */ - -void -TclFSUnloadTempFile( - Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to - * Tcl_FSLoadFile(). The loadHandle is a token - * that represents the loaded file. */ -{ - FsDivertLoad *tvdlPtr = (FsDivertLoad *) loadHandle; - - /* - * This test should never trigger, since we give the client data in the - * function above. - */ - - if (tvdlPtr == NULL) { - return; - } - - /* - * Call the real 'unloadfile' proc we actually used. It is very important - * that we call this first, so that the shared library is actually - * unloaded by the OS. Otherwise, the following 'delete' may well fail - * because the shared library is still in use. - */ - - if (tvdlPtr->unloadProcPtr != NULL) { - tvdlPtr->unloadProcPtr(tvdlPtr->loadHandle); - } - - if (tvdlPtr->divertedFilesystem == NULL) { - /* - * It was the native filesystem, and we have a special function - * available just for this purpose, which we know works even at this - * late stage. - */ - - TclpDeleteFile(tvdlPtr->divertedFileNativeRep); - NativeFreeInternalRep(tvdlPtr->divertedFileNativeRep); - } else { - /* - * Remove the temporary file we created. Note, we may crash here - * because encodings have been taken down already. - */ - - if (tvdlPtr->divertedFilesystem->deleteFileProc(tvdlPtr->divertedFile) - != TCL_OK) { - /* - * The above may have failed because the filesystem, or something - * it depends upon (e.g. encodings) have been taken down because - * Tcl is exiting. - * - * We may need to work out how to delete this file more robustly - * (or give the filesystem the information it needs to delete the - * file more robustly). - * - * In particular, one problem might be that the filesystem cannot - * extract the information it needs from the above path object - * because Tcl's entire filesystem apparatus (the code in this - * file) has been finalized, and it refuses to pass the internal - * representation to the filesystem. - */ - } - - /* - * And free up the allocations. This will also of course remove a - * refCount from the Tcl_Filesystem to which this file belongs, which - * could then free up the filesystem if we are exiting. - */ - - Tcl_DecrRefCount(tvdlPtr->divertedFile); - } - - ckfree(tvdlPtr); -} - -/* *--------------------------------------------------------------------------- * * Tcl_FSLink -- diff --git a/generic/tclInt.h b/generic/tclInt.h index 9993440..4d28dbe 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2970,7 +2970,6 @@ MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); MODULE_SCOPE int TclNREvalFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *encodingName); -MODULE_SCOPE void TclFSUnloadTempFile(Tcl_LoadHandle loadHandle); MODULE_SCOPE int * TclGetAsyncReadyPtr(void); MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp); MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp, -- cgit v0.12 From a74d73bc13dd4961d02d3974912000145bff5d1a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 9 Oct 2023 20:39:27 +0000 Subject: Fix [db537f8809]: tclInt.h: TclNsDecrRefCount() declaration duplicated --- generic/tclInt.h | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 4d28dbe..103827f 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3043,7 +3043,6 @@ MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc, MODULE_SCOPE Tcl_Obj * TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options); MODULE_SCOPE int TclNokia770Doubles(void); MODULE_SCOPE void TclNsDecrRefCount(Namespace *nsPtr); -MODULE_SCOPE void TclNsDecrRefCount(Namespace *nsPtr); MODULE_SCOPE int TclNamespaceDeleted(Namespace *nsPtr); MODULE_SCOPE void TclObjVarErrMsg(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, const char *operation, -- cgit v0.12 From 462e3dd262738368000603e841b1365c4dc115b4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 10 Oct 2023 11:35:22 +0000 Subject: Proposed fix for [8ab8a138c9]: Do not pass incompatible function pointers to Tcl_EventuallyFree(). This should eliminate all warnings when using -fsanitize=function. --- generic/tclBasic.c | 7 ++++--- generic/tclIORChan.c | 9 +++++---- generic/tclIORTrans.c | 17 +++++++++-------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 9d84de2..f46a778 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -136,7 +136,7 @@ static int CancelEvalProc(ClientData clientData, Tcl_Interp *interp, int code); static int CheckDoubleResult(Tcl_Interp *interp, double dResult); static void DeleteCoroutine(ClientData clientData); -static void DeleteInterpProc(Tcl_Interp *interp); +static void DeleteInterpProc(void *blockPtr); static void DeleteOpCmdClientData(ClientData clientData); #ifdef USE_DTRACE static Tcl_ObjCmdProc DTraceObjCmd; @@ -1392,7 +1392,7 @@ Tcl_DeleteInterp( * Ensure that the interpreter is eventually deleted. */ - Tcl_EventuallyFree(interp, (Tcl_FreeProc *) DeleteInterpProc); + Tcl_EventuallyFree(interp, (Tcl_FreeProc *)(void *)DeleteInterpProc); } /* @@ -1418,8 +1418,9 @@ Tcl_DeleteInterp( static void DeleteInterpProc( - Tcl_Interp *interp) /* Interpreter to delete. */ + void *blockPtr) /* Interpreter to delete. */ { + Tcl_Interp *interp = (Tcl_Interp *) blockPtr; Interp *iPtr = (Interp *) interp; Tcl_HashEntry *hPtr; Tcl_HashSearch search; diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 3eca3f8..792cf80 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -430,7 +430,7 @@ static Tcl_Obj * DecodeEventMask(int mask); static ReflectedChannel * NewReflectedChannel(Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, int mode, Tcl_Obj *handleObj); static Tcl_Obj * NextHandle(void); -static void FreeReflectedChannel(ReflectedChannel *rcPtr); +static void FreeReflectedChannel(void *blockPtr); static int InvokeTclMethod(ReflectedChannel *rcPtr, MethodName method, Tcl_Obj *argOneObj, Tcl_Obj *argTwoObj, Tcl_Obj **resultObjPtr); @@ -1170,7 +1170,7 @@ ReflectClose( ckfree((char *)tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } - Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel); + Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *)(void *)FreeReflectedChannel); return EOK; } @@ -1239,7 +1239,7 @@ ReflectClose( ckfree((char *)tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } - Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel); + Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *)(void *)FreeReflectedChannel); return (result == TCL_OK) ? EOK : EINVAL; } @@ -2210,8 +2210,9 @@ NextHandle(void) static void FreeReflectedChannel( - ReflectedChannel *rcPtr) + void *blockPtr) { + ReflectedChannel *rcPtr = (ReflectedChannel *) blockPtr; Channel *chanPtr = (Channel *) rcPtr->chan; TclChannelRelease((Tcl_Channel)chanPtr); diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 730820e..d8d8b25 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -417,7 +417,7 @@ static ReflectedTransform * NewReflectedTransform(Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, int mode, Tcl_Obj *handleObj, Tcl_Channel parentChan); static Tcl_Obj * NextHandle(void); -static void FreeReflectedTransform(ReflectedTransform *rtPtr); +static void FreeReflectedTransform(void *blockPtr); static void FreeReflectedTransformArgs(ReflectedTransform *rtPtr); static int InvokeTclMethod(ReflectedTransform *rtPtr, const char *method, Tcl_Obj *argOneObj, @@ -718,7 +718,7 @@ TclChanPushObjCmd( * structure. */ - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); return TCL_ERROR; #undef CHAN @@ -924,7 +924,7 @@ ReflectClose( } #endif /* TCL_THREADS */ - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); return EOK; } @@ -941,7 +941,7 @@ ReflectClose( #ifdef TCL_THREADS if (rtPtr->thread != Tcl_GetCurrentThread()) { Tcl_EventuallyFree(rtPtr, - (Tcl_FreeProc *) FreeReflectedTransform); + (Tcl_FreeProc *)(void *)FreeReflectedTransform); return errorCode; } #endif /* TCL_THREADS */ @@ -955,7 +955,7 @@ ReflectClose( #ifdef TCL_THREADS if (rtPtr->thread != Tcl_GetCurrentThread()) { Tcl_EventuallyFree(rtPtr, - (Tcl_FreeProc *) FreeReflectedTransform); + (Tcl_FreeProc *)(void *)FreeReflectedTransform); return errorCode; } #endif /* TCL_THREADS */ @@ -975,7 +975,7 @@ ReflectClose( ForwardOpToOwnerThread(rtPtr, ForwardedClose, &p); result = p.base.code; - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); if (result != TCL_OK) { PassReceivedErrorInterp(interp, &p); @@ -1034,7 +1034,7 @@ ReflectClose( #endif /* TCL_THREADS */ } - Tcl_EventuallyFree (rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); return errorCodeSet ? errorCode : ((result == TCL_OK) ? EOK : EINVAL); } @@ -1920,8 +1920,9 @@ FreeReflectedTransformArgs( static void FreeReflectedTransform( - ReflectedTransform *rtPtr) + void *blockPtr) { + ReflectedTransform *rtPtr = (ReflectedTransform *) blockPtr; TimerKill(rtPtr); ResultClear(&rtPtr->result); -- cgit v0.12 From 0cc51f1259bd11611fce289213ceb3ae398d2406 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 10 Oct 2023 11:37:16 +0000 Subject: Follow-up for extensions: This way, usage of Tcl_EventuallyFree() won't give warnings any more. Only do this for 8.6 and 8.7, _not_ for 9.0! --- generic/tclDecls.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 8a226a9..79a2f7b 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3973,6 +3973,9 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags)) # define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) +# undef Tcl_EventuallyFree +# define Tcl_EventuallyFree \ + ((void (*)(void *,void *))(void *)(tclStubsPtr->tcl_EventuallyFree)) /* 132 */ #endif #if defined(_WIN32) && defined(UNICODE) -- cgit v0.12 From 9d1989bb3d587463c572ff5d4dd49ec042c68d19 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 10 Oct 2023 11:49:11 +0000 Subject: Handle Tcl_SetResult() the same way as Tcl_EventuallyFree --- generic/tclDecls.h | 3 +++ generic/tclTest.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 79a2f7b..f8e9bcf 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3976,6 +3976,9 @@ extern const TclStubs *tclStubsPtr; # undef Tcl_EventuallyFree # define Tcl_EventuallyFree \ ((void (*)(void *,void *))(void *)(tclStubsPtr->tcl_EventuallyFree)) /* 132 */ +# undef Tcl_SetResult +# define Tcl_SetResult \ + ((void (*)(Tcl_Interp *, char *, void *))(void *)(tclStubsPtr->tcl_SetResult)) /* 232 */ #endif #if defined(_WIN32) && defined(UNICODE) diff --git a/generic/tclTest.c b/generic/tclTest.c index d05ef7d..c623b36 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -204,7 +204,7 @@ static int ObjTraceProc(ClientData clientData, Tcl_Obj *const objv[]); static void ObjTraceDeleteProc(ClientData clientData); static void PrintParse(Tcl_Interp *interp, Tcl_Parse *parsePtr); -static void SpecialFree(char *blockPtr); +static void SpecialFree(void *blockPtr); static int StaticInitProc(Tcl_Interp *interp); static Tcl_CmdProc TestasyncCmd; static Tcl_ObjCmdProc TestbumpinterpepochObjCmd; @@ -265,7 +265,7 @@ static Tcl_ObjCmdProc TestreturnObjCmd; static void TestregexpXflags(const char *string, int length, int *cflagsPtr, int *eflagsPtr); static Tcl_ObjCmdProc TestsaveresultCmd; -static void TestsaveresultFree(char *blockPtr); +static void TestsaveresultFree(void *blockPtr); static Tcl_CmdProc TestsetassocdataCmd; static Tcl_CmdProc TestsetCmd; static Tcl_CmdProc Testset2Cmd; @@ -1764,7 +1764,7 @@ TestdstringCmd( } else if (strcmp(argv[2], "special") == 0) { char *s = (char *)ckalloc(100) + 16; strcpy(s, "This is a specially-allocated string"); - Tcl_SetResult(interp, s, SpecialFree); + Tcl_SetResult(interp, s, (Tcl_FreeProc *)(void *)SpecialFree); } else { Tcl_AppendResult(interp, "bad gresult option \"", argv[2], "\": must be staticsmall, staticlarge, free, or special", @@ -1811,9 +1811,9 @@ TestdstringCmd( */ static void SpecialFree( - char *blockPtr /* Block to free. */ + void *blockPtr /* Block to free. */ ) { - ckfree(blockPtr - 16); + ckfree((char *)blockPtr - 16); } /* @@ -5428,7 +5428,7 @@ TestsaveresultCmd( break; } case RESULT_DYNAMIC: - Tcl_SetResult(interp, (char *)"dynamic result", TestsaveresultFree); + Tcl_SetResult(interp, (char *)"dynamic result", (Tcl_FreeProc *)(void *)TestsaveresultFree); break; case RESULT_OBJECT: objPtr = Tcl_NewStringObj("object result", -1); @@ -5454,7 +5454,7 @@ TestsaveresultCmd( switch ((enum options) index) { case RESULT_DYNAMIC: { - int present = iPtr->freeProc == TestsaveresultFree; + int present = iPtr->freeProc == (Tcl_FreeProc *)(void *)TestsaveresultFree; int called = freeCount; Tcl_AppendElement(interp, called ? "called" : "notCalled"); @@ -5489,7 +5489,7 @@ TestsaveresultCmd( static void TestsaveresultFree( - char *blockPtr) + void *blockPtr) { freeCount++; } -- cgit v0.12 -- cgit v0.12 From 490dc70b4f574d3a29e179b12dcda013bd7bb831 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 10 Oct 2023 15:01:28 +0000 Subject: Bug [894e11d7f7] - fix broken test configuration for zipfs builds - nmake version --- win/makefile.vc | 85 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index ec3bc63..dfd2d48 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -20,10 +20,10 @@ # or examine Sections 6-8 in rules.vc. # # Possible values of TARGET are: -# release -- Builds the core, the shell and the dlls. (default) +# release -- Builds everything that ships with a release. (default) +# core -- Builds the core [tclXX.(dll|lib)] +# shell -- Builds tclsh and the core. # dlls -- Just builds the windows extensions -# shell -- Just builds the shell and the core. -# core -- Only builds the core [tclXX.(dll|lib)]. # all -- Builds everything. # test -- Builds and runs the test suite. # tcltest -- Just builds the test shell. @@ -143,6 +143,13 @@ RCFILE = tcl.rc # the build configuration, macros, output directories etc. !include "rules.vc" +# +# The tclsh executable without the embedded libzip. We need this +# separately from tclsh to have dependency and build order work right. +# Ditto for the DLL and tcltest +TCLSHRAW=$(TCLSH:.exe=-raw.exe) +TCLLIBRAW=$(TCLLIB:.dll=-raw.dll) + # Tcl version info based on macros set up by rules.vc DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) @@ -217,6 +224,7 @@ TCLDDELIBNAME = $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT) TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME) TCLTEST = $(OUT_DIR)\$(PROJECT)test.exe +TCLTESTRAW = $(TCLTEST:.exe=-raw.exe) TCLSHOBJS = \ $(TMP_DIR)\tclAppInit.obj \ @@ -473,15 +481,51 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) #--------------------------------------------------------------------- # Project specific targets +# There are 4 primary build configurations to consider from the combination +# of static/shared and embed/noembed of the library zip. The targets are +# done in the following order. +# $(TCLLIB) - this is either the core static .lib or the .dll. The target +# build does not embed the library zip in the DLL irrespective +# of the noembed setting. A copy is made as $(TCLLIBRAW) +# as the $(TCLLIB) binary is potentially modified later. +# dlls - these are the registry and dde DLL's or static libraries +# $(TCLSH) - the Tcl shell WITHOUT any embedded zip. This needs $(TCLLIB) +# to be built first as it links against it. A copy is made +# as $(TCLSHRAW) as $(TCLSH) binary may be modified later. +# $(TCLSCRIPTZIP) - the zip file that is to be embedded. Note this also +# ships separately and needs to be built irrespective of the +# whether it is embedded or not. All above targets need to +# be built prior as they are used to build the zip (unlike +# Unix where the external zip program is used.) +# core - this virtual target builds the final release ready Tcl +# library. For shared, embedded builds it appends $(TCLSCRIPTZIP) +# to the $(TCLLIB). For other build configurations, this +# is a no-op. +# shell - this virtual target builds the final release ready tclsh shell. +# For static, embedded builds it appends $(TCLSCRIPTZIP) +# to the $(TCLSH). For other build configurations, this +# is a no-op. +# release - Everything that builds as part of a release #--------------------------------------------------------------------- -release: setup $(TCLSH) $(TCLSTUBLIB) dlls libtclzip embed pkgs -core: setup $(TCLLIB) $(TCLSTUBLIB) +release: setup libtclzip core dlls shell pkgs +all: setup libtclzip core dlls shell pkgs + +core: setup $(TCLLIB) +!if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD) +core: libtclzip + @$(COPY) /b "$(TCLLIBRAW)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)" +!endif + shell: setup $(TCLSH) +!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) +shell: libtclzip + @$(COPY) /b "$(TCLSHRAW)"+"$(TCLSCRIPTZIP)" "$(TCLSH)" +!endif + dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll -libtclzip: core dlls $(TCLSCRIPTZIP) -all: setup $(TCLSH) $(TCLSTUBLIB) dlls libtclzip embed pkgs -embed: setup $(TCLSH) $(TCLSTUBLIB) libtclzip +libtclzip: $(TCLSCRIPTZIP) +tbdembed: setup $(TCLSH) $(TCLSTUBLIB) libtclzip !if $(TCL_EMBED_SCRIPTS) !if $(STATIC_BUILD) @copy /y /b "$(TCLSH)"+"$(TCLSCRIPTZIP)" "$(TCLSH)" @@ -491,6 +535,11 @@ embed: setup $(TCLSH) $(TCLSTUBLIB) libtclzip !endif tcltest: setup $(TCLTEST) dlls +!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) +tcltest: libtclzip + @$(COPY) /b "$(TCLTESTRAW)"+"$(TCLSCRIPTZIP)" "$(TCLTEST)" +!endif + install: install-binaries install-libraries install-docs install-pkgs !if $(SYMBOLS) install: install-pdbs @@ -498,7 +547,7 @@ install: install-pdbs setup: default-setup test: test-core test-pkgs -test-core: setup $(TCLTEST) dlls +test-core: tcltest set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile << package ifneeded dde 1.4.5 [list load "$(TCLDDELIB:\=/)"] @@ -509,7 +558,7 @@ runtest: setup $(TCLTEST) dlls set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLTEST) $(SCRIPT) -runshell: setup $(TCLSH) dlls +runshell: setup core shell dlls set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLSH) $(SCRIPT) @@ -527,6 +576,9 @@ $(TCLLIB): $(TCLOBJS) $** << $(_VC_MANIFEST_EMBED_DLL) +!if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD) + $(COPY) $@ $(TCLLIBRAW) +!endif $(TCLIMPLIB): $(TCLLIB) @@ -538,10 +590,17 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS) $(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(CONEXECMD) -stack:2300000 $** $(_VC_MANIFEST_EMBED_EXE) +!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) + $(COPY) $@ $(TCLSHRAW) +!endif + $(TCLTEST): $(TCLTESTOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(CONEXECMD) -stack:2300000 $** $(_VC_MANIFEST_EMBED_EXE) +!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) + $(COPY) $@ $(TCLTESTRAW) +!endif !if $(STATIC_BUILD) $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj @@ -590,8 +649,9 @@ $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win64\tommath.lib $(COPY) $(TOMMATHDIR)\win64\tommath.lib $(OUT_DIR)\tommath.lib !endif -$(TCLSCRIPTZIP): $(TCLDDELIB) $(TCLREGLIB) - @echo Building Tcl library zip file +$(TCLSCRIPTZIP): $(TCLLIB) $(TCLSH) dlls + @echo Building Tcl library zip file $(TCLSCRIPTZIP) + @set TCL_LIBRARY=$(ROOT:\=/)/library @if exist "$(LIBTCLVFS)" $(RMDIR) "$(LIBTCLVFS)" @$(MKDIR) "$(LIBTCLVFS)" @$(CPYDIR) $(LIBDIR) "$(LIBTCLVFS)\tcl_library" @@ -610,7 +670,6 @@ $(TCLSCRIPTZIP): $(TCLDDELIB) $(TCLREGLIB) @echo zipfs mkzip {$@} {$(LIBTCLVFS)} {$(LIBTCLVFS)} >> "$(OUT_DIR)\zipper.tcl" @cd "$(OUT_DIR)" && $(TCLSH_NATIVE) zipper.tcl - pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ -- cgit v0.12 From 7e719795438ad86eff493fcd9f84f325c1a50c99 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 10 Oct 2023 19:27:54 +0000 Subject: More int -> Tcl_Size (backported from 9.0) --- generic/tcl.decls | 4 +- generic/tclBasic.c | 125 ++++++++++++++++++++++++------------------------ generic/tclCmdMZ.c | 2 +- generic/tclCompCmds.c | 9 ++-- generic/tclCompCmdsGR.c | 20 ++++---- generic/tclCompile.c | 2 +- generic/tclCompile.h | 8 ++-- generic/tclDecls.h | 8 ++-- generic/tclExecute.c | 23 +++++---- generic/tclInterp.c | 4 +- generic/tclProc.c | 8 ++-- generic/tclResult.c | 2 +- 12 files changed, 108 insertions(+), 107 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 4572817..0097eea 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -256,7 +256,7 @@ declare 66 {deprecated {No longer in use, changed to macro}} { } declare 67 {deprecated {No longer in use, changed to macro}} { void Tcl_AddObjErrorInfo(Tcl_Interp *interp, const char *message, - int length) + Tcl_Size length) } declare 68 { void Tcl_AllowExceptions(Tcl_Interp *interp) @@ -1267,7 +1267,7 @@ declare 356 { } declare 357 {deprecated {Use Tcl_EvalTokensStandard}} { Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, - int count) + Tcl_Size count) } declare 358 { void Tcl_FreeParse(Tcl_Parse *parsePtr) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 54d3076..752027c 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -234,13 +234,13 @@ static void ProcessUnexpectedResult(Tcl_Interp *interp, static int RewindCoroutine(CoroutineData *corPtr, int result); static void TEOV_SwitchVarFrame(Tcl_Interp *interp); static void TEOV_PushExceptionHandlers(Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[], int flags); + Tcl_Size objc, Tcl_Obj *const objv[], int flags); static inline Command * TEOV_LookupCmdFromObj(Tcl_Interp *interp, Tcl_Obj *namePtr, Namespace *lookupNsPtr); -static int TEOV_NotFound(Tcl_Interp *interp, int objc, +static int TEOV_NotFound(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], Namespace *lookupNsPtr); static int TEOV_RunEnterTraces(Tcl_Interp *interp, - Command **cmdPtrPtr, Tcl_Obj *commandPtr, int objc, + Command **cmdPtrPtr, Tcl_Obj *commandPtr, Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_NRPostProc RewindCoroutineCallback; static Tcl_NRPostProc TEOEx_ByteCodeCallback; @@ -2226,7 +2226,7 @@ Tcl_HideCommand( if (strstr(hiddenCmdToken, "::") != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot use namespace qualifiers in hidden command" - " token (rename)", -1)); + " token (rename)", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "HIDDENTOKEN", NULL); return TCL_ERROR; } @@ -2251,7 +2251,7 @@ Tcl_HideCommand( if (cmdPtr->nsPtr != iPtr->globalNsPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only hide global namespace commands (use rename then hide)", - -1)); + TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "HIDE", "NON_GLOBAL", NULL); return TCL_ERROR; } @@ -2381,7 +2381,7 @@ Tcl_ExposeCommand( if (strstr(cmdName, "::") != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot expose to a namespace (use expose to toplevel, then rename)", - -1)); + TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "NON_GLOBAL", NULL); return TCL_ERROR; } @@ -2418,7 +2418,7 @@ Tcl_ExposeCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj( "trying to expose a non-global command namespace command", - -1)); + TCL_INDEX_NONE)); return TCL_ERROR; } @@ -3227,11 +3227,11 @@ TclRenameCommand( */ Tcl_DStringInit(&newFullName); - Tcl_DStringAppend(&newFullName, newNsPtr->fullName, -1); + Tcl_DStringAppend(&newFullName, newNsPtr->fullName, TCL_INDEX_NONE); if (newNsPtr != iPtr->globalNsPtr) { TclDStringAppendLiteral(&newFullName, "::"); } - Tcl_DStringAppend(&newFullName, newTail, -1); + Tcl_DStringAppend(&newFullName, newTail, TCL_INDEX_NONE); cmdPtr->refCount++; CallCommandTraces(iPtr, cmdPtr, TclGetString(oldFullName), Tcl_DStringValue(&newFullName), TCL_TRACE_RENAME); @@ -3519,14 +3519,14 @@ Tcl_GetCommandFullName( if ((cmdPtr != NULL) && TclRoutineHasName(cmdPtr)) { if (cmdPtr->nsPtr != NULL) { - Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, -1); + Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, TCL_INDEX_NONE); if (cmdPtr->nsPtr != iPtr->globalNsPtr) { Tcl_AppendToObj(objPtr, "::", 2); } } if (cmdPtr->hPtr != NULL) { name = (char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr); - Tcl_AppendToObj(objPtr, name, -1); + Tcl_AppendToObj(objPtr, name, TCL_INDEX_NONE); } } } @@ -4390,7 +4390,7 @@ TclInterpReady( if (iPtr->flags & DELETED) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "attempt to call eval in deleted interpreter", -1)); + "attempt to call eval in deleted interpreter", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "IDELETE", "attempt to call eval in deleted interpreter", NULL); return TCL_ERROR; @@ -4419,7 +4419,7 @@ TclInterpReady( } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "too many nested evaluations (infinite loop?)", -1)); + "too many nested evaluations (infinite loop?)", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); return TCL_ERROR; } @@ -4553,7 +4553,7 @@ Tcl_Canceled( } } - Tcl_SetObjResult(interp, Tcl_NewStringObj(message, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(message, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "CANCEL", id, message, NULL); } @@ -4758,7 +4758,7 @@ EvalObjvCore( { Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0]; int flags = PTR2INT(data[1]); - int objc = PTR2INT(data[2]); + Tcl_Size objc = PTR2INT(data[2]); Tcl_Obj **objv = (Tcl_Obj **)data[3]; Interp *iPtr = (Interp *) interp; Namespace *lookupNsPtr = NULL; @@ -5055,7 +5055,7 @@ NRCommand( static void TEOV_PushExceptionHandlers( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[], int flags) { @@ -5151,7 +5151,7 @@ TEOV_Error( Tcl_Obj *listPtr; const char *cmdString; Tcl_Size cmdLen; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj **objv = (Tcl_Obj **)data[1]; if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { @@ -5173,7 +5173,7 @@ TEOV_Error( static int TEOV_NotFound( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[], Namespace *lookupNsPtr) { @@ -5274,11 +5274,11 @@ TEOV_NotFoundCallback( int result) { Interp *iPtr = (Interp *) interp; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj **objv = (Tcl_Obj **)data[1]; Namespace *savedNsPtr = (Namespace *)data[2]; - int i; + Tcl_Size i; if (savedNsPtr) { iPtr->varFramePtr->nsPtr = savedNsPtr; @@ -5301,7 +5301,7 @@ TEOV_RunEnterTraces( Tcl_Interp *interp, Command **cmdPtrPtr, Tcl_Obj *commandPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Interp *iPtr = (Interp *) interp; @@ -5355,7 +5355,7 @@ TEOV_RunLeaveTraces( { Interp *iPtr = (Interp *) interp; int traceCode = TCL_OK; - int objc = PTR2INT(data[0]); + Tcl_Size objc = PTR2INT(data[0]); Tcl_Obj *commandPtr = (Tcl_Obj *)data[1]; Command *cmdPtr = (Command *)data[2]; Tcl_Obj **objv = (Tcl_Obj **)data[3]; @@ -5484,7 +5484,7 @@ Tcl_EvalTokens( * errors. */ Tcl_Token *tokenPtr, /* Pointer to first in an array of tokens to * evaluate and concatenate. */ - int count) /* Number of tokens to consider at tokenPtr. + Tcl_Size count) /* Number of tokens to consider at tokenPtr. * Must be at least 1. */ { Tcl_Obj *resPtr; @@ -5567,7 +5567,7 @@ TclEvalEx( { Interp *iPtr = (Interp *) interp; const char *p, *next; - const unsigned int minObjs = 20; + const int minObjs = 20; Tcl_Obj **objv, **objvSpace; int *expand; Tcl_Size *lines, *lineSpace; @@ -5578,7 +5578,7 @@ TclEvalEx( * TCL_EVAL_GLOBAL was set. */ int allowExceptions = (iPtr->evalFlags & TCL_ALLOW_EXCEPTIONS); int gotParse = 0; - TCL_HASH_TYPE i, objectsUsed = 0; + Tcl_Size i, objectsUsed = 0; /* These variables keep track of how much * state has been allocated while evaluating * the script, so that it can be freed @@ -5716,8 +5716,8 @@ TclEvalEx( Tcl_Size wordLine = line; const char *wordStart = parsePtr->commandStart; Tcl_Size *wordCLNext = clNext; - unsigned int objectsNeeded = 0; - unsigned int numWords = parsePtr->numWords; + Tcl_Size objectsNeeded = 0; + Tcl_Size numWords = parsePtr->numWords; /* * Generate an array of objects for the words of the command. @@ -6107,11 +6107,12 @@ void TclArgumentEnter( Tcl_Interp *interp, Tcl_Obj **objv, - int objc, + Tcl_Size objc, CmdFrame *cfPtr) { Interp *iPtr = (Interp *) interp; - int isNew, i; + int isNew; + Tcl_Size i; Tcl_HashEntry *hPtr; CFWord *cfwPtr; @@ -6175,10 +6176,10 @@ void TclArgumentRelease( Tcl_Interp *interp, Tcl_Obj **objv, - int objc) + Tcl_Size objc) { Interp *iPtr = (Interp *) interp; - int i; + Tcl_Size i; for (i = 1; i < objc; i++) { CFWord *cfwPtr; @@ -6223,14 +6224,14 @@ void TclArgumentBCEnter( Tcl_Interp *interp, Tcl_Obj *objv[], - int objc, + Tcl_Size objc, void *codePtr, CmdFrame *cfPtr, Tcl_Size cmd, Tcl_Size pc) { ExtCmdLoc *eclPtr; - int word; + Tcl_Size word; ECL *ePtr; CFWordBC *lastPtr = NULL; Interp *iPtr = (Interp *) interp; @@ -6842,10 +6843,10 @@ ProcessUnexpectedResult( Tcl_ResetResult(interp); if (returnCode == TCL_BREAK) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"break\" outside of a loop", -1)); + "invoked \"break\" outside of a loop", TCL_INDEX_NONE)); } else if (returnCode == TCL_CONTINUE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"continue\" outside of a loop", -1)); + "invoked \"continue\" outside of a loop", TCL_INDEX_NONE)); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "command returned bad code: %d", returnCode)); @@ -6891,7 +6892,7 @@ Tcl_ExprLong( *ptr = 0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprLongObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6919,7 +6920,7 @@ Tcl_ExprDouble( *ptr = 0.0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprDoubleObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6947,7 +6948,7 @@ Tcl_ExprBoolean( return TCL_OK; } else { int result; - Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, -1); + Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, TCL_INDEX_NONE); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprBooleanObj(interp, exprPtr, ptr); @@ -7112,7 +7113,7 @@ int TclObjInvokeNamespace( Tcl_Interp *interp, /* Interpreter in which command is to be * invoked. */ - int objc, /* Count of arguments. */ + Tcl_Size objc, /* Count of arguments. */ Tcl_Obj *const objv[], /* Argument objects; objv[0] points to the * name of the command to invoke. */ Tcl_Namespace *nsPtr, /* The namespace to use. */ @@ -7156,7 +7157,7 @@ int TclObjInvoke( Tcl_Interp *interp, /* Interpreter in which command is to be * invoked. */ - int objc, /* Count of arguments. */ + Tcl_Size objc, /* Count of arguments. */ Tcl_Obj *const objv[], /* Argument objects; objv[0] points to the * name of the command to invoke. */ int flags) /* Combination of flags controlling the call: @@ -7168,7 +7169,7 @@ TclObjInvoke( } if ((objc < 1) || (objv == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "illegal argument vector", -1)); + "illegal argument vector", TCL_INDEX_NONE)); return TCL_ERROR; } if ((flags & TCL_INVOKE_HIDDEN) == 0) { @@ -7267,7 +7268,7 @@ Tcl_ExprString( Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); } else { - Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, -1); + Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, TCL_INDEX_NONE); Tcl_IncrRefCount(exprObj); code = Tcl_ExprObj(interp, exprObj, &resultPtr); @@ -7378,7 +7379,7 @@ Tcl_AddObjErrorInfo( * pertains. */ const char *message, /* Points to the first byte of an array of * bytes of the message. */ - int length) /* The number of bytes in the message. If < 0, + Tcl_Size length) /* The number of bytes in the message. If < 0, * then append all bytes up to a NULL byte. */ { Interp *iPtr = (Interp *) interp; @@ -7400,7 +7401,7 @@ Tcl_AddObjErrorInfo( * interp->result completely. */ - iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, -1); + iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, TCL_INDEX_NONE); } else #endif /* !defined(TCL_NO_DEPRECATED) */ iPtr->errorInfo = iPtr->objResultPtr; @@ -7841,7 +7842,7 @@ ExprIsqrtFunc( negarg: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "square root of negative argument", -1)); + "square root of negative argument", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "domain error: argument not in valid range", NULL); return TCL_ERROR; @@ -9372,7 +9373,7 @@ TclNRTailcallObjCmd( if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "tailcall can only be called from a proc, lambda or method", -1)); + "tailcall can only be called from a proc, lambda or method", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); return TCL_ERROR; } @@ -9402,7 +9403,7 @@ TclNRTailcallObjCmd( * namespace, the rest the command to be tailcalled. */ - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_INDEX_NONE); listPtr = Tcl_NewListObj(objc, objv); TclListObjSetElement(interp, listPtr, 0, nsObjPtr); @@ -9534,7 +9535,7 @@ TclNRYieldObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yield can only be called in a coroutine", -1)); + "yield can only be called in a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } @@ -9567,14 +9568,14 @@ TclNRYieldToObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yieldto can only be called in a coroutine", -1)); + "yieldto can only be called in a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } if (((Namespace *) nsPtr)->flags & NS_DYING) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yieldto called in deleted namespace", -1)); + "yieldto called in deleted namespace", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED", NULL); return TCL_ERROR; @@ -9587,7 +9588,7 @@ TclNRYieldToObjCmd( */ listPtr = Tcl_NewListObj(objc, objv); - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_INDEX_NONE); TclListObjSetElement(interp, listPtr, 0, nsObjPtr); /* @@ -9810,7 +9811,7 @@ TclNRCoroutineActivateCallback( Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot yield: C stack busy", -1)); + "cannot yield: C stack busy", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD", NULL); return TCL_ERROR; @@ -9899,7 +9900,7 @@ CoroTypeObjCmd( cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[1]); if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only get coroutine type of a coroutine", -1)); + "can only get coroutine type of a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", TclGetString(objv[1]), NULL); return TCL_ERROR; @@ -9912,7 +9913,7 @@ CoroTypeObjCmd( corPtr = (CoroutineData *)cmdPtr->objClientData; if (!COR_IS_SUSPENDED(corPtr)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("active", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("active", TCL_INDEX_NONE)); return TCL_OK; } @@ -9923,14 +9924,14 @@ CoroTypeObjCmd( switch (corPtr->nargs) { case COROUTINE_ARGUMENTS_SINGLE_OPTIONAL: - Tcl_SetObjResult(interp, Tcl_NewStringObj("yield", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("yield", TCL_INDEX_NONE)); return TCL_OK; case COROUTINE_ARGUMENTS_ARBITRARY: - Tcl_SetObjResult(interp, Tcl_NewStringObj("yieldto", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("yieldto", TCL_INDEX_NONE)); return TCL_OK; default: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unknown coroutine type", -1)); + "unknown coroutine type", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BAD_TYPE", NULL); return TCL_ERROR; } @@ -9959,7 +9960,7 @@ GetCoroutineFromObj( Command *cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objPtr); if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", TclGetString(objPtr), NULL); return NULL; @@ -9993,7 +9994,7 @@ TclNRCoroInjectObjCmd( } if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a suspended coroutine", -1)); + "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -10039,7 +10040,7 @@ TclNRCoroProbeObjCmd( if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only inject a probe command into a suspended coroutine", - -1)); + TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -10230,7 +10231,7 @@ NRInjectObjCmd( } if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a suspended coroutine", -1)); + "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -10284,7 +10285,7 @@ TclNRInterpCoroutine( if (corPtr->nargs + 1 != objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong coro nargs; how did we get here? " - "not implemented!", -1)); + "not implemented!", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TCL_ERROR; } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 3890ac0..32ed560 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1057,7 +1057,7 @@ Tcl_ReturnObjCmd( */ int explicitResult = (0 == (objc % 2)); - int numOptionWords = objc - 1 - explicitResult; + Tcl_Size numOptionWords = objc - 1 - explicitResult; if (TCL_ERROR == TclMergeReturnOptions(interp, numOptionWords, objv+1, &returnOpts, &code, &level)) { diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 7c5eead..0104285 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3347,12 +3347,13 @@ TclCompileFormatCmd( *---------------------------------------------------------------------- */ -int +Tcl_Size TclLocalScalarFromToken( Tcl_Token *tokenPtr, CompileEnv *envPtr) { - int isScalar, index; + int isScalar; + Tcl_Size index; TclPushVarName(NULL, tokenPtr, envPtr, TCL_NO_ELEMENT, &index, &isScalar); if (!isScalar) { @@ -3361,10 +3362,10 @@ TclLocalScalarFromToken( return index; } -int +Tcl_Size TclLocalScalar( const char *bytes, - int numBytes, + TCL_HASH_TYPE numBytes, CompileEnv *envPtr) { Tcl_Token token[2] = {{TCL_TOKEN_SIMPLE_WORD, NULL, 0, 1}, diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index d0cd6e9..ea1e42d 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -49,8 +49,8 @@ static int IndexTailVarIfKnown(Tcl_Interp *interp, int TclGetIndexFromToken( Tcl_Token *tokenPtr, - int before, - int after, + Tcl_Size before, + Tcl_Size after, int *indexPtr) { Tcl_Obj *tmpObj; @@ -2113,7 +2113,7 @@ TclCompileRegsubCmd( Tcl_DString pattern; const char *bytes; int exact, quantified, result = TCL_ERROR; - int len; + Tcl_Size len; if (parsePtr->numWords < 5 || parsePtr->numWords > 6) { return TCL_ERROR; @@ -2267,11 +2267,11 @@ TclCompileReturnCmd( * General syntax: [return ?-option value ...? ?result?] * An even number of words means an explicit result argument is present. */ - int level, code, objc, status = TCL_OK; - int size; - int numWords = parsePtr->numWords; - int explicitResult = (0 == (numWords % 2)); - int numOptionWords = numWords - 1 - explicitResult; + int level, code, status = TCL_OK; + Tcl_Size size; + Tcl_Size numWords = parsePtr->numWords; + Tcl_Size explicitResult = (0 == (numWords % 2)); + Tcl_Size objc, numOptionWords = numWords - 1 - explicitResult; Tcl_Obj *returnOpts, **objv; Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -2478,7 +2478,7 @@ TclCompileSyntaxError( CompileEnv *envPtr) { Tcl_Obj *msg = Tcl_GetObjResult(interp); - int numBytes; + Tcl_Size numBytes; const char *bytes = TclGetStringFromObj(msg, &numBytes); TclErrorStackResetIf(interp, bytes, numBytes); @@ -2705,7 +2705,7 @@ IndexTailVarIfKnown( Tcl_Obj *tailPtr; const char *tailName, *p; int n = varTokenPtr->numComponents; - int len; + Tcl_Size len; Tcl_Token *lastTokenPtr; int full, localIndex; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 1ab7301..22bc2d3 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1447,7 +1447,7 @@ TclInitCompileEnv( CompileEnv *envPtr,/* Points to the CompileEnv structure to * initialize. */ const char *stringPtr, /* The source string to be compiled. */ - int numBytes, /* Number of bytes in source string. */ + TCL_HASH_TYPE numBytes, /* Number of bytes in source string. */ const CmdFrame *invoker, /* Location context invoking the bcc */ int word) /* Index of the word in that context getting * compiled */ diff --git a/generic/tclCompile.h b/generic/tclCompile.h index e3d8d4f..1d748b5 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1124,7 +1124,7 @@ MODULE_SCOPE Tcl_Size TclCreateAuxData(void *clientData, const AuxDataType *typePtr, CompileEnv *envPtr); MODULE_SCOPE Tcl_Size TclCreateExceptRange(ExceptionRangeType type, CompileEnv *envPtr); -MODULE_SCOPE ExecEnv * TclCreateExecEnv(Tcl_Interp *interp, int size); +MODULE_SCOPE ExecEnv * TclCreateExecEnv(Tcl_Interp *interp, TCL_HASH_TYPE size); MODULE_SCOPE Tcl_Obj * TclCreateLiteral(Interp *iPtr, const char *bytes, Tcl_Size length, TCL_HASH_TYPE hash, int *newPtr, Namespace *nsPtr, int flags, @@ -1155,7 +1155,7 @@ MODULE_SCOPE ByteCode * TclInitByteCodeObj(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, CompileEnv *envPtr); MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp, CompileEnv *envPtr, const char *string, - int numBytes, const CmdFrame *invoker, int word); + TCL_HASH_TYPE numBytes, const CmdFrame *invoker, int word); MODULE_SCOPE void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr); MODULE_SCOPE void TclInitLiteralTable(LiteralTable *tablePtr); MODULE_SCOPE ExceptionRange *TclGetInnermostExceptionRange(CompileEnv *envPtr, @@ -1170,9 +1170,9 @@ MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr, MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr); MODULE_SCOPE int TclLog2(int value); #endif -MODULE_SCOPE int TclLocalScalar(const char *bytes, int numBytes, +MODULE_SCOPE Tcl_Size TclLocalScalar(const char *bytes, TCL_HASH_TYPE numBytes, CompileEnv *envPtr); -MODULE_SCOPE int TclLocalScalarFromToken(Tcl_Token *tokenPtr, +MODULE_SCOPE Tcl_Size TclLocalScalarFromToken(Tcl_Token *tokenPtr, CompileEnv *envPtr); MODULE_SCOPE void TclOptimizeBytecode(void *envPtr); #ifdef TCL_COMPILE_DEBUG diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 101a883..0fe582e 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -261,7 +261,7 @@ void Tcl_AddErrorInfo(Tcl_Interp *interp, /* 67 */ TCL_DEPRECATED("No longer in use, changed to macro") void Tcl_AddObjErrorInfo(Tcl_Interp *interp, - const char *message, int length); + const char *message, Tcl_Size length); /* 68 */ EXTERN void Tcl_AllowExceptions(Tcl_Interp *interp); /* 69 */ @@ -1093,7 +1093,7 @@ EXTERN Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, /* 357 */ TCL_DEPRECATED("Use Tcl_EvalTokensStandard") Tcl_Obj * Tcl_EvalTokens(Tcl_Interp *interp, - Tcl_Token *tokenPtr, int count); + Tcl_Token *tokenPtr, Tcl_Size count); /* 358 */ EXTERN void Tcl_FreeParse(Tcl_Parse *parsePtr); /* 359 */ @@ -2107,7 +2107,7 @@ typedef struct TclStubs { void (*tcl_SetObjLength) (Tcl_Obj *objPtr, Tcl_Size length); /* 64 */ void (*tcl_SetStringObj) (Tcl_Obj *objPtr, const char *bytes, Tcl_Size length); /* 65 */ TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_AddErrorInfo) (Tcl_Interp *interp, const char *message); /* 66 */ - TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_AddObjErrorInfo) (Tcl_Interp *interp, const char *message, int length); /* 67 */ + TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_AddObjErrorInfo) (Tcl_Interp *interp, const char *message, Tcl_Size length); /* 67 */ void (*tcl_AllowExceptions) (Tcl_Interp *interp); /* 68 */ void (*tcl_AppendElement) (Tcl_Interp *interp, const char *element); /* 69 */ void (*tcl_AppendResult) (Tcl_Interp *interp, ...); /* 70 */ @@ -2405,7 +2405,7 @@ typedef struct TclStubs { char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, Tcl_Size uniLength, Tcl_DString *dsPtr); /* 354 */ unsigned short * (*tcl_UtfToChar16DString) (const char *src, Tcl_Size length, Tcl_DString *dsPtr); /* 355 */ Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */ - TCL_DEPRECATED_API("Use Tcl_EvalTokensStandard") Tcl_Obj * (*tcl_EvalTokens) (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count); /* 357 */ + TCL_DEPRECATED_API("Use Tcl_EvalTokensStandard") Tcl_Obj * (*tcl_EvalTokens) (Tcl_Interp *interp, Tcl_Token *tokenPtr, Tcl_Size count); /* 357 */ void (*tcl_FreeParse) (Tcl_Parse *parsePtr); /* 358 */ void (*tcl_LogCommandInfo) (Tcl_Interp *interp, const char *script, const char *command, Tcl_Size length); /* 359 */ int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 360 */ diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e64e752..f188950 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -170,9 +170,8 @@ typedef struct { ByteCode *codePtr; /* Constant until the BC returns */ /* -----------------------------------------*/ Tcl_Obj **catchTop; /* These fields are used on return TO this */ - Tcl_Obj *auxObjList; /* this level: they record the state when a */ - CmdFrame cmdFrame; /* new codePtr was received for NR */ - /* execution. */ + Tcl_Obj *auxObjList; /* level: they record the state when a new */ + CmdFrame cmdFrame; /* codePtr was received for NR execution. */ Tcl_Obj *stack[1]; /* Start of the actual combined catch and obj * stacks; the struct will be expanded as * necessary */ @@ -693,7 +692,7 @@ static ExceptionRange * GetExceptRangeForPc(const unsigned char *pc, int searchMode, ByteCode *codePtr); static const char * GetSrcInfoForPc(const unsigned char *pc, ByteCode *codePtr, Tcl_Size *lengthPtr, - const unsigned char **pcBeg, int *cmdIdxPtr); + const unsigned char **pcBeg, Tcl_Size *cmdIdxPtr); static Tcl_Obj ** GrowEvaluationStack(ExecEnv *eePtr, TCL_HASH_TYPE growth, int move); static void IllegalExprOperandType(Tcl_Interp *interp, @@ -849,7 +848,7 @@ ExecEnv * TclCreateExecEnv( Tcl_Interp *interp, /* Interpreter for which the execution * environment is being created. */ - Tcl_Size size) /* The initial stack size, in number of words + TCL_HASH_TYPE size) /* The initial stack size, in number of words * [sizeof(Tcl_Obj*)] */ { ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv)); @@ -1903,10 +1902,10 @@ ArgumentBCEnter( ByteCode *codePtr, TEBCdata *tdPtr, const unsigned char *pc, - int objc, + Tcl_Size objc, Tcl_Obj **objv) { - int cmd; + Tcl_Size cmd; if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) { TclArgumentBCEnter(interp, objv, objc, codePtr, &tdPtr->cmdFrame, cmd, @@ -9436,7 +9435,7 @@ IllegalExprOperandType( Tcl_Obj * TclGetSourceFromFrame( CmdFrame *cfPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { if (cfPtr == NULL) { @@ -9535,7 +9534,7 @@ GetSrcInfoForPc( const unsigned char **pcBeg,/* If non-NULL, the bytecode location * where the current instruction starts. * If NULL; no pointer is stored. */ - int *cmdIdxPtr) /* If non-NULL, the location where the index + Tcl_Size *cmdIdxPtr) /* If non-NULL, the location where the index * of the command containing the pc should * be stored. */ { @@ -9545,9 +9544,9 @@ GetSrcInfoForPc( unsigned char *srcDeltaNext, *srcLengthNext; Tcl_Size codeOffset, codeLen, codeEnd, srcOffset, srcLen, delta, i; int bestDist = INT_MAX; /* Distance of pc to best cmd's start pc. */ - int bestSrcOffset = -1; /* Initialized to avoid compiler warning. */ - int bestSrcLength = -1; /* Initialized to avoid compiler warning. */ - int bestCmdIdx = -1; + Tcl_Size bestSrcOffset = -1; /* Initialized to avoid compiler warning. */ + Tcl_Size bestSrcLength = -1; /* Initialized to avoid compiler warning. */ + Tcl_Size bestCmdIdx = -1; /* The pc must point within the bytecode */ assert ((pcOffset >= 0) && (pcOffset < codePtr->numCodeBytes)); diff --git a/generic/tclInterp.c b/generic/tclInterp.c index b59175f..e0de04f 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -249,7 +249,7 @@ static int ChildHidden(Tcl_Interp *interp, static int ChildInvokeHidden(Tcl_Interp *interp, Tcl_Interp *childInterp, const char *namespaceName, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static int ChildMarkTrusted(Tcl_Interp *interp, Tcl_Interp *childInterp); static Tcl_CmdDeleteProc ChildObjCmdDeleteProc; @@ -3134,7 +3134,7 @@ ChildInvokeHidden( Tcl_Interp *childInterp, /* The child interpreter in which command will * be invoked. */ const char *namespaceName, /* The namespace to use, if any. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; diff --git a/generic/tclProc.c b/generic/tclProc.c index 95523a8..2800c20 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -34,14 +34,14 @@ typedef struct { static void DupLambdaInternalRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); static void FreeLambdaInternalRep(Tcl_Obj *objPtr); -static int InitArgsAndLocals(Tcl_Interp *interp, int skip); +static int InitArgsAndLocals(Tcl_Interp *interp, Tcl_Size skip); static void InitResolvedLocals(Tcl_Interp *interp, ByteCode *codePtr, Var *defPtr, Namespace *nsPtr); static void InitLocalCache(Proc *procPtr); static void ProcBodyDup(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr); static void ProcBodyFree(Tcl_Obj *objPtr); -static int ProcWrongNumArgs(Tcl_Interp *interp, int skip); +static int ProcWrongNumArgs(Tcl_Interp *interp, Tcl_Size skip); static void MakeProcError(Tcl_Interp *interp, Tcl_Obj *procNameObj); static void MakeLambdaError(Tcl_Interp *interp, @@ -1061,7 +1061,7 @@ TclIsProc( static int ProcWrongNumArgs( Tcl_Interp *interp, - int skip) + Tcl_Size skip) { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; Proc *procPtr = framePtr->procPtr; @@ -1393,7 +1393,7 @@ static int InitArgsAndLocals( Tcl_Interp *interp,/* Interpreter in which procedure was * invoked. */ - int skip) /* Number of initial arguments to be skipped, + Tcl_Size skip) /* Number of initial arguments to be skipped, * i.e., words in the "command name". */ { CallFrame *framePtr = ((Interp *)interp)->varFramePtr; diff --git a/generic/tclResult.c b/generic/tclResult.c index 7e108e9..f639c08 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1388,7 +1388,7 @@ TclProcessReturn( int TclMergeReturnOptions( Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ Tcl_Obj **optionsPtrPtr, /* If not NULL, points to space for a (Tcl_Obj * *) where the pointer to the merged return -- cgit v0.12 From 646abe64b8c1932c626a47b4c136b5bdca8208c9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 11 Oct 2023 04:53:25 +0000 Subject: Minor nmake tweaks, remove obsolete target --- win/makefile.vc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index dfd2d48..7360269 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -517,7 +517,7 @@ core: libtclzip @$(COPY) /b "$(TCLLIBRAW)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)" !endif -shell: setup $(TCLSH) +shell: setup core $(TCLSH) !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) shell: libtclzip @$(COPY) /b "$(TCLSHRAW)"+"$(TCLSCRIPTZIP)" "$(TCLSH)" @@ -525,16 +525,8 @@ shell: libtclzip dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll libtclzip: $(TCLSCRIPTZIP) -tbdembed: setup $(TCLSH) $(TCLSTUBLIB) libtclzip -!if $(TCL_EMBED_SCRIPTS) -!if $(STATIC_BUILD) - @copy /y /b "$(TCLSH)"+"$(TCLSCRIPTZIP)" "$(TCLSH)" -!else - @copy /y /b "$(TCLLIB)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)" -!endif -!endif -tcltest: setup $(TCLTEST) dlls +tcltest: setup core $(TCLTEST) dlls !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) tcltest: libtclzip @$(COPY) /b "$(TCLTESTRAW)"+"$(TCLSCRIPTZIP)" "$(TCLTEST)" -- cgit v0.12 From a64802e7ede7f1794273c96ae87b61920c268964 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 11 Oct 2023 09:15:09 +0000 Subject: Remove typecasts, just define directly as Tcl_FreeProc --- generic/tclBasic.c | 12 ++++++------ generic/tclIORChan.c | 8 ++++---- generic/tclIORTrans.c | 16 ++++++++-------- generic/tclTest.c | 18 +++++++++++++----- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index f46a778..ff8333f 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -7,10 +7,10 @@ * * Copyright (c) 1987-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. - * Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved. + * Copyright (c) 1998-1999 Scriptics Corporation. + * Copyright (c) 2001, 2002 Kevin B. Kenny. All rights reserved. * Copyright (c) 2007 Daniel A. Steffen - * Copyright (c) 2006-2008 by Joe Mistachkin. All rights reserved. + * Copyright (c) 2006-2008 Joe Mistachkin. All rights reserved. * Copyright (c) 2008 Miguel Sofer * * See the file "license.terms" for information on usage and redistribution of @@ -136,7 +136,7 @@ static int CancelEvalProc(ClientData clientData, Tcl_Interp *interp, int code); static int CheckDoubleResult(Tcl_Interp *interp, double dResult); static void DeleteCoroutine(ClientData clientData); -static void DeleteInterpProc(void *blockPtr); +static Tcl_FreeProc DeleteInterpProc; static void DeleteOpCmdClientData(ClientData clientData); #ifdef USE_DTRACE static Tcl_ObjCmdProc DTraceObjCmd; @@ -1392,7 +1392,7 @@ Tcl_DeleteInterp( * Ensure that the interpreter is eventually deleted. */ - Tcl_EventuallyFree(interp, (Tcl_FreeProc *)(void *)DeleteInterpProc); + Tcl_EventuallyFree(interp, DeleteInterpProc); } /* @@ -1418,7 +1418,7 @@ Tcl_DeleteInterp( static void DeleteInterpProc( - void *blockPtr) /* Interpreter to delete. */ + char *blockPtr) /* Interpreter to delete. */ { Tcl_Interp *interp = (Tcl_Interp *) blockPtr; Interp *iPtr = (Interp *) interp; diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 792cf80..69a8e11 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -430,7 +430,7 @@ static Tcl_Obj * DecodeEventMask(int mask); static ReflectedChannel * NewReflectedChannel(Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, int mode, Tcl_Obj *handleObj); static Tcl_Obj * NextHandle(void); -static void FreeReflectedChannel(void *blockPtr); +static Tcl_FreeProc FreeReflectedChannel; static int InvokeTclMethod(ReflectedChannel *rcPtr, MethodName method, Tcl_Obj *argOneObj, Tcl_Obj *argTwoObj, Tcl_Obj **resultObjPtr); @@ -1170,7 +1170,7 @@ ReflectClose( ckfree((char *)tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } - Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *)(void *)FreeReflectedChannel); + Tcl_EventuallyFree(rcPtr, FreeReflectedChannel); return EOK; } @@ -1239,7 +1239,7 @@ ReflectClose( ckfree((char *)tctPtr); ((Channel *)rcPtr->chan)->typePtr = NULL; } - Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *)(void *)FreeReflectedChannel); + Tcl_EventuallyFree(rcPtr, FreeReflectedChannel); return (result == TCL_OK) ? EOK : EINVAL; } @@ -2210,7 +2210,7 @@ NextHandle(void) static void FreeReflectedChannel( - void *blockPtr) + char *blockPtr) { ReflectedChannel *rcPtr = (ReflectedChannel *) blockPtr; Channel *chanPtr = (Channel *) rcPtr->chan; diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index d8d8b25..bc0e20c 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -417,7 +417,7 @@ static ReflectedTransform * NewReflectedTransform(Tcl_Interp *interp, Tcl_Obj *cmdpfxObj, int mode, Tcl_Obj *handleObj, Tcl_Channel parentChan); static Tcl_Obj * NextHandle(void); -static void FreeReflectedTransform(void *blockPtr); +static Tcl_FreeProc FreeReflectedTransform; static void FreeReflectedTransformArgs(ReflectedTransform *rtPtr); static int InvokeTclMethod(ReflectedTransform *rtPtr, const char *method, Tcl_Obj *argOneObj, @@ -718,7 +718,7 @@ TclChanPushObjCmd( * structure. */ - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, FreeReflectedTransform); return TCL_ERROR; #undef CHAN @@ -924,7 +924,7 @@ ReflectClose( } #endif /* TCL_THREADS */ - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, FreeReflectedTransform); return EOK; } @@ -941,7 +941,7 @@ ReflectClose( #ifdef TCL_THREADS if (rtPtr->thread != Tcl_GetCurrentThread()) { Tcl_EventuallyFree(rtPtr, - (Tcl_FreeProc *)(void *)FreeReflectedTransform); + FreeReflectedTransform); return errorCode; } #endif /* TCL_THREADS */ @@ -955,7 +955,7 @@ ReflectClose( #ifdef TCL_THREADS if (rtPtr->thread != Tcl_GetCurrentThread()) { Tcl_EventuallyFree(rtPtr, - (Tcl_FreeProc *)(void *)FreeReflectedTransform); + FreeReflectedTransform); return errorCode; } #endif /* TCL_THREADS */ @@ -975,7 +975,7 @@ ReflectClose( ForwardOpToOwnerThread(rtPtr, ForwardedClose, &p); result = p.base.code; - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, FreeReflectedTransform); if (result != TCL_OK) { PassReceivedErrorInterp(interp, &p); @@ -1034,7 +1034,7 @@ ReflectClose( #endif /* TCL_THREADS */ } - Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *)(void *)FreeReflectedTransform); + Tcl_EventuallyFree(rtPtr, FreeReflectedTransform); return errorCodeSet ? errorCode : ((result == TCL_OK) ? EOK : EINVAL); } @@ -1920,7 +1920,7 @@ FreeReflectedTransformArgs( static void FreeReflectedTransform( - void *blockPtr) + char *blockPtr) { ReflectedTransform *rtPtr = (ReflectedTransform *) blockPtr; TimerKill(rtPtr); diff --git a/generic/tclTest.c b/generic/tclTest.c index c623b36..ea23d40 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -204,7 +204,7 @@ static int ObjTraceProc(ClientData clientData, Tcl_Obj *const objv[]); static void ObjTraceDeleteProc(ClientData clientData); static void PrintParse(Tcl_Interp *interp, Tcl_Parse *parsePtr); -static void SpecialFree(void *blockPtr); +static Tcl_FreeProc SpecialFree; static int StaticInitProc(Tcl_Interp *interp); static Tcl_CmdProc TestasyncCmd; static Tcl_ObjCmdProc TestbumpinterpepochObjCmd; @@ -265,7 +265,7 @@ static Tcl_ObjCmdProc TestreturnObjCmd; static void TestregexpXflags(const char *string, int length, int *cflagsPtr, int *eflagsPtr); static Tcl_ObjCmdProc TestsaveresultCmd; -static void TestsaveresultFree(void *blockPtr); +static Tcl_FreeProc TestsaveresultFree; static Tcl_CmdProc TestsetassocdataCmd; static Tcl_CmdProc TestsetCmd; static Tcl_CmdProc Testset2Cmd; @@ -1764,7 +1764,7 @@ TestdstringCmd( } else if (strcmp(argv[2], "special") == 0) { char *s = (char *)ckalloc(100) + 16; strcpy(s, "This is a specially-allocated string"); - Tcl_SetResult(interp, s, (Tcl_FreeProc *)(void *)SpecialFree); + Tcl_SetResult(interp, s, SpecialFree); } else { Tcl_AppendResult(interp, "bad gresult option \"", argv[2], "\": must be staticsmall, staticlarge, free, or special", @@ -1811,7 +1811,11 @@ TestdstringCmd( */ static void SpecialFree( +#if TCL_MAJOR_VERSION > 8 void *blockPtr /* Block to free. */ +#else + char *blockPtr /* Block to free. */ +#endif ) { ckfree((char *)blockPtr - 16); } @@ -5428,7 +5432,7 @@ TestsaveresultCmd( break; } case RESULT_DYNAMIC: - Tcl_SetResult(interp, (char *)"dynamic result", (Tcl_FreeProc *)(void *)TestsaveresultFree); + Tcl_SetResult(interp, (char *)"dynamic result", TestsaveresultFree); break; case RESULT_OBJECT: objPtr = Tcl_NewStringObj("object result", -1); @@ -5454,7 +5458,7 @@ TestsaveresultCmd( switch ((enum options) index) { case RESULT_DYNAMIC: { - int present = iPtr->freeProc == (Tcl_FreeProc *)(void *)TestsaveresultFree; + int present = iPtr->freeProc == TestsaveresultFree; int called = freeCount; Tcl_AppendElement(interp, called ? "called" : "notCalled"); @@ -5489,7 +5493,11 @@ TestsaveresultCmd( static void TestsaveresultFree( +#if TCL_MAJOR_VERSION > 8 void *blockPtr) +#else + char *blockPtr) +#endif { freeCount++; } -- cgit v0.12 From 14998a5fff1e9c95a47da25ca632d0d2cd637d3c Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 11 Oct 2023 17:19:52 +0000 Subject: Minor source readability and delete obsolete code --- generic/tclZipfs.c | 138 ++++++++++++++++++++++++++--------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 9cd4286..e53507e 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -161,6 +161,7 @@ static const z_crc_t* crc32tab; #define ZIP_COMPMETH_DEFLATED 8 #define ZIP_PASSWORD_END_SIG 0x5a5a4b50 +#define ZIP_CRYPT_HDR_LEN 12 #define ZIP_MAX_FILE_SIZE INT_MAX #define DEFAULT_WRITE_MAX_SIZE ZIP_MAX_FILE_SIZE @@ -348,9 +349,11 @@ static void SerializeLocalEntryHeader( const unsigned char *start, const unsigned char *end, unsigned char *buf, ZipEntry *z, int nameLength, int align); -static int IsCryptHeaderValid(ZipEntry *z, unsigned char cryptHdr[12]); +static int IsCryptHeaderValid(ZipEntry *z, + unsigned char cryptHdr[ZIP_CRYPT_HDR_LEN]); static int DecodeCryptHeader(Tcl_Interp *interp, ZipEntry *z, - unsigned long keys[3], unsigned char cryptHdr[12]); + unsigned long keys[3], + unsigned char cryptHdr[ZIP_CRYPT_HDR_LEN]); #if !defined(STATIC_BUILD) static int ZipfsAppHookFindTclInit(const char *archive); #endif @@ -765,7 +768,7 @@ CountSlashes( */ static int IsCryptHeaderValid( ZipEntry *z, - unsigned char cryptHeader[12] + unsigned char cryptHeader[ZIP_CRYPT_HDR_LEN] ) { /* @@ -816,7 +819,7 @@ DecodeCryptHeader(Tcl_Interp *interp, ZipEntry *z, unsigned long keys[3],/* Updated on success. Must have been initialized by caller. */ - unsigned char cryptHeader[12]) /* From zip file content */ + unsigned char cryptHeader[ZIP_CRYPT_HDR_LEN]) /* From zip file content */ { int i; int ch; @@ -830,9 +833,9 @@ DecodeCryptHeader(Tcl_Interp *interp, passBuf[i] = '\0'; init_keys(passBuf, keys, crc32tab); memset(passBuf, 0, sizeof(passBuf)); - unsigned char encheader[12]; - memcpy(encheader, cryptHeader, 12); - for (i = 0; i < 12; i++) { + unsigned char encheader[ZIP_CRYPT_HDR_LEN]; + memcpy(encheader, cryptHeader, ZIP_CRYPT_HDR_LEN); + for (i = 0; i < ZIP_CRYPT_HDR_LEN; i++) { ch = cryptHeader[i]; ch ^= decrypt_byte(keys, crc32tab); encheader[i] = ch; @@ -1412,7 +1415,7 @@ ZipFSFindTOC( ZipFile *zf) { size_t i, minoff; - const unsigned char *p, *q; + const unsigned char *eocdPtr; /* End of Central Directory Record */ const unsigned char *start = zf->data; const unsigned char *end = zf->data + zf->length; @@ -1422,18 +1425,18 @@ ZipFSFindTOC( * on the end of executables; digital signatures can also go there. */ - p = zf->data + zf->length - ZIP_CENTRAL_END_LEN; - while (p >= start) { - if (*p == (ZIP_CENTRAL_END_SIG & 0xFF)) { - if (ZipReadInt(start, end, p) == ZIP_CENTRAL_END_SIG) { + eocdPtr = zf->data + zf->length - ZIP_CENTRAL_END_LEN; + while (eocdPtr >= start) { + if (*eocdPtr == (ZIP_CENTRAL_END_SIG & 0xFF)) { + if (ZipReadInt(start, end, eocdPtr) == ZIP_CENTRAL_END_SIG) { break; } - p -= ZIP_SIG_LEN; + eocdPtr -= ZIP_SIG_LEN; } else { - --p; + --eocdPtr; } } - if (p < zf->data) { + if (eocdPtr < zf->data) { /* * Didn't find it (or not enough space for a central directory!); not * a ZIP archive. This might be OK or a problem. @@ -1448,13 +1451,17 @@ ZipFSFindTOC( goto error; } - /* p -> End of Central Directory (EOCD) record at this point */ + /* + * eocdPtr -> End of Central Directory (EOCD) record at this point. + * Note this is not same as "end of Central Directory" :-) as EOCD + * is a record/structure in the ZIP spec terminology + */ /* * How many files in the archive? If that's bogus, we're done here. */ - zf->numFiles = ZipReadShort(start, end, p + ZIP_CENTRAL_ENTS_OFFS); + zf->numFiles = ZipReadShort(start, end, eocdPtr + ZIP_CENTRAL_ENTS_OFFS); if (zf->numFiles == 0) { if (!needZip) { zf->baseOffset = zf->passOffset = zf->length; @@ -1473,9 +1480,9 @@ ZipFSFindTOC( * cdirSize. NOTE: offset into archive does NOT mean offset into * (zf->data) as other data may precede the archive in the file. */ - ptrdiff_t eocdDataOffset = p - zf->data; - unsigned int cdirZipOffset = ZipReadInt(start, end, p + ZIP_CENTRAL_DIRSTART_OFFS); - unsigned int cdirSize = ZipReadInt(start, end, p + ZIP_CENTRAL_DIRSIZE_OFFS); + ptrdiff_t eocdDataOffset = eocdPtr - zf->data; + unsigned int cdirZipOffset = ZipReadInt(start, end, eocdPtr + ZIP_CENTRAL_DIRSTART_OFFS); + unsigned int cdirSize = ZipReadInt(start, end, eocdPtr + ZIP_CENTRAL_DIRSIZE_OFFS); /* * As computed above, @@ -1511,39 +1518,29 @@ ZipFSFindTOC( zf->directoryOffset = cdirZipOffset + zf->baseOffset; zf->directorySize = cdirSize; - const unsigned char *const cdirStart = p - cdirSize; /* Start of CD */ - - /* - * Original pointer based validation replaced by simpler checks above. - * Ensure still holds. The assigments to p, q are only there for use in - * the asserts. May be removed at some future date. - */ - q = zf->data + cdirZipOffset; - p -= cdirSize; - assert(!((p < q) || (p < zf->data) || (p > zf->data + zf->length) || - (q < zf->data) || (q > zf->data + zf->length))); - /* * Read the central directory. */ + const unsigned char *const cdirStart = eocdPtr - cdirSize; /* Start of CD */ + const unsigned char *dirEntry; minoff = zf->length; - for (q = cdirStart, i = 0; i < zf->numFiles; i++) { - if ((q-cdirStart) + ZIP_CENTRAL_HEADER_LEN > (ptrdiff_t)zf->directorySize) { + for (dirEntry = cdirStart, i = 0; i < zf->numFiles; i++) { + if ((dirEntry-cdirStart) + ZIP_CENTRAL_HEADER_LEN > (ptrdiff_t)zf->directorySize) { ZIPFS_ERROR(interp, "truncated directory"); ZIPFS_ERROR_CODE(interp, "TRUNC_DIR"); goto error; } - if (ZipReadInt(start, end, q) != ZIP_CENTRAL_HEADER_SIG) { + if (ZipReadInt(start, end, dirEntry) != ZIP_CENTRAL_HEADER_SIG) { ZIPFS_ERROR(interp, "wrong header signature"); ZIPFS_ERROR_CODE(interp, "HDR_SIG"); goto error; } - int pathlen = ZipReadShort(start, end, q + ZIP_CENTRAL_PATHLEN_OFFS); - int comlen = ZipReadShort(start, end, q + ZIP_CENTRAL_FCOMMENTLEN_OFFS); - int extra = ZipReadShort(start, end, q + ZIP_CENTRAL_EXTRALEN_OFFS); - size_t localhdr_off = ZipReadInt(start, end, q + ZIP_CENTRAL_LOCALHDR_OFFS); + int pathlen = ZipReadShort(start, end, dirEntry + ZIP_CENTRAL_PATHLEN_OFFS); + int comlen = ZipReadShort(start, end, dirEntry + ZIP_CENTRAL_FCOMMENTLEN_OFFS); + int extra = ZipReadShort(start, end, dirEntry + ZIP_CENTRAL_EXTRALEN_OFFS); + size_t localhdr_off = ZipReadInt(start, end, dirEntry + ZIP_CENTRAL_LOCALHDR_OFFS); const unsigned char *localP = zf->data + zf->baseOffset + localhdr_off; - if (localP > (p - ZIP_LOCAL_HEADER_LEN) || + if (localP > (cdirStart - ZIP_LOCAL_HEADER_LEN) || ZipReadInt(start, end, localP) != ZIP_LOCAL_HEADER_SIG) { ZIPFS_ERROR(interp, "Failed to find local header"); ZIPFS_ERROR_CODE(interp, "LCL_HDR"); @@ -1552,9 +1549,9 @@ ZipFSFindTOC( if (localhdr_off < minoff) { minoff = localhdr_off; } - q += pathlen + comlen + extra + ZIP_CENTRAL_HEADER_LEN; + dirEntry += pathlen + comlen + extra + ZIP_CENTRAL_HEADER_LEN; } - if ((q-cdirStart) < (ptrdiff_t) zf->directorySize) { + if ((dirEntry-cdirStart) < (ptrdiff_t) zf->directorySize) { /* file count and dir size do not match */ ZIPFS_ERROR(interp, "short file count"); ZIPFS_ERROR_CODE(interp, "FILE_COUNT"); @@ -1566,9 +1563,11 @@ ZipFSFindTOC( /* * If there's also an encoded password, extract that too (but don't decode * yet). + * TODO - is this even part of the ZIP "standard". The idea of storing + * a password with the archive seems absurd, encoded or not. */ - q = zf->data + zf->passOffset; + unsigned char *q = zf->data + zf->passOffset; if ((zf->passOffset >= 6) && (start < q-4) && (ZipReadInt(start, end, q - 4) == ZIP_PASSWORD_END_SIG)) { const unsigned char *passPtr; @@ -2047,7 +2046,7 @@ ZipFSCatalogFilesystem( z->isDirectory = isdir; z->isEncrypted = (ZipReadShort(start, end, lq + ZIP_LOCAL_FLAGS_OFFS) & 1) - && (nbcompr > 12); + && (nbcompr > ZIP_CRYPT_HDR_LEN); z->offset = offs; if (gq) { z->crc32 = ZipReadInt(start, end, gq + ZIP_CENTRAL_CRC32_OFFS); @@ -3013,30 +3012,30 @@ ZipAddFile( if (passwd) { int i, ch, tmp; - unsigned char kvbuf[24]; + unsigned char kvbuf[2*ZIP_CRYPT_HDR_LEN]; init_keys(passwd, keys, crc32tab); - for (i = 0; i < 12 - 2; i++) { + for (i = 0; i < ZIP_CRYPT_HDR_LEN - 2; i++) { if (RandomChar(interp, i, &ch) != TCL_OK) { Tcl_Close(interp, in); return TCL_ERROR; } - kvbuf[i + 12] = UCHAR(zencode(keys, crc32tab, ch, tmp)); + kvbuf[i + ZIP_CRYPT_HDR_LEN] = UCHAR(zencode(keys, crc32tab, ch, tmp)); } Tcl_ResetResult(interp); init_keys(passwd, keys, crc32tab); - for (i = 0; i < 12 - 2; i++) { - kvbuf[i] = UCHAR(zencode(keys, crc32tab, kvbuf[i + 12], tmp)); + for (i = 0; i < ZIP_CRYPT_HDR_LEN - 2; i++) { + kvbuf[i] = UCHAR(zencode(keys, crc32tab, kvbuf[i + ZIP_CRYPT_HDR_LEN], tmp)); } kvbuf[i++] = UCHAR(zencode(keys, crc32tab, crc >> 16, tmp)); kvbuf[i++] = UCHAR(zencode(keys, crc32tab, crc >> 24, tmp)); - len = Tcl_Write(out, (char *) kvbuf, 12); - memset(kvbuf, 0, 24); - if (len != 12) { + len = Tcl_Write(out, (char *) kvbuf, ZIP_CRYPT_HDR_LEN); + memset(kvbuf, 0, sizeof(kvbuf)); + if (len != ZIP_CRYPT_HDR_LEN) { goto writeErrorWithChannelOpen; } memcpy(keys0, keys, sizeof(keys0)); - nbytecompr += 12; + nbytecompr += ZIP_CRYPT_HDR_LEN; } /* @@ -3128,7 +3127,7 @@ ZipAddFile( Tcl_DStringFree(&zpathDs); return TCL_ERROR; } - nbytecompr = (passwd ? 12 : 0); + nbytecompr = (passwd ? ZIP_CRYPT_HDR_LEN : 0); while (1) { len = Tcl_Read(in, buf, bufsize); if (len == ERROR_LENGTH) { @@ -4820,7 +4819,7 @@ ZipChannelOpen( } if (z->isEncrypted) { - if (z->numCompressedBytes < 12) { + if (z->numCompressedBytes < ZIP_CRYPT_HDR_LEN) { ZIPFS_ERROR(interp, "decryption failed: truncated decryption header"); ZIPFS_ERROR_CODE(interp, "DECRYPT"); @@ -4945,7 +4944,7 @@ InitWritableChannel( } if (z->isEncrypted) { - assert(z->numCompressedBytes >= 12); /* caller should have checked*/ + assert(z->numCompressedBytes >= ZIP_CRYPT_HDR_LEN); /* caller should have checked*/ if (DecodeCryptHeader( interp, z, info->keys, z->zipFilePtr->data + z->offset) != TCL_OK) { @@ -4975,7 +4974,7 @@ InitWritableChannel( unsigned char *zbuf = z->zipFilePtr->data + z->offset; if (z->isEncrypted) { - zbuf += 12; + zbuf += ZIP_CRYPT_HDR_LEN; } if (z->compressMethod == ZIP_COMPMETH_DEFLATED) { @@ -4990,10 +4989,10 @@ InitWritableChannel( if (z->isEncrypted) { unsigned int j; - /* Min length 12 for keys should already been checked. */ - assert(stream.avail_in >= 12); + /* Min length ZIP_CRYPT_HDR_LEN for keys should already been checked. */ + assert(stream.avail_in >= ZIP_CRYPT_HDR_LEN); - stream.avail_in -= 12; + stream.avail_in -= ZIP_CRYPT_HDR_LEN; cbuf = (unsigned char *) attemptckalloc(stream.avail_in ? stream.avail_in : 1); if (!cbuf) { goto memoryError; @@ -5028,10 +5027,10 @@ InitWritableChannel( /* * Need to decrypt some otherwise-simple stored data. */ - if (z->numCompressedBytes <= 12 || - (z->numCompressedBytes - 12) != z->numBytes) + if (z->numCompressedBytes <= ZIP_CRYPT_HDR_LEN || + (z->numCompressedBytes - ZIP_CRYPT_HDR_LEN) != z->numBytes) goto corruptionError; - int len = z->numCompressedBytes - 12; + int len = z->numCompressedBytes - ZIP_CRYPT_HDR_LEN; assert(len <= info->ubufSize); for (i = 0; i < len; i++) { ch = zbuf[i]; @@ -5120,11 +5119,11 @@ InitReadableChannel( info->numBytes = z->numBytes; if (info->isEncrypted) { - assert(z->numCompressedBytes >= 12); /* caller should have checked*/ + assert(z->numCompressedBytes >= ZIP_CRYPT_HDR_LEN); /* caller should have checked*/ if (DecodeCryptHeader(interp, z, info->keys, info->ubuf) != TCL_OK) { goto error_cleanup; } - info->ubuf += 12; + info->ubuf += ZIP_CRYPT_HDR_LEN; } if (info->iscompr) { @@ -5144,8 +5143,8 @@ InitReadableChannel( stream.opaque = Z_NULL; stream.avail_in = z->numCompressedBytes; if (info->isEncrypted) { - assert(stream.avail_in >= 12); - stream.avail_in -= 12; + assert(stream.avail_in >= ZIP_CRYPT_HDR_LEN); + stream.avail_in -= ZIP_CRYPT_HDR_LEN; ubuf = (unsigned char *) attemptckalloc(stream.avail_in ? stream.avail_in : 1); if (!ubuf) { goto memoryError; @@ -5199,9 +5198,10 @@ InitReadableChannel( * Decode encrypted but uncompressed file, since we support Tcl_Seek() * on it, and it can be randomly accessed later. */ - if (z->numCompressedBytes <= 12 || (z->numCompressedBytes - 12) != z->numBytes) + if (z->numCompressedBytes <= ZIP_CRYPT_HDR_LEN || + (z->numCompressedBytes - ZIP_CRYPT_HDR_LEN) != z->numBytes) goto corruptionError; - len = z->numCompressedBytes - 12; + len = z->numCompressedBytes - ZIP_CRYPT_HDR_LEN; ubuf = (unsigned char *) attemptckalloc(len); if (ubuf == NULL) { goto memoryError; -- cgit v0.12 From a8542abb38dfca077204db3f750351144bb801ee Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Thu, 12 Oct 2023 11:33:17 +0000 Subject: Add --disable-zipfs config to github actions --- .github/workflows/linux-build.yml | 1 + .github/workflows/mac-build.yml | 1 + .github/workflows/win-build.yml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index b616d14..f97ec63 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -18,6 +18,7 @@ jobs: - "" - "CFLAGS=-DTCL_NO_DEPRECATED=1" - "--disable-shared" + - "--disable-zipfs" - "--enable-symbols" - "--enable-symbols=mem" - "--enable-symbols=all" diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 30e695f..e998256 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -42,6 +42,7 @@ jobs: cfgopt: - "" - "--disable-shared" + - "--disable-zipfs" - "--enable-symbols" - "--enable-symbols=mem" - "--enable-symbols=all" diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 8af5ac7..b5ee266 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -24,6 +24,7 @@ jobs: - "" - "CHECKS=nodep" - "OPTS=static" + - "OPTS=noembed" - "OPTS=symbols" - "OPTS=symbols STATS=compdbg,memdbg" # Using powershell means we need to explicitly stop on failure @@ -67,6 +68,7 @@ jobs: - "" - "CFLAGS=-DTCL_NO_DEPRECATED=1" - "--disable-shared" + - "--disable-zipfs" - "--enable-symbols" - "--enable-symbols=mem" - "--enable-symbols=all" -- cgit v0.12 From ea1d0bdda1fbfe0bcdd1b2d0d1cfb6684670693c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 12 Oct 2023 14:38:09 +0000 Subject: Fix [bf899d6d6d]: tclUnixSock.c: remove unnecessary cast --- unix/tclUnixSock.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 6ca1293..441f75b 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -138,7 +138,7 @@ static int TcpOutputProc(void *instanceData, static void TcpThreadActionProc(void *instanceData, int action); static void TcpWatchProc(void *instanceData, int mask); static int WaitForConnect(TcpState *statePtr, int *errorCodePtr); -static void WrapNotify(void *clientData, int mask); +static Tcl_FileProc WrapNotify; /* * This structure describes the channel type structure for TCP socket @@ -564,7 +564,7 @@ TcpOutputProc( if (WaitForConnect(statePtr, errorCodePtr) != 0) { return -1; } - written = send(statePtr->fds.fd, buf, (size_t) toWrite, 0); + written = send(statePtr->fds.fd, buf, toWrite, 0); if (written >= 0) { return written; @@ -807,7 +807,7 @@ TcpHostPortList( static int TcpGetOptionProc( - void *instanceData, /* Socket state. */ + void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to retrieve the value * for, or NULL to get all options and their @@ -909,8 +909,8 @@ TcpGetOptionProc( if ((len == 0) || ((len > 1) && (optionName[1] == 's') && (strncmp(optionName, "-sockname", len) == 0))) { TcpFdList *fds; - address sockname; - socklen_t size; + address sockname; + socklen_t size; int found = 0; if (len == 0) { @@ -1093,10 +1093,10 @@ TcpWatchProc( */ statePtr->interest = mask; - Tcl_CreateFileHandler(statePtr->fds.fd, mask|TCL_READABLE, - (Tcl_FileProc *) WrapNotify, statePtr); + Tcl_CreateFileHandler(statePtr->fds.fd, mask|TCL_READABLE, + WrapNotify, statePtr); } else { - Tcl_DeleteFileHandler(statePtr->fds.fd); + Tcl_DeleteFileHandler(statePtr->fds.fd); } } -- cgit v0.12 From 2a8151fd1a52f6e52b76fb628af9d699cc580b35 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 12 Oct 2023 14:46:42 +0000 Subject: Those type-casts don't work well in C++ --- generic/tclDecls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index f8e9bcf..a91f718 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3973,6 +3973,7 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags)) # define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) +#ifndef __cplusplus # undef Tcl_EventuallyFree # define Tcl_EventuallyFree \ ((void (*)(void *,void *))(void *)(tclStubsPtr->tcl_EventuallyFree)) /* 132 */ @@ -3980,6 +3981,7 @@ extern const TclStubs *tclStubsPtr; # define Tcl_SetResult \ ((void (*)(Tcl_Interp *, char *, void *))(void *)(tclStubsPtr->tcl_SetResult)) /* 232 */ #endif +#endif #if defined(_WIN32) && defined(UNICODE) # define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg))) -- cgit v0.12 From e6a868c242fb7ad99bf71d9d57597761e1fec9ab Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 12 Oct 2023 15:11:10 +0000 Subject: Fix [ad5a57f2f2]: Functions passed to Tcl_CreateFileHandler() must be declared/defined as Tcl_FileProc. Also, add some type-casts --- unix/tclUnixChan.c | 73 ++++++++++++++++++++++++++++++++---------------------- unix/tclUnixPipe.c | 51 ++++++++++++++++++++++++-------------- 2 files changed, 76 insertions(+), 48 deletions(-) diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 2f51226..5742e9a 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -5,7 +5,7 @@ * and TCP sockets. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -205,7 +205,7 @@ FileBlockModeProc( int mode) /* The mode to set. Can be TCL_MODE_BLOCKING * or TCL_MODE_NONBLOCKING. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; if (TclUnixSetBlockingMode(fsPtr->fd, mode) < 0) { return errno; @@ -240,7 +240,7 @@ FileInputProc( * buffer? */ int *errorCodePtr) /* Where to store error code. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; int bytesRead; /* How many bytes were actually read from the * input device? */ @@ -254,7 +254,7 @@ FileInputProc( */ do { - bytesRead = read(fsPtr->fd, buf, (size_t) toRead); + bytesRead = read(fsPtr->fd, buf, toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { @@ -289,7 +289,7 @@ FileOutputProc( int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; int written; *errorCodePtr = 0; @@ -303,8 +303,8 @@ FileOutputProc( return 0; } - written = write(fsPtr->fd, buf, (size_t) toWrite); - if (written > -1) { + written = write(fsPtr->fd, buf, toWrite); + if (written >= 0) { return written; } *errorCodePtr = errno; @@ -333,7 +333,7 @@ FileCloseProc( ClientData instanceData, /* File state. */ Tcl_Interp *interp) /* For error reporting - unused. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; int errorCode = 0; Tcl_DeleteFileHandler(fsPtr->fd); @@ -451,7 +451,7 @@ FileWideSeekProc( * one of SEEK_START, SEEK_CUR or SEEK_END. */ int *errorCodePtr) /* To store error code. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; Tcl_WideInt newLoc; newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode); @@ -477,6 +477,20 @@ FileWideSeekProc( *---------------------------------------------------------------------- */ +/* + * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc, + * so do not pass it to directly to Tcl_CreateFileHandler. + * Instead, pass a wrapper which is a Tcl_FileProc. + */ +static void +FileWatchNotifyChannelWrapper( + ClientData clientData, + int mask) +{ + Tcl_Channel channel = clientData; + Tcl_NotifyChannel(channel, mask); +} + static void FileWatchProc( ClientData instanceData, /* The file state. */ @@ -484,18 +498,16 @@ FileWatchProc( * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; /* - * Make sure we only register for events that are valid on this file. Note - * that we are passing Tcl_NotifyChannel directly to Tcl_CreateFileHandler - * with the channel pointer as the client data. + * Make sure we only register for events that are valid on this file. */ mask &= fsPtr->validMask; if (mask) { Tcl_CreateFileHandler(fsPtr->fd, mask, - (Tcl_FileProc *) Tcl_NotifyChannel, fsPtr->channel); + FileWatchNotifyChannelWrapper, fsPtr->channel); } else { Tcl_DeleteFileHandler(fsPtr->fd); } @@ -525,7 +537,7 @@ FileGetHandleProc( int direction, /* TCL_READABLE or TCL_WRITABLE */ ClientData *handlePtr) /* Where to store the handle. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; if (direction & fsPtr->validMask) { *handlePtr = INT2PTR(fsPtr->fd); @@ -593,7 +605,7 @@ TtySetOptionProc( const char *optionName, /* Which option to set? */ const char *value) /* New value for option. */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; unsigned int len, vlen; TtyAttrs tty; int argc; @@ -620,7 +632,6 @@ TtySetOptionProc( return TCL_OK; } - /* * Option -handshake none|xonxoff|rtscts|dtrdsr */ @@ -721,9 +732,11 @@ TtySetOptionProc( /* * Option -ttycontrol {DTR 1 RTS 0 BREAK 0} */ + if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) { #if defined(TIOCMGET) && defined(TIOCMSET) - int i, control, flag; + int control, flag; + int i; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; @@ -820,7 +833,7 @@ TtyGetOptionProc( const char *optionName, /* Option to get. */ Tcl_DString *dsPtr) /* Where to store value(s). */ { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; unsigned int len; char buf[3*TCL_INTEGER_SPACE + 16]; int valid = 0; /* Flag if valid option parsed. */ @@ -897,6 +910,7 @@ TtyGetOptionProc( * Option is readonly and returned by [fconfigure chan -ttystatus] but not * returned by unnamed [fconfigure chan]. */ + if ((len > 4) && (strncmp(optionName, "-ttystatus", len) == 0)) { int status; @@ -914,7 +928,6 @@ TtyGetOptionProc( ); } - static const struct {int baud; speed_t speed;} speeds[] = { #ifdef B0 {0, B0}, @@ -1038,7 +1051,7 @@ static const struct {int baud; speed_t speed;} speeds[] = { #endif {-1, 0} }; - + /* *--------------------------------------------------------------------------- * @@ -1330,7 +1343,8 @@ TtyParseMode( static void TtyInit( - int fd) /* Open file descriptor for serial port to be initialized. */ + int fd) /* Open file descriptor for serial port to be + * initialized. */ { struct termios iostate; tcgetattr(fd, &iostate); @@ -1340,8 +1354,7 @@ TtyInit( || iostate.c_lflag != 0 || iostate.c_cflag & CREAD || iostate.c_cc[VMIN] != 1 - || iostate.c_cc[VTIME] != 0) - { + || iostate.c_cc[VTIME] != 0) { iostate.c_iflag = IGNBRK; iostate.c_oflag = 0; iostate.c_lflag = 0; @@ -1407,7 +1420,7 @@ TclpOpenFileChannel( return NULL; } - native = Tcl_FSGetNativePath(pathPtr); + native = (const char *)Tcl_FSGetNativePath(pathPtr); if (native == NULL) { if (interp != (Tcl_Interp *) NULL) { Tcl_AppendResult(interp, "couldn't open \"", @@ -1467,7 +1480,7 @@ TclpOpenFileChannel( channelTypePtr = &fileChannelType; } - fsPtr = ckalloc(sizeof(FileState)); + fsPtr = (FileState *)ckalloc(sizeof(FileState)); fsPtr->validMask = channelPermissions | TCL_EXCEPTION; fsPtr->fd = fd; @@ -1483,8 +1496,8 @@ TclpOpenFileChannel( * reports that the serial port isn't working. */ - if (Tcl_SetChannelOption(interp, fsPtr->channel, "-translation", - translation) != TCL_OK) { + if (Tcl_SetChannelOption(interp, fsPtr->channel, + "-translation", translation) != TCL_OK) { Tcl_Close(NULL, fsPtr->channel); return NULL; } @@ -1543,7 +1556,7 @@ Tcl_MakeFileChannel( snprintf(channelName, sizeof(channelName), "file%d", fd); } - fsPtr = ckalloc(sizeof(FileState)); + fsPtr = (FileState *)ckalloc(sizeof(FileState)); fsPtr->fd = fd; fsPtr->validMask = mode | TCL_EXCEPTION; fsPtr->channel = Tcl_CreateChannel(channelTypePtr, channelName, @@ -1925,7 +1938,7 @@ FileTruncateProc( ClientData instanceData, Tcl_WideInt length) { - FileState *fsPtr = instanceData; + FileState *fsPtr = (FileState *)instanceData; int result; #ifdef HAVE_TYPE_OFF64_T diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 96ca095..6e07a02 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -421,7 +421,8 @@ TclpCreateProcess( char errSpace[200 + TCL_INTEGER_SPACE]; Tcl_DString *dsArray; char **newArgv; - int pid, i; + int pid; + int i; #if defined(HAVE_POSIX_SPAWNP) int childErrno; static int use_spawn = -1; @@ -447,8 +448,8 @@ TclpCreateProcess( * deallocated later */ - dsArray = TclStackAlloc(interp, argc * sizeof(Tcl_DString)); - newArgv = TclStackAlloc(interp, (argc+1) * sizeof(char *)); + dsArray = (Tcl_DString *)TclStackAlloc(interp, argc * sizeof(Tcl_DString)); + newArgv = (char **)TclStackAlloc(interp, (argc+1) * sizeof(char *)); newArgv[argc] = NULL; for (i = 0; i < argc; i++) { newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]); @@ -608,7 +609,7 @@ TclpCreateProcess( errPipeOut = NULL; fd = GetFd(errPipeIn); - count = read(fd, errSpace, (size_t) (sizeof(errSpace) - 1)); + count = read(fd, errSpace, sizeof(errSpace) - 1); if (count > 0) { char *end; @@ -632,7 +633,7 @@ TclpCreateProcess( * here, since this is the error case. [Bug: 6148] */ - Tcl_WaitPid((Tcl_Pid) INT2PTR(pid), &status, 0); + Tcl_WaitPid((Tcl_Pid)INT2PTR(pid), &status, 0); } if (errPipeIn) { @@ -828,7 +829,7 @@ TclpCreateCommandChannel( { char channelName[16 + TCL_INTEGER_SPACE]; int channelId; - PipeState *statePtr = ckalloc(sizeof(PipeState)); + PipeState *statePtr = (PipeState *)ckalloc(sizeof(PipeState)); int mode; statePtr->inFile = readFile; @@ -953,7 +954,7 @@ TclGetAndDetachPids( return; } - pipePtr = Tcl_GetChannelInstanceData(chan); + pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan); TclNewObj(pidsObj); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewIntObj( @@ -991,7 +992,7 @@ PipeBlockModeProc( * TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { - PipeState *psPtr = instanceData; + PipeState *psPtr = (PipeState *)instanceData; if (psPtr->inFile && TclUnixSetBlockingMode(GetFd(psPtr->inFile), mode) < 0) { @@ -1030,7 +1031,7 @@ PipeClose2Proc( Tcl_Interp *interp, /* For error reporting. */ int flags) /* Flags that indicate which side to close. */ { - PipeState *pipePtr = instanceData; + PipeState *pipePtr = (PipeState *)instanceData; Tcl_Channel errChan; int errorCode, result; @@ -1127,7 +1128,7 @@ PipeInputProc( * buffer? */ int *errorCodePtr) /* Where to store error code. */ { - PipeState *psPtr = instanceData; + PipeState *psPtr = (PipeState *)instanceData; int bytesRead; /* How many bytes were actually read from the * input device? */ @@ -1142,7 +1143,7 @@ PipeInputProc( */ do { - bytesRead = read(GetFd(psPtr->inFile), buf, (size_t) toRead); + bytesRead = read(GetFd(psPtr->inFile), buf, toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { @@ -1177,7 +1178,7 @@ PipeOutputProc( int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { - PipeState *psPtr = instanceData; + PipeState *psPtr = (PipeState *)instanceData; int written; *errorCodePtr = 0; @@ -1188,7 +1189,7 @@ PipeOutputProc( */ do { - written = write(GetFd(psPtr->outFile), buf, (size_t) toWrite); + written = write(GetFd(psPtr->outFile), buf, toWrite); } while ((written < 0) && (errno == EINTR)); if (written < 0) { @@ -1215,6 +1216,20 @@ PipeOutputProc( *---------------------------------------------------------------------- */ +/* + * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc, + * so do not pass it to directly to Tcl_CreateFileHandler. + * Instead, pass a wrapper which is a Tcl_FileProc. + */ +static void +PipeWatchNotifyChannelWrapper( + ClientData clientData, + int mask) +{ + Tcl_Channel channel = clientData; + Tcl_NotifyChannel(channel, mask); +} + static void PipeWatchProc( ClientData instanceData, /* The pipe state. */ @@ -1222,14 +1237,14 @@ PipeWatchProc( * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { - PipeState *psPtr = instanceData; + PipeState *psPtr = (PipeState *)instanceData; int newmask; if (psPtr->inFile) { newmask = mask & (TCL_READABLE | TCL_EXCEPTION); if (newmask) { Tcl_CreateFileHandler(GetFd(psPtr->inFile), newmask, - (Tcl_FileProc *) Tcl_NotifyChannel, psPtr->channel); + PipeWatchNotifyChannelWrapper, psPtr->channel); } else { Tcl_DeleteFileHandler(GetFd(psPtr->inFile)); } @@ -1238,7 +1253,7 @@ PipeWatchProc( newmask = mask & (TCL_WRITABLE | TCL_EXCEPTION); if (newmask) { Tcl_CreateFileHandler(GetFd(psPtr->outFile), newmask, - (Tcl_FileProc *) Tcl_NotifyChannel, psPtr->channel); + PipeWatchNotifyChannelWrapper, psPtr->channel); } else { Tcl_DeleteFileHandler(GetFd(psPtr->outFile)); } @@ -1269,7 +1284,7 @@ PipeGetHandleProc( int direction, /* TCL_READABLE or TCL_WRITABLE */ ClientData *handlePtr) /* Where to store the handle. */ { - PipeState *psPtr = instanceData; + PipeState *psPtr = (PipeState *)instanceData; if (direction == TCL_READABLE && psPtr->inFile) { *handlePtr = INT2PTR(GetFd(psPtr->inFile)); @@ -1368,7 +1383,7 @@ Tcl_PidObjCmd( * Extract the process IDs from the pipe structure. */ - pipePtr = Tcl_GetChannelInstanceData(chan); + pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan); TclNewObj(resultPtr); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(NULL, resultPtr, -- cgit v0.12 From bfa39cdd57f5e52d610b1c1e7168718760e77b93 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Oct 2023 13:50:10 +0000 Subject: Fix warning on MacOSX: "/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libtcl8.6.a(tclAlloc.o) has no symbols". Backported from 8.7 --- generic/tclAlloc.c | 6 ++++-- generic/tclInt.h | 21 +++++++++++++++++++++ generic/tclThreadJoin.c | 6 ++++-- unix/tclUnixEvent.c | 4 +++- unix/tclUnixNotfy.c | 2 ++ 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 5eaa2eb..c9d5113 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -8,7 +8,7 @@ * * Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson. * @@ -275,7 +275,7 @@ TclpAlloc( if (numBytes >= MAXMALLOC - OVERHEAD) { if (numBytes <= UINT_MAX - OVERHEAD -sizeof(struct block)) { bigBlockPtr = (struct block *) TclpSysAlloc( - (sizeof(struct block) + OVERHEAD + numBytes), 0); + sizeof(struct block) + OVERHEAD + numBytes, 0); } if (bigBlockPtr == NULL) { Tcl_MutexUnlock(allocMutexPtr); @@ -748,6 +748,8 @@ TclpRealloc( } #endif /* !USE_TCLALLOC */ +#else +TCL_MAC_EMPTY_FILE(generic_tclAlloc_c) #endif /* !TCL_THREADS */ /* diff --git a/generic/tclInt.h b/generic/tclInt.h index 103827f..6550ab3 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4503,6 +4503,27 @@ typedef struct NRE_callback { #endif /* + * Special hack for macOS, where the static linker (technically the 'ar' + * command) hates empty object files, and accepts no flags to make it shut up. + * + * These symbols are otherwise completely useless. + * + * They can't be written to or written through. They can't be seen by any + * other code. They use a separate attribute (supported by all macOS + * compilers, which are derivatives of clang or gcc) to stop the compilation + * from moaning. They will be excluded during the final linking stage. + * + * Other platforms get nothing at all. That's good. + */ + +#ifdef MAC_OSX_TCL +#define TCL_MAC_EMPTY_FILE(name) \ + static __attribute__((used)) const void *const TclUnusedFile_ ## name = NULL; +#else +#define TCL_MAC_EMPTY_FILE(name) +#endif /* MAC_OSX_TCL */ + +/* * Other externals. */ diff --git a/generic/tclThreadJoin.c b/generic/tclThreadJoin.c index d6d89a1..5c4d969 100644 --- a/generic/tclThreadJoin.c +++ b/generic/tclThreadJoin.c @@ -6,7 +6,7 @@ * provide the functionality of joining threads. This code is currently * not necessary on Unix. * - * Copyright (c) 2000 by Scriptics Corporation + * Copyright (c) 2000 Scriptics Corporation * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -230,7 +230,7 @@ TclRememberJoinableThread( { JoinableThread *threadPtr; - threadPtr = ckalloc(sizeof(JoinableThread)); + threadPtr = (JoinableThread *)ckalloc(sizeof(JoinableThread)); threadPtr->id = id; threadPtr->done = 0; threadPtr->waitedUpon = 0; @@ -305,6 +305,8 @@ TclSignalExitThread( Tcl_MutexUnlock(&threadPtr->threadMutex); } +#else +TCL_MAC_EMPTY_FILE(generic_tclThreadJoin_c) #endif /* _WIN32 */ /* diff --git a/unix/tclUnixEvent.c b/unix/tclUnixEvent.c index 40aac6f..7161d18 100644 --- a/unix/tclUnixEvent.c +++ b/unix/tclUnixEvent.c @@ -3,7 +3,7 @@ * * This file implements Unix specific event related routines. * - * Copyright (c) 1997 by Sun Microsystems, Inc. + * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -85,6 +85,8 @@ Tcl_Sleep( } } +#else +TCL_MAC_EMPTY_FILE(unix_tclUnixEvent_c) #endif /* HAVE_COREFOUNDATION */ /* * Local Variables: diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 4655327..0bee2f1 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -1483,6 +1483,8 @@ AtForkChild(void) #endif /* TCL_THREADS */ +#else +TCL_MAC_EMPTY_FILE(unix_tclUnixNotfy_c) #endif /* !HAVE_COREFOUNDATION */ /* -- cgit v0.12 From 559178bdc0175fffe57607164f601e2816ac0de9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Oct 2023 14:33:24 +0000 Subject: Fix [52dbc4b3f8]: tclInterp.c: Tcl_Free() called through pointer of incorrect type --- generic/tclInterp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 0a57b70..42d8ec3 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -3499,6 +3499,14 @@ RunLimitHandlers( *---------------------------------------------------------------------- */ +/* Bug 52dbc4b3f8: wrap Tcl_Free since it is not a Tcl_LimitHandlerDeleteProc. */ +static void +WrapFree( + void *ptr) +{ + Tcl_Free(ptr); +} + void Tcl_LimitAddHandler( Tcl_Interp *interp, @@ -3515,10 +3523,7 @@ Tcl_LimitAddHandler( */ if (deleteProc == (Tcl_LimitHandlerDeleteProc *) TCL_DYNAMIC) { - deleteProc = (Tcl_LimitHandlerDeleteProc *) Tcl_Free; - } - if (deleteProc == (Tcl_LimitHandlerDeleteProc *) TCL_STATIC) { - deleteProc = NULL; + deleteProc = WrapFree; } /* -- cgit v0.12 From 6919903c105a176e4445b225bb1a05f54a023348 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Oct 2023 14:59:52 +0000 Subject: Restore to rules.vc version 10, so we don't accidentally use Tcl 8.7/9.0 features --- win/rules.vc | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/win/rules.vc b/win/rules.vc index bca056c..32a5024 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change # the major version. RULES_VERSION_MAJOR = 1 -RULES_VERSION_MINOR = 11 +RULES_VERSION_MINOR = 10 # The PROJECT macro must be defined by parent makefile. !if "$(PROJECT)" == "" @@ -876,17 +876,11 @@ TCL_THREADS = 0 USE_THREAD_ALLOC= 0 !endif -!if [nmakehlp -f $(OPTS) "tcl8"] -!message *** Build for Tcl8 -TCL_BUILD_FOR = 8 -!endif - !if $(TCL_MAJOR_VERSION) == 8 !if [nmakehlp -f $(OPTS) "time64bit"] !message *** Force 64-bit time_t _USE_64BIT_TIME_T = 1 !endif -!endif # Yes, it's weird that the "symbols" option controls DEBUG and # the "pdbs" option controls SYMBOLS. That's historical. @@ -1145,11 +1139,7 @@ TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) TCLSCRIPTZIP = $(OUT_DIR)\$(TCLSCRIPTZIPNAME) -!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib -!else -TCLSTUBLIBNAME = $(STUBPREFIX).lib -!endif TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" @@ -1165,11 +1155,7 @@ TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif -!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib -!else -TCLSTUBLIB = $(_TCLDIR)\lib\tclstub.lib -!endif TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. @@ -1189,11 +1175,7 @@ TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe !if !exist($(TCLSH)) TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif -!if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib -!else -TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub.lib -!endif TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. @@ -1209,11 +1191,7 @@ TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif # TCLINSTALL -!if !$(STATIC_BUILD) && "$(TCL_BUILD_FOR)" == "8" -tcllibs = "$(TCLSTUBLIB)" -!else tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)" -!endif !endif # $(DOING_TCL) @@ -1233,7 +1211,7 @@ WISHNAMEPREFIX = wish WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe TKLIBNAME8 = tk$(TK_VERSION)$(SUFX).$(EXT) TKLIBNAME9 = tcl9tk$(TK_VERSION)$(SUFX).$(EXT) -!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" +!if $(TCL_MAJOR_VERSION) == 8 TKLIBNAME = tk$(TK_VERSION)$(SUFX).$(EXT) TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib !else @@ -1290,18 +1268,14 @@ tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib PRJLIBNAME8 = $(PROJECT)$(VERSION)$(SUFX).$(EXT) PRJLIBNAME9 = tcl9$(PROJECT)$(VERSION)$(SUFX).$(EXT) -!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" +!if $(TCL_MAJOR_VERSION) == 8 PRJLIBNAME = $(PRJLIBNAME8) !else PRJLIBNAME = $(PRJLIBNAME9) !endif PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) -!if $(TCL_MAJOR_VERSION) == 8 PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib -!else -PRJSTUBLIBNAME = $(STUBPREFIX).lib -!endif PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) # If extension parent makefile has not defined a resource definition file, @@ -1445,9 +1419,6 @@ OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1 # _ATL_XP_TARGETING - Newer SDK's need this to build for XP COMPILERFLAGS = /D_ATL_XP_TARGETING !endif -!if "$(TCL_BUILD_FOR)" == "8" -OPTDEFINES = $(OPTDEFINES) /DTCL_MAJOR_VERSION=8 -!endif # Like the TEA system only set this non empty for non-Tk extensions # Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME @@ -1530,10 +1501,6 @@ INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)" # cflags contains generic flags used for building practically all object files cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug) -!if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 -cflags = $(cflags) -DTcl_Size=int -!endif - # appcflags contains $(cflags) and flags for building the application # object files (e.g. tclsh, or wish) pkgcflags contains $(cflags) plus # flags used for building shared object files The two differ in the -- cgit v0.12 From a0eabd9b694e5a3ab9fad09794db5ea2b62fb483 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Oct 2023 21:37:47 +0000 Subject: Fix C++ errors, e.g: "generic/tclZipfs.c:5598:6: error: cannot jump from this goto statement to its label" --- generic/tclZipfs.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index bfcf7ec..27e002e 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1448,7 +1448,11 @@ ZipFSFindTOC( } ZIPFS_ERROR(interp, "archive directory end signature not found"); ZIPFS_ERROR_CODE(interp, "END_SIG"); - goto error; + + error: + ZipFSCloseArchive(interp, zf); + return TCL_ERROR; + } /* @@ -1582,10 +1586,6 @@ ZipFSFindTOC( } return TCL_OK; - - error: - ZipFSCloseArchive(interp, zf); - return TCL_ERROR; } /* @@ -5523,6 +5523,8 @@ ZipFSMatchInDirectoryProc( Tcl_Size prefixLen, len, strip = 0; char *pat, *prefix, *path; Tcl_DString dsPref, *prefixBuf = NULL; + int foundInHash, notDuplicate; + ZipEntry *z; if (!normPathPtr) { return -1; @@ -5572,7 +5574,7 @@ ZipFSMatchInDirectoryProc( } /* Does the path exist in the hash table? */ - ZipEntry *z = ZipFSLookup(path); + z = ZipFSLookup(path); if (z) { /* * Can we skip the complexity of actual globbing? Without a pattern, @@ -5598,7 +5600,7 @@ ZipFSMatchInDirectoryProc( } } - int foundInHash = (z != NULL); + foundInHash = (z != NULL); /* * We've got to work for our supper and do the actual globbing. And all @@ -5620,7 +5622,7 @@ ZipFSMatchInDirectoryProc( scnt = CountSlashes(pat); Tcl_HashTable duplicates; - int notDuplicate = 0; + notDuplicate = 0; Tcl_InitHashTable(&duplicates, TCL_STRING_KEYS); Tcl_HashEntry *hPtr; -- cgit v0.12 -- cgit v0.12 From d64ced490d84fc3d9882daae3dad861769ee41da Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 14 Oct 2023 15:51:20 +0000 Subject: Redo zipfs path handling --- doc/filename.n | 4 +- doc/zipfs.n | 2 + generic/tclZipfs.c | 409 ++++++++++++++++++++++++++++++++++++++--------------- tests/zipfs.test | 17 ++- 4 files changed, 311 insertions(+), 121 deletions(-) diff --git a/doc/filename.n b/doc/filename.n index d236b7f..801e346 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -122,8 +122,8 @@ extra backslashes are superfluous. .TP \fBZipfs\fR On all platforms where \fBzipfs\fR support is enabled, paths within mounted -ZIP archives begin with the string returned by the \fBzipfs root\fR command -and otherwise follow the rules for the Unix paths. +ZIP archives begin with the string returned by the \fBzipfs root\fR command. +Zipfs paths are case-sensitive on all platforms. .RE .SH "TILDE SUBSTITUTION" .PP diff --git a/doc/zipfs.n b/doc/zipfs.n index 7cb050e..fa361ef 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -47,6 +47,8 @@ zip64 formats and other compression methods like bzip2 are not supported. Files within mounted archives can be written to but new files or directories cannot be created. Further, modifications to files are limited to the mounted archive in memory and are not persisted to disk. +.PP +Paths in mounted archives are case-sensitive on all platforms. .TP \fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIinZipfs\fR? . diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 27e002e..a7c96c4 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -491,7 +491,18 @@ static Tcl_ChannelType ZipChannelType = { */ int TclIsZipfsPath (const char *path) { +#ifdef _WIN32 return strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) ? 0 : ZIPFS_VOLUME_LEN; +#else + int i; + for (i = 0; i < ZIPFS_VOLUME_LEN; ++i) { + if (path[i] != ZIPFS_VOLUME[i] && + (path[i] != '\\' || ZIPFS_VOLUME[i] != '/')) { + return 0; + } + } + return ZIPFS_VOLUME_LEN; +#endif } /* @@ -959,6 +970,166 @@ DecodeZipEntryText( } /* + *------------------------------------------------------------------------ + * + * NormalizeMountPoint -- + * + * Converts the passed path into a normalized zipfs mount point + * of the form //zipfs:/some/path. On Windows any \ path separators + * are converted to /. + * + * Mount points with a volume will raise an error unless the volume is + * zipfs root. Thus D:/foo is not a valid mount point. + * + * Relative paths and absolute paths without a volume are mapped under + * the zipfs root. + * + * The empty string is mapped to the zipfs root. + * + * dsPtr is initialized by the function and must be cleared by caller + * on a successful return. + * + * Results: + * TCL_OK on success with normalized mount path in dsPtr + * TCL_ERROR on fail with error message in interp if not NULL + * + *------------------------------------------------------------------------ + */ +static int +NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPtr) +{ + const char *joiner[2]; + char *joinedPath; + Tcl_Obj *unnormalizedObj; + Tcl_Obj *normalizedObj; + const char *normalizedPath; + Tcl_Size normalizedLen; + + Tcl_DStringInit(dsPtr); + + /* + * Several things need to happen here + * - Absolute paths containing volumes (drive letter or UNC) raise error + * except of course if the volume is zipfs root + * - \ need to be converted to / + * - \ -> / and // -> / conversions (except if UNC which is error) + * - . and .. have to be dealt with + * The first is explicitly checked, the others are dealt with a + * combination file join and normalize. Easier than doing it ourselves + * and not performance sensitive anyways. + */ + + joiner[0] = ZIPFS_VOLUME; + joiner[1] = mountPath; + joinedPath = Tcl_JoinPath(2, joiner, dsPtr); + + /* Now joinedPath has all \ -> / and // -> / (except UNC) converted. */ + + if (!strncmp(ZIPFS_VOLUME, joinedPath, ZIPFS_VOLUME_LEN)) { + unnormalizedObj = Tcl_DStringToObj(dsPtr); + } else { + if (joinedPath[0] != '/' || joinedPath[1] == '/') { + /* D:/x, D:x or //unc */ + goto invalidMountPath; + } + unnormalizedObj = Tcl_ObjPrintf(ZIPFS_VOLUME "%s", joinedPath + 1); + } + Tcl_IncrRefCount(unnormalizedObj); + normalizedObj = Tcl_FSGetNormalizedPath(interp, unnormalizedObj); + if (normalizedObj == NULL) { + Tcl_DecrRefCount(unnormalizedObj); + goto errorReturn; + } + Tcl_IncrRefCount(normalizedObj); /* BEFORE DecrRefCount on unnormalizedObj */ + Tcl_DecrRefCount(unnormalizedObj); + + /* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */ + normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen); + Tcl_DStringFree(dsPtr); /* Reset */ + Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen); + Tcl_DecrRefCount(normalizedObj); + return TCL_OK; + +invalidMountPath: + if (interp) { + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("Invalid mount path \"%s\"", mountPath)); + ZIPFS_ERROR_CODE(interp, "MOUNT_PATH"); + } + +errorReturn: + Tcl_DStringFree(dsPtr); + return TCL_ERROR; +} + +/* + *------------------------------------------------------------------------ + * + * MapPathToZipfs -- + * + * Maps a path as stored in a zip archive to its normalized location + * under a given zipfs mount point. Relative paths and Unix style + * absolute paths go directly under the mount point. Volume relative + * paths and absolute paths that have a volume (drive or UNC) are + * stripped of the volume before joining the mount point. + * + * Results: + * Pointer to normalized path. + * + * Side effects: + * Stores mapped path in dsPtr. + * + *------------------------------------------------------------------------ + */ +static char * +MapPathToZipfs(Tcl_Interp *interp, + const char *mountPath, /* Must be fully normalized */ + const char *path, /* Archive content path to map */ + Tcl_DString *dsPtr) /* Must be cleared on success return */ +{ + const char *joiner[2]; + char *joinedPath; + Tcl_Obj *unnormalizedObj; + Tcl_Obj *normalizedObj; + const char *normalizedPath; + Tcl_Size normalizedLen; + + assert(TclIsZipfsPath(mountPath)); + Tcl_DStringInit(dsPtr); + + joiner[0] = mountPath; + joiner[1] = path; + joinedPath = Tcl_JoinPath(2, joiner, dsPtr); + + if (strncmp(ZIPFS_VOLUME, joinedPath, ZIPFS_VOLUME_LEN)) { + /* path was not relative. Strip off the volume */ + Tcl_Size numParts; + const char **partsPtr; + Tcl_SplitPath(path, &numParts, &partsPtr); + Tcl_DStringFree(dsPtr); + partsPtr[0] = ZIPFS_VOLUME; + (void)Tcl_JoinPath(numParts, partsPtr, dsPtr); + ckfree(partsPtr); + } + unnormalizedObj = Tcl_DStringToObj(dsPtr); /* Also resets dsPtr */ + Tcl_IncrRefCount(unnormalizedObj); + normalizedObj = Tcl_FSGetNormalizedPath(interp, unnormalizedObj); + if (normalizedObj == NULL) { + /* Should not happen but continue... */ + normalizedObj = unnormalizedObj; + } + Tcl_IncrRefCount(normalizedObj); /* BEFORE DecrRefCount on unnormalizedObj */ + Tcl_DecrRefCount(unnormalizedObj); + + /* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */ + Tcl_DStringFree(dsPtr); /* Reset */ + normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen); + Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen); + Tcl_DecrRefCount(normalizedObj); + return Tcl_DStringValue(dsPtr); +} + +/* *------------------------------------------------------------------------- * * CanonicalPath -- @@ -1850,7 +2021,7 @@ static int ZipFSCatalogFilesystem( Tcl_Interp *interp, /* Current interpreter. NULLable. */ ZipFile *zf, /* Temporary buffer hold archive descriptors */ - const char *mountPoint, /* Mount point path. */ + const char *mountPoint, /* Mount point path. Must be fully normalized */ const char *passwd, /* Password for opening the ZIP, or NULL if * the ZIP is unprotected. */ const char *zipname) /* Path to ZIP file to build a catalog of. */ @@ -1860,9 +2031,13 @@ ZipFSCatalogFilesystem( ZipFile *zf0; ZipEntry *z; Tcl_HashEntry *hPtr; - Tcl_DString ds, dsm, fpBuf; + Tcl_DString ds, fpBuf; unsigned char *q; + assert(TclIsZipfsPath(mountPoint)); /* Caller should have normalized */ + + Tcl_DStringInit(&ds); + /* * Basic verification of the password for sanity. */ @@ -1892,17 +2067,6 @@ ZipFSCatalogFilesystem( WriteLock(); - /* - * Mount point sometimes is a relative or otherwise denormalized path. - * But an absolute name is needed as mount point here. - */ - - Tcl_DStringInit(&ds); - Tcl_DStringInit(&dsm); - if (strcmp(mountPoint, "/") == 0) { - mountPoint = ""; - } - mountPoint = CanonicalPath("", mountPoint, &dsm, 1); hPtr = Tcl_CreateHashEntry(&ZipFS.zipHash, mountPoint, &isNew); if (!isNew) { if (interp) { @@ -1913,6 +2077,7 @@ ZipFSCatalogFilesystem( } Unlock(); ZipFSCloseArchive(interp, zf); + Tcl_DStringFree(&ds); ckfree(zf); return TCL_ERROR; } @@ -1939,6 +2104,7 @@ ZipFSCatalogFilesystem( } zf->passBuf[k] = '\0'; } + /* TODO - is this test necessary? WHen will mountPoint[0] be \0 ? */ if (mountPoint[0] != '\0') { hPtr = Tcl_CreateHashEntry(&ZipFS.fileHash, mountPoint, &isNew); if (isNew) { @@ -2038,7 +2204,7 @@ ZipFSCatalogFilesystem( } Tcl_DStringSetLength(&fpBuf, 0); - fullpath = CanonicalPath(mountPoint, path, &fpBuf, 1); + fullpath = MapPathToZipfs(interp, mountPoint, path, &fpBuf); z = AllocateZipEntry(); z->depth = CountSlashes(fullpath); assert(z->depth >= ZIPFS_ROOTDIR_DEPTH); @@ -2129,9 +2295,9 @@ ZipFSCatalogFilesystem( nextent: q += pathlen + comlen + extra + ZIP_CENTRAL_HEADER_LEN; } + Unlock(); Tcl_DStringFree(&fpBuf); Tcl_DStringFree(&ds); - Unlock(); Tcl_FSMountsChanged(NULL); return TCL_OK; } @@ -2316,13 +2482,13 @@ DescribeMounted( int TclZipfs_Mount( Tcl_Interp *interp, /* Current interpreter. NULLable. */ - const char *zipname, /* Path to ZIP file to mount; should be - * normalized. */ + const char *zipname, /* Path to ZIP file to mount */ const char *mountPoint, /* Mount point path. */ const char *passwd) /* Password for opening the ZIP, or NULL if * the ZIP is unprotected. */ { ZipFile *zf; + int ret; ReadLock(); if (!ZipFS.initialized) { @@ -2333,45 +2499,51 @@ TclZipfs_Mount( * No mount point, so list all mount points and what is mounted there. */ - if (!mountPoint) { - int ret = ListMountPoints(interp); + if (mountPoint == NULL) { + ret = ListMountPoints(interp); Unlock(); return ret; } - /* - * Mount point but no file, so describe what is mounted at that mount - * point. - */ - - if (!zipname) { - DescribeMounted(interp, mountPoint); + Tcl_DString ds; + ret = NormalizeMountPoint(interp, mountPoint, &ds); + if (ret != TCL_OK) { Unlock(); - return TCL_OK; + return ret; } - Unlock(); + mountPoint = Tcl_DStringValue(&ds); - /* - * Have both a mount point and a file (name) to mount there. - */ + if (!zipname) { + /* + * Mount point but no file, so describe what is mounted at that mount + * point. + */ - if (passwd && IsPasswordValid(interp, passwd, strlen(passwd)) != TCL_OK) { - return TCL_ERROR; - } - zf = AllocateZipFile(interp, strlen(mountPoint)); - if (!zf) { - return TCL_ERROR; - } - if (ZipFSOpenArchive(interp, zipname, 1, zf) != TCL_OK) { - ckfree(zf); - return TCL_ERROR; - } - if (ZipFSCatalogFilesystem(interp, zf, mountPoint, passwd, zipname) - != TCL_OK) { - /* zf would have been freed! */ - return TCL_ERROR; + ret = DescribeMounted(interp, mountPoint); + Unlock(); + } else { + Unlock(); + + /* Have both a mount point and a file (name) to mount there. */ + if (passwd == NULL || + (ret = IsPasswordValid(interp, passwd, strlen(passwd))) == TCL_OK) { + zf = AllocateZipFile(interp, strlen(mountPoint)); + if (zf == NULL) { + ret = TCL_ERROR; + } else { + ret = ZipFSOpenArchive(interp, zipname, 1, zf); + if (ret != TCL_OK) { + ckfree(zf); + } else { + ret = ZipFSCatalogFilesystem( + interp, zf, mountPoint, passwd, zipname); + /* Note zf is already freed on error! */ + } + } + } } - return TCL_OK; + Tcl_DStringFree(&ds); + return ret; } /* @@ -2401,6 +2573,7 @@ TclZipfs_MountBuffer( int copy) { ZipFile *zf; + int ret; /* TODO - how come a *read* lock suffices for initialzing ? */ ReadLock(); @@ -2413,62 +2586,72 @@ TclZipfs_MountBuffer( */ if (!mountPoint) { - int ret = ListMountPoints(interp); + ret = ListMountPoints(interp); Unlock(); return ret; } - /* - * Mount point but no data, so describe what is mounted at that mount - * point. - */ - - if (!data) { - DescribeMounted(interp, mountPoint); + Tcl_DString ds; + ret = NormalizeMountPoint(interp, mountPoint, &ds); + if (ret != TCL_OK) { Unlock(); - return TCL_OK; + return ret; } - Unlock(); + mountPoint = Tcl_DStringValue(&ds); - /* - * Have both a mount point and data to mount there. - * What's the magic about 64 * 1024 * 1024 ? - */ - if ((datalen <= ZIP_CENTRAL_END_LEN) || - (datalen - ZIP_CENTRAL_END_LEN) > - (64 * 1024 * 1024 - ZIP_CENTRAL_END_LEN)) { - ZIPFS_ERROR(interp, "illegal file size"); - ZIPFS_ERROR_CODE(interp, "FILE_SIZE"); - return TCL_ERROR; - } + if (data == NULL) { + /* Mount point but no data, so describe what is mounted at there */ + ret = DescribeMounted(interp, mountPoint); + Unlock(); + } else { + Unlock(); - zf = AllocateZipFile(interp, strlen(mountPoint)); - if (!zf) { - return TCL_ERROR; - } - zf->isMemBuffer = 1; - zf->length = datalen; - if (copy) { - zf->data = (unsigned char *) attemptckalloc(datalen); - if (!zf->data) { - ZipFSCloseArchive(interp, zf); + /* + * Have both a mount point and data to mount there. + * What's the magic about 64 * 1024 * 1024 ? + */ + ret = TCL_ERROR; + if ((datalen <= ZIP_CENTRAL_END_LEN) || + (datalen - ZIP_CENTRAL_END_LEN) > + (64 * 1024 * 1024 - ZIP_CENTRAL_END_LEN)) { + ZIPFS_ERROR(interp, "illegal file size"); + ZIPFS_ERROR_CODE(interp, "FILE_SIZE"); + goto done; + } + zf = AllocateZipFile(interp, strlen(mountPoint)); + if (zf == NULL) { + goto done; + } + zf->isMemBuffer = 1; + zf->length = datalen; + + if (copy) { + zf->data = (unsigned char *)attemptckalloc(datalen); + if (zf->data == NULL) { + ZipFSCloseArchive(interp, zf); + ckfree(zf); + ZIPFS_MEM_ERROR(interp); + goto done; + } + memcpy(zf->data, data, datalen); + zf->ptrToFree = zf->data; + } else { + zf->data = (unsigned char *)data; + zf->ptrToFree = NULL; + } + ret = ZipFSFindTOC(interp, 1, zf); + if (ret != TCL_OK) { ckfree(zf); - ZIPFS_MEM_ERROR(interp); - return TCL_ERROR; + } else { + /* Note ZipFSCatalogFilesystem will free zf on error */ + ret = ZipFSCatalogFilesystem( + interp, zf, mountPoint, NULL, "Memory Buffer"); } - memcpy(zf->data, data, datalen); - zf->ptrToFree = zf->data; - } else { - zf->data = (unsigned char *) data; - zf->ptrToFree = NULL; - } - if (ZipFSFindTOC(interp, 1, zf) != TCL_OK) { - ckfree(zf); - return TCL_ERROR; } - /* Note ZipFSCatalogFilesystem will free zf on error */ - return ZipFSCatalogFilesystem( - interp, zf, mountPoint, NULL, "Memory Buffer"); + +done: + Tcl_DStringFree(&ds); + return ret; } /* @@ -2497,6 +2680,8 @@ TclZipfs_Unmount( Tcl_DString dsm; int ret = TCL_OK, unmounted = 0; + Tcl_DStringInit(&dsm); + WriteLock(); if (!ZipFS.initialized) { goto done; @@ -2507,8 +2692,10 @@ TclZipfs_Unmount( * But an absolute name is needed as mount point here. */ - Tcl_DStringInit(&dsm); - mountPoint = CanonicalPath("", mountPoint, &dsm, 1); + if (NormalizeMountPoint(interp, mountPoint, &dsm) != TCL_OK) { + goto done; + } + mountPoint = Tcl_DStringValue(&dsm); hPtr = Tcl_FindHashEntry(&ZipFS.zipHash, mountPoint); /* don't report no-such-mount as an error */ @@ -2538,6 +2725,7 @@ TclZipfs_Unmount( done: Unlock(); + Tcl_DStringFree(&dsm); if (unmounted) { Tcl_FSMountsChanged(NULL); } @@ -2632,34 +2820,25 @@ ZipFSMountBufferObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - const char *mountPoint; /* Mount point path. */ - unsigned char *data; + const char *mountPoint = NULL; /* Mount point path. */ + unsigned char *data = NULL; Tcl_Size length; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?data? ?mountpoint?"); return TCL_ERROR; } - if (objc < 2) { - int ret; - - ReadLock(); - ret = ListMountPoints(interp); - Unlock(); - return ret; - } - - if (objc < 3) { - ReadLock(); - DescribeMounted(interp, Tcl_GetString(objv[1])); - Unlock(); - return TCL_OK; - } - data = Tcl_GetBytesFromObj(interp, objv[1], &length); - mountPoint = Tcl_GetString(objv[2]); - if (data == NULL) { - return TCL_ERROR; + if (objc > 1) { + if (objc == 2) { + mountPoint = Tcl_GetString(objv[1]); + } else { + data = Tcl_GetBytesFromObj(interp, objv[1], &length); + mountPoint = Tcl_GetString(objv[2]); + if (data == NULL) { + return TCL_ERROR; + } + } } return TclZipfs_MountBuffer(interp, data, length, mountPoint, 1); } diff --git a/tests/zipfs.test b/tests/zipfs.test index 55cce1f..88bee93 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -913,10 +913,16 @@ namespace eval test_ns_zipfs { -body [list zipfs canonical {*}$cmdargs] \ -result $result {*}$args } - testzipfscanonical basic-relative PATH [file join [zipfs root] PATH] - testzipfscanonical basic-absolute /PATH [file join [zipfs root] PATH] - testzipfscanonical mountpoint-relative {MT PATH} [file join [zipfs root] MT PATH] - testzipfscanonical mountpoint-absolute {MT /PATH} [file join [zipfs root] PATH] + testzipfscanonical default-relative PATH [file join [zipfs root] PATH] + testzipfscanonical default-absolute /PATH [file join [zipfs root] PATH] + testzipfscanonical root-relative-1 [list [zipfs root] PATH] [file join [zipfs root] PATH] + testzipfscanonical root-relative-2 [list / PATH] [file join [zipfs root] PATH] + testzipfscanonical root-absolute-1 [list [zipfs root] /PATH] [file join [zipfs root] PATH] + testzipfscanonical root-absolute-2 [list / /PATH] [file join [zipfs root] PATH] + testzipfscanonical absolute-relative {/MT PATH} [file join [zipfs root] MT PATH] + testzipfscanonical absolute-absolute {/MT /PATH} [file join [zipfs root] PATH] + testzipfscanonical relative-relative {MT PATH} [file join [zipfs root] MT PATH] + testzipfscanonical relative-absolute {MT /PATH} [file join [zipfs root] PATH] testzipfscanonical mountpoint-trailslash-relative {MT/ PATH} [file join [zipfs root] MT PATH] testzipfscanonical mountpoint-trailslash-absolute {MT/ /PATH} [file join [zipfs root] PATH] testzipfscanonical mountpoint-root-relative [list [zipfs root] PATH] [file join [zipfs root] PATH] @@ -925,9 +931,12 @@ namespace eval test_ns_zipfs { testzipfscanonical driveletter X: [zipfs root] -constraints win testzipfscanonical drivepath X:/foo/bar [file join [zipfs root] foo bar] -constraints win + testzipfscanonical drivepath {MT X:/foo/bar} [file join [zipfs root] MT foo bar] -constraints win # (backslashes need additional escaping passed to testzipfscanonical) testzipfscanonical backslashes X:\\\\foo\\\\bar [file join [zipfs root] foo bar] -constraints win testzipfscanonical backslashes-1 X:/foo\\\\bar [file join [zipfs root] foo bar] -constraints win + testzipfscanonical zipfspath //zipfs:/x/y [file join [zipfs root] x y] + testzipfscanonical zipfspath {MT //zipfs:/x/y} [file join [zipfs root] mt x y] # # Read/uncompress -- cgit v0.12 From 8c3b029c0757d433637c1911a74cd55c2766e3e9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 14 Oct 2023 17:07:20 +0000 Subject: Eliminate CanonicalPath - obsolete --- generic/tclZipfs.c | 213 +++++------------------------------------------------ 1 file changed, 17 insertions(+), 196 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index a7c96c4..d840224 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1107,7 +1107,7 @@ MapPathToZipfs(Tcl_Interp *interp, const char **partsPtr; Tcl_SplitPath(path, &numParts, &partsPtr); Tcl_DStringFree(dsPtr); - partsPtr[0] = ZIPFS_VOLUME; + partsPtr[0] = mountPath; (void)Tcl_JoinPath(numParts, partsPtr, dsPtr); ckfree(partsPtr); } @@ -1128,181 +1128,6 @@ MapPathToZipfs(Tcl_Interp *interp, Tcl_DecrRefCount(normalizedObj); return Tcl_DStringValue(dsPtr); } - -/* - *------------------------------------------------------------------------- - * - * CanonicalPath -- - * - * This function computes the canonical path from a directory and file - * name components into the specified Tcl_DString. - * - * Results: - * Returns the pointer to the canonical path contained in the specified - * Tcl_DString. - * - * Side effects: - * Modifies the specified Tcl_DString. - * - *------------------------------------------------------------------------- - */ - -static char * -CanonicalPath( - const char *root, - const char *tail, - Tcl_DString *dsPtr, - int inZipfs) -{ - char *path; - int i, j, c, isUNC = 0, isVfs = 0, n = 0; - int haveZipfsPath = 1; - -#ifdef _WIN32 - if (tail[0] != '\0' && strchr(drvletters, tail[0]) && tail[1] == ':') { - tail += 2; - haveZipfsPath = 0; - } - /* UNC style path */ - if (tail[0] == '\\') { - root = ""; - ++tail; - haveZipfsPath = 0; - } - if (tail[0] == '\\') { - root = "/"; - ++tail; - haveZipfsPath = 0; - } -#endif /* _WIN32 */ - - if (haveZipfsPath) { - /* UNC style path */ - if (root && strncmp(root, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) == 0) { - isVfs = 1; - } else if (tail && - strncmp(tail, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) == 0) { - isVfs = 2; - } - if (isVfs != 1 && (root[0] == '/') && (root[1] == '/')) { - isUNC = 1; - } - } - - if (isVfs != 2) { - if (tail[0] == '/') { - if (isVfs != 1) { - root = ""; - } - ++tail; - isUNC = 0; - } - if (tail[0] == '/') { - if (isVfs != 1) { - root = "/"; - } - ++tail; - isUNC = 1; - } - } - i = strlen(root); - j = strlen(tail); - - switch (isVfs) { - case 1: - if (i > ZIPFS_VOLUME_LEN) { - Tcl_DStringSetLength(dsPtr, i + j + 1); - path = Tcl_DStringValue(dsPtr); - memcpy(path, root, i); - path[i++] = '/'; - memcpy(path + i, tail, j); - } else { - Tcl_DStringSetLength(dsPtr, i + j); - path = Tcl_DStringValue(dsPtr); - memcpy(path, root, i); - memcpy(path + i, tail, j); - } - break; - case 2: - Tcl_DStringSetLength(dsPtr, j); - path = Tcl_DStringValue(dsPtr); - memcpy(path, tail, j); - break; - default: - if (inZipfs) { - /* pathLen = zipfs vol len + root len + separator + tail len */ - Tcl_DStringInit(dsPtr); - (void) Tcl_DStringAppend(dsPtr, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN); - if (i) { - (void) Tcl_DStringAppend(dsPtr, root, i); - if (root[i-1] != '/') { - Tcl_DStringAppend(dsPtr, "/", 1); - } - } - path = Tcl_DStringAppend(dsPtr, tail, j); - } else { - Tcl_DStringSetLength(dsPtr, i + j + 1); - path = Tcl_DStringValue(dsPtr); - memcpy(path, root, i); - path[i++] = '/'; - memcpy(path + i, tail, j); - } - break; - } - -#ifdef _WIN32 - for (i = 0; path[i] != '\0'; i++) { - if (path[i] == '\\') { - path[i] = '/'; - } - } -#endif /* _WIN32 */ - - if (inZipfs) { - n = ZIPFS_VOLUME_LEN; - } else { - n = 0; - } - - for (i = j = n; (c = path[i]) != '\0'; i++) { - if (c == '/') { - int c2 = path[i + 1]; - - if (c2 == '\0' || c2 == '/') { - continue; - } - if (c2 == '.') { - int c3 = path[i + 2]; - - if ((c3 == '/') || (c3 == '\0')) { - i++; - continue; - } - if ((c3 == '.') - && ((path[i + 3] == '/') || (path[i + 3] == '\0'))) { - i += 2; - while ((j > 0) && (path[j - 1] != '/')) { - j--; - } - if (j > isUNC) { - --j; - while ((j > 1 + isUNC) && (path[j - 2] == '/')) { - j--; - } - } - continue; - } - } - } - path[j++] = c; - } - if (j == 0) { - path[j++] = '/'; - } - path[j] = 0; - Tcl_DStringSetLength(dsPtr, j); - return Tcl_DStringValue(dsPtr); -} /* *------------------------------------------------------------------------- @@ -4139,34 +3964,30 @@ ZipFSCanonicalObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *mntpoint = NULL; - char *filename = NULL; - char *result; - Tcl_DString dPath; + char *mntPoint = NULL; + Tcl_DString dsPath, dsMount; - if (objc < 2 || objc > 4) { - Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename ?inZipfs?"); + if (objc < 2 || objc > 3) { + Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename"); return TCL_ERROR; } - Tcl_DStringInit(&dPath); + + Tcl_DStringInit(&dsPath); + Tcl_DStringInit(&dsMount); + if (objc == 2) { - filename = Tcl_GetString(objv[1]); - result = CanonicalPath("", filename, &dPath, 1); - } else if (objc == 3) { - mntpoint = Tcl_GetString(objv[1]); - filename = Tcl_GetString(objv[2]); - result = CanonicalPath(mntpoint, filename, &dPath, 1); + mntPoint = ZIPFS_VOLUME; } else { - int zipfs = 0; - - if (Tcl_GetBooleanFromObj(interp, objv[3], &zipfs)) { + if (NormalizeMountPoint(interp, Tcl_GetString(objv[1]), &dsMount) != TCL_OK) { return TCL_ERROR; } - mntpoint = Tcl_GetString(objv[1]); - filename = Tcl_GetString(objv[2]); - result = CanonicalPath(mntpoint, filename, &dPath, zipfs); + mntPoint = Tcl_DStringValue(&dsMount); } - Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1)); + (void)MapPathToZipfs(interp, + mntPoint, + Tcl_GetString(objv[objc - 1]), + &dsPath); + Tcl_SetObjResult(interp, Tcl_DStringToObj(&dsPath)); return TCL_OK; } -- cgit v0.12 From 3ce94d7a92879b852d784527197413482fb4573b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 14 Oct 2023 21:25:42 +0000 Subject: Missing !endif (in previous commit) --- win/rules.vc | 1 + 1 file changed, 1 insertion(+) diff --git a/win/rules.vc b/win/rules.vc index 32a5024..fc816ac 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -881,6 +881,7 @@ USE_THREAD_ALLOC= 0 !message *** Force 64-bit time_t _USE_64BIT_TIME_T = 1 !endif +!endif # Yes, it's weird that the "symbols" option controls DEBUG and # the "pdbs" option controls SYMBOLS. That's historical. -- cgit v0.12 From 8c2f47321dea1fe813bb8ca865d2cff1a9b08236 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 15 Oct 2023 06:32:31 +0000 Subject: More fixes, update docs --- doc/zipfs.3 | 47 ++++++++++++++++++------- doc/zipfs.n | 6 ++++ generic/tclZipfs.c | 87 ++++++++++++++++++++++++++++----------------- tests/zipfs.test | 101 ++++++++++++++++++++++++++++++++--------------------- 4 files changed, 157 insertions(+), 84 deletions(-) diff --git a/doc/zipfs.3 b/doc/zipfs.3 index 77a6a57..af1281c 100644 --- a/doc/zipfs.3 +++ b/doc/zipfs.3 @@ -91,20 +91,43 @@ The function \fImay\fR modify the variables pointed to by \fIargcPtr\fR and \fIargvPtr\fR to remove arguments; the current implementation does not do so, but callers \fIshould not\fR assume that this will be true in the future. .PP -\fBTclZipfs_Mount\fR mounts the ZIP archive \fIzipname\fR on the mount point -given in \fImountpoint\fR using the optional ZIP password \fIpassword\fR. -Errors during that process are reported in the interpreter \fIinterp\fR. If -\fImountpoint\fR is a NULL pointer, information on all currently mounted ZIP -file systems is written into \fIinterp\fR's result as a sequence of mount -points and ZIP file names. The result of this call is a standard Tcl result +\fBTclZipfs_Mount\fR is used to mount ZIP archives and to retrieve information +about currently mounted archives. If \fImountpoint\fR and \fIzipname\fR are both +specified (i.e. non-NULL), the function mounts the ZIP archive \fIzipname\fR on +the mount point given in \fImountpoint\fR. If \fIpassword\fR is not NULL, it +should point to the NUL terminated password protecting the archive. If not under +the zipfs file system root, \fImountpoint\fR is normalized with respect to it. +For example, a mount point passed as either \fBmt\fR \fB/mt\fR would be +normalized to \fB//zipfs:/mt\fR. An error is raised if the mount point includes +a drive or UNC volume. On success, \fIinterp\fR's result is set to the +normalized mount point path. +.PP +If \fImountpoint\fR is a NULL pointer, information on all currently mounted ZIP +file systems is stored in \fIinterp\fR's result as a sequence of mount +points and ZIP file names. +.PP +If \fImountpoint\fR is not NULL but \fIzipfile\fR +is NULL, the path to the archive mounted at that mount point is stored +as \fIinterp\fR's result. The function returns a standard Tcl result code. .PP -\fBTclZipfs_MountBuffer\fR mounts the ZIP archive in the buffer pointed to by -\fIdata\fR on the mount point given in \fImountpoint\fR. The ZIP archive is -assumed to be not password protected. Errors during that process are reported -in the interpreter \fIinterp\fR. The \fIcopy\fR argument determines whether -the buffer is internally copied before mounting or not. The result of this -call is a standard Tcl result code. +\fBTclZipfs_MountBuffer\fR is similar to \fBTclZipfs_Mount\fR except that the +content of a ZIP archive is passed in the buffer pointed to by \fIdata\fR. +If \fImountpoint\fR and +\fIdata\fR are both non-NULL, the function +mounts the ZIP archive content \fIdata\fR on the mount point +given in \fImountpoint\fR. +The +\fIcopy\fR argument determines whether the buffer is internally copied before +mounting or not. The ZIP archive is assumed to be not password protected. +On success, \fIinterp\fR's result is set to the normalized mount point +path. +If \fImountpoint\fR is a NULL pointer, information on all currently mounted ZIP +file systems is stored in \fIinterp\fR's result as a sequence of mount +points and ZIP file names. If \fImountpoint\fR is not NULL but \fIdata\fR +is NULL, the path to the archive mounted at that mount point is stored +as \fIinterp\fR's result. The function returns a standard Tcl result +code. .PP \fBTclZipfs_Unmount\fR undoes the effect of \fBTclZipfs_Mount\fR, i.e., it unmounts the mounted ZIP file system that was mounted from \fIzipname\fR (at diff --git a/doc/zipfs.n b/doc/zipfs.n index fa361ef..a730497 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -123,6 +123,12 @@ filesystem at \fImountpoint\fR. After this command executes, files contained in \fIzipfile\fR will appear to Tcl to be regular files at the mount point. If \fImountpoint\fR is specified as an empty string, it is defaulted to the \fB[zipfs root]\fR. +The command returns the normalized mount point path. +.PP +If not under the zipfs file system root, \fImountpoint\fR is normalized with +respect to it. For example, a mount point passed as either \fBmt\fR \fB/mt\fR +would be normalized to \fB//zipfs:/mt\fR. An error is raised if the mount point +includes a drive or UNC volume. .PP \fBNB:\fR because the current working directory is a concept maintained by the operating system, using \fBcd\fR into a mounted archive will only work in the diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index d840224..a074db1 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1011,7 +1011,6 @@ NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPt * Several things need to happen here * - Absolute paths containing volumes (drive letter or UNC) raise error * except of course if the volume is zipfs root - * - \ need to be converted to / * - \ -> / and // -> / conversions (except if UNC which is error) * - . and .. have to be dealt with * The first is explicitly checked, the others are dealt with a @@ -1029,7 +1028,7 @@ NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPt unnormalizedObj = Tcl_DStringToObj(dsPtr); } else { if (joinedPath[0] != '/' || joinedPath[1] == '/') { - /* D:/x, D:x or //unc */ + /* mount path was D:/x, D:x or //unc */ goto invalidMountPath; } unnormalizedObj = Tcl_ObjPrintf(ZIPFS_VOLUME "%s", joinedPath + 1); @@ -1099,10 +1098,16 @@ MapPathToZipfs(Tcl_Interp *interp, joiner[0] = mountPath; joiner[1] = path; +#ifndef _WIN32 + /* On Unix C:/foo/bat is not treated as absolute by JoinPath so check ourself */ + if (path[0] && path[1] == ':') { + joiner[1] += 2; + } +#endif joinedPath = Tcl_JoinPath(2, joiner, dsPtr); if (strncmp(ZIPFS_VOLUME, joinedPath, ZIPFS_VOLUME_LEN)) { - /* path was not relative. Strip off the volume */ + /* path was not relative. Strip off the volume (e.g. UNC) */ Tcl_Size numParts; const char **partsPtr; Tcl_SplitPath(path, &numParts, &partsPtr); @@ -2347,26 +2352,52 @@ TclZipfs_Mount( ret = DescribeMounted(interp, mountPoint); Unlock(); } else { + /* Have both a mount point and a file (name) to mount there. */ + + Tcl_Obj *zipPathObj; + Tcl_Obj *normZipPathObj; + Unlock(); - /* Have both a mount point and a file (name) to mount there. */ - if (passwd == NULL || - (ret = IsPasswordValid(interp, passwd, strlen(passwd))) == TCL_OK) { - zf = AllocateZipFile(interp, strlen(mountPoint)); - if (zf == NULL) { - ret = TCL_ERROR; - } else { - ret = ZipFSOpenArchive(interp, zipname, 1, zf); - if (ret != TCL_OK) { - ckfree(zf); - } else { - ret = ZipFSCatalogFilesystem( - interp, zf, mountPoint, passwd, zipname); - /* Note zf is already freed on error! */ + zipPathObj = Tcl_NewStringObj(zipname, -1); + Tcl_IncrRefCount(zipPathObj); + normZipPathObj = Tcl_FSGetNormalizedPath(interp, zipPathObj); + if (normZipPathObj == NULL) { + Tcl_SetObjResult( + interp, + Tcl_ObjPrintf("could not normalize zip filename \"%s\"", zipname)); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NORMALIZE", NULL); + ret = TCL_ERROR; + } else { + Tcl_IncrRefCount(normZipPathObj); + const char *normPath = Tcl_GetString(normZipPathObj); + if (passwd == NULL || + (ret = IsPasswordValid(interp, passwd, strlen(passwd))) == + TCL_OK) { + zf = AllocateZipFile(interp, strlen(mountPoint)); + if (zf == NULL) { + ret = TCL_ERROR; + } + else { + ret = ZipFSOpenArchive(interp, normPath, 1, zf); + if (ret != TCL_OK) { + ckfree(zf); + } + else { + ret = ZipFSCatalogFilesystem( + interp, zf, mountPoint, passwd, normPath); + /* Note zf is already freed on error! */ + } } } + Tcl_DecrRefCount(normZipPathObj); + if (ret == TCL_OK && interp) { + Tcl_DStringResult(interp, &ds); + } } + Tcl_DecrRefCount(zipPathObj); } + Tcl_DStringFree(&ds); return ret; } @@ -2377,7 +2408,7 @@ TclZipfs_Mount( * TclZipfs_MountBuffer -- * * This procedure is invoked to mount a given ZIP archive file on a given - * mountpoint with optional ZIP password. + * mountpoint. * * Results: * A standard Tcl result. @@ -2472,6 +2503,9 @@ TclZipfs_MountBuffer( ret = ZipFSCatalogFilesystem( interp, zf, mountPoint, NULL, "Memory Buffer"); } + if (ret == TCL_OK && interp) { + Tcl_DStringResult(interp, &ds); + } } done: @@ -2581,7 +2615,6 @@ ZipFSMountObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { const char *mountPoint = NULL, *zipFile = NULL, *password = NULL; - Tcl_Obj *zipFileObj = NULL; int result; if (objc > 4) { @@ -2598,16 +2631,7 @@ ZipFSMountObjCmd( mountPoint = Tcl_GetString(objv[1]); } else { /* 2 < objc < 4 */ - zipFileObj = Tcl_FSGetNormalizedPath(interp, objv[1]); - if (!zipFileObj) { - Tcl_SetObjResult( - interp, - Tcl_NewStringObj("could not normalize zip filename", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NORMALIZE", NULL); - return TCL_ERROR; - } - Tcl_IncrRefCount(zipFileObj); - zipFile = Tcl_GetString(zipFileObj); + zipFile = Tcl_GetString(objv[1]); mountPoint = Tcl_GetString(objv[2]); if (objc > 3) { password = Tcl_GetString(objv[3]); @@ -2616,9 +2640,6 @@ ZipFSMountObjCmd( } result = TclZipfs_Mount(interp, zipFile, mountPoint, password); - if (zipFileObj != NULL) { - Tcl_DecrRefCount(zipFileObj); - } return result; } @@ -3964,7 +3985,7 @@ ZipFSCanonicalObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *mntPoint = NULL; + const char *mntPoint = NULL; Tcl_DString dsPath, dsMount; if (objc < 2 || objc > 3) { diff --git a/tests/zipfs.test b/tests/zipfs.test index 88bee93..025d4c1 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -390,7 +390,7 @@ namespace eval test_ns_zipfs { # Wrapper to ease transition if Tcl changes order of argument to zipfs mount # or the zipfs prefix proc mount [list zippath [list mountpoint $defMountPt]] { - zipfs mount $zippath $mountpoint + return [zipfs mount $zippath $mountpoint] } # Make full path to zip file @@ -464,23 +464,21 @@ namespace eval test_ns_zipfs { proc testmount {id zippath checkPath mountpoint args} { set zippath [zippath $zippath] test zipfs-mount-$id "zipfs mount $id" -body { - mount $zippath $mountpoint - set canon [zipfs canonical $mountpoint] + set canon [mount $zippath $mountpoint] list [file exists [file join $canon $checkPath]] \ - [mounttarget $canon] + [zipfs mount $canon] [zipfs mount $mountpoint] } -cleanup { zipfs unmount $mountpoint - } -result [list 1 $zippath] {*}$args + } -result [list 1 $zippath $zippath] {*}$args # Mount memory buffer test zipfs-mount_data-$id "zipfs mount_data $id" -body { - zipfs mount_data [readbin $zippath] $mountpoint - set canon [zipfs canonical $mountpoint] + set canon [zipfs mount_data [readbin $zippath] $mountpoint] list [file exists [file join $canon $checkPath]] \ - [mounttarget $canon] + [zipfs mount $canon] [zipfs mount $mountpoint] } -cleanup { cleanup - } -result [list 1 {Memory Buffer}] {*}$args + } -result [list 1 {Memory Buffer} {Memory Buffer}] {*}$args } @@ -498,12 +496,28 @@ namespace eval test_ns_zipfs { testbadmount bad-file-count-high incons-file-count-high.zip "truncated directory" testbadmount bad-file-count-low incons-file-count-low.zip "short file count" + test zipfs-mount-on-drive "Mount point include drive" -body { + zipfs mount [zippath test.zip] C:/foo + } -result {Invalid mount path "C:/foo"} -returnCodes error -constraints win + test zipfs-mount_data-on-drive "Mount point include drive" -body { + zipfs mount_data [readbin [zippath test.zip]] C:/foo + } -result {Invalid mount path "C:/foo"} -returnCodes error -constraints win + test zipfs-mount-on-unc "Mount point is unc" -body { + zipfs mount [zippath test.zip] //unc/share/foo + } -result {Invalid mount path "//unc/share/foo"} -returnCodes error + test zipfs-mount_data-on-unc "Mount point include unc" -body { + zipfs mount_data [readbin [zippath test.zip]] //unc/share/foo + } -result {Invalid mount path "//unc/share/foo"} -returnCodes error + + # Good mounts testmount basic test.zip testdir/test2 $defMountPt testmount basic-on-default test.zip testdir/test2 "" testmount basic-on-root test.zip testdir/test2 [zipfs root] testmount basic-on-slash test.zip testdir/test2 / + testmount basic-on-bslash test.zip testdir/test2 \\ -constraints win testmount basic-on-relative test.zip testdir/test2 testmount testmount basic-on-absolute test.zip testdir/test2 /testmount + testmount basic-on-absolute-bslash test.zip testdir/test2 \\testmount -constraints win testmount zip-at-end junk-at-start.zip testdir/test2 $defMountPt testmount zip-at-start junk-at-end.zip testdir/test2 $defMountPt testmount zip-in-zip [file join [zipfs root] test2 test.zip] testdir/test2 $defMountPt -setup { @@ -672,6 +686,18 @@ namespace eval test_ns_zipfs { } -result {{} {test2 test3} test2-overlay} # + # paths inside a zip + # TODO - paths encoded in utf-8 vs fallback encoding + test zipfs-content-paths-1 "Test absolute and full paths" -setup { + mount [zippath test-paths.zip] + } -cleanup { + cleanup + } -body { + # Primarily verifies that drive letters are stripped and paths maintained + lsort [zipfs list] + } -result {//zipfs:/testmount //zipfs:/testmount/filename.txt //zipfs:/testmount/src //zipfs:/testmount/src/tcltk //zipfs:/testmount/src/tcltk/wip //zipfs:/testmount/src/tcltk/wip/tcl //zipfs:/testmount/src/tcltk/wip/tcl/tests //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/abspath.txt //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt} + + # # zipfs list testnumargs "zipfs list" "" "?(-glob|-regexp)? ?pattern?" @@ -899,44 +925,41 @@ namespace eval test_ns_zipfs { } -result {path "//zipfs:/testmt/a" not found in any zipfs volume} -returnCodes error # - # zipfs canonical - - # TODO - semantics are very unclear. Can produce nonsensical paths like - # //zipfs:/n/zipfs:/m/test. Minimal sanity tests for now. + # zipfs canonical test zipfs-canonical-minargs {zipfs canonical min args} -body { zipfs canonical - } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename ?inZipfs?"} + } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename"} test zipfs-canonical-maxargs {zipfs canonical max args} -body { - zipfs canonical a b c d - } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename ?inZipfs?"} + zipfs canonical a b c + } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename"} proc testzipfscanonical {id cmdargs result args} { test zipfs-canonical-$id "zipfs canonical $id" \ -body [list zipfs canonical {*}$cmdargs] \ -result $result {*}$args } - testzipfscanonical default-relative PATH [file join [zipfs root] PATH] - testzipfscanonical default-absolute /PATH [file join [zipfs root] PATH] - testzipfscanonical root-relative-1 [list [zipfs root] PATH] [file join [zipfs root] PATH] - testzipfscanonical root-relative-2 [list / PATH] [file join [zipfs root] PATH] - testzipfscanonical root-absolute-1 [list [zipfs root] /PATH] [file join [zipfs root] PATH] - testzipfscanonical root-absolute-2 [list / /PATH] [file join [zipfs root] PATH] - testzipfscanonical absolute-relative {/MT PATH} [file join [zipfs root] MT PATH] - testzipfscanonical absolute-absolute {/MT /PATH} [file join [zipfs root] PATH] - testzipfscanonical relative-relative {MT PATH} [file join [zipfs root] MT PATH] - testzipfscanonical relative-absolute {MT /PATH} [file join [zipfs root] PATH] - testzipfscanonical mountpoint-trailslash-relative {MT/ PATH} [file join [zipfs root] MT PATH] - testzipfscanonical mountpoint-trailslash-absolute {MT/ /PATH} [file join [zipfs root] PATH] - testzipfscanonical mountpoint-root-relative [list [zipfs root] PATH] [file join [zipfs root] PATH] - testzipfscanonical mountpoint-root-absolute [list [zipfs root] /PATH] [file join [zipfs root] PATH] - testzipfscanonical mountpoint-empty-relative {{} PATH} [file join [zipfs root] PATH] - - testzipfscanonical driveletter X: [zipfs root] -constraints win - testzipfscanonical drivepath X:/foo/bar [file join [zipfs root] foo bar] -constraints win - testzipfscanonical drivepath {MT X:/foo/bar} [file join [zipfs root] MT foo bar] -constraints win - # (backslashes need additional escaping passed to testzipfscanonical) - testzipfscanonical backslashes X:\\\\foo\\\\bar [file join [zipfs root] foo bar] -constraints win - testzipfscanonical backslashes-1 X:/foo\\\\bar [file join [zipfs root] foo bar] -constraints win - testzipfscanonical zipfspath //zipfs:/x/y [file join [zipfs root] x y] - testzipfscanonical zipfspath {MT //zipfs:/x/y} [file join [zipfs root] mt x y] + testzipfscanonical default-relative [list a] [file join [zipfs root] a] + testzipfscanonical default-absolute [list /a] [file join [zipfs root] a] + testzipfscanonical root-relative-1 [list [zipfs root] a] [file join [zipfs root] a] + testzipfscanonical root-relative-2 [list / a] [file join [zipfs root] a] + testzipfscanonical root-absolute-1 [list [zipfs root] /a] [file join [zipfs root] a] + testzipfscanonical root-absolute-2 [list / /a] [file join [zipfs root] a] + testzipfscanonical absolute-relative [list /MT a] [file join [zipfs root] MT a] + testzipfscanonical absolute-absolute [list /MT /a] [file join [zipfs root] MT a] + testzipfscanonical relative-relative [list MT a] [file join [zipfs root] MT a] + testzipfscanonical relative-absolute [list MT /a] [file join [zipfs root] MT a] + testzipfscanonical mountpoint-trailslash-relative [list MT/ a] [file join [zipfs root] MT a] + testzipfscanonical mountpoint-trailslash-absolute [list MT/ /a] [file join [zipfs root] MT a] + testzipfscanonical mountpoint-root-relative [list [zipfs root] a] [file join [zipfs root] a] + testzipfscanonical mountpoint-root-absolute [list [zipfs root] /a] [file join [zipfs root] a] + testzipfscanonical mountpoint-empty-relative [list {} a] [file join [zipfs root] a] + + testzipfscanonical driveletter [list X:] [zipfs root] -constraints win + testzipfscanonical drivepath [list X:/foo/bar] [file join [zipfs root] foo bar] -constraints win + testzipfscanonical drivepath [list MT X:/foo/bar] [file join [zipfs root] MT foo bar] -constraints win + testzipfscanonical backslashes [list X:\\\\foo\\\\bar] [file join [zipfs root] foo bar] -constraints win + testzipfscanonical backslashes-1 [list X:/foo\\\\bar] [file join [zipfs root] foo bar] -constraints win + testzipfscanonical zipfspath [list //zipfs:/x/y] [file join [zipfs root] x y] + testzipfscanonical zipfspath [list MT //zipfs:/x/y] [file join [zipfs root] x y] # # Read/uncompress -- cgit v0.12 From fead0fac7d5a920009e8dd9cc9a3a9992151c9a0 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 15 Oct 2023 10:12:55 +0000 Subject: Fix zipfs long path memory leaks [9525f4c8bc] --- generic/tclZipfs.c | 37 +++++++++++++++++++++---------------- tests/zipfs.test | 12 ++++++++++-- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index a074db1..4e38b09 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -889,7 +889,7 @@ static char * DecodeZipEntryText( const unsigned char *inputBytes, unsigned int inputLength, - Tcl_DString *dstPtr) + Tcl_DString *dstPtr) /* Must have been initialized by caller! */ { Tcl_Encoding encoding; const char *src; @@ -897,7 +897,6 @@ DecodeZipEntryText( int dstLen, srcLen = inputLength, flags; Tcl_EncodingState state; - Tcl_DStringInit(dstPtr); if (inputLength < 1) { return Tcl_DStringValue(dstPtr); } @@ -996,7 +995,9 @@ DecodeZipEntryText( *------------------------------------------------------------------------ */ static int -NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPtr) +NormalizeMountPoint(Tcl_Interp *interp, + const char *mountPath, + Tcl_DString *dsPtr) /* Must be initialized by caller! */ { const char *joiner[2]; char *joinedPath; @@ -1004,8 +1005,7 @@ NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPt Tcl_Obj *normalizedObj; const char *normalizedPath; Tcl_Size normalizedLen; - - Tcl_DStringInit(dsPtr); + Tcl_DString dsJoin; /* * Several things need to happen here @@ -1020,12 +1020,13 @@ NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPt joiner[0] = ZIPFS_VOLUME; joiner[1] = mountPath; - joinedPath = Tcl_JoinPath(2, joiner, dsPtr); + Tcl_DStringInit(&dsJoin); + joinedPath = Tcl_JoinPath(2, joiner, &dsJoin); /* Now joinedPath has all \ -> / and // -> / (except UNC) converted. */ if (!strncmp(ZIPFS_VOLUME, joinedPath, ZIPFS_VOLUME_LEN)) { - unnormalizedObj = Tcl_DStringToObj(dsPtr); + unnormalizedObj = Tcl_DStringToObj(&dsJoin); } else { if (joinedPath[0] != '/' || joinedPath[1] == '/') { /* mount path was D:/x, D:x or //unc */ @@ -1044,7 +1045,7 @@ NormalizeMountPoint(Tcl_Interp *interp, const char *mountPath, Tcl_DString *dsPt /* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */ normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen); - Tcl_DStringFree(dsPtr); /* Reset */ + Tcl_DStringFree(&dsJoin); Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen); Tcl_DecrRefCount(normalizedObj); return TCL_OK; @@ -1057,7 +1058,7 @@ invalidMountPath: } errorReturn: - Tcl_DStringFree(dsPtr); + Tcl_DStringFree(&dsJoin); return TCL_ERROR; } @@ -1084,7 +1085,8 @@ static char * MapPathToZipfs(Tcl_Interp *interp, const char *mountPath, /* Must be fully normalized */ const char *path, /* Archive content path to map */ - Tcl_DString *dsPtr) /* Must be cleared on success return */ + Tcl_DString *dsPtr) /* Must be initialized and cleared + by caller */ { const char *joiner[2]; char *joinedPath; @@ -1092,9 +1094,9 @@ MapPathToZipfs(Tcl_Interp *interp, Tcl_Obj *normalizedObj; const char *normalizedPath; Tcl_Size normalizedLen; + Tcl_DString dsJoin; assert(TclIsZipfsPath(mountPath)); - Tcl_DStringInit(dsPtr); joiner[0] = mountPath; joiner[1] = path; @@ -1104,19 +1106,20 @@ MapPathToZipfs(Tcl_Interp *interp, joiner[1] += 2; } #endif - joinedPath = Tcl_JoinPath(2, joiner, dsPtr); + Tcl_DStringInit(&dsJoin); + joinedPath = Tcl_JoinPath(2, joiner, &dsJoin); if (strncmp(ZIPFS_VOLUME, joinedPath, ZIPFS_VOLUME_LEN)) { /* path was not relative. Strip off the volume (e.g. UNC) */ Tcl_Size numParts; const char **partsPtr; Tcl_SplitPath(path, &numParts, &partsPtr); - Tcl_DStringFree(dsPtr); + Tcl_DStringFree(&dsJoin); partsPtr[0] = mountPath; - (void)Tcl_JoinPath(numParts, partsPtr, dsPtr); + (void)Tcl_JoinPath(numParts, partsPtr, &dsJoin); ckfree(partsPtr); } - unnormalizedObj = Tcl_DStringToObj(dsPtr); /* Also resets dsPtr */ + unnormalizedObj = Tcl_DStringToObj(&dsJoin); /* Also resets dsJoin */ Tcl_IncrRefCount(unnormalizedObj); normalizedObj = Tcl_FSGetNormalizedPath(interp, unnormalizedObj); if (normalizedObj == NULL) { @@ -1127,7 +1130,6 @@ MapPathToZipfs(Tcl_Interp *interp, Tcl_DecrRefCount(unnormalizedObj); /* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */ - Tcl_DStringFree(dsPtr); /* Reset */ normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen); Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen); Tcl_DecrRefCount(normalizedObj); @@ -1971,6 +1973,7 @@ ZipFSCatalogFilesystem( pathlen = ZipReadShort(start, end, q + ZIP_CENTRAL_PATHLEN_OFFS); comlen = ZipReadShort(start, end, q + ZIP_CENTRAL_FCOMMENTLEN_OFFS); extra = ZipReadShort(start, end, q + ZIP_CENTRAL_EXTRALEN_OFFS); + Tcl_DStringSetLength(&ds, 0); path = DecodeZipEntryText(q + ZIP_CENTRAL_HEADER_LEN, pathlen, &ds); if ((pathlen > 0) && (path[pathlen - 1] == '/')) { Tcl_DStringSetLength(&ds, pathlen - 1); @@ -2336,6 +2339,7 @@ TclZipfs_Mount( } Tcl_DString ds; + Tcl_DStringInit(&ds); ret = NormalizeMountPoint(interp, mountPoint, &ds); if (ret != TCL_OK) { Unlock(); @@ -2448,6 +2452,7 @@ TclZipfs_MountBuffer( } Tcl_DString ds; + Tcl_DStringInit(&ds); ret = NormalizeMountPoint(interp, mountPoint, &ds); if (ret != TCL_OK) { Unlock(); diff --git a/tests/zipfs.test b/tests/zipfs.test index 025d4c1..a7a6a1d 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -694,8 +694,8 @@ namespace eval test_ns_zipfs { cleanup } -body { # Primarily verifies that drive letters are stripped and paths maintained - lsort [zipfs list] - } -result {//zipfs:/testmount //zipfs:/testmount/filename.txt //zipfs:/testmount/src //zipfs:/testmount/src/tcltk //zipfs:/testmount/src/tcltk/wip //zipfs:/testmount/src/tcltk/wip/tcl //zipfs:/testmount/src/tcltk/wip/tcl/tests //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/abspath.txt //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt} + lsort [zipfs find $defMountPt] + } -result {//zipfs:/testmount/filename.txt //zipfs:/testmount/src //zipfs:/testmount/src/tcltk //zipfs:/testmount/src/tcltk/wip //zipfs:/testmount/src/tcltk/wip/tcl //zipfs:/testmount/src/tcltk/wip/tcl/tests //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/abspath.txt //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt} # # zipfs list @@ -1917,6 +1917,14 @@ namespace eval test_ns_zipfs { read $fd close $fd } -result "" + + # Following will only show a leak with valgrind + test bug-9525f4c8bc "Memory leak with long mount paths" -body { + set mt //zipfs:[string repeat /x 240] + zipfs mount [zippath test.zip] $mt + zipfs unmount $mt + } -result "" + } -- cgit v0.12 From ab8f66680584cabba56ab7af696818dfa8e2a8e6 Mon Sep 17 00:00:00 2001 From: oehhar Date: Sun, 15 Oct 2023 11:25:34 +0000 Subject: Comment correction --- generic/tclZipfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 4e38b09..d08767b 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1936,7 +1936,7 @@ ZipFSCatalogFilesystem( } zf->passBuf[k] = '\0'; } - /* TODO - is this test necessary? WHen will mountPoint[0] be \0 ? */ + /* TODO - is this test necessary? When will mountPoint[0] be \0 ? */ if (mountPoint[0] != '\0') { hPtr = Tcl_CreateHashEntry(&ZipFS.fileHash, mountPoint, &isNew); if (isNew) { -- cgit v0.12 From 79dbad99aa25a1c2503fe6a0228d1196fcaa8519 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 15 Oct 2023 11:45:35 +0000 Subject: Refactor mount_data api as to not duplicate mount command functionality. Needs revisiting as mount_data is not even in TIP 430 --- doc/zipfs.3 | 23 +++------- generic/tclZipfs.c | 124 +++++++++++++++++++++++------------------------------ tests/zipfs.test | 4 +- 3 files changed, 61 insertions(+), 90 deletions(-) diff --git a/doc/zipfs.3 b/doc/zipfs.3 index af1281c..571647f 100644 --- a/doc/zipfs.3 +++ b/doc/zipfs.3 @@ -111,23 +111,12 @@ is NULL, the path to the archive mounted at that mount point is stored as \fIinterp\fR's result. The function returns a standard Tcl result code. .PP -\fBTclZipfs_MountBuffer\fR is similar to \fBTclZipfs_Mount\fR except that the -content of a ZIP archive is passed in the buffer pointed to by \fIdata\fR. -If \fImountpoint\fR and -\fIdata\fR are both non-NULL, the function -mounts the ZIP archive content \fIdata\fR on the mount point -given in \fImountpoint\fR. -The -\fIcopy\fR argument determines whether the buffer is internally copied before -mounting or not. The ZIP archive is assumed to be not password protected. -On success, \fIinterp\fR's result is set to the normalized mount point -path. -If \fImountpoint\fR is a NULL pointer, information on all currently mounted ZIP -file systems is stored in \fIinterp\fR's result as a sequence of mount -points and ZIP file names. If \fImountpoint\fR is not NULL but \fIdata\fR -is NULL, the path to the archive mounted at that mount point is stored -as \fIinterp\fR's result. The function returns a standard Tcl result -code. +\fBTclZipfs_MountBuffer\fR mounts the ZIP archive content \fIdata\fR on the +mount point given in \fImountpoint\fR. Both \fImountpoint\fR and \fIdata\fR must +be specified as non-NULL. The \fIcopy\fR argument determines whether the buffer +is internally copied before mounting or not. The ZIP archive is assumed to be +not password protected. On success, \fIinterp\fR's result is set to the +normalized mount point path. .PP \fBTclZipfs_Unmount\fR undoes the effect of \fBTclZipfs_Mount\fR, i.e., it unmounts the mounted ZIP file system that was mounted from \fIzipname\fR (at diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index d08767b..8ce17eb 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2435,22 +2435,17 @@ TclZipfs_MountBuffer( ZipFile *zf; int ret; + if (mountPoint == NULL || data == NULL) { + ZIPFS_ERROR(interp, "mount point and/or data are null"); + return TCL_ERROR; + } + /* TODO - how come a *read* lock suffices for initialzing ? */ ReadLock(); if (!ZipFS.initialized) { ZipfsSetup(); } - /* - * No mount point, so list all mount points and what is mounted there. - */ - - if (!mountPoint) { - ret = ListMountPoints(interp); - Unlock(); - return ret; - } - Tcl_DString ds; Tcl_DStringInit(&ds); ret = NormalizeMountPoint(interp, mountPoint, &ds); @@ -2460,57 +2455,53 @@ TclZipfs_MountBuffer( } mountPoint = Tcl_DStringValue(&ds); - if (data == NULL) { - /* Mount point but no data, so describe what is mounted at there */ - ret = DescribeMounted(interp, mountPoint); - Unlock(); - } else { - Unlock(); + Unlock(); - /* - * Have both a mount point and data to mount there. - * What's the magic about 64 * 1024 * 1024 ? - */ - ret = TCL_ERROR; - if ((datalen <= ZIP_CENTRAL_END_LEN) || - (datalen - ZIP_CENTRAL_END_LEN) > - (64 * 1024 * 1024 - ZIP_CENTRAL_END_LEN)) { - ZIPFS_ERROR(interp, "illegal file size"); - ZIPFS_ERROR_CODE(interp, "FILE_SIZE"); - goto done; - } - zf = AllocateZipFile(interp, strlen(mountPoint)); - if (zf == NULL) { - goto done; - } - zf->isMemBuffer = 1; - zf->length = datalen; + /* + * Have both a mount point and data to mount there. + * What's the magic about 64 * 1024 * 1024 ? + */ + ret = TCL_ERROR; + if ((datalen <= ZIP_CENTRAL_END_LEN) || + (datalen - ZIP_CENTRAL_END_LEN) > + (64 * 1024 * 1024 - ZIP_CENTRAL_END_LEN)) { + ZIPFS_ERROR(interp, "illegal file size"); + ZIPFS_ERROR_CODE(interp, "FILE_SIZE"); + goto done; + } + zf = AllocateZipFile(interp, strlen(mountPoint)); + if (zf == NULL) { + goto done; + } + zf->isMemBuffer = 1; + zf->length = datalen; - if (copy) { - zf->data = (unsigned char *)attemptckalloc(datalen); - if (zf->data == NULL) { - ZipFSCloseArchive(interp, zf); - ckfree(zf); - ZIPFS_MEM_ERROR(interp); - goto done; - } - memcpy(zf->data, data, datalen); - zf->ptrToFree = zf->data; - } else { - zf->data = (unsigned char *)data; - zf->ptrToFree = NULL; - } - ret = ZipFSFindTOC(interp, 1, zf); - if (ret != TCL_OK) { + if (copy) { + zf->data = (unsigned char *)attemptckalloc(datalen); + if (zf->data == NULL) { + ZipFSCloseArchive(interp, zf); ckfree(zf); - } else { - /* Note ZipFSCatalogFilesystem will free zf on error */ - ret = ZipFSCatalogFilesystem( - interp, zf, mountPoint, NULL, "Memory Buffer"); - } - if (ret == TCL_OK && interp) { - Tcl_DStringResult(interp, &ds); + ZIPFS_MEM_ERROR(interp); + goto done; } + memcpy(zf->data, data, datalen); + zf->ptrToFree = zf->data; + } + else { + zf->data = (unsigned char *)data; + zf->ptrToFree = NULL; + } + ret = ZipFSFindTOC(interp, 1, zf); + if (ret != TCL_OK) { + ckfree(zf); + } + else { + /* Note ZipFSCatalogFilesystem will free zf on error */ + ret = ZipFSCatalogFilesystem( + interp, zf, mountPoint, NULL, "Memory Buffer"); + } + if (ret == TCL_OK && interp) { + Tcl_DStringResult(interp, &ds); } done: @@ -2675,21 +2666,14 @@ ZipFSMountBufferObjCmd( unsigned char *data = NULL; Tcl_Size length; - if (objc > 3) { - Tcl_WrongNumArgs(interp, 1, objv, "?data? ?mountpoint?"); + if (objc != 3) { + Tcl_WrongNumArgs(interp, 1, objv, "data mountpoint"); return TCL_ERROR; } - - if (objc > 1) { - if (objc == 2) { - mountPoint = Tcl_GetString(objv[1]); - } else { - data = Tcl_GetBytesFromObj(interp, objv[1], &length); - mountPoint = Tcl_GetString(objv[2]); - if (data == NULL) { - return TCL_ERROR; - } - } + data = Tcl_GetBytesFromObj(interp, objv[1], &length); + mountPoint = Tcl_GetString(objv[2]); + if (data == NULL) { + return TCL_ERROR; } return TclZipfs_MountBuffer(interp, data, length, mountPoint, 1); } diff --git a/tests/zipfs.test b/tests/zipfs.test index a7a6a1d..0226918 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -361,9 +361,6 @@ test zipfs-5.3 {zipfs mount_data: short data} -constraints zipfs -body { append data PK\x05\x06..................................... zipfs mount_data $data gorp } -returnCodes error -result {archive directory truncated} -test zipfs-5.4 {zipfs mount_data: bad arg count} -constraints zipfs -body { - zipfs mount_data {} gorp foobar -} -returnCodes error -result {wrong # args: should be "zipfs mount_data ?data? ?mountpoint?"} test zipfs-6.1 {zipfs mkkey} -constraints zipfs -body { binary scan [zipfs mkkey gorp] cu* x @@ -483,6 +480,7 @@ namespace eval test_ns_zipfs { } testnumargs "zipfs mount" "" "?zipfile? ?mountpoint? ?password?" + testnumargs "zipfs mount_data" "data mountpoint" "" # Not supported zip files testbadmount non-existent-file nosuchfile.zip "couldn't open*nosuchfile.zip*no such file or directory" -- cgit v0.12 From 8fda4dd37512f41e1e7b277e11b450cd7185d5ed Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 15 Oct 2023 11:51:54 +0000 Subject: Fix [26870862f0]: Wrong sentinel in Tcl_SetErrorCode usage --- generic/tclAssembly.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index e69348c..2e5709a 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -2011,7 +2011,7 @@ CreateMirrorJumpTable( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "duplicate entry in jump table for \"%s\"", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TCL", "ASSEM", "DUPJUMPTABLEENTRY"); + Tcl_SetErrorCode(interp, "TCL", "ASSEM", "DUPJUMPTABLEENTRY", NULL); DeleteMirrorJumpTable(jtPtr); return TCL_ERROR; } @@ -3451,7 +3451,7 @@ StackCheckBasicBlock( if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "code pops stack below level of enclosing catch", -1)); - Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADSTACKINCATCH", -1); + Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADSTACKINCATCH", NULL); AddBasicBlockRangeToErrorInfo(assemEnvPtr, blockPtr); Tcl_SetErrorLine(interp, blockPtr->startLine); } -- cgit v0.12 From e8c71c8d77a88b01a75b6d6e62b819b5c60c4ddd Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 15 Oct 2023 14:38:44 +0000 Subject: Fix broken nmake static install --- win/makefile.vc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win/makefile.vc b/win/makefile.vc index 7360269..72f4957 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1021,9 +1021,11 @@ install-binaries: !endif @$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\zlib1.dll" "$(BIN_INSTALL_DIR)\" - @$(CPY) "$(OUT_DIR)\zdll.lib" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\libtommath.dll" "$(BIN_INSTALL_DIR)\" +!if !$(STATIC_BUILD) + @$(CPY) "$(OUT_DIR)\zdll.lib" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\tommath.lib" "$(LIB_INSTALL_DIR)\" +!endif !if exist($(TCLSH)) @echo Installing $(TCLSHNAME) @$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\" -- cgit v0.12 From 7ab31a033508f2d3cc00bdbe28aef55c188f52cd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 15 Oct 2023 21:47:03 +0000 Subject: C++ doesn't accept "register" keyword --- compat/zlib/contrib/minizip/crypt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/zlib/contrib/minizip/crypt.h b/compat/zlib/contrib/minizip/crypt.h index f4b93b7..8bde464 100644 --- a/compat/zlib/contrib/minizip/crypt.h +++ b/compat/zlib/contrib/minizip/crypt.h @@ -50,7 +50,7 @@ static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c) (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { - register int keyshift = (int)((*(pkeys+1)) >> 24); + int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; -- cgit v0.12 From e42609ff3118ff940f6dbb3e5287fbaf74d763a6 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 16 Oct 2023 04:03:35 +0000 Subject: Add missing zipfs test zip --- tests/zipfiles/test-paths.zip | Bin 0 -> 671 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/zipfiles/test-paths.zip diff --git a/tests/zipfiles/test-paths.zip b/tests/zipfiles/test-paths.zip new file mode 100644 index 0000000..539013e Binary files /dev/null and b/tests/zipfiles/test-paths.zip differ -- cgit v0.12 From 4e528b8c42aee52ecce0336f66a3637dcc959e41 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 16 Oct 2023 18:18:58 +0000 Subject: test hygiene --- tests/zipfs.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/zipfs.test b/tests/zipfs.test index 0226918..c1cde5e 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -953,11 +953,11 @@ namespace eval test_ns_zipfs { testzipfscanonical driveletter [list X:] [zipfs root] -constraints win testzipfscanonical drivepath [list X:/foo/bar] [file join [zipfs root] foo bar] -constraints win - testzipfscanonical drivepath [list MT X:/foo/bar] [file join [zipfs root] MT foo bar] -constraints win + testzipfscanonical drivepath-1 [list MT X:/foo/bar] [file join [zipfs root] MT foo bar] -constraints win testzipfscanonical backslashes [list X:\\\\foo\\\\bar] [file join [zipfs root] foo bar] -constraints win testzipfscanonical backslashes-1 [list X:/foo\\\\bar] [file join [zipfs root] foo bar] -constraints win testzipfscanonical zipfspath [list //zipfs:/x/y] [file join [zipfs root] x y] - testzipfscanonical zipfspath [list MT //zipfs:/x/y] [file join [zipfs root] x y] + testzipfscanonical zipfspath-1 [list MT //zipfs:/x/y] [file join [zipfs root] x y] # # Read/uncompress -- cgit v0.12 From 12f22db7d88ada7a15f6c0371b6dc49ef02d698d Mon Sep 17 00:00:00 2001 From: bch Date: Mon, 16 Oct 2023 18:39:51 +0000 Subject: document available TCL_TCPSERVER_* flags --- doc/OpenTcp.3 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 index 5a0f559..602f081 100644 --- a/doc/OpenTcp.3 +++ b/doc/OpenTcp.3 @@ -50,7 +50,7 @@ If nonzero, the client socket is connected asynchronously to the server. .AP int backlog in Length of OS listen backlog queue. Use -1 for default value. .AP "unsigned int" flags in -ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional +ORed combination of \fBTCL_TCPSERVER_*\fR flags that specify additional informations about the socket being created. .AP void *sock in Platform-specific handle for client TCP socket. @@ -173,7 +173,10 @@ replacement for the standard channel. .PP \fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but gives more flexibility to the user by providing a mean to further customize some -aspects of the socket via the \fIflags\fR parameter. +aspects of the socket via the \fIflags\fR parameter. Available +flags (dependent on platform) are +\fITCL_TCPSERVER_REUSEADDR\fR +\fITCL_TCPSERVER_REUSEPORT\fR .SH "PLATFORM ISSUES" .PP On Unix platforms, the socket handle is a Unix file descriptor as -- cgit v0.12 From 37a36056c65bd6b16e50fc8e6e206899f3d91af3 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 16 Oct 2023 20:52:24 +0000 Subject: Missing cleanups that can cause conflicts in "-singleproc 1" testing. --- tests/assemble.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/assemble.test b/tests/assemble.test index 42c268a..6ac090a 100644 --- a/tests/assemble.test +++ b/tests/assemble.test @@ -141,6 +141,7 @@ test assemble-3.1 {wrong # args, compiled path} { -returnCodes error -match glob -result {wrong # args:*} + -cleanup {rename x {}} } test assemble-3.2 {wrong # args, compiled path} { -body { @@ -235,6 +236,7 @@ test assemble-5.3 {unsupported substitution} { list [catch {x} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} + -cleanup {rename x {}} } test assemble-5.4 {backslash substitution} { -body { @@ -634,6 +636,7 @@ test assemble-7.24 {lsetList} { x } -result {{a b} {c d} {e i} {g h}} + -cleanup {rename x {}} } test assemble-7.25 {lshift} { -body { @@ -3104,6 +3107,7 @@ test assemble-41.1 {Inconsistent stack usage} {*}{ -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 10)*} + -cleanup {rename x {}} } test assemble-41.2 {Inconsistent stack, jumptable and default} { -body { @@ -3122,6 +3126,7 @@ test assemble-41.2 {Inconsistent stack, jumptable and default} { -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 6)*} + -cleanup {rename x {}} } test assemble-41.3 {Inconsistent stack, two legs of jumptable} { -body { @@ -3141,6 +3146,7 @@ test assemble-41.3 {Inconsistent stack, two legs of jumptable} { -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 7)*} + -cleanup {rename x {}} } test assemble-50.1 {Ulam's 3n+1 problem, TAL implementation} { @@ -3193,6 +3199,7 @@ test assemble-50.1 {Ulam's 3n+1 problem, TAL implementation} { set result } -result {1 2 16 4 16 16 52 8 52 16 52 16 40 52 160 16 52 52 88 20 64 52 160 24 88 40 9232 52 88} + -cleanup {rename ulam {}} } test assemble-51.1 {memory leak testing} memory { @@ -3348,6 +3355,10 @@ test assemble-52.1 {Bug 3154ea2759} { rename fillTables {} rename assemble {} +if {[testConstraint memory]} { + rename getbytes {} + rename leaktest {} +} ::tcltest::cleanupTests return -- cgit v0.12 From 6def0d48c1fff35f9f5b3bfbe1ddbe6cedd2c247 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 17 Oct 2023 06:02:36 +0000 Subject: Handle sentinels for any C++ compiler --- generic/tclArithSeries.c | 6 +-- generic/tclBasic.c | 92 ++++++++++++++++++++-------------------- generic/tclBinary.c | 16 +++---- generic/tclClock.c | 10 ++--- generic/tclCmdAH.c | 10 ++--- generic/tclCmdIL.c | 70 +++++++++++++++--------------- generic/tclCmdMZ.c | 44 +++++++++---------- generic/tclCompExpr.c | 2 +- generic/tclCompile.c | 2 +- generic/tclConfig.c | 6 +-- generic/tclDate.c | 16 +++---- generic/tclDecls.h | 8 ++-- generic/tclDictObj.c | 12 +++--- generic/tclDisassemble.c | 22 +++++----- generic/tclEncoding.c | 20 ++++----- generic/tclEnsemble.c | 48 ++++++++++----------- generic/tclEvent.c | 18 ++++---- generic/tclExecute.c | 52 +++++++++++------------ generic/tclFCmd.c | 6 +-- generic/tclFileName.c | 26 ++++++------ generic/tclIO.c | 10 ++--- generic/tclIOCmd.c | 2 +- generic/tclIORChan.c | 2 +- generic/tclIOUtil.c | 2 +- generic/tclIndexObj.c | 34 +++++++-------- generic/tclInterp.c | 54 +++++++++++------------ generic/tclListObj.c | 8 ++-- generic/tclLoad.c | 24 +++++------ generic/tclNamesp.c | 30 ++++++------- generic/tclOO.c | 18 ++++---- generic/tclOOBasic.c | 42 +++++++++--------- generic/tclOODefineCmds.c | 82 +++++++++++++++++------------------ generic/tclOOInfo.c | 30 ++++++------- generic/tclOOMethod.c | 4 +- generic/tclObj.c | 24 +++++------ generic/tclPathObj.c | 8 ++-- generic/tclPipe.c | 18 ++++---- generic/tclPkg.c | 30 ++++++------- generic/tclProc.c | 32 +++++++------- generic/tclRegexp.c | 2 +- generic/tclResult.c | 14 +++--- generic/tclScan.c | 24 +++++------ generic/tclStrToD.c | 6 +-- generic/tclStringObj.c | 22 +++++----- generic/tclTimer.c | 4 +- generic/tclTomMathDecls.h | 4 +- generic/tclTrace.c | 8 ++-- generic/tclUtil.c | 14 +++--- generic/tclVar.c | 64 ++++++++++++++-------------- generic/tclZipfs.c | 15 ++----- generic/tclZlib.c | 52 +++++++++++------------ libtommath/bn_s_mp_balance_mul.c | 4 +- libtommath/bn_s_mp_toom_mul.c | 4 +- macosx/tclMacOSXFCmd.c | 8 ++-- unix/dltest/pkgb.c | 2 +- unix/dltest/pkgooa.c | 6 +-- unix/tclLoadDl.c | 2 +- unix/tclLoadDyld.c | 2 +- unix/tclLoadNext.c | 2 +- unix/tclLoadOSF.c | 2 +- unix/tclUnixChan.c | 32 +++++++------- unix/tclUnixFCmd.c | 6 +-- unix/tclUnixTest.c | 34 +++++++-------- unix/tclXtTest.c | 2 +- win/tclWinChan.c | 2 +- win/tclWinConsole.c | 2 +- win/tclWinFile.c | 2 +- win/tclWinLoad.c | 14 +++--- win/tclWinSerial.c | 20 ++++----- win/tclWinTest.c | 8 ++-- 70 files changed, 657 insertions(+), 666 deletions(-) diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c index 45a3481..34fd635 100755 --- a/generic/tclArithSeries.c +++ b/generic/tclArithSeries.c @@ -545,7 +545,7 @@ TclNewArithSeriesObj( Tcl_SetObjResult( interp, Tcl_NewStringObj("max length of a Tcl list exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } @@ -876,7 +876,7 @@ TclArithSeriesGetElements( Tcl_SetObjResult( interp, Tcl_NewStringObj("max length of a Tcl list exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return TCL_ERROR; } @@ -899,7 +899,7 @@ TclArithSeriesGetElements( Tcl_SetObjResult( interp, Tcl_ObjPrintf("value is not an arithseries")); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "UNKNOWN", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "UNKNOWN", (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 53a5614..0120466 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -682,7 +682,7 @@ buildInfoObjCmd( if (p) { memcpy(buf, (char *)clientData, p - (char *)clientData); buf[p - (char *)clientData] = '\0'; - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } return TCL_OK; } else if (len == 10 && !strcmp(arg, "patchlevel")) { @@ -691,7 +691,7 @@ buildInfoObjCmd( if (p) { memcpy(buf, (char *)clientData, p - (char *)clientData); buf[p - (char *)clientData] = '\0'; - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } return TCL_OK; } else if (len == 6 && !strcmp(arg, "commit")) { @@ -701,9 +701,9 @@ buildInfoObjCmd( char buf[80]; memcpy(buf, p+1, q - p - 1); buf[q - p - 1] = '\0'; - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } else { - Tcl_AppendResult(interp, p+1, NULL); + Tcl_AppendResult(interp, p+1, (void *)NULL); } } return TCL_OK; @@ -717,29 +717,29 @@ buildInfoObjCmd( char buf[16]; memcpy(buf, p+1, q - p - 1); buf[q - p - 1] = '\0'; - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } else { - Tcl_AppendResult(interp, p+1, NULL); + Tcl_AppendResult(interp, p+1, (void *)NULL); } return TCL_OK; } p = strchr(p+1, '.'); } - Tcl_AppendResult(interp, "0", NULL); + Tcl_AppendResult(interp, "0", (void *)NULL); return TCL_OK; } const char *p = strchr((char *)clientData, '.'); while (p) { if (!strncmp(p+1, arg, len) && ((p[len+1] == '.') || (p[len+1] == '\0'))) { - Tcl_AppendResult(interp, "1", NULL); + Tcl_AppendResult(interp, "1", (void *)NULL); return TCL_OK; } p = strchr(p+1, '.'); } - Tcl_AppendResult(interp, "0", NULL); + Tcl_AppendResult(interp, "0", (void *)NULL); return TCL_OK; } - Tcl_AppendResult(interp, (char *)clientData, NULL); + Tcl_AppendResult(interp, (char *)clientData, (void *)NULL); return TCL_OK; } @@ -1522,7 +1522,7 @@ BadEnsembleSubcommand( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "not allowed to invoke subcommand %s of %s", infoPtr->commandName, infoPtr->ensembleNsName)); - Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", NULL); + Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", (void *)NULL); return TCL_ERROR; } @@ -2228,7 +2228,7 @@ Tcl_HideCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot use namespace qualifiers in hidden command" " token (rename)", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "HIDDENTOKEN", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "HIDDENTOKEN", (void *)NULL); return TCL_ERROR; } @@ -2253,7 +2253,7 @@ Tcl_HideCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only hide global namespace commands (use rename then hide)", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "HIDE", "NON_GLOBAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "HIDE", "NON_GLOBAL", (void *)NULL); return TCL_ERROR; } @@ -2279,7 +2279,7 @@ Tcl_HideCommand( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "hidden command named \"%s\" already exists", hiddenCmdToken)); - Tcl_SetErrorCode(interp, "TCL", "HIDE", "ALREADY_HIDDEN", NULL); + Tcl_SetErrorCode(interp, "TCL", "HIDE", "ALREADY_HIDDEN", (void *)NULL); return TCL_ERROR; } @@ -2383,7 +2383,7 @@ Tcl_ExposeCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot expose to a namespace (use expose to toplevel, then rename)", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "NON_GLOBAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "NON_GLOBAL", (void *)NULL); return TCL_ERROR; } @@ -2400,7 +2400,7 @@ Tcl_ExposeCommand( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown hidden command \"%s\"", hiddenCmdToken)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "HIDDENTOKEN", - hiddenCmdToken, NULL); + hiddenCmdToken, (void *)NULL); return TCL_ERROR; } cmdPtr = (Command *)Tcl_GetHashValue(hPtr); @@ -2438,7 +2438,7 @@ Tcl_ExposeCommand( if (!isNew) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "exposed command \"%s\" already exists", cmdName)); - Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "COMMAND_EXISTS", NULL); + Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "COMMAND_EXISTS", (void *)NULL); return TCL_ERROR; } @@ -3118,7 +3118,7 @@ TclRenameCommand( "can't %s \"%s\": command doesn't exist", ((newName == NULL)||(*newName == '\0'))? "delete":"rename", oldName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", oldName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", oldName, (void *)NULL); return TCL_ERROR; } @@ -3149,7 +3149,7 @@ TclRenameCommand( if ((newNsPtr == NULL) || (newTail == NULL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't rename to \"%s\": bad command name", newName)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3157,7 +3157,7 @@ TclRenameCommand( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't rename to \"%s\": command already exists", newName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "RENAME", - "TARGET_EXISTS", NULL); + "TARGET_EXISTS", (void *)NULL); result = TCL_ERROR; goto done; } @@ -4274,7 +4274,7 @@ Tcl_GetMathFuncInfo( if (cmdPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown math function \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "MATHFUNC", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "MATHFUNC", name, (void *)NULL); *numArgsPtr = -1; *argTypesPtr = NULL; *procPtr = NULL; @@ -4393,7 +4393,7 @@ TclInterpReady( Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to call eval in deleted interpreter", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "IDELETE", - "attempt to call eval in deleted interpreter", NULL); + "attempt to call eval in deleted interpreter", (void *)NULL); return TCL_ERROR; } @@ -4421,7 +4421,7 @@ TclInterpReady( Tcl_SetObjResult(interp, Tcl_NewStringObj( "too many nested evaluations (infinite loop?)", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", (void *)NULL); return TCL_ERROR; } @@ -4555,7 +4555,7 @@ Tcl_Canceled( } Tcl_SetObjResult(interp, Tcl_NewStringObj(message, TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "CANCEL", id, message, NULL); + Tcl_SetErrorCode(interp, "TCL", "CANCEL", id, message, (void *)NULL); } /* @@ -4845,7 +4845,7 @@ EvalObjvCore( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "attempt to invoke a deleted command")); - Tcl_SetErrorCode(interp, "TCL", "EVAL", "DELETEDCOMMAND", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVAL", "DELETEDCOMMAND", (void *)NULL); return TCL_ERROR; } } @@ -5244,7 +5244,7 @@ TEOV_NotFound( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid command name \"%s\"", TclGetString(objv[0]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", - TclGetString(objv[0]), NULL); + TclGetString(objv[0]), (void *)NULL); /* * Release any resources we locked and allocated during the handler @@ -6853,7 +6853,7 @@ ProcessUnexpectedResult( "command returned bad code: %d", returnCode)); } snprintf(buf, sizeof(buf), "%d", returnCode); - Tcl_SetErrorCode(interp, "TCL", "UNEXPECTED_RESULT_CODE", buf, NULL); + Tcl_SetErrorCode(interp, "TCL", "UNEXPECTED_RESULT_CODE", buf, (void *)NULL); } /* @@ -7201,7 +7201,7 @@ TclNRInvoke( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid hidden command name \"%s\"", cmdName)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "HIDDENTOKEN", cmdName, - NULL); + (void *)NULL); return TCL_ERROR; } cmdPtr = (Command *)Tcl_GetHashValue(hPtr); @@ -7408,7 +7408,7 @@ Tcl_AddObjErrorInfo( iPtr->errorInfo = iPtr->objResultPtr; Tcl_IncrRefCount(iPtr->errorInfo); if (!iPtr->errorCode) { - Tcl_SetErrorCode(interp, "NONE", NULL); + Tcl_SetErrorCode(interp, "NONE", (void *)NULL); } } @@ -7845,7 +7845,7 @@ ExprIsqrtFunc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "square root of negative argument", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", - "domain error: argument not in valid range", NULL); + "domain error: argument not in valid range", (void *)NULL); return TCL_ERROR; } @@ -8954,7 +8954,7 @@ MathFuncWrongNumArgs( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s arguments for math function \"%s\"", (found < expected ? "not enough" : "too many"), name)); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); } #ifdef USE_DTRACE @@ -9375,7 +9375,7 @@ TclNRTailcallObjCmd( if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "tailcall can only be called from a proc, lambda or method", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", (void *)NULL); return TCL_ERROR; } @@ -9537,7 +9537,7 @@ TclNRYieldObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "yield can only be called in a coroutine", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", (void *)NULL); return TCL_ERROR; } @@ -9570,7 +9570,7 @@ TclNRYieldToObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "yieldto can only be called in a coroutine", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", (void *)NULL); return TCL_ERROR; } @@ -9578,7 +9578,7 @@ TclNRYieldToObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "yieldto called in deleted namespace", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -9814,7 +9814,7 @@ TclNRCoroutineActivateCallback( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot yield: C stack busy", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -9903,7 +9903,7 @@ CoroTypeObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only get coroutine type of a coroutine", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } @@ -9933,7 +9933,7 @@ CoroTypeObjCmd( default: Tcl_SetObjResult(interp, Tcl_NewStringObj( "unknown coroutine type", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BAD_TYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BAD_TYPE", (void *)NULL); return TCL_ERROR; } } @@ -9963,7 +9963,7 @@ GetCoroutineFromObj( if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", - TclGetString(objPtr), NULL); + TclGetString(objPtr), (void *)NULL); return NULL; } return (CoroutineData *)cmdPtr->objClientData; @@ -9996,7 +9996,7 @@ TclNRCoroInjectObjCmd( if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", (void *)NULL); return TCL_ERROR; } @@ -10042,7 +10042,7 @@ TclNRCoroProbeObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only inject a probe command into a suspended coroutine", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", (void *)NULL); return TCL_ERROR; } @@ -10233,7 +10233,7 @@ NRInjectObjCmd( if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can only inject a command into a suspended coroutine", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", (void *)NULL); return TCL_ERROR; } @@ -10263,7 +10263,7 @@ TclNRInterpCoroutine( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "coroutine \"%s\" is already running", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BUSY", NULL); + Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BUSY", (void *)NULL); return TCL_ERROR; } @@ -10287,7 +10287,7 @@ TclNRInterpCoroutine( Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong coro nargs; how did we get here? " "not implemented!", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); return TCL_ERROR; } /* fallthrough */ @@ -10341,14 +10341,14 @@ TclNRCoroutineObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create procedure \"%s\": unknown namespace", procName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", (void *)NULL); return TCL_ERROR; } if (simpleName == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create procedure \"%s\": bad procedure name", procName)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", procName, NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", procName, (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 9c47dd4..9b59ee7 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -440,7 +440,7 @@ Tcl_GetBytesFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected byte sequence but character %d " "was '%1s' (U+%06X)", baPtr->bad, nonbyte, ucs4)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", (void *)NULL); } return NULL; } @@ -2658,7 +2658,7 @@ BinaryDecodeHex( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid hexadecimal digit \"%c\" (U+%06X) at position %d", ucs4, ucs4, (int) (data - datastart - 1))); - Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL); + Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", (void *)NULL); return TCL_ERROR; } @@ -2726,7 +2726,7 @@ BinaryEncode64( Tcl_SetObjResult(interp, Tcl_NewStringObj( "line length out of range", -1)); Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE", - "LINE_LENGTH", NULL); + "LINE_LENGTH", (void *)NULL); return TCL_ERROR; } break; @@ -2851,7 +2851,7 @@ BinaryEncodeUu( Tcl_SetObjResult(interp, Tcl_NewStringObj( "line length out of range", -1)); Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE", - "LINE_LENGTH", NULL); + "LINE_LENGTH", (void *)NULL); return TCL_ERROR; } lineLength = ((lineLength - 1) & -4) + 1; /* 5, 9, 13 ... */ @@ -2880,7 +2880,7 @@ BinaryEncodeUu( "invalid wrapchar; will defeat decoding", -1)); Tcl_SetErrorCode(interp, "TCL", "BINARY", - "ENCODE", "WRAPCHAR", NULL); + "ENCODE", "WRAPCHAR", (void *)NULL); return TCL_ERROR; } } @@ -3101,7 +3101,7 @@ BinaryDecodeUu( shortUu: Tcl_SetObjResult(interp, Tcl_ObjPrintf("short uuencode data")); - Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "SHORT", NULL); + Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "SHORT", (void *)NULL); TclDecrRefCount(resultObj); return TCL_ERROR; @@ -3114,7 +3114,7 @@ BinaryDecodeUu( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid uuencode character \"%c\" (U+%06X) at position %d", ucs4, ucs4, (int) (data - datastart - 1))); - Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL); + Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", (void *)NULL); TclDecrRefCount(resultObj); return TCL_ERROR; } @@ -3289,7 +3289,7 @@ BinaryDecode64( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid base64 character \"%c\" (U+%06X) at position %d", ucs4, ucs4, (int) (data - datastart - 1))); - Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL); + Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", (void *)NULL); TclDecrRefCount(resultObj); return TCL_ERROR; } diff --git a/generic/tclClock.c b/generic/tclClock.c index 15256e8..ab6d23f 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1045,7 +1045,7 @@ ConvertUTCToLocalUsingC( if ((Tcl_WideInt) tock != fields->seconds) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "number too large to represent as a Posix time", -1)); - Tcl_SetErrorCode(interp, "CLOCK", "argTooLarge", NULL); + Tcl_SetErrorCode(interp, "CLOCK", "argTooLarge", (void *)NULL); return TCL_ERROR; } TzsetIfNecessary(); @@ -1054,7 +1054,7 @@ ConvertUTCToLocalUsingC( Tcl_SetObjResult(interp, Tcl_NewStringObj( "localtime failed (clock value may be too " "large/small to represent)", -1)); - Tcl_SetErrorCode(interp, "CLOCK", "localtimeFailed", NULL); + Tcl_SetErrorCode(interp, "CLOCK", "localtimeFailed", (void *)NULL); return TCL_ERROR; } @@ -1905,7 +1905,7 @@ ClockParseformatargsObjCmd( Tcl_WrongNumArgs(interp, 0, objv, "clock format clockval ?-format string? " "?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?"); - Tcl_SetErrorCode(interp, "CLOCK", "wrongNumArgs", NULL); + Tcl_SetErrorCode(interp, "CLOCK", "wrongNumArgs", (void *)NULL); return TCL_ERROR; } @@ -1920,7 +1920,7 @@ ClockParseformatargsObjCmd( if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, &optionIndex) != TCL_OK) { Tcl_SetErrorCode(interp, "CLOCK", "badOption", - TclGetString(objv[i]), NULL); + TclGetString(objv[i]), (void *)NULL); return TCL_ERROR; } switch (optionIndex) { @@ -1952,7 +1952,7 @@ ClockParseformatargsObjCmd( if ((saw & (1 << CLOCK_FORMAT_GMT)) && (saw & (1 << CLOCK_FORMAT_TIMEZONE))) { Tcl_SetObjResult(interp, litPtr[LIT_CANNOT_USE_GMT_AND_TIMEZONE]); - Tcl_SetErrorCode(interp, "CLOCK", "gmtWithTimezone", NULL); + Tcl_SetErrorCode(interp, "CLOCK", "gmtWithTimezone", (void *)NULL); return TCL_ERROR; } if (gmtFlag) { diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index c983109..12216d4 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -875,7 +875,7 @@ EncodingDirsObjCmd( "expected directory list but got \"%s\"", TclGetString(dirListObj))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "ENCODING", "BADPATH", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, dirListObj); @@ -2068,7 +2068,7 @@ PathFilesystemCmd( if (fsInfo == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("unrecognised path", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, fsInfo); @@ -2218,7 +2218,7 @@ PathSplitCmd( "could not read \"%s\": no such file or directory", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PATHSPLIT", "NONESUCH", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, res); @@ -2320,7 +2320,7 @@ FilesystemSeparatorCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unrecognised path", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, separatorObj); @@ -2961,7 +2961,7 @@ EachloopCmd( (statePtr->resultList != NULL ? "lmap" : "foreach"))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", (statePtr->resultList != NULL ? "LMAP" : "FOREACH"), - "NEEDVARS", NULL); + "NEEDVARS", (void *)NULL); result = TCL_ERROR; goto done; } diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 9f4587c..8f7cbe6 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -225,7 +225,7 @@ TclNRIfObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: no expression after \"%s\" argument", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); return TCL_ERROR; } @@ -316,7 +316,7 @@ IfConditionCallback( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: no expression after \"%s\" argument", clause)); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); return TCL_ERROR; } if (!thenScriptIndex) { @@ -343,7 +343,7 @@ IfConditionCallback( Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args: extra words after \"else\" clause in \"if\" command", -1)); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); return TCL_ERROR; } if (thenScriptIndex) { @@ -360,7 +360,7 @@ IfConditionCallback( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: no script following \"%s\" argument", TclGetString(objv[i-1]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); return TCL_ERROR; } @@ -489,7 +489,7 @@ InfoArgsCmd( if (procPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" isn't a procedure", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROCEDURE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROCEDURE", name, (void *)NULL); return TCL_ERROR; } @@ -551,7 +551,7 @@ InfoBodyCmd( if (procPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" isn't a procedure", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROCEDURE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROCEDURE", name, (void *)NULL); return TCL_ERROR; } @@ -972,7 +972,7 @@ InfoDefaultCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" isn't a procedure", procName)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROCEDURE", procName, - NULL); + (void *)NULL); return TCL_ERROR; } @@ -1005,7 +1005,7 @@ InfoDefaultCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "procedure \"%s\" doesn't have an argument \"%s\"", procName, argName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARGUMENT", argName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARGUMENT", argName, (void *)NULL); return TCL_ERROR; } @@ -1188,7 +1188,7 @@ InfoFrameCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); code = TCL_ERROR; goto done; } @@ -1550,7 +1550,7 @@ InfoHostnameCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unable to determine name of host", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "HOSTNAME", "UNKNOWN", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "HOSTNAME", "UNKNOWN", (void *)NULL); return TCL_ERROR; } @@ -1623,7 +1623,7 @@ InfoLevelCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } @@ -1670,7 +1670,7 @@ InfoLibraryCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "no library has been specified for Tcl", -1)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", "tcl_library",NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", "tcl_library", (void *)NULL); return TCL_ERROR; } @@ -2168,7 +2168,7 @@ InfoCmdTypeCmd( if (Tcl_IsSafe(interp) && (((Command *) command)->objProc == TclAliasObjCmd)) { - Tcl_AppendResult(interp, "native", NULL); + Tcl_AppendResult(interp, "native", (void *)NULL); } else { Tcl_SetObjResult(interp, Tcl_NewStringObj(TclGetCommandTypeName(command), -1)); @@ -2663,7 +2663,7 @@ Tcl_LpopObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "index \"end\" out of range", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX" - "OUTOFRANGE", NULL); + "OUTOFRANGE", (void *)NULL); return TCL_ERROR; } elemPtr = elemPtrs[listLen - 1]; @@ -2967,7 +2967,7 @@ Tcl_LrepeatObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad count \"%" TCL_LL_MODIFIER "d\": must be integer >= 0", elementCount)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LREPEAT", "NEGARG", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -2983,7 +2983,7 @@ Tcl_LrepeatObjCmd( if (elementCount && objc > LIST_MAX/elementCount) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "max length of a Tcl list (%" TCL_SIZE_MODIFIER "d elements) exceeded", LIST_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } totalElems = objc * elementCount; @@ -3401,7 +3401,7 @@ Tcl_LsearchObjCmd( if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing starting index", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3425,7 +3425,7 @@ Tcl_LsearchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-stride\" option must be " "followed by stride length", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3437,7 +3437,7 @@ Tcl_LsearchObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "stride length must be between 1 and %d", LIST_MAX)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", - "BADSTRIDE", NULL); + "BADSTRIDE", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3456,7 +3456,7 @@ Tcl_LsearchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-index\" option must be followed by list index", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3504,7 +3504,7 @@ Tcl_LsearchObjCmd( "index \"%s\" out of range", TclGetString(indices[j]))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX" - "OUTOFRANGE", NULL); + "OUTOFRANGE", (void *)NULL); result = TCL_ERROR; } if (result == TCL_ERROR) { @@ -3527,7 +3527,7 @@ Tcl_LsearchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "-subindices cannot be used without -index option", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", - "BAD_OPTION_MIX", NULL); + "BAD_OPTION_MIX", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3536,7 +3536,7 @@ Tcl_LsearchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "-bisect is not compatible with -all or -not", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", - "BAD_OPTION_MIX", NULL); + "BAD_OPTION_MIX", (void *)NULL); result = TCL_ERROR; goto done; } @@ -3590,7 +3590,7 @@ Tcl_LsearchObjCmd( "list size must be a multiple of the stride length", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", "BADSTRIDE", - NULL); + (void *)NULL); result = TCL_ERROR; goto done; } @@ -3606,7 +3606,7 @@ Tcl_LsearchObjCmd( "when used with \"-stride\", the leading \"-index\"" " value must be within the group", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", - "BADINDEX", NULL); + "BADINDEX", (void *)NULL); result = TCL_ERROR; goto done; } @@ -4575,7 +4575,7 @@ Tcl_LsortObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-command\" option must be followed " "by comparison command", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4600,7 +4600,7 @@ Tcl_LsortObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-index\" option must be followed by list index", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4628,7 +4628,7 @@ Tcl_LsortObjCmd( "index \"%s\" out of range", TclGetString(indexv[j]))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX" - "OUTOFRANGE", NULL); + "OUTOFRANGE", (void *)NULL); result = TCL_ERROR; } if (result == TCL_ERROR) { @@ -4662,7 +4662,7 @@ Tcl_LsortObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-stride\" option must be " "followed by stride length", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4674,7 +4674,7 @@ Tcl_LsortObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "stride length must be between 2 and %d", LIST_MAX)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", - "BADSTRIDE", NULL); + "BADSTRIDE", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4780,7 +4780,7 @@ Tcl_LsortObjCmd( "list size must be a multiple of the stride length", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", "BADSTRIDE", - NULL); + (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4797,7 +4797,7 @@ Tcl_LsortObjCmd( "when used with \"-stride\", the leading \"-index\"" " value must be within the group", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", - "BADINDEX", NULL); + "BADINDEX", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -4859,7 +4859,7 @@ Tcl_LsortObjCmd( if (!elementArray) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no enough memory to proccess sort of %d items", length)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); sortInfo.resultCode = TCL_ERROR; goto done; } @@ -5323,7 +5323,7 @@ SortCompare( Tcl_SetObjResult(infoPtr->interp, Tcl_NewStringObj( "-compare command returned non-integer result", -1)); Tcl_SetErrorCode(infoPtr->interp, "TCL", "OPERATION", "LSORT", - "COMPARISONFAILED", NULL); + "COMPARISONFAILED", (void *)NULL); infoPtr->resultCode = TCL_ERROR; return 0; } @@ -5539,7 +5539,7 @@ SelectObjFromSublist( index, TclGetString(objPtr))); } Tcl_SetErrorCode(infoPtr->interp, "TCL", "OPERATION", "LSORT", - "INDEXFAILED", NULL); + "INDEXFAILED", (void *)NULL); infoPtr->resultCode = TCL_ERROR; return NULL; } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 32ed560..a2d7372 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -232,7 +232,7 @@ Tcl_RegexpObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "regexp match variables not allowed when using -inline", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "REGEXP", - "MIX_VAR_INLINE", NULL); + "MIX_VAR_INLINE", (void *)NULL); goto optionError; } @@ -687,7 +687,7 @@ Tcl_RegsubObjCmd( "command prefix must be a list of at least one element", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "REGSUB", - "CMDEMPTY", NULL); + "CMDEMPTY", (void *)NULL); return TCL_ERROR; } regExpr = Tcl_GetRegExpFromObj(interp, objv[0], cflags); @@ -1985,7 +1985,7 @@ StringMapCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\": must be -nocase", string)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", - string, NULL); + string, (void *)NULL); return TCL_ERROR; } } @@ -2050,7 +2050,7 @@ StringMapCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj("char map list unbalanced", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "MAP", - "UNBALANCED", NULL); + "UNBALANCED", (void *)NULL); return TCL_ERROR; } } @@ -2255,7 +2255,7 @@ StringMatchCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\": must be -nocase", string)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", - string, NULL); + string, (void *)NULL); return TCL_ERROR; } } @@ -2677,7 +2677,7 @@ StringEqualCmd( "bad option \"%s\": must be -nocase or -length", string2)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", - string2, NULL); + string2, (void *)NULL); return TCL_ERROR; } } @@ -2782,7 +2782,7 @@ StringCmpOpts( "bad option \"%s\": must be -nocase or -length", string)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", - string, NULL); + string, (void *)NULL); return TCL_ERROR; } } @@ -3554,7 +3554,7 @@ TclNRSwitchObjCmd( "bad option \"%s\": %s option already found", TclGetString(objv[i]), options[mode])); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "DOUBLEOPT", NULL); + "DOUBLEOPT", (void *)NULL); return TCL_ERROR; } foundmode = 1; @@ -3573,7 +3573,7 @@ TclNRSwitchObjCmd( "missing variable name argument to %s option", "-indexvar")); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "NOVAR", NULL); + "NOVAR", (void *)NULL); return TCL_ERROR; } indexVarObj = objv[i]; @@ -3586,7 +3586,7 @@ TclNRSwitchObjCmd( "missing variable name argument to %s option", "-matchvar")); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "NOVAR", NULL); + "NOVAR", (void *)NULL); return TCL_ERROR; } matchVarObj = objv[i]; @@ -3605,14 +3605,14 @@ TclNRSwitchObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s option requires -regexp option", "-indexvar")); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "MODERESTRICTION", NULL); + "MODERESTRICTION", (void *)NULL); return TCL_ERROR; } if (matchVarObj != NULL && mode != OPT_REGEXP) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s option requires -regexp option", "-matchvar")); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "MODERESTRICTION", NULL); + "MODERESTRICTION", (void *)NULL); return TCL_ERROR; } @@ -3665,7 +3665,7 @@ TclNRSwitchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "extra switch pattern with no body", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", "BADARM", - NULL); + (void *)NULL); /* * Check if this can be due to a badly placed comment in the switch @@ -3683,7 +3683,7 @@ TclNRSwitchObjCmd( " placed outside of a switch body - see the" " \"switch\" documentation", -1); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", - "BADARM", "COMMENT?", NULL); + "BADARM", "COMMENT?", (void *)NULL); break; } } @@ -3702,7 +3702,7 @@ TclNRSwitchObjCmd( "no body specified for pattern \"%s\"", TclGetString(objv[objc-2]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", "BADARM", - "FALLTHROUGH", NULL); + "FALLTHROUGH", (void *)NULL); return TCL_ERROR; } @@ -4033,7 +4033,7 @@ Tcl_ThrowObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "type must be non-empty list", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "THROW", "BADEXCEPTION", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -4772,7 +4772,7 @@ TclNRTryObjCmd( "finally clause must be last", -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "FINALLY", - "NONTERMINAL", NULL); + "NONTERMINAL", (void *)NULL); return TCL_ERROR; } else if (i == objc-1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -4780,7 +4780,7 @@ TclNRTryObjCmd( " \"... finally script\"", -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "FINALLY", - "ARGUMENT", NULL); + "ARGUMENT", (void *)NULL); return TCL_ERROR; } finallyObj = objv[++i]; @@ -4793,7 +4793,7 @@ TclNRTryObjCmd( " variableList script\"", -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "ON", - "ARGUMENT", NULL); + "ARGUMENT", (void *)NULL); return TCL_ERROR; } if (TclGetCompletionCodeFromObj(interp, objv[i+1], @@ -4812,7 +4812,7 @@ TclNRTryObjCmd( -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "TRAP", - "ARGUMENT", NULL); + "ARGUMENT", (void *)NULL); return TCL_ERROR; } code = 1; @@ -4822,7 +4822,7 @@ TclNRTryObjCmd( TclGetString(objv[i+1]))); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "TRAP", - "EXNFORMAT", NULL); + "EXNFORMAT", (void *)NULL); return TCL_ERROR; } info[2] = objv[i+1]; @@ -4854,7 +4854,7 @@ TclNRTryObjCmd( "last non-finally clause must not have a body of \"-\"", -1)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "BADFALLTHROUGH", - NULL); + (void *)NULL); return TCL_ERROR; } if (!haveHandlers) { diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 3a05621..e97c552 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -1479,7 +1479,7 @@ ParseExpr( parsePtr->string, (numBytes < limit) ? "" : "...")); if (errCode) { Tcl_SetErrorCode(interp, "TCL", "PARSE", "EXPR", errCode, - subErrCode, NULL); + subErrCode, (void *)NULL); } } diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 22bc2d3..7ca9e77 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2178,7 +2178,7 @@ TclCompileScript( if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "too many nested compilations (infinite loop?)", -1)); - Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", (void *)NULL); TclCompileSyntaxError(interp, envPtr); return; } diff --git a/generic/tclConfig.c b/generic/tclConfig.c index 36d37ec..28853a1 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -229,7 +229,7 @@ QueryConfigObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj("package not known", -1)); Tcl_SetErrorCode(interp, "TCL", "FATAL", "PKGCFG_BASE", - TclGetString(pkgName), NULL); + TclGetString(pkgName), (void *)NULL); return TCL_ERROR; } @@ -244,7 +244,7 @@ QueryConfigObjCmd( || val == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("key not known", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CONFIG", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -277,7 +277,7 @@ QueryConfigObjCmd( if (!listPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "insufficient memory to create list", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclDate.c b/generic/tclDate.c index 674f4a0..44d45f9 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -2794,12 +2794,12 @@ TclClockOldscanObjCmd( if (status == 1) { Tcl_SetObjResult(interp, dateInfo.messages); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "PARSE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "PARSE", (void *)NULL); return TCL_ERROR; } else if (status == 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj("memory exhausted", -1)); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } else if (status != 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("Unknown status returned " @@ -2807,7 +2807,7 @@ TclClockOldscanObjCmd( "report this error as a " "bug in Tcl.", -1)); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "BUG", NULL); + Tcl_SetErrorCode(interp, "TCL", "BUG", (void *)NULL); return TCL_ERROR; } Tcl_DecrRefCount(dateInfo.messages); @@ -2815,31 +2815,31 @@ TclClockOldscanObjCmd( if (yyHaveDate > 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj("more than one date in string", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", (void *)NULL); return TCL_ERROR; } if (yyHaveTime > 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj("more than one time of day in string", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", (void *)NULL); return TCL_ERROR; } if (yyHaveZone > 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj("more than one time zone in string", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", (void *)NULL); return TCL_ERROR; } if (yyHaveDay > 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj("more than one weekday in string", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", (void *)NULL); return TCL_ERROR; } if (yyHaveOrdinalMonth > 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj("more than one ordinal month in string", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 78eba87..4e42d31 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -106,7 +106,7 @@ EXTERN int Tcl_WaitForEvent(const Tcl_Time *timePtr); EXTERN int Tcl_AppendAllObjTypes(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 15 */ -EXTERN void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...); +EXTERN void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...) __attribute__((sentinel)); /* 16 */ EXTERN void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, Tcl_Size length); @@ -268,7 +268,7 @@ EXTERN void Tcl_AllowExceptions(Tcl_Interp *interp); EXTERN void Tcl_AppendElement(Tcl_Interp *interp, const char *element); /* 70 */ -EXTERN void Tcl_AppendResult(Tcl_Interp *interp, ...); +EXTERN void Tcl_AppendResult(Tcl_Interp *interp, ...) __attribute__((sentinel)); /* 71 */ EXTERN Tcl_AsyncHandler Tcl_AsyncCreate(Tcl_AsyncProc *proc, void *clientData); @@ -715,7 +715,7 @@ EXTERN int Tcl_SetCommandInfo(Tcl_Interp *interp, /* 227 */ EXTERN void Tcl_SetErrno(int err); /* 228 */ -EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...); +EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...) __attribute__((sentinel)); /* 229 */ EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr); /* 230 */ @@ -820,7 +820,7 @@ EXTERN int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags); /* 260 */ -EXTERN int Tcl_VarEval(Tcl_Interp *interp, ...); +EXTERN int Tcl_VarEval(Tcl_Interp *interp, ...) __attribute__((sentinel)); /* 261 */ TCL_DEPRECATED("No longer in use, changed to macro") void * Tcl_VarTraceInfo(Tcl_Interp *interp, diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 44ee1a9..9e0baea 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -727,7 +727,7 @@ SetDictFromAny( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing value to go with key", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", (void *)NULL); } errorInFindDictElement: DeleteChainTable(dict); @@ -822,7 +822,7 @@ TclTraceDictPath( "key \"%s\" not known in dictionary", TclGetString(keyv[i]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT", - TclGetString(keyv[i]), NULL); + TclGetString(keyv[i]), (void *)NULL); } return NULL; } @@ -1614,7 +1614,7 @@ DictGetCmd( "key \"%s\" not known in dictionary", TclGetString(objv[objc-1]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT", - TclGetString(objv[objc-1]), NULL); + TclGetString(objv[objc-1]), (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, valuePtr); @@ -2491,7 +2491,7 @@ DictForNRCmd( if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "must have exactly two variable names", -1)); - Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "for", NULL); + Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "for", (void *)NULL); return TCL_ERROR; } searchPtr = (Tcl_DictSearch *)TclStackAlloc(interp, sizeof(Tcl_DictSearch)); @@ -2686,7 +2686,7 @@ DictMapNRCmd( if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "must have exactly two variable names", -1)); - Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "map", NULL); + Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "map", (void *)NULL); return TCL_ERROR; } storagePtr = (DictMapStorage *)TclStackAlloc(interp, sizeof(DictMapStorage)); @@ -3126,7 +3126,7 @@ DictFilterCmd( if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "must have exactly two variable names", -1)); - Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "filter", NULL); + Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "filter", (void *)NULL); return TCL_ERROR; } keyVarObj = varv[0]; diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 08f7888..cc13ce9 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -1344,7 +1344,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" isn't a procedure", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROC", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -1394,7 +1394,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -1404,7 +1404,7 @@ Tcl_DisassembleObjCmd( "\"%s\" has no defined constructor", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "CONSRUCTOR", NULL); + "CONSRUCTOR", (void *)NULL); return TCL_ERROR; } procPtr = TclOOGetProcFromMethod(methodPtr); @@ -1412,7 +1412,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "body not available for this kind of constructor", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "METHODTYPE", NULL); + "METHODTYPE", (void *)NULL); return TCL_ERROR; } @@ -1459,7 +1459,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -1469,7 +1469,7 @@ Tcl_DisassembleObjCmd( "\"%s\" has no defined destructor", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "DESRUCTOR", NULL); + "DESRUCTOR", (void *)NULL); return TCL_ERROR; } procPtr = TclOOGetProcFromMethod(methodPtr); @@ -1477,7 +1477,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "body not available for this kind of destructor", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "METHODTYPE", NULL); + "METHODTYPE", (void *)NULL); return TCL_ERROR; } @@ -1524,7 +1524,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } hPtr = Tcl_FindHashEntry(&oPtr->classPtr->classMethods, @@ -1559,7 +1559,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[3]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[3]), NULL); + TclGetString(objv[3]), (void *)NULL); return TCL_ERROR; } procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr)); @@ -1567,7 +1567,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "body not available for this kind of method", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "METHODTYPE", NULL); + "METHODTYPE", (void *)NULL); return TCL_ERROR; } if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) { @@ -1604,7 +1604,7 @@ Tcl_DisassembleObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not disassemble prebuilt bytecode", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE", - "BYTECODE", NULL); + "BYTECODE", (void *)NULL); return TCL_ERROR; } if (clientData) { diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 80a37d2..e461db2 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1292,7 +1292,7 @@ Tcl_ExternalToUtfDStringEx( Tcl_NewStringObj( "Parameter error: TCL_ENCODING_{START,STOP} bits set in flags.", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALFLAGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALFLAGS", (void *)NULL); errno = EINVAL; return TCL_ERROR; } @@ -1345,7 +1345,7 @@ Tcl_ExternalToUtfDStringEx( nBytesProcessed, UCHAR(srcStart[nBytesProcessed]))); Tcl_SetErrorCode( - interp, "TCL", "ENCODING", "ILLEGALSEQUENCE", buf, NULL); + interp, "TCL", "ENCODING", "ILLEGALSEQUENCE", buf, (void *)NULL); } } if (result != TCL_OK) { @@ -1596,7 +1596,7 @@ Tcl_UtfToExternalDStringEx( Tcl_NewStringObj( "Parameter error: TCL_ENCODING_{START,STOP} bits set in flags.", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALFLAGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALFLAGS", (void *)NULL); errno = EINVAL; return TCL_ERROR; } @@ -1651,7 +1651,7 @@ Tcl_UtfToExternalDStringEx( pos, ucs4)); Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALSEQUENCE", - buf, NULL); + buf, (void *)NULL); } } if (result != TCL_OK) { @@ -1900,7 +1900,7 @@ OpenEncodingFileChannel( if ((NULL == chan) && (interp != NULL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown encoding \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ENCODING", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ENCODING", name, (void *)NULL); } Tcl_DecrRefCount(fileNameObj); Tcl_DecrRefCount(nameObj); @@ -1975,7 +1975,7 @@ LoadEncodingFile( if ((encoding == NULL) && (interp != NULL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid encoding file \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ENCODING", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ENCODING", name, (void *)NULL); } Tcl_Close(NULL, chan); @@ -4451,14 +4451,14 @@ TclEncodingProfileNameToId( profileName); for (i = 0; i < (numProfiles - 1); ++i) { Tcl_AppendStringsToObj( - errorObj, " ", encodingProfiles[i].name, ",", NULL); + errorObj, " ", encodingProfiles[i].name, ",", (void *)NULL); } Tcl_AppendStringsToObj( - errorObj, " or ", encodingProfiles[numProfiles-1].name, NULL); + errorObj, " or ", encodingProfiles[numProfiles-1].name, (void *)NULL); Tcl_SetObjResult(interp, errorObj); Tcl_SetErrorCode( - interp, "TCL", "ENCODING", "PROFILE", profileName, NULL); + interp, "TCL", "ENCODING", "PROFILE", profileName, (void *)NULL); } return TCL_ERROR; } @@ -4497,7 +4497,7 @@ TclEncodingProfileIdToName( "Internal error. Bad profile id \"%d\".", profileValue)); Tcl_SetErrorCode( - interp, "TCL", "ENCODING", "PROFILEID", NULL); + interp, "TCL", "ENCODING", "PROFILEID", (void *)NULL); } return NULL; } diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 37531fc..cdc13af 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -171,7 +171,7 @@ TclNamespaceEnsembleCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "tried to manipulate ensemble of deleted namespace", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", (void *)NULL); } return TCL_ERROR; } @@ -289,7 +289,7 @@ TclNamespaceEnsembleCmd( "ensemble subcommand implementations " "must be non-empty lists", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", - "EMPTY_TARGET", NULL); + "EMPTY_TARGET", (void *)NULL); Tcl_DictObjDone(&search); if (patchedDict) { Tcl_DecrRefCount(patchedDict); @@ -305,7 +305,7 @@ TclNamespaceEnsembleCmd( Tcl_Obj *newCmd = NewNsObj((Tcl_Namespace *) nsPtr); if (nsPtr->parentPtr) { - Tcl_AppendStringsToObj(newCmd, "::", NULL); + Tcl_AppendStringsToObj(newCmd, "::", (void *)NULL); } Tcl_AppendObjToObj(newCmd, listv[0]); Tcl_ListObjReplace(NULL, newList, 0, 1, 1, &newCmd); @@ -575,7 +575,7 @@ TclNamespaceEnsembleCmd( "ensemble subcommand implementations " "must be non-empty lists", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", - "EMPTY_TARGET", NULL); + "EMPTY_TARGET", (void *)NULL); Tcl_DictObjDone(&search); if (patchedDict) { Tcl_DecrRefCount(patchedDict); @@ -596,7 +596,7 @@ TclNamespaceEnsembleCmd( Tcl_Obj *newCmd = NewNsObj((Tcl_Namespace*)nsPtr); if (nsPtr->parentPtr) { - Tcl_AppendStringsToObj(newCmd, "::", NULL); + Tcl_AppendStringsToObj(newCmd, "::", (void *)NULL); } Tcl_AppendObjToObj(newCmd, listv[0]); Tcl_ListObjReplace(NULL, newList, 0, 1, 1, @@ -623,7 +623,7 @@ TclNamespaceEnsembleCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "option -namespace is read-only", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "READ_ONLY", - NULL); + (void *)NULL); goto freeMapAndError; case CONF_PREFIX: if (Tcl_GetBooleanFromObj(interp, objv[1], @@ -795,7 +795,7 @@ Tcl_SetEnsembleSubcommandList( if (cmdPtr->objProc != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); return TCL_ERROR; } if (subcmdList != NULL) { @@ -871,7 +871,7 @@ Tcl_SetEnsembleParameterList( if (cmdPtr->objProc != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); return TCL_ERROR; } if (paramList == NULL) { @@ -947,7 +947,7 @@ Tcl_SetEnsembleMappingDict( if (cmdPtr->objProc != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); return TCL_ERROR; } if (mapDict != NULL) { @@ -975,7 +975,7 @@ Tcl_SetEnsembleMappingDict( "ensemble target is not a fully-qualified command", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", - "UNQUALIFIED_TARGET", NULL); + "UNQUALIFIED_TARGET", (void *)NULL); Tcl_DictObjDone(&search); return TCL_ERROR; } @@ -1047,7 +1047,7 @@ Tcl_SetEnsembleUnknownHandler( if (cmdPtr->objProc != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); return TCL_ERROR; } if (unknownList != NULL) { @@ -1113,7 +1113,7 @@ Tcl_SetEnsembleFlags( if (cmdPtr->objProc != TclEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); return TCL_ERROR; } @@ -1190,7 +1190,7 @@ Tcl_GetEnsembleSubcommandList( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1232,7 +1232,7 @@ Tcl_GetEnsembleParameterList( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1274,7 +1274,7 @@ Tcl_GetEnsembleMappingDict( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1315,7 +1315,7 @@ Tcl_GetEnsembleUnknownHandler( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1356,7 +1356,7 @@ Tcl_GetEnsembleFlags( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1397,7 +1397,7 @@ Tcl_GetEnsembleNamespace( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command is not an ensemble", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", (void *)NULL); } return TCL_ERROR; } @@ -1458,7 +1458,7 @@ Tcl_FindEnsemble( "\"%s\" is not an ensemble command", TclGetString(cmdNameObj))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ENSEMBLE", - TclGetString(cmdNameObj), NULL); + TclGetString(cmdNameObj), (void *)NULL); } return NULL; } @@ -1751,7 +1751,7 @@ NsEnsembleImplementationCmdNR( if (!Tcl_InterpDeleted(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "ensemble activated for deleted namespace", -1)); - Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", NULL); + Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", (void *)NULL); } return TCL_ERROR; } @@ -1964,7 +1964,7 @@ NsEnsembleImplementationCmdNR( Tcl_ResetResult(interp); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "SUBCOMMAND", - TclGetString(subObj), NULL); + TclGetString(subObj), (void *)NULL); if (ensemblePtr->subcommandTable.numEntries == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown subcommand \"%s\": namespace %s does not" @@ -2324,7 +2324,7 @@ EnsembleUnknownCallback( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unknown subcommand handler deleted its ensemble", -1)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "UNKNOWN_DELETED", - NULL); + (void *)NULL); } result = TCL_ERROR; } @@ -2388,7 +2388,7 @@ EnsembleUnknownCallback( "ensemble unknown subcommand handler: "); Tcl_AppendObjToErrorInfo(interp, unknownCmd); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "UNKNOWN_RESULT", - NULL); + (void *)NULL); } else { Tcl_AddErrorInfo(interp, "\n (ensemble unknown subcommand handler)"); @@ -2722,7 +2722,7 @@ BuildEnsembleConfig( Tcl_AppendStringsToObj(cmdObj, ensemblePtr->nsPtr->fullName, (ensemblePtr->nsPtr->parentPtr ? "::" : ""), - nsCmdName, NULL); + nsCmdName, (void *)NULL); cmdPrefixObj = Tcl_NewListObj(1, &cmdObj); Tcl_SetHashValue(hPtr, cmdPrefixObj); Tcl_IncrRefCount(cmdPrefixObj); diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 0cf0df1..cd1b5da 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -361,7 +361,7 @@ TclDefaultBgErrorHandlerObjCmd( if (result != TCL_OK || valuePtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing return option \"-level\"", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, valuePtr, &level) == TCL_ERROR) { @@ -374,7 +374,7 @@ TclDefaultBgErrorHandlerObjCmd( if (result != TCL_OK || valuePtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing return option \"-code\"", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, valuePtr, &code) == TCL_ERROR) { @@ -1579,7 +1579,7 @@ Tcl_VwaitObjCmd( Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "argument required for \"%s\"", vWaitOptionStrings[index])); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "ARGUMENT", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "ARGUMENT", (void *)NULL); result = TCL_ERROR; goto done; } @@ -1591,7 +1591,7 @@ Tcl_VwaitObjCmd( Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_NewStringObj( "timeout must be positive", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "NEGTIME", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "NEGTIME", (void *)NULL); result = TCL_ERROR; goto done; } @@ -1671,7 +1671,7 @@ Tcl_VwaitObjCmd( TCL_TIMER_EVENTS | TCL_WINDOW_EVENTS)) == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't wait: would block forever", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_SOURCES", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_SOURCES", (void *)NULL); result = TCL_ERROR; goto done; } @@ -1679,7 +1679,7 @@ Tcl_VwaitObjCmd( if ((timeout > 0) && ((mask & TCL_TIMER_EVENTS) == 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "timer events disabled with timeout specified", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_TIME", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_TIME", (void *)NULL); result = TCL_ERROR; goto done; } @@ -1707,7 +1707,7 @@ Tcl_VwaitObjCmd( if (vwaitItems[i].mask) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "file events disabled with channel(s) specified", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_FILE_EVENT", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_FILE_EVENT", (void *)NULL); result = TCL_ERROR; goto done; } @@ -1746,7 +1746,7 @@ Tcl_VwaitObjCmd( if (Tcl_LimitExceeded(interp)) { Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_NewStringObj("limit exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "LIMIT", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "LIMIT", (void *)NULL); break; } if ((numItems == 0) && (timeout == 0)) { @@ -1766,7 +1766,7 @@ Tcl_VwaitObjCmd( "can't wait: would wait forever" : "can't wait for variable(s)/channel(s): would wait forever", -1)); - Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_SOURCES", NULL); + Tcl_SetErrorCode(interp, "TCL", "EVENT", "NO_SOURCES", (void *)NULL); result = TCL_ERROR; goto done; } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 22dc200..fd955f5 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2434,7 +2434,7 @@ TEBCresume( "yield can only be called in a coroutine", -1)); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", - NULL); + (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -2465,7 +2465,7 @@ TEBCresume( "yieldto can only be called in a coroutine", -1)); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", - NULL); + (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -2476,7 +2476,7 @@ TEBCresume( "yieldto called in deleted namespace", -1)); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "YIELDTO_IN_DELETED", - NULL); + (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -2538,7 +2538,7 @@ TEBCresume( Tcl_SetObjResult(interp, Tcl_NewStringObj( "tailcall can only be called from a proc or lambda", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4155,7 +4155,7 @@ TEBCresume( TclObjVarErrMsg(interp, part1Ptr, NULL, "array set", "variable isn't array", opnd); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", (void *)NULL); CACHE_STACK_INFO(); TRACE_ERROR(interp); goto gotError; @@ -4501,7 +4501,7 @@ TEBCresume( TRACE_ERROR(interp); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "STACK_LEVEL", - TclGetString(OBJ_AT_TOS), NULL); + TclGetString(OBJ_AT_TOS), (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4541,7 +4541,7 @@ TEBCresume( "invalid command name \"%s\"", TclGetString(OBJ_AT_TOS))); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", - TclGetString(OBJ_AT_TOS), NULL); + TclGetString(OBJ_AT_TOS), (void *)NULL); CACHE_STACK_INFO(); TRACE_APPEND(("ERROR: not command\n")); goto gotError; @@ -4570,7 +4570,7 @@ TEBCresume( "self may only be called from inside a method", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4598,7 +4598,7 @@ TEBCresume( "nextto may only be called from inside a method", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4619,7 +4619,7 @@ TEBCresume( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(valuePtr))); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_REQUIRED", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4671,7 +4671,7 @@ TEBCresume( methodType, TclGetString(valuePtr))); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_REACHABLE", - NULL); + (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4679,7 +4679,7 @@ TEBCresume( "%s has no non-filter implementation by \"%s\"", methodType, TclGetString(valuePtr))); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_THERE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_THERE", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4697,7 +4697,7 @@ TEBCresume( "next may only be called from inside a method", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); CACHE_STACK_INFO(); goto gotError; } @@ -4726,7 +4726,7 @@ TEBCresume( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no next %s implementation", methodType)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", (void *)NULL); CACHE_STACK_INFO(); goto gotError; #ifdef TCL_COMPILE_DEBUG @@ -6062,7 +6062,7 @@ TEBCresume( DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "domain error: argument not in valid range", - NULL); + (void *)NULL); CACHE_STACK_INFO(); #endif /* ERROR_CODE_FOR_EARLY_DETECTED_ARITH_ERROR */ goto gotError; @@ -6111,7 +6111,7 @@ TEBCresume( DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "domain error: argument not in valid range", - NULL); + (void *)NULL); CACHE_STACK_INFO(); #endif /* ERROR_CODE_FOR_EARLY_DETECTED_ARITH_ERROR */ goto gotError; @@ -6133,7 +6133,7 @@ TEBCresume( #ifdef ERROR_CODE_FOR_EARLY_DETECTED_ARITH_ERROR DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - "integer value too large to represent", NULL); + "integer value too large to represent", (void *)NULL); CACHE_STACK_INFO(); #endif /* ERROR_CODE_FOR_EARLY_DETECTED_ARITH_ERROR */ goto gotError; @@ -7126,7 +7126,7 @@ TEBCresume( TclGetString(OBJ_AT_TOS))); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT", - TclGetString(OBJ_AT_TOS), NULL); + TclGetString(OBJ_AT_TOS), (void *)NULL); CACHE_STACK_INFO(); TRACE_ERROR(interp); goto gotError; @@ -7831,14 +7831,14 @@ TEBCresume( divideByZero: Tcl_SetObjResult(interp, Tcl_NewStringObj("divide by zero", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", NULL); + Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", (void *)NULL); CACHE_STACK_INFO(); goto gotError; outOfMemory: Tcl_SetObjResult(interp, Tcl_NewStringObj("out of memory", -1)); DECACHE_STACK_INFO(); - Tcl_SetErrorCode(interp, "ARITH", "OUTOFMEMORY", "out of memory", NULL); + Tcl_SetErrorCode(interp, "ARITH", "OUTOFMEMORY", "out of memory", (void *)NULL); CACHE_STACK_INFO(); goto gotError; @@ -7852,7 +7852,7 @@ TEBCresume( "exponentiation of zero by negative power", -1)); DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", - "exponentiation of zero by negative power", NULL); + "exponentiation of zero by negative power", (void *)NULL); CACHE_STACK_INFO(); /* @@ -9405,7 +9405,7 @@ IllegalExprOperandType( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use %s \"%s\" as operand of \"%s\"", description, TclGetString(opndPtr), op)); - Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL); + Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, (void *)NULL); } /* @@ -9783,23 +9783,23 @@ TclExprFloatError( if ((errno == EDOM) || isnan(value)) { s = "domain error: argument not in valid range"; Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); - Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, (void *)NULL); } else if ((errno == ERANGE) || isinf(value)) { if (value == 0.0) { s = "floating-point value too small to represent"; Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); - Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, (void *)NULL); } else { s = "floating-point value too large to represent"; Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); - Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, (void *)NULL); } } else { Tcl_Obj *objPtr = Tcl_ObjPrintf( "unknown floating-point error, errno = %d", errno); Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", - TclGetString(objPtr), NULL); + TclGetString(objPtr), (void *)NULL); Tcl_SetObjResult(interp, objPtr); } } diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 1ad7e1a..8ca0c88 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1080,7 +1080,7 @@ TclFileAttrsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\", there are no file attributes in this" " filesystem", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL); + Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", (void *)NULL); goto end; } @@ -1104,7 +1104,7 @@ TclFileAttrsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\", there are no file attributes in this" " filesystem", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL); + Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", (void *)NULL); goto end; } @@ -1117,7 +1117,7 @@ TclFileAttrsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", TclGetString(objv[i]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FATTR", - "NOVALUE", NULL); + "NOVALUE", (void *)NULL); goto end; } if (Tcl_FSFileAttrsSet(interp, index, filePtr, diff --git a/generic/tclFileName.c b/generic/tclFileName.c index f23b468..92d325f 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1172,7 +1172,7 @@ DoTildeSubst( Tcl_SetObjResult(interp, Tcl_NewStringObj( "couldn't find HOME environment " "variable to expand path", -1)); - Tcl_SetErrorCode(interp, "TCL", "FILENAME", "NO_HOME", NULL); + Tcl_SetErrorCode(interp, "TCL", "FILENAME", "NO_HOME", (void *)NULL); } return NULL; } @@ -1183,7 +1183,7 @@ DoTildeSubst( Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "user \"%s\" doesn't exist", user)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "USER", user, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "USER", user, (void *)NULL); } return NULL; } @@ -1265,7 +1265,7 @@ Tcl_GlobObjCmd( if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing argument to \"-directory\"", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); return TCL_ERROR; } if (dir != PATH_NONE) { @@ -1275,7 +1275,7 @@ Tcl_GlobObjCmd( : "\"-directory\" cannot be used with \"-path\"", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", - "BADOPTIONCOMBINATION", NULL); + "BADOPTIONCOMBINATION", (void *)NULL); return TCL_ERROR; } dir = PATH_DIR; @@ -1293,7 +1293,7 @@ Tcl_GlobObjCmd( if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing argument to \"-path\"", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); return TCL_ERROR; } if (dir != PATH_NONE) { @@ -1303,7 +1303,7 @@ Tcl_GlobObjCmd( : "\"-path\" cannot be used with \"-dictionary\"", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", - "BADOPTIONCOMBINATION", NULL); + "BADOPTIONCOMBINATION", (void *)NULL); return TCL_ERROR; } dir = PATH_GENERAL; @@ -1314,7 +1314,7 @@ Tcl_GlobObjCmd( if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing argument to \"-types\"", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", (void *)NULL); return TCL_ERROR; } typePtr = objv[i+1]; @@ -1335,7 +1335,7 @@ Tcl_GlobObjCmd( "\"-tails\" must be used with either " "\"-directory\" or \"-path\"", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", - "BADOPTIONCOMBINATION", NULL); + "BADOPTIONCOMBINATION", (void *)NULL); return TCL_ERROR; } @@ -1548,7 +1548,7 @@ Tcl_GlobObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument to \"-types\": %s", Tcl_GetString(look))); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", (void *)NULL); result = TCL_ERROR; join = 0; goto endOfGlob; @@ -1558,7 +1558,7 @@ Tcl_GlobObjCmd( "only one MacOS type or creator argument" " to \"-types\" allowed", -1)); result = TCL_ERROR; - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", (void *)NULL); join = 0; goto endOfGlob; } @@ -1650,7 +1650,7 @@ Tcl_GlobObjCmd( Tcl_AppendToObj(errorMsg, "\"", -1); Tcl_SetObjResult(interp, errorMsg); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "NOMATCH", - NULL); + (void *)NULL); result = TCL_ERROR; } } @@ -2218,14 +2218,14 @@ DoGlob( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unmatched open-brace in file name", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BALANCE", - NULL); + (void *)NULL); return TCL_ERROR; } else if (*p == '}') { Tcl_SetObjResult(interp, Tcl_NewStringObj( "unmatched close-brace in file name", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BALANCE", - NULL); + (void *)NULL); return TCL_ERROR; } } diff --git a/generic/tclIO.c b/generic/tclIO.c index 2e25d2d..d79397b 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -1468,7 +1468,7 @@ Tcl_GetChannel( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can not find channel named \"%s\"", chanName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanName, (void *)NULL); return NULL; } @@ -9881,12 +9881,12 @@ CopyData( if (interp) { TclNewObj(errObj); Tcl_AppendStringsToObj(errObj, "error reading \"", - Tcl_GetChannelName(inChan), "\": ", NULL); + Tcl_GetChannelName(inChan), "\": ", (void *)NULL); if (msg != NULL) { Tcl_AppendObjToObj(errObj, msg); } else { Tcl_AppendStringsToObj(errObj, Tcl_PosixError(interp), - NULL); + (void *)NULL); } } if (msg != NULL) { @@ -9962,12 +9962,12 @@ CopyData( if (interp) { TclNewObj(errObj); Tcl_AppendStringsToObj(errObj, "error writing \"", - Tcl_GetChannelName(outChan), "\": ", NULL); + Tcl_GetChannelName(outChan), "\": ", (void *)NULL); if (msg != NULL) { Tcl_AppendObjToObj(errObj, msg); } else { Tcl_AppendStringsToObj(errObj, Tcl_PosixError(interp), - NULL); + (void *)NULL); } } if (msg != NULL) { diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 5a0a8da..938fa01 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -446,7 +446,7 @@ Tcl_ReadObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected non-negative integer but got \"%s\"", TclGetString(objv[i]))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (void *)NULL); return TCL_ERROR; #if !defined(TCL_NO_DEPRECATED) } diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 629c8cc..e342126 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -881,7 +881,7 @@ TclChanPostEventObjCmd( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can not find reflected channel named \"%s\"", chanId)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanId, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanId, (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 2986949..2cb22f5 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -2051,7 +2051,7 @@ Tcl_PosixError( msg = Tcl_ErrnoMsg(errno); id = Tcl_ErrnoId(); if (interp) { - Tcl_SetErrorCode(interp, "POSIX", id, msg, NULL); + Tcl_SetErrorCode(interp, "POSIX", id, msg, (void *)NULL); } return msg; } diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 537a600..efa29eb 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -399,29 +399,29 @@ Tcl_GetIndexFromObjStruct( } Tcl_AppendStringsToObj(resultPtr, (numAbbrev>1 && !(flags & TCL_EXACT) ? "ambiguous " : "bad "), - msg, " \"", key, NULL); + msg, " \"", key, (void *)NULL); if (*entryPtr == NULL) { - Tcl_AppendStringsToObj(resultPtr, "\": no valid options", NULL); + Tcl_AppendStringsToObj(resultPtr, "\": no valid options", (void *)NULL); } else { Tcl_AppendStringsToObj(resultPtr, "\": must be ", - *entryPtr, NULL); + *entryPtr, (void *)NULL); entryPtr = NEXT_ENTRY(entryPtr, offset); while (*entryPtr != NULL) { if ((*NEXT_ENTRY(entryPtr, offset) == NULL) && !(flags & TCL_NULL_OK)) { Tcl_AppendStringsToObj(resultPtr, (count > 0 ? "," : ""), - " or ", *entryPtr, NULL); + " or ", *entryPtr, (void *)NULL); } else if (**entryPtr) { - Tcl_AppendStringsToObj(resultPtr, ", ", *entryPtr, NULL); + Tcl_AppendStringsToObj(resultPtr, ", ", *entryPtr, (void *)NULL); count++; } entryPtr = NEXT_ENTRY(entryPtr, offset); } if ((flags & TCL_NULL_OK)) { - Tcl_AppendStringsToObj(resultPtr, ", or \"\"", NULL); + Tcl_AppendStringsToObj(resultPtr, ", or \"\"", (void *)NULL); } } Tcl_SetObjResult(interp, resultPtr); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", msg, key, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", msg, key, (void *)NULL); } return TCL_ERROR; } @@ -599,7 +599,7 @@ PrefixMatchObjCmd( if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing value for -message", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (void *)NULL); return TCL_ERROR; } i++; @@ -609,7 +609,7 @@ PrefixMatchObjCmd( if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing value for -error", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (void *)NULL); return TCL_ERROR; } i++; @@ -621,7 +621,7 @@ PrefixMatchObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "error options must have an even number of elements", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", (void *)NULL); return TCL_ERROR; } errorPtr = objv[i]; @@ -980,7 +980,7 @@ Tcl_WrongNumArgs( */ if (i + 1 < toPrint || objc!=0 || message!=NULL) { - Tcl_AppendStringsToObj(objPtr, " ", NULL); + Tcl_AppendStringsToObj(objPtr, " ", (void *)NULL); } } } @@ -1002,7 +1002,7 @@ Tcl_WrongNumArgs( if ((irPtr = TclFetchInternalRep(objv[i], &tclIndexType))) { IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; - Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL); + Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), (void *)NULL); } else { /* * Quote the argument if it contains spaces (Bug 942757). @@ -1032,7 +1032,7 @@ Tcl_WrongNumArgs( */ if (i + 1 < objc || message!=NULL) { - Tcl_AppendStringsToObj(objPtr, " ", NULL); + Tcl_AppendStringsToObj(objPtr, " ", (void *)NULL); } } @@ -1043,10 +1043,10 @@ Tcl_WrongNumArgs( */ if (message != NULL) { - Tcl_AppendStringsToObj(objPtr, message, NULL); + Tcl_AppendStringsToObj(objPtr, message, (void *)NULL); } - Tcl_AppendStringsToObj(objPtr, "\"", NULL); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_AppendStringsToObj(objPtr, "\"", (void *)NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL); Tcl_SetObjResult(interp, objPtr); #undef MAY_QUOTE_WORD #undef AFTER_FIRST_WORD @@ -1463,7 +1463,7 @@ TclGetCompletionCodeFromObj( "bad completion code \"%s\": must be" " ok, error, return, break, continue, or an integer", TclGetString(value))); - Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_CODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_CODE", (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 31ecea0..ed3c527 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -869,7 +869,7 @@ NRInterpCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot delete the current interpreter", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "DELETESELF", NULL); + "DELETESELF", (void *)NULL); return TCL_ERROR; } iiPtr = (InterpInfo *) ((Interp *) childInterp)->interpInfo; @@ -1113,7 +1113,7 @@ NRInterpCmd( "alias \"%s\" in path \"%s\" not found", aliasName, TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, - NULL); + (void *)NULL); return TCL_ERROR; } aliasPtr = (Alias *)Tcl_GetHashValue(hPtr); @@ -1122,7 +1122,7 @@ NRInterpCmd( "target interpreter for alias \"%s\" in path \"%s\" is " "not my descendant", aliasName, Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "TARGETSHROUDED", NULL); + "TARGETSHROUDED", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1302,7 +1302,7 @@ Tcl_GetAlias( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "alias \"%s\" not found", aliasName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, (void *)NULL); return TCL_ERROR; } aliasPtr = (Alias *)Tcl_GetHashValue(hPtr); @@ -1364,7 +1364,7 @@ Tcl_GetAliasObj( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "alias \"%s\" not found", aliasName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, (void *)NULL); return TCL_ERROR; } aliasPtr = (Alias *)Tcl_GetHashValue(hPtr); @@ -1471,7 +1471,7 @@ TclPreventAliasLoop( "cannot define or rename alias \"%s\": would create a loop", Tcl_GetCommandName(cmdInterp, cmd))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "ALIASLOOP", NULL); + "ALIASLOOP", (void *)NULL); return TCL_ERROR; } @@ -1692,7 +1692,7 @@ AliasDelete( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "alias \"%s\" not found", TclGetString(namePtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", - TclGetString(namePtr), NULL); + TclGetString(namePtr), (void *)NULL); return TCL_ERROR; } aliasPtr = (Alias *)Tcl_GetHashValue(hPtr); @@ -2344,7 +2344,7 @@ GetInterp( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not find interpreter \"%s\"", TclGetString(pathPtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INTERP", - TclGetString(pathPtr), NULL); + TclGetString(pathPtr), (void *)NULL); } return searchInterp; } @@ -2382,7 +2382,7 @@ ChildBgerror( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cmdPrefix must be list of length >= 1", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BGERRORFORMAT", NULL); + "BGERRORFORMAT", (void *)NULL); return TCL_ERROR; } TclSetBgErrorHandler(childInterp, objv[0]); @@ -2954,7 +2954,7 @@ ChildExpose( "permission denied: safe interpreter cannot expose commands", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -2999,7 +2999,7 @@ ChildRecursionLimit( Tcl_SetObjResult(interp, Tcl_NewStringObj("permission denied: " "safe interpreters cannot change recursion limit", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", - NULL); + (void *)NULL); return TCL_ERROR; } if (TclGetIntFromObj(interp, objv[0], &limit) == TCL_ERROR) { @@ -3009,7 +3009,7 @@ ChildRecursionLimit( Tcl_SetObjResult(interp, Tcl_NewStringObj( "recursion limit must be > 0", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADLIMIT", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_SetRecursionLimit(childInterp, limit); @@ -3017,7 +3017,7 @@ ChildRecursionLimit( if (interp == childInterp && iPtr->numLevels > limit) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "falling back due to new recursion limit", -1)); - Tcl_SetErrorCode(interp, "TCL", "RECURSION", NULL); + Tcl_SetErrorCode(interp, "TCL", "RECURSION", (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, objv[0]); @@ -3060,7 +3060,7 @@ ChildHide( "permission denied: safe interpreter cannot hide commands", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -3145,7 +3145,7 @@ ChildInvokeHidden( "not allowed to invoke hidden commands from safe interpreter", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -3222,7 +3222,7 @@ ChildMarkTrusted( "permission denied: safe interpreter cannot mark trusted", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", - NULL); + (void *)NULL); return TCL_ERROR; } ((Interp *) childInterp)->flags &= ~SAFE_INTERP; @@ -3476,7 +3476,7 @@ Tcl_LimitCheck( } else if (iPtr->limit.exceeded & TCL_LIMIT_COMMANDS) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "command count limit exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "LIMIT", "COMMANDS", NULL); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "COMMANDS", (void *)NULL); Tcl_Release(interp); return TCL_ERROR; } @@ -3502,7 +3502,7 @@ Tcl_LimitCheck( } else if (iPtr->limit.exceeded & TCL_LIMIT_TIME) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "time limit exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "LIMIT", "TIME", NULL); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "TIME", (void *)NULL); Tcl_Release(interp); return TCL_ERROR; } @@ -4514,7 +4514,7 @@ ChildCommandLimitCmd( if (interp == childInterp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "limits on current interpreter inaccessible", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", (void *)NULL); return TCL_ERROR; } @@ -4614,7 +4614,7 @@ ChildCommandLimitCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "granularity must be at least 1", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADVALUE", NULL); + "BADVALUE", (void *)NULL); return TCL_ERROR; } break; @@ -4631,7 +4631,7 @@ ChildCommandLimitCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "command limit value must be at least 0", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADVALUE", NULL); + "BADVALUE", (void *)NULL); return TCL_ERROR; } break; @@ -4703,7 +4703,7 @@ ChildTimeLimitCmd( if (interp == childInterp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "limits on current interpreter inaccessible", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", (void *)NULL); return TCL_ERROR; } @@ -4824,7 +4824,7 @@ ChildTimeLimitCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "granularity must be at least 1", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADVALUE", NULL); + "BADVALUE", (void *)NULL); return TCL_ERROR; } break; @@ -4841,7 +4841,7 @@ ChildTimeLimitCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "milliseconds must be between 0 and %ld", LONG_MAX)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADVALUE", NULL); + "BADVALUE", (void *)NULL); return TCL_ERROR; } limitMoment.usec = ((long)tmp)*1000; @@ -4859,7 +4859,7 @@ ChildTimeLimitCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "seconds must be between 0 and %ld", LONG_MAX)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADVALUE", NULL); + "BADVALUE", (void *)NULL); return TCL_ERROR; } limitMoment.sec = (long)tmp; @@ -4878,7 +4878,7 @@ ChildTimeLimitCmd( "may only set -milliseconds if -seconds is not " "also being reset", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADUSAGE", NULL); + "BADUSAGE", (void *)NULL); return TCL_ERROR; } if (milliLen == 0 && (secObj == NULL || secLen > 0)) { @@ -4886,7 +4886,7 @@ ChildTimeLimitCmd( "may only reset -milliseconds if -seconds is " "also being reset", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", - "BADUSAGE", NULL); + "BADUSAGE", (void *)NULL); return TCL_ERROR; } } diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 150de6d..d9f13d0 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -495,7 +495,7 @@ MemoryAllocationError( "list construction failed: unable to alloc %" TCL_LL_MODIFIER "u bytes", (Tcl_WideInt)size)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return TCL_ERROR; } @@ -522,7 +522,7 @@ ListLimitExceededError(Tcl_Interp *interp) Tcl_SetObjResult( interp, Tcl_NewStringObj("max length of a Tcl list exceeded", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return TCL_ERROR; } @@ -2948,7 +2948,7 @@ TclLsetFlat( "VALUE", "INDEX" "OUTOFRANGE", - NULL); + (void *)NULL); } result = TCL_ERROR; break; @@ -3138,7 +3138,7 @@ TclListObjSetElement( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "index \"%" TCL_SIZE_MODIFIER "u\" out of range", index)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", - "OUTOFRANGE", NULL); + "OUTOFRANGE", (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclLoad.c b/generic/tclLoad.c index ee1862d..05883ba 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -198,7 +198,7 @@ Tcl_LoadObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "must specify either file name or prefix", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "NOLIBRARY", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -266,7 +266,7 @@ Tcl_LoadObjCmd( "file \"%s\" is already loaded for prefix \"%s\"", fullFileName, libraryPtr->prefix)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", - "SPLITPERSONALITY", NULL); + "SPLITPERSONALITY", (void *)NULL); code = TCL_ERROR; Tcl_MutexUnlock(&libraryMutex); goto done; @@ -303,7 +303,7 @@ Tcl_LoadObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no library with prefix \"%s\" is loaded statically", prefix)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "NOTSTATIC", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -366,7 +366,7 @@ Tcl_LoadObjCmd( "couldn't figure out prefix for %s", fullFileName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", - "WHATLIBRARY", NULL); + "WHATLIBRARY", (void *)NULL); code = TCL_ERROR; goto done; } @@ -462,7 +462,7 @@ Tcl_LoadObjCmd( "can't use library in a safe interpreter: no" " %s_SafeInit procedure", libraryPtr->prefix)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "UNSAFE", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -473,7 +473,7 @@ Tcl_LoadObjCmd( "can't attach library to interpreter: no %s_Init procedure", libraryPtr->prefix)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "ENTRYPOINT", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -635,7 +635,7 @@ Tcl_UnloadObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "must specify either file name or prefix", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NOLIBRARY", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -705,7 +705,7 @@ Tcl_UnloadObjCmd( "library with prefix \"%s\" is loaded statically and cannot be unloaded", prefix)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "STATIC", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -717,7 +717,7 @@ Tcl_UnloadObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "file \"%s\" has never been loaded", fullFileName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NEVERLOADED", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -747,7 +747,7 @@ Tcl_UnloadObjCmd( "file \"%s\" has never been loaded in this interpreter", fullFileName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NEVERLOADED", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -810,7 +810,7 @@ UnloadLibrary( "file \"%s\" cannot be unloaded under a safe interpreter", fullFileName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "CANNOT", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } @@ -823,7 +823,7 @@ UnloadLibrary( "file \"%s\" cannot be unloaded under a trusted interpreter", fullFileName)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "CANNOT", - NULL); + (void *)NULL); code = TCL_ERROR; goto done; } diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index aea397e..24d9646 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -720,7 +720,7 @@ Tcl_CreateNamespace( Tcl_SetObjResult(interp, Tcl_NewStringObj("can't create namespace" " \"\": only global namespace can have empty name", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NAMESPACE", - "CREATEGLOBAL", NULL); + "CREATEGLOBAL", (void *)NULL); Tcl_DStringFree(&tmpBuffer); return NULL; } @@ -759,7 +759,7 @@ Tcl_CreateNamespace( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create namespace \"%s\": already exists", name)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NAMESPACE", - "CREATEEXISTING", NULL); + "CREATEEXISTING", (void *)NULL); Tcl_DStringFree(&tmpBuffer); return NULL; } @@ -1439,7 +1439,7 @@ Tcl_Export( if ((exportNsPtr != nsPtr) || (strcmp(pattern, simplePattern) != 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("invalid export pattern" " \"%s\": pattern can't specify a namespace", pattern)); - Tcl_SetErrorCode(interp, "TCL", "EXPORT", "INVALID", NULL); + Tcl_SetErrorCode(interp, "TCL", "EXPORT", "INVALID", (void *)NULL); return TCL_ERROR; } @@ -1645,7 +1645,7 @@ Tcl_Import( if (strlen(pattern) == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("empty import pattern",-1)); - Tcl_SetErrorCode(interp, "TCL", "IMPORT", "EMPTY", NULL); + Tcl_SetErrorCode(interp, "TCL", "IMPORT", "EMPTY", (void *)NULL); return TCL_ERROR; } TclGetNamespaceForQualName(interp, pattern, nsPtr, TCL_NAMESPACE_ONLY, @@ -1654,7 +1654,7 @@ Tcl_Import( if (importNsPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown namespace in import pattern \"%s\"", pattern)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", pattern, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", pattern, (void *)NULL); return TCL_ERROR; } if (importNsPtr == nsPtr) { @@ -1662,12 +1662,12 @@ Tcl_Import( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no namespace specified in import pattern \"%s\"", pattern)); - Tcl_SetErrorCode(interp, "TCL", "IMPORT", "ORIGIN", NULL); + Tcl_SetErrorCode(interp, "TCL", "IMPORT", "ORIGIN", (void *)NULL); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "import pattern \"%s\" tries to import from namespace" " \"%s\" into itself", pattern, importNsPtr->name)); - Tcl_SetErrorCode(interp, "TCL", "IMPORT", "SELF", NULL); + Tcl_SetErrorCode(interp, "TCL", "IMPORT", "SELF", (void *)NULL); } return TCL_ERROR; } @@ -1790,7 +1790,7 @@ DoImport( " containing command \"%s\"", pattern, Tcl_DStringValue(&ds))); Tcl_DStringFree(&ds); - Tcl_SetErrorCode(interp, "TCL", "IMPORT", "LOOP", NULL); + Tcl_SetErrorCode(interp, "TCL", "IMPORT", "LOOP", (void *)NULL); return TCL_ERROR; } } @@ -1832,7 +1832,7 @@ DoImport( } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't import command \"%s\": already exists", cmdName)); - Tcl_SetErrorCode(interp, "TCL", "IMPORT", "OVERWRITE", NULL); + Tcl_SetErrorCode(interp, "TCL", "IMPORT", "OVERWRITE", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1902,7 +1902,7 @@ Tcl_ForgetImport( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown namespace in namespace forget pattern \"%s\"", pattern)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", pattern, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", pattern, (void *)NULL); return TCL_ERROR; } @@ -2537,7 +2537,7 @@ Tcl_FindNamespace( if (flags & TCL_LEAVE_ERR_MSG) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown namespace \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", name, (void *)NULL); } return NULL; } @@ -2727,7 +2727,7 @@ Tcl_FindCommand( if (flags & TCL_LEAVE_ERR_MSG) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown command \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", name, (void *)NULL); } return NULL; } @@ -2921,7 +2921,7 @@ TclGetNamespaceFromObj( "namespace \"%s\" not found in \"%s\"", name, Tcl_GetStringResult(interp))); } - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", name, (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -3313,7 +3313,7 @@ NamespaceDeleteCmd( "unknown namespace \"%s\" in namespace delete command", TclGetString(objv[i]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "NAMESPACE", - TclGetString(objv[i]), NULL); + TclGetString(objv[i]), (void *)NULL); return TCL_ERROR; } } @@ -3947,7 +3947,7 @@ NamespaceOriginCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid command name \"%s\"", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, resultPtr); diff --git a/generic/tclOO.c b/generic/tclOO.c index 624ea8f..a65dc8f 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -1865,7 +1865,7 @@ TclNewObjectInstanceCommon( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create object \"%s\": command already exists with" " that name", nameStr)); - Tcl_SetErrorCode(interp, "TCL", "OO", "OVERWRITE_OBJECT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "OVERWRITE_OBJECT", (void *)NULL); return NULL; } } @@ -1919,7 +1919,7 @@ FinalizeAlloc( if (result != TCL_ERROR && Destructing(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "object deleted in constructor", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", (void *)NULL); result = TCL_ERROR; } if (result != TCL_OK) { @@ -1990,7 +1990,7 @@ Tcl_CopyObjectInstance( if (IsRootClass(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not clone the class of classes", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "CLONING_CLASS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CLONING_CLASS", (void *)NULL); return NULL; } @@ -2755,7 +2755,7 @@ TclOOObjectCmdCore( "impossible to invoke method \"%s\": no defined method or" " unknown method", TclGetString(methodNamePtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD_MAPPED", - TclGetString(methodNamePtr), NULL); + TclGetString(methodNamePtr), (void *)NULL); return TCL_ERROR; } } else { @@ -2772,7 +2772,7 @@ TclOOObjectCmdCore( "impossible to invoke method \"%s\": no defined method or" " unknown method", TclGetString(methodNamePtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(methodNamePtr), NULL); + TclGetString(methodNamePtr), (void *)NULL); return TCL_ERROR; } } @@ -2799,7 +2799,7 @@ TclOOObjectCmdCore( Tcl_SetObjResult(interp, Tcl_NewStringObj( "no valid method implementation", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(methodNamePtr), NULL); + TclGetString(methodNamePtr), (void *)NULL); TclOODeleteContext(contextPtr); return TCL_ERROR; } @@ -2880,7 +2880,7 @@ Tcl_ObjectContextInvokeNext( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no next %s implementation", methodType)); - Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", (void *)NULL); return TCL_ERROR; } @@ -2949,7 +2949,7 @@ TclNRObjectContextInvokeNext( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no next %s implementation", methodType)); - Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "NOTHING_NEXT", (void *)NULL); return TCL_ERROR; } @@ -3028,7 +3028,7 @@ Tcl_GetObjectFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s does not refer to an object", TclGetString(objPtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "OBJECT", TclGetString(objPtr), - NULL); + (void *)NULL); return NULL; } diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index 9b72060..82aad22 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -195,7 +195,7 @@ TclOO_Class_Create( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "object \"%s\" is not a class", TclGetString(cmdnameObj))); - Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", (void *)NULL); return TCL_ERROR; } @@ -213,7 +213,7 @@ TclOO_Class_Create( if (len == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "object name must not be empty", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", (void *)NULL); return TCL_ERROR; } @@ -260,7 +260,7 @@ TclOO_Class_CreateNs( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "object \"%s\" is not a class", TclGetString(cmdnameObj))); - Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", (void *)NULL); return TCL_ERROR; } @@ -278,7 +278,7 @@ TclOO_Class_CreateNs( if (len == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "object name must not be empty", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", (void *)NULL); return TCL_ERROR; } nsName = TclGetStringFromObj( @@ -286,7 +286,7 @@ TclOO_Class_CreateNs( if (len == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "namespace name must not be empty", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "EMPTY_NAME", (void *)NULL); return TCL_ERROR; } @@ -331,7 +331,7 @@ TclOO_Class_New( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "object \"%s\" is not a class", TclGetString(cmdnameObj))); - Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "INSTANTIATE_NONCLASS", (void *)NULL); return TCL_ERROR; } @@ -589,7 +589,7 @@ TclOO_Object_Unknown( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "object \"%s\" has no %s", TclGetString(tmpBuf), piece)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[skip]), NULL); + TclGetString(objv[skip]), (void *)NULL); return TCL_ERROR; } @@ -608,7 +608,7 @@ TclOO_Object_Unknown( ckfree(methodNames); Tcl_SetObjResult(interp, errorMsg); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[skip]), NULL); + TclGetString(objv[skip]), (void *)NULL); return TCL_ERROR; } @@ -665,7 +665,7 @@ TclOO_Object_LinkVar( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "variable name \"%s\" illegal: must not contain namespace" " separator", varName)); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "INVERTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "INVERTED", (void *)NULL); return TCL_ERROR; } @@ -694,7 +694,7 @@ TclOO_Object_LinkVar( TclVarErrMsg(interp, varName, NULL, "define", "name refers to an element in an array"); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", (void *)NULL); return TCL_ERROR; } @@ -822,7 +822,7 @@ TclOO_Object_VarName( TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG, "refer to", 1, 1, &aryVar); Tcl_DecrRefCount(varNamePtr); if (varPtr == NULL) { - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", arg, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", arg, (void *)NULL); return TCL_ERROR; } @@ -883,7 +883,7 @@ TclOONextObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s may only be called from inside a method", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); return TCL_ERROR; } context = (Tcl_ObjectContext)framePtr->clientData; @@ -923,7 +923,7 @@ TclOONextToObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s may only be called from inside a method", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); return TCL_ERROR; } contextPtr = (CallContext *)framePtr->clientData; @@ -944,7 +944,7 @@ TclOONextToObjCmd( if (classPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(objv[1]))); - Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_REQUIRED", (void *)NULL); return TCL_ERROR; } @@ -993,14 +993,14 @@ TclOONextToObjCmd( "%s implementation by \"%s\" not reachable from here", methodType, TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_REACHABLE", - NULL); + (void *)NULL); return TCL_ERROR; } } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s has no non-filter implementation by \"%s\"", methodType, TclGetString(objv[1]))); - Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_THERE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CLASS_NOT_THERE", (void *)NULL); return TCL_ERROR; } @@ -1063,7 +1063,7 @@ TclOOSelfObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s may only be called from inside a method", TclGetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); return TCL_ERROR; } @@ -1098,7 +1098,7 @@ TclOOSelfObjCmd( if (clsPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "method not defined by a class", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", (void *)NULL); return TCL_ERROR; } @@ -1119,7 +1119,7 @@ TclOOSelfObjCmd( if (!CurrentlyInvoked(contextPtr).isFilter) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not inside a filtering context", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", (void *)NULL); return TCL_ERROR; } else { struct MInvoke *miPtr = &CurrentlyInvoked(contextPtr); @@ -1145,7 +1145,7 @@ TclOOSelfObjCmd( !(framePtr->callerVarPtr->isProcCallFrame & FRAME_IS_METHOD)){ Tcl_SetObjResult(interp, Tcl_NewStringObj( "caller is not an object", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", (void *)NULL); return TCL_ERROR; } else { CallContext *callerPtr = (CallContext *)framePtr->callerVarPtr->clientData; @@ -1213,7 +1213,7 @@ TclOOSelfObjCmd( if (!CurrentlyInvoked(contextPtr).isFilter) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not inside a filtering context", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "UNMATCHED_CONTEXT", (void *)NULL); return TCL_ERROR; } else { Method *mPtr; diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 3b849ea..034c877 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -635,7 +635,7 @@ RenameDeleteMethod( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "method %s does not exist", TclGetString(fromPtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(fromPtr), NULL); + TclGetString(fromPtr), (void *)NULL); return TCL_ERROR; } hPtr = Tcl_FindHashEntry(oPtr->methodsPtr, (char *) fromPtr); @@ -649,14 +649,14 @@ RenameDeleteMethod( renameToSelf: Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot rename method to itself", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "RENAME_TO_SELF", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "RENAME_TO_SELF", (void *)NULL); return TCL_ERROR; } else if (!isNew) { renameToExisting: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "method called %s already exists", TclGetString(toPtr))); - Tcl_SetErrorCode(interp, "TCL", "OO", "RENAME_OVER", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "RENAME_OVER", (void *)NULL); return TCL_ERROR; } } @@ -726,7 +726,7 @@ TclOOUnknownDefinition( if (objc < 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad call of unknown handler", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_UNKNOWN", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_UNKNOWN", (void *)NULL); return TCL_ERROR; } if (TclOOGetDefineCmdContext(interp) == NULL) { @@ -773,7 +773,7 @@ TclOOUnknownDefinition( noMatch: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid command name \"%s\"", soughtStr)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", soughtStr, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND", soughtStr, (void *)NULL); return TCL_ERROR; } @@ -863,7 +863,7 @@ InitDefineContext( if (namespacePtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no definition namespace available", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -904,7 +904,7 @@ TclOOGetDefineCmdContext( Tcl_SetObjResult(interp, Tcl_NewStringObj( "this command may only be called from within the context of" " an ::oo::define or ::oo::objdefine command", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return NULL; } object = (Tcl_Object)iPtr->varFramePtr->clientData; @@ -912,7 +912,7 @@ TclOOGetDefineCmdContext( Tcl_SetObjResult(interp, Tcl_NewStringObj( "this command cannot be called when the object has been" " deleted", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return NULL; } return object; @@ -956,7 +956,7 @@ GetClassInOuterContext( if (oPtr->classPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(className), NULL); + TclGetString(className), (void *)NULL); return NULL; } return oPtr->classPtr; @@ -1131,7 +1131,7 @@ TclOODefineObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s does not refer to a class", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(objv[1]), NULL); + TclGetString(objv[1]), (void *)NULL); return TCL_ERROR; } @@ -1453,13 +1453,13 @@ TclOODefineClassObjCmd( if (oPtr->flags & ROOT_OBJECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not modify the class of the root object class", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } if (oPtr->flags & ROOT_CLASS) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not modify the class of the class of classes", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -1479,7 +1479,7 @@ TclOODefineClassObjCmd( if (oPtr == clsPtr->thisPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not change classes into an instance of themselves", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -1632,14 +1632,14 @@ TclOODefineDefnNsObjCmd( if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } if (oPtr->flags & (ROOT_OBJECT | ROOT_CLASS)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not modify the definition namespace of the root classes", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -1716,7 +1716,7 @@ TclOODefineDeleteMethodObjCmd( if (!isInstanceDeleteMethod && !oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -1842,7 +1842,7 @@ TclOODefineExportObjCmd( if (!isInstanceExport && !clsPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -1936,7 +1936,7 @@ TclOODefineForwardObjCmd( if (!isInstanceForward && !oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } isPublic = Tcl_StringMatch(TclGetString(objv[1]), PUBLIC_PATTERN) @@ -2014,7 +2014,7 @@ TclOODefineMethodObjCmd( if (!isInstanceMethod && !oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } if (objc == 5) { @@ -2093,7 +2093,7 @@ TclOODefineRenameMethodObjCmd( if (!isInstanceRenameMethod && !oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2155,7 +2155,7 @@ TclOODefineUnexportObjCmd( if (!isInstanceUnexport && !clsPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2351,7 +2351,7 @@ ClassFilterGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2387,7 +2387,7 @@ ClassFilterSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (TclListObjGetElementsM(interp, objv[0], &filterc, &filterv) != TCL_OK) { @@ -2432,7 +2432,7 @@ ClassMixinGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2471,7 +2471,7 @@ ClassMixinSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (TclListObjGetElementsM(interp, objv[0], &mixinc, &mixinv) != TCL_OK) { @@ -2490,7 +2490,7 @@ ClassMixinSet( if (TclOOIsReachable(oPtr->classPtr, mixins[i])) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not mix a class into itself", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "SELF_MIXIN", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "SELF_MIXIN", (void *)NULL); goto freeAndError; } } @@ -2538,7 +2538,7 @@ ClassSuperGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2576,12 +2576,12 @@ ClassSuperSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (oPtr == oPtr->fPtr->objectCls->thisPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may not modify the superclass of the root object", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (TclListObjGetElementsM(interp, objv[0], &superc, &superv) != TCL_OK) { @@ -2622,14 +2622,14 @@ ClassSuperSet( Tcl_SetObjResult(interp, Tcl_NewStringObj( "class should only be a direct superclass once", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS",NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS",(void *)NULL); goto failedAfterAlloc; } } if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to form circular dependency graph", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", (void *)NULL); failedAfterAlloc: for (; i-- > 0 ;) { TclOODecrRefCount(superclasses[i]->thisPtr); @@ -2704,7 +2704,7 @@ ClassVarsGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -2751,7 +2751,7 @@ ClassVarsSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (TclListObjGetElementsM(interp, objv[0], &varc, &varv) != TCL_OK) { @@ -2765,14 +2765,14 @@ ClassVarsSet( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid declared variable name \"%s\": must not %s", varName, "contain namespace separators")); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", (void *)NULL); return TCL_ERROR; } if (Tcl_StringMatch(varName, "*(*)")) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid declared variable name \"%s\": must not %s", varName, "refer to an array element")); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", (void *)NULL); return TCL_ERROR; } } @@ -3021,14 +3021,14 @@ ObjVarsSet( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid declared variable name \"%s\": must not %s", varName, "contain namespace separators")); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", (void *)NULL); return TCL_ERROR; } if (Tcl_StringMatch(varName, "*(*)")) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid declared variable name \"%s\": must not %s", varName, "refer to an array element")); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", (void *)NULL); return TCL_ERROR; } } @@ -3185,7 +3185,7 @@ ClassRPropsGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -3221,7 +3221,7 @@ ClassRPropsSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (Tcl_ListObjGetElements(interp, objv[0], &varc, &varv) != TCL_OK) { @@ -3382,7 +3382,7 @@ ClassWPropsGet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } @@ -3418,7 +3418,7 @@ ClassWPropsSet( } else if (!oPtr->classPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "attempt to misuse API", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL); return TCL_ERROR; } else if (Tcl_ListObjGetElements(interp, objv[0], &varc, &varv) != TCL_OK) { diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index e0594e5..6aa3214 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -158,7 +158,7 @@ GetClassFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" is not a class", TclGetString(objPtr))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS", - TclGetString(objPtr), NULL); + TclGetString(objPtr), (void *)NULL); return NULL; } return oPtr->classPtr; @@ -263,7 +263,7 @@ InfoObjectDefnCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr)); @@ -271,7 +271,7 @@ InfoObjectDefnCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "definition not available for this kind of method", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -374,7 +374,7 @@ InfoObjectForwardCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } prefixObj = TclOOGetFwdFromMethod((Method *)Tcl_GetHashValue(hPtr)); @@ -383,7 +383,7 @@ InfoObjectForwardCmd( "prefix argument list not available for this kind of method", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -577,7 +577,7 @@ InfoObjectMethodsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing option for -scope")); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", - NULL); + (void *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], scopes, "scope", 0, @@ -670,7 +670,7 @@ InfoObjectMethodTypeCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } mPtr = (Method *)Tcl_GetHashValue(hPtr); @@ -947,7 +947,7 @@ InfoClassConstrCmd( if (procPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "definition not available for this kind of method", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "METHOD_TYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "METHOD_TYPE", (void *)NULL); return TCL_ERROR; } @@ -1007,7 +1007,7 @@ InfoClassDefnCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr)); @@ -1015,7 +1015,7 @@ InfoClassDefnCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "definition not available for this kind of method", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -1125,7 +1125,7 @@ InfoClassDestrCmd( if (procPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "definition not available for this kind of method", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "METHOD_TYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "METHOD_TYPE", (void *)NULL); return TCL_ERROR; } @@ -1205,7 +1205,7 @@ InfoClassForwardCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } prefixObj = TclOOGetFwdFromMethod((Method *)Tcl_GetHashValue(hPtr)); @@ -1214,7 +1214,7 @@ InfoClassForwardCmd( "prefix argument list not available for this kind of method", -1)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } @@ -1335,7 +1335,7 @@ InfoClassMethodsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing option for -scope")); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", - NULL); + (void *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], scopes, "scope", 0, @@ -1422,7 +1422,7 @@ InfoClassMethodTypeCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown method \"%s\"", TclGetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", - TclGetString(objv[2]), NULL); + TclGetString(objv[2]), (void *)NULL); return TCL_ERROR; } mPtr = (Method *)Tcl_GetHashValue(hPtr); diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index feaeb23..893c05e 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -1395,7 +1395,7 @@ TclOONewForwardInstanceMethod( if (prefixLen < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "method forward prefix must be non-empty", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_FORWARD", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_FORWARD", (void *)NULL); return NULL; } @@ -1434,7 +1434,7 @@ TclOONewForwardMethod( if (prefixLen < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "method forward prefix must be non-empty", -1)); - Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_FORWARD", NULL); + Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_FORWARD", (void *)NULL); return NULL; } diff --git a/generic/tclObj.c b/generic/tclObj.c index 321b100..7f41765 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -973,7 +973,7 @@ Tcl_ConvertToType( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't convert value to type %s", typePtr->name)); - Tcl_SetErrorCode(interp, "TCL", "API_ABUSE", NULL); + Tcl_SetErrorCode(interp, "TCL", "API_ABUSE", (void *)NULL); } return TCL_ERROR; } @@ -2268,7 +2268,7 @@ TclSetBooleanFromAny( Tcl_AppendLimitedToObj(msg, str, length, 50, ""); Tcl_AppendToObj(msg, "\"", -1); Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BOOLEAN", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BOOLEAN", (void *)NULL); } return TCL_ERROR; } @@ -2557,7 +2557,7 @@ Tcl_GetDoubleFromObj( Tcl_SetObjResult(interp, Tcl_NewStringObj( "floating point value is Not a Number", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DOUBLE", "NAN", - NULL); + (void *)NULL); } return TCL_ERROR; } @@ -2773,7 +2773,7 @@ Tcl_GetIntFromObj( const char *s = "integer value too large to represent"; Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (void *)NULL); } return TCL_ERROR; } @@ -3070,7 +3070,7 @@ Tcl_GetLongFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer but got \"%s\"", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", (void *)NULL); } return TCL_ERROR; } @@ -3114,7 +3114,7 @@ Tcl_GetLongFromObj( Tcl_Obj *msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (void *)NULL); } return TCL_ERROR; } @@ -3311,7 +3311,7 @@ Tcl_GetWideIntFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer but got \"%s\"", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", (void *)NULL); } return TCL_ERROR; } @@ -3349,7 +3349,7 @@ Tcl_GetWideIntFromObj( Tcl_Obj *msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (void *)NULL); } return TCL_ERROR; } @@ -3394,7 +3394,7 @@ Tcl_GetWideUIntFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected unsigned integer but got \"%s\"", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", (void *)NULL); } return TCL_ERROR; } @@ -3433,7 +3433,7 @@ Tcl_GetWideUIntFromObj( Tcl_Obj *msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (void *)NULL); } return TCL_ERROR; } @@ -3480,7 +3480,7 @@ TclGetWideBitsFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer but got \"%s\"", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", (void *)NULL); } return TCL_ERROR; } @@ -3770,7 +3770,7 @@ GetBignumFromObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer but got \"%s\"", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 0095469..7282709 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -2286,7 +2286,7 @@ SetFsPathFromAny( "couldn't find HOME environment variable to" " expand path", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH", - "HOMELESS", NULL); + "HOMELESS", (void *)NULL); } return TCL_ERROR; } @@ -2311,7 +2311,7 @@ SetFsPathFromAny( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "user \"%s\" doesn't exist", expandedUser)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH", "NOUSER", - NULL); + (void *)NULL); } Tcl_DStringFree(&userName); Tcl_DStringFree(&temp); @@ -2630,7 +2630,7 @@ MakeTildeRelativePath( "couldn't find HOME environment variable to" " expand path", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH", - "HOMELESS", NULL); + "HOMELESS", (void *)NULL); } return TCL_ERROR; } @@ -2642,7 +2642,7 @@ MakeTildeRelativePath( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "user \"%s\" doesn't exist", user)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH", "NOUSER", - NULL); + (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclPipe.c b/generic/tclPipe.c index 830f3f6..8b6eb11 100644 --- a/generic/tclPipe.c +++ b/generic/tclPipe.c @@ -111,7 +111,7 @@ FileForRedirect( Tcl_GetChannelName(chan), ((writing) ? "writing" : "reading"))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "BADCHAN", NULL); + "BADCHAN", (void *)NULL); } return NULL; } @@ -155,7 +155,7 @@ FileForRedirect( badLastArg: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't specify \"%s\" as last word in command", arg)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "SYNTAX", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "SYNTAX", (void *)NULL); return NULL; } @@ -513,7 +513,7 @@ TclCreatePipeline( Tcl_SetObjResult(interp, Tcl_NewStringObj( "illegal use of | or |& in command", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "PIPESYNTAX", NULL); + "PIPESYNTAX", (void *)NULL); goto error; } } @@ -542,7 +542,7 @@ TclCreatePipeline( "can't specify \"%s\" as last word in command", argv[i])); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "PIPESYNTAX", NULL); + "PIPESYNTAX", (void *)NULL); goto error; } skip = 2; @@ -659,7 +659,7 @@ TclCreatePipeline( "must specify \"%s\" as last word in command", argv[i])); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "PIPESYNTAX", NULL); + "PIPESYNTAX", (void *)NULL); goto error; } errorFile = outputFile; @@ -701,7 +701,7 @@ TclCreatePipeline( Tcl_SetObjResult(interp, Tcl_NewStringObj( "illegal use of | or |& in command", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "PIPESYNTAX", - NULL); + (void *)NULL); goto error; } @@ -1055,7 +1055,7 @@ Tcl_OpenCommandChannel( "can't read output from command:" " standard output was redirected", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "BADREDIRECT", NULL); + "BADREDIRECT", (void *)NULL); goto error; } if ((flags & TCL_STDIN) && (inPipe == NULL)) { @@ -1063,7 +1063,7 @@ Tcl_OpenCommandChannel( "can't write input to command:" " standard input was redirected", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", - "BADREDIRECT", NULL); + "BADREDIRECT", (void *)NULL); goto error; } } @@ -1074,7 +1074,7 @@ Tcl_OpenCommandChannel( if (channel == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "pipe for command could not be created", -1)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "NOPIPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "NOPIPE", (void *)NULL); goto error; } return channel; diff --git a/generic/tclPkg.c b/generic/tclPkg.c index c5b2d38..b5b5582 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -192,7 +192,7 @@ Tcl_PkgProvideEx( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "conflicting versions provided for package \"%s\": %s, then %s", name, Tcl_GetString(pkgPtr->version), version)); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "VERSIONCONFLICT", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "VERSIONCONFLICT", (void *)NULL); return TCL_ERROR; } @@ -389,7 +389,7 @@ Tcl_PkgRequireEx( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Cannot load package \"%s\" in standalone executable:" " This package is not compiled with stub support", name)); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "UNSTUBBED", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "UNSTUBBED", (void *)NULL); return NULL; } @@ -409,7 +409,7 @@ Tcl_PkgRequireEx( } ov = Tcl_NewStringObj(version, -1); if (exact) { - Tcl_AppendStringsToObj(ov, "-", version, NULL); + Tcl_AppendStringsToObj(ov, "-", version, (void *)NULL); } Tcl_IncrRefCount(ov); if (Tcl_PkgRequireProc(interp, name, 1, &ov, clientDataPtr) == TCL_OK) { @@ -559,7 +559,7 @@ PkgRequireCoreStep2( if ((result != TCL_OK) && (result != TCL_ERROR)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad return code: %d", result)); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "BADRESULT", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "BADRESULT", (void *)NULL); result = TCL_ERROR; } if (result == TCL_ERROR) { @@ -596,7 +596,7 @@ PkgRequireCoreFinal( if (reqPtr->pkgPtr->version == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't find package %s", name)); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "UNFOUND", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "UNFOUND", (void *)NULL); AddRequirementsToResult(interp, reqc, reqv); return TCL_ERROR; } @@ -617,7 +617,7 @@ PkgRequireCoreFinal( "version conflict for package \"%s\": have %s, need", name, Tcl_GetString(reqPtr->pkgPtr->version))); Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "VERSIONCONFLICT", - NULL); + (void *)NULL); AddRequirementsToResult(interp, reqc, reqv); return TCL_ERROR; } @@ -670,7 +670,7 @@ SelectPackage( " attempt to provide %s %s requires %s", name, (char *) pkgPtr->clientData, name)); AddRequirementsToResult(interp, reqc, reqv); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "CIRCULARITY", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "CIRCULARITY", (void *)NULL); return TCL_ERROR; } @@ -876,7 +876,7 @@ SelectPackageFinal( " no version of package %s provided", name, versionToProvide, name)); Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "UNPROVIDED", - NULL); + (void *)NULL); } else { char *pvi, *vi; @@ -900,7 +900,7 @@ SelectPackageFinal( name, versionToProvide, name, Tcl_GetString(reqPtr->pkgPtr->version))); Tcl_SetErrorCode(interp, "TCL", "PACKAGE", - "WRONGPROVIDE", NULL); + "WRONGPROVIDE", (void *)NULL); } } } @@ -912,7 +912,7 @@ SelectPackageFinal( "attempt to provide package %s %s failed:" " bad return code: %s", name, versionToProvide, TclGetString(codePtr))); - Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "BADRESULT", NULL); + Tcl_SetErrorCode(interp, "TCL", "PACKAGE", "BADRESULT", (void *)NULL); TclDecrRefCount(codePtr); result = TCL_ERROR; } @@ -1018,7 +1018,7 @@ Tcl_PkgPresentEx( if (foundVersion == NULL) { Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PACKAGE", name, - NULL); + (void *)NULL); } return foundVersion; } @@ -1031,7 +1031,7 @@ Tcl_PkgPresentEx( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "package %s is not present", name)); } - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PACKAGE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PACKAGE", name, (void *)NULL); return NULL; } @@ -1351,7 +1351,7 @@ TclNRPackageObjCmd( */ ov = Tcl_NewStringObj(version, -1); - Tcl_AppendStringsToObj(ov, "-", version, NULL); + Tcl_AppendStringsToObj(ov, "-", version, (void *)NULL); version = NULL; argv3 = TclGetString(objv[3]); Tcl_IncrRefCount(objv[3]); @@ -1753,7 +1753,7 @@ CheckVersionAndConvert( ckfree(ibuf); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected version number but got \"%s\"", string)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "VERSION", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "VERSION", (void *)NULL); return TCL_ERROR; } @@ -2016,7 +2016,7 @@ CheckRequirement( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected versionMin-versionMax but got \"%s\"", string)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "VERSIONRANGE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "VERSIONRANGE", (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclProc.c b/generic/tclProc.c index 2800c20..adb69ba 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -182,14 +182,14 @@ Tcl_ProcObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create procedure \"%s\": unknown namespace", procName)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", (void *)NULL); return TCL_ERROR; } if (simpleName == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't create procedure \"%s\": bad procedure name", procName)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMMAND", (void *)NULL); return TCL_ERROR; } @@ -497,7 +497,7 @@ TclCreateProc( "precompiled header expects %" TCL_SIZE_MODIFIER "u", procName, numArgs, procPtr->numArgs)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "BYTECODELIES", NULL); + "BYTECODELIES", (void *)NULL); goto procError; } localPtr = procPtr->firstLocalPtr; @@ -527,14 +527,14 @@ TclCreateProc( Tcl_AppendToObj(errorObj, "\"", -1); Tcl_SetObjResult(interp, errorObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "FORMALARGUMENTFORMAT", NULL); + "FORMALARGUMENTFORMAT", (void *)NULL); goto procError; } if ((fieldCount == 0) || (TclGetCharLength(fieldValues[0]) == 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "argument with no name", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "FORMALARGUMENTFORMAT", NULL); + "FORMALARGUMENTFORMAT", (void *)NULL); goto procError; } @@ -553,7 +553,7 @@ TclCreateProc( "formal parameter \"%s\" is an array element", Tcl_GetString(fieldValues[0]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "FORMALARGUMENTFORMAT", NULL); + "FORMALARGUMENTFORMAT", (void *)NULL); goto procError; } } else if (*argnamei == ':' && *(argnamei+1) == ':') { @@ -563,7 +563,7 @@ TclCreateProc( Tcl_AppendToObj(errorObj, "\" is not a simple name", -1); Tcl_SetObjResult(interp, errorObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "FORMALARGUMENTFORMAT", NULL); + "FORMALARGUMENTFORMAT", (void *)NULL); goto procError; } argnamei++; @@ -591,7 +591,7 @@ TclCreateProc( "procedure \"%s\": formal parameter %" TCL_SIZE_MODIFIER "u is " "inconsistent with precompiled body", procName, i)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "BYTECODELIES", NULL); + "BYTECODELIES", (void *)NULL); goto procError; } @@ -614,7 +614,7 @@ TclCreateProc( "default value inconsistent with precompiled body", -1); Tcl_SetObjResult(interp, errorObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "BYTECODELIES", NULL); + "BYTECODELIES", (void *)NULL); goto procError; } } @@ -842,7 +842,7 @@ badLevel: name = objPtr ? TclGetString(objPtr) : "1" ; } Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad level \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", name, (void *)NULL); return -1; } @@ -1097,7 +1097,7 @@ ProcWrongNumArgs( if (defPtr->value.objPtr != NULL) { TclNewObj(argObj); - Tcl_AppendStringsToObj(argObj, "?", TclGetString(namePtr), "?", NULL); + Tcl_AppendStringsToObj(argObj, "?", TclGetString(namePtr), "?", (void *)NULL); } else if (defPtr->flags & VAR_IS_ARGS) { numArgs--; final = "?arg ...?"; @@ -1874,7 +1874,7 @@ InterpProcNR2( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invoked \"%s\" outside of a loop", ((result == TCL_BREAK) ? "break" : "continue"))); - Tcl_SetErrorCode(interp, "TCL", "RESULT", "UNEXPECTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "RESULT", "UNEXPECTED", (void *)NULL); result = TCL_ERROR; /* FALLTHRU */ @@ -1958,7 +1958,7 @@ TclProcCompileProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "a precompiled script jumped interps", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC", - "CROSSINTERPBYTECODE", NULL); + "CROSSINTERPBYTECODE", (void *)NULL); return TCL_ERROR; } codePtr->compileEpoch = iPtr->compileEpoch; @@ -1983,7 +1983,7 @@ TclProcCompileProc( TclNewLiteralStringObj(message, "Compiling "); Tcl_IncrRefCount(message); - Tcl_AppendStringsToObj(message, description, " \"", NULL); + Tcl_AppendStringsToObj(message, description, " \"", (void *)NULL); Tcl_AppendLimitedToObj(message, procName, TCL_INDEX_NONE, 50, NULL); fprintf(stdout, "%s\"\n", TclGetString(message)); Tcl_DecrRefCount(message); @@ -2470,7 +2470,7 @@ SetLambdaFromAny( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't interpret \"%s\" as a lambda expression", Tcl_GetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", (void *)NULL); return TCL_ERROR; } result = TclListObjGetElementsM(NULL, objPtr, &objc, &objv); @@ -2478,7 +2478,7 @@ SetLambdaFromAny( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't interpret \"%s\" as a lambda expression", Tcl_GetString(objPtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 558355f..a823af5 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -731,7 +731,7 @@ TclRegError( snprintf(cbuf, sizeof(cbuf), "%d", status); (void) TclReError(REG_ITOA, cbuf, sizeof(cbuf)); - Tcl_SetErrorCode(interp, "REGEXP", cbuf, buf, NULL); + Tcl_SetErrorCode(interp, "REGEXP", cbuf, buf, (void *)NULL); } /* diff --git a/generic/tclResult.c b/generic/tclResult.c index f639c08..91ddc6e 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1347,7 +1347,7 @@ TclProcessReturn( if (valuePtr != NULL) { Tcl_SetObjErrorCode(interp, valuePtr); } else { - Tcl_SetErrorCode(interp, "NONE", NULL); + Tcl_SetErrorCode(interp, "NONE", (void *)NULL); } Tcl_DictObjGet(NULL, iPtr->returnOpts, keys[KEY_ERRORLINE], @@ -1427,7 +1427,7 @@ TclMergeReturnOptions( "bad %s value: expected dictionary but got \"%s\"", compare, TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_OPTIONS", - NULL); + (void *)NULL); goto error; } @@ -1476,7 +1476,7 @@ TclMergeReturnOptions( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad -level value: expected non-negative integer but got" " \"%s\"", TclGetString(valuePtr))); - Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_LEVEL", NULL); + Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_LEVEL", (void *)NULL); goto error; } Tcl_DictObjRemove(NULL, returnOpts, keys[KEY_LEVEL]); @@ -1499,7 +1499,7 @@ TclMergeReturnOptions( "bad -errorcode value: expected a list but got \"%s\"", TclGetString(valuePtr))); Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_ERRORCODE", - NULL); + (void *)NULL); goto error; } } @@ -1521,7 +1521,7 @@ TclMergeReturnOptions( "bad -errorstack value: expected a list but got \"%s\"", TclGetString(valuePtr))); Tcl_SetErrorCode(interp, "TCL", "RESULT", "NONLIST_ERRORSTACK", - NULL); + (void *)NULL); goto error; } if (length % 2) { @@ -1533,7 +1533,7 @@ TclMergeReturnOptions( "forbidden odd-sized list for -errorstack: \"%s\"", TclGetString(valuePtr))); Tcl_SetErrorCode(interp, "TCL", "RESULT", - "ODDSIZEDLIST_ERRORSTACK", NULL); + "ODDSIZEDLIST_ERRORSTACK", (void *)NULL); goto error; } } @@ -1686,7 +1686,7 @@ Tcl_SetReturnOptions( || (objc % 2)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected dict but got \"%s\"", TclGetString(options))); - Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_OPTIONS", NULL); + Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_OPTIONS", (void *)NULL); code = TCL_ERROR; } else if (TCL_ERROR == TclMergeReturnOptions(interp, objc, objv, &mergedOpts, &code, &level)) { diff --git a/generic/tclScan.c b/generic/tclScan.c index b8c29fa..4c141ab 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -341,7 +341,7 @@ ValidateFormat( Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot mix \"%\" and \"%n$\" conversion specifiers", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "MIXEDSPECTYPES", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "MIXEDSPECTYPES", (void *)NULL); goto error; } @@ -390,7 +390,7 @@ ValidateFormat( Tcl_SetObjResult(interp, Tcl_NewStringObj( "field width may not be specified in %c conversion", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADWIDTH", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADWIDTH", (void *)NULL); goto error; } /* FALLTHRU */ @@ -404,7 +404,7 @@ ValidateFormat( Tcl_AppendToObj(errorMsg, buf, -1); Tcl_AppendToObj(errorMsg, " conversion", -1); Tcl_SetObjResult(interp, errorMsg); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADSIZE", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADSIZE", (void *)NULL); goto error; } /* @@ -456,7 +456,7 @@ ValidateFormat( badSet: Tcl_SetObjResult(interp, Tcl_NewStringObj( "unmatched [ in format string", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BRACKET", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BRACKET", (void *)NULL); goto error; default: buf[Tcl_UniCharToUtf(ch, buf)] = '\0'; @@ -465,7 +465,7 @@ ValidateFormat( Tcl_AppendToObj(errorMsg, buf, -1); Tcl_AppendToObj(errorMsg, "\"", -1); Tcl_SetObjResult(interp, errorMsg); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADTYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADTYPE", (void *)NULL); goto error; } if (!(flags & SCAN_SUPPRESS)) { @@ -512,7 +512,7 @@ ValidateFormat( Tcl_SetObjResult(interp, Tcl_NewStringObj( "variable is assigned by multiple \"%n$\" conversion specifiers", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "POLYASSIGNED", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "POLYASSIGNED", (void *)NULL); goto error; } else if (!xpgSize && (nassign[i] == 0)) { /* @@ -523,7 +523,7 @@ ValidateFormat( Tcl_SetObjResult(interp, Tcl_NewStringObj( "variable is not assigned by any conversion specifiers", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "UNASSIGNED", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "UNASSIGNED", (void *)NULL); goto error; } } @@ -535,12 +535,12 @@ ValidateFormat( if (gotXpg) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"%n$\" argument index out of range", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "INDEXRANGE", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "INDEXRANGE", (void *)NULL); } else { Tcl_SetObjResult(interp, Tcl_NewStringObj( "different numbers of variable names and field specifiers", -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "FIELDVARMISMATCH", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "FIELDVARMISMATCH", (void *)NULL); } error: @@ -930,7 +930,7 @@ Tcl_ScanObjCmd( if (mp_init_u64(&big, (Tcl_WideUInt)wideValue) != MP_OKAY) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "insufficient memory to create bignum", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } else { Tcl_SetBignumObj(objPtr, &big); @@ -958,7 +958,7 @@ Tcl_ScanObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unsigned bignum scans are invalid", -1)); Tcl_SetErrorCode(interp, "TCL", "FORMAT", - "BADUNSIGNED",NULL); + "BADUNSIGNED", (void *)NULL); return TCL_ERROR; } } @@ -976,7 +976,7 @@ Tcl_ScanObjCmd( if (mp_init_u64(&big, (unsigned long)value) != MP_OKAY) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "insufficient memory to create bignum", -1)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); return TCL_ERROR; } else { Tcl_SetBignumObj(objPtr, &big); diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 78ab911..f23b23b 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -1595,7 +1595,7 @@ TclParseNumber( Tcl_AppendToObj(msg, " (looks like invalid octal number)", -1); } Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (void *)NULL); } } @@ -4328,7 +4328,7 @@ StrictBignumConversion( * string. */ - mp_clear_multi(&b, &S, &dig, NULL); + mp_clear_multi(&b, &S, &dig, (void *)NULL); *s = '\0'; *decpt = k; if (endPtr) { @@ -4859,7 +4859,7 @@ Tcl_InitBignumFromDouble( const char *s = "integer value too large to represent"; Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL); + Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 2b6d7c2..b307cd6 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2872,7 +2872,7 @@ Tcl_AppendFormatToObj( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad field specifier \"%c\"", ch)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADTYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADTYPE", (void *)NULL); } goto error; } @@ -2932,7 +2932,7 @@ Tcl_AppendFormatToObj( errorMsg: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, -1)); - Tcl_SetErrorCode(interp, "TCL", "FORMAT", errCode, NULL); + Tcl_SetErrorCode(interp, "TCL", "FORMAT", errCode, (void *)NULL); } error: Tcl_SetObjLength(appendObj, originalLength); @@ -3325,7 +3325,7 @@ TclStringRepeat( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "max size for a Tcl value (%" TCL_SIZE_MODIFIER "d bytes) exceeded", TCL_SIZE_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3362,7 +3362,7 @@ TclStringRepeat( "string size overflow: unable to alloc %" TCL_Z_MODIFIER "u bytes", UNICHAR_STRING_SIZE(count*length))); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3389,7 +3389,7 @@ TclStringRepeat( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "string size overflow: unable to alloc %" TCL_SIZE_MODIFIER "d bytes", count*length)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3696,7 +3696,7 @@ TclStringCat( "concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes", UNICHAR_STRING_SIZE(length))); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3713,7 +3713,7 @@ TclStringCat( "concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes", UNICHAR_STRING_SIZE(length))); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3744,7 +3744,7 @@ TclStringCat( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "concatenation failed: unable to alloc %" TCL_SIZE_MODIFIER "d bytes", length)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3760,7 +3760,7 @@ TclStringCat( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "concatenation failed: unable to alloc %" TCL_SIZE_MODIFIER "d bytes", length)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -3786,7 +3786,7 @@ TclStringCat( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "max size for a Tcl value (%" TCL_SIZE_MODIFIER "d bytes) exceeded", TCL_SIZE_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } @@ -4427,7 +4427,7 @@ TclStringReplace( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "max size for a Tcl value (%" TCL_SIZE_MODIFIER "d bytes) exceeded", TCL_SIZE_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return NULL; } diff --git a/generic/tclTimer.c b/generic/tclTimer.c index e986db7..954e38f 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -826,7 +826,7 @@ Tcl_AfterObjCmd( "bad argument \"%s\": must be" " cancel, idle, info, or an integer", arg)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "argument", - arg, NULL); + arg, (void *)NULL); return TCL_ERROR; } } @@ -965,7 +965,7 @@ Tcl_AfterObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "event \"%s\" doesn't exist", eventStr)); - Tcl_SetErrorCode(interp, "TCL","LOOKUP","EVENT", eventStr, NULL); + Tcl_SetErrorCode(interp, "TCL","LOOKUP","EVENT", eventStr, (void *)NULL); return TCL_ERROR; } else { Tcl_Obj *resultListPtr; diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index b4ab607..41c9c10 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -220,7 +220,7 @@ EXTERN void TclBN_mp_clamp(mp_int *a); /* 6 */ EXTERN void TclBN_mp_clear(mp_int *a); /* 7 */ -EXTERN void TclBN_mp_clear_multi(mp_int *a, ...); +EXTERN void TclBN_mp_clear_multi(mp_int *a, ...) __attribute__((sentinel)); /* 8 */ EXTERN mp_ord TclBN_mp_cmp(const mp_int *a, const mp_int *b) MP_WUR; /* 9 */ @@ -258,7 +258,7 @@ EXTERN mp_err TclBN_mp_init(mp_int *a) MP_WUR; /* 22 */ EXTERN mp_err TclBN_mp_init_copy(mp_int *a, const mp_int *b) MP_WUR; /* 23 */ -EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...) MP_WUR; +EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...) __attribute__((sentinel)) MP_WUR; /* 24 */ EXTERN mp_err TclBN_mp_init_set(mp_int *a, unsigned int b) MP_WUR; /* 25 */ diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 797714d..6adc724 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -384,7 +384,7 @@ Tcl_TraceObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad operations \"%s\": should be one or more of rwua", flagOps)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRACE", "BADOPS", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRACE", "BADOPS", (void *)NULL); return TCL_ERROR; #endif } @@ -452,7 +452,7 @@ TraceExecutionObjCmd( "bad operation list \"\": must be one or more of" " enter, leave, enterstep, or leavestep", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRACE", "NOOPS", - NULL); + (void *)NULL); return TCL_ERROR; } result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); @@ -699,7 +699,7 @@ TraceCommandObjCmd( "bad operation list \"\": must be one or more of" " delete or rename", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRACE", "NOOPS", - NULL); + (void *)NULL); return TCL_ERROR; } result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); @@ -903,7 +903,7 @@ TraceVariableObjCmd( "bad operation list \"\": must be one or more of" " array, read, unset, or write", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRACE", "NOOPS", - NULL); + (void *)NULL); return TCL_ERROR; } result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 3ab741a..30fb89d 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -656,7 +656,7 @@ FindElement( "%s element in braces followed by \"%.*s\" " "instead of space", typeStr, (int) (p2-p), p)); Tcl_SetErrorCode(interp, "TCL", "VALUE", typeCode, "JUNK", - NULL); + (void *)NULL); } return TCL_ERROR; } @@ -708,7 +708,7 @@ FindElement( "%s element in quotes followed by \"%.*s\" " "instead of space", typeStr, (int) (p2-p), p)); Tcl_SetErrorCode(interp, "TCL", "VALUE", typeCode, "JUNK", - NULL); + (void *)NULL); } return TCL_ERROR; } @@ -741,7 +741,7 @@ FindElement( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unmatched open brace in %s", typeStr)); Tcl_SetErrorCode(interp, "TCL", "VALUE", typeCode, "BRACE", - NULL); + (void *)NULL); } return TCL_ERROR; } else if (inQuotes) { @@ -749,7 +749,7 @@ FindElement( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unmatched open quote in %s", typeStr)); Tcl_SetErrorCode(interp, "TCL", "VALUE", typeCode, "QUOTE", - NULL); + (void *)NULL); } return TCL_ERROR; } @@ -900,7 +900,7 @@ Tcl_SplitList( Tcl_SetObjResult(interp, Tcl_NewStringObj( "internal error in Tcl_SplitList", -1)); Tcl_SetErrorCode(interp, "TCL", "INTERNAL", "Tcl_SplitList", - NULL); + (void *)NULL); } return TCL_ERROR; } @@ -3997,7 +3997,7 @@ GetEndOffsetFromObj( bytes += 4; } TclCheckBadOctal(interp, bytes); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", (void *)NULL); } return TCL_ERROR; @@ -4807,7 +4807,7 @@ TclReToGlob( invalidGlob: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, -1)); - Tcl_SetErrorCode(interp, "TCL", "RE2GLOB", code, NULL); + Tcl_SetErrorCode(interp, "TCL", "RE2GLOB", code, (void *)NULL); } Tcl_DStringFree(dsPtr); return TCL_ERROR; diff --git a/generic/tclVar.c b/generic/tclVar.c index 4110d81..3007296 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -341,7 +341,7 @@ NotArrayError( Tcl_SetObjResult(interp, Tcl_ObjPrintf("\"%s\" isn't an array", nameStr)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", nameStr, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", nameStr, (void *)NULL); return TCL_ERROR; } @@ -645,7 +645,7 @@ TclObjLookupVarEx( if (flags & TCL_LEAVE_ERR_MSG) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg, NOSUCHVAR, -1); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", (void *)NULL); } return NULL; } @@ -671,7 +671,7 @@ TclObjLookupVarEx( TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg, NEEDARRAY, -1); Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", - NULL); + (void *)NULL); } return NULL; } @@ -699,7 +699,7 @@ TclObjLookupVarEx( if ((errMsg != NULL) && (flags & TCL_LEAVE_ERR_MSG)) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg, errMsg, -1); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - TclGetString(part1Ptr), NULL); + TclGetString(part1Ptr), (void *)NULL); } return NULL; } @@ -1086,7 +1086,7 @@ TclLookupArrayElement( TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, NOSUCHVAR, index); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL); + arrayNamePtr?TclGetString(arrayNamePtr):NULL, (void *)NULL); } return NULL; } @@ -1101,7 +1101,7 @@ TclLookupArrayElement( TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, DANGLINGVAR, index); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL); + arrayNamePtr?TclGetString(arrayNamePtr):NULL, (void *)NULL); } return NULL; } @@ -1112,7 +1112,7 @@ TclLookupArrayElement( TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, NEEDARRAY, index); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - arrayNamePtr?TclGetString(arrayNamePtr):NULL, NULL); + arrayNamePtr?TclGetString(arrayNamePtr):NULL, (void *)NULL); } return NULL; } @@ -1133,7 +1133,7 @@ TclLookupArrayElement( TclObjVarErrMsg(interp, arrayNamePtr, elNamePtr, msg, NOSUCHELEMENT, index); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT", - TclGetString(elNamePtr), NULL); + TclGetString(elNamePtr), (void *)NULL); } } } @@ -1496,7 +1496,7 @@ TclPtrGetVarIdx( */ errorReturn: - Tcl_SetErrorCode(interp, "TCL", "READ", "VARNAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "READ", "VARNAME", (void *)NULL); if (TclIsVarUndefined(varPtr)) { TclCleanupVar(varPtr, arrayPtr); } @@ -2021,11 +2021,11 @@ TclPtrSetVarIdx( if (TclIsVarArrayElement(varPtr)) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", DANGLINGELEMENT, index); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ELEMENT", (void *)NULL); } else { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", DANGLINGVAR, index); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", (void *)NULL); } } goto earlyError; @@ -2038,7 +2038,7 @@ TclPtrSetVarIdx( if (TclIsVarArray(varPtr)) { if (flags & TCL_LEAVE_ERR_MSG) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "set", ISARRAY,index); - Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", (void *)NULL); } goto earlyError; } @@ -2131,7 +2131,7 @@ TclPtrSetVarIdx( cleanup: if (resultPtr == NULL) { - Tcl_SetErrorCode(interp, "TCL", "WRITE", "VARNAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRITE", "VARNAME", (void *)NULL); } if (TclIsVarUndefined(varPtr)) { TclCleanupVar(varPtr, arrayPtr); @@ -2606,7 +2606,7 @@ TclPtrUnsetVarIdx( if (flags & TCL_LEAVE_ERR_MSG) { TclObjVarErrMsg(interp, part1Ptr, part2Ptr, "unset", ((arrayPtr == NULL) ? NOSUCHVAR : NOSUCHELEMENT), index); - Tcl_SetErrorCode(interp, "TCL", "UNSET", "VARNAME", NULL); + Tcl_SetErrorCode(interp, "TCL", "UNSET", "VARNAME", (void *)NULL); } } @@ -3195,7 +3195,7 @@ ArrayForNRCmd( if (numVars != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "must have two variable names", -1)); - Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "array", "for", NULL); + Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "array", "for", (void *)NULL); return TCL_ERROR; } @@ -3297,7 +3297,7 @@ ArrayForLoopCallback( if (done == TCL_ERROR) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "array changed during iteration", -1)); - Tcl_SetErrorCode(interp, "TCL", "READ", "array", "for", NULL); + Tcl_SetErrorCode(interp, "TCL", "READ", "array", "for", (void *)NULL); varPtr->flags |= TCL_LEAVE_ERR_MSG; result = done; } @@ -4112,7 +4112,7 @@ ArraySetCmd( CleanupVar(varPtr, arrayPtr); TclObjVarErrMsg(interp, arrayNameObj, NULL, "set", NEEDARRAY, -1); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - TclGetString(arrayNameObj), NULL); + TclGetString(arrayNameObj), (void *)NULL); return TCL_ERROR; } @@ -4179,7 +4179,7 @@ ArraySetCmd( if (elemLen & 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "list must have an even number of elements", -1)); - Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "FORMAT", NULL); + Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "FORMAT", (void *)NULL); return TCL_ERROR; } if (elemLen == 0) { @@ -4238,7 +4238,7 @@ ArraySetCmd( TclObjVarErrMsg(interp, arrayNameObj, NULL, "array set", NEEDARRAY, -1); - Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", (void *)NULL); return TCL_ERROR; } } @@ -4622,7 +4622,7 @@ ObjMakeUpvar( "bad variable name \"%s\": can't create namespace " "variable that refers to procedure variable", TclGetString(myNamePtr))); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "INVERTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "INVERTED", (void *)NULL); return TCL_ERROR; } } @@ -4738,7 +4738,7 @@ TclPtrObjMakeUpvarIdx( "bad variable name \"%s\": can't create a scalar " "variable that looks like an array element", myName)); Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", - NULL); + (void *)NULL); return TCL_ERROR; } } @@ -4757,7 +4757,7 @@ TclPtrObjMakeUpvarIdx( if (varPtr == NULL) { TclObjVarErrMsg(interp, myNamePtr, NULL, "create", errMsg, -1); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - TclGetString(myNamePtr), NULL); + TclGetString(myNamePtr), (void *)NULL); return TCL_ERROR; } } @@ -4765,14 +4765,14 @@ TclPtrObjMakeUpvarIdx( if (varPtr == otherPtr) { Tcl_SetObjResult((Tcl_Interp *) iPtr, Tcl_NewStringObj( "can't upvar from variable to itself", -1)); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "SELF", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "SELF", (void *)NULL); return TCL_ERROR; } if (TclIsVarTraced(varPtr)) { Tcl_SetObjResult((Tcl_Interp *) iPtr, Tcl_ObjPrintf( "variable \"%s\" has traces: can't use for upvar", myName)); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "TRACED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "TRACED", (void *)NULL); return TCL_ERROR; } else if (!TclIsVarUndefined(varPtr)) { Var *linkPtr; @@ -4787,7 +4787,7 @@ TclPtrObjMakeUpvarIdx( if (!TclIsVarLink(varPtr)) { Tcl_SetObjResult((Tcl_Interp *) iPtr, Tcl_ObjPrintf( "variable \"%s\" already exists", myName)); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "EXISTS", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "EXISTS", (void *)NULL); return TCL_ERROR; } @@ -5139,7 +5139,7 @@ Tcl_VariableObjCmd( TclObjVarErrMsg(interp, varNamePtr, NULL, "define", ISARRAYELEMENT, -1); - Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", NULL); + Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT", (void *)NULL); return TCL_ERROR; } @@ -5290,7 +5290,7 @@ Tcl_UpvarObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad level \"%s\"", TclGetString(levelObj))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", - TclGetString(levelObj), NULL); + TclGetString(levelObj), (void *)NULL); return TCL_ERROR; } @@ -5381,7 +5381,7 @@ ParseSearchId( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't find search \"%s\"", handle)); } - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", handle, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", handle, (void *)NULL); return NULL; } @@ -6021,7 +6021,7 @@ ObjFindNamespaceVar( if ((varPtr == NULL) && (flags & TCL_LEAVE_ERR_MSG)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown variable \"%s\"", name)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", name, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", name, (void *)NULL); } return (Tcl_Var) varPtr; } @@ -6687,7 +6687,7 @@ ArrayDefaultCmd( /* Array default must exist. */ Tcl_SetObjResult(interp, Tcl_NewStringObj( "array has no default value", -1)); - Tcl_SetErrorCode(interp, "TCL", "READ", "ARRAY", "DEFAULT", NULL); + Tcl_SetErrorCode(interp, "TCL", "READ", "ARRAY", "DEFAULT", (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, defaultValueObj); @@ -6717,7 +6717,7 @@ ArrayDefaultCmd( TclObjVarErrMsg(interp, arrayNameObj, NULL, "array default set", NEEDARRAY, -1); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - TclGetString(arrayNameObj), NULL); + TclGetString(arrayNameObj), (void *)NULL); return TCL_ERROR; } if (!TclIsVarArray(varPtr) && !TclIsVarUndefined(varPtr)) { @@ -6727,7 +6727,7 @@ ArrayDefaultCmd( TclObjVarErrMsg(interp, arrayNameObj, NULL, "array default set", NEEDARRAY, -1); - Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRITE", "ARRAY", (void *)NULL); return TCL_ERROR; } diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 8ce17eb..f625150 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -56,7 +56,7 @@ if (interp) { \ Tcl_SetObjResult(interp, Tcl_NewStringObj( \ "out of memory", -1)); \ - Tcl_SetErrorCode(interp, "TCL", "MALLOC", NULL); \ + Tcl_SetErrorCode(interp, "TCL", "MALLOC", (void *)NULL); \ } \ } while (0) #define ZIPFS_POSIX_ERROR(interp,errstr) \ @@ -69,7 +69,7 @@ #define ZIPFS_ERROR_CODE(interp,errcode) \ do { \ if (interp) { \ - Tcl_SetErrorCode(interp, "TCL", "ZIPFS", errcode, NULL); \ + Tcl_SetErrorCode(interp, "TCL", "ZIPFS", errcode, (void *)NULL); \ } \ } while (0) @@ -167,15 +167,6 @@ static const z_crc_t* crc32tab; #define DEFAULT_WRITE_MAX_SIZE ZIP_MAX_FILE_SIZE /* - * Windows drive letters. - */ - -#ifdef _WIN32 -static const char drvletters[] = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; -#endif /* _WIN32 */ - -/* * Mutex to protect localtime(3) when no reentrant version available. */ @@ -2370,7 +2361,7 @@ TclZipfs_Mount( Tcl_SetObjResult( interp, Tcl_ObjPrintf("could not normalize zip filename \"%s\"", zipname)); - Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NORMALIZE", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NORMALIZE", (void *)NULL); ret = TCL_ERROR; } else { Tcl_IncrRefCount(normZipPathObj); diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 1810ba1..e951060 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -320,7 +320,7 @@ ConvertError( * type is known). */ - Tcl_SetErrorCode(interp, "TCL", "ZLIB", codeStr, codeStr2, NULL); + Tcl_SetErrorCode(interp, "TCL", "ZLIB", codeStr, codeStr2, (void *)NULL); } static Tcl_Obj * @@ -452,9 +452,9 @@ GenerateHeader( if (interp) { if (result == TCL_CONVERT_UNKNOWN) { Tcl_AppendResult( - interp, "Comment contains characters > 0xFF", NULL); + interp, "Comment contains characters > 0xFF", (void *)NULL); } else { - Tcl_AppendResult(interp, "Comment too large for zip", NULL); + Tcl_AppendResult(interp, "Comment too large for zip", (void *)NULL); } } result = TCL_ERROR; /* TCL_CONVERT_* -> TCL_ERROR*/ @@ -487,10 +487,10 @@ GenerateHeader( if (interp) { if (result == TCL_CONVERT_UNKNOWN) { Tcl_AppendResult( - interp, "Filename contains characters > 0xFF", NULL); + interp, "Filename contains characters > 0xFF", (void *)NULL); } else { Tcl_AppendResult( - interp, "Filename too large for zip", NULL); + interp, "Filename too large for zip", (void *)NULL); } } result = TCL_ERROR; /* TCL_CONVERT_* -> TCL_ERROR*/ @@ -843,7 +843,7 @@ Tcl_ZlibStreamInit( NULL, 0) != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "BUG: Stream command name already exists", -1)); - Tcl_SetErrorCode(interp, "TCL", "BUG", "EXISTING_CMD", NULL); + Tcl_SetErrorCode(interp, "TCL", "BUG", "EXISTING_CMD", (void *)NULL); Tcl_DStringFree(&cmdname); goto error; } @@ -1234,7 +1234,7 @@ Tcl_ZlibStreamPut( if (zshPtr->interp) { Tcl_SetObjResult(zshPtr->interp, Tcl_NewStringObj( "already past compressed stream end", -1)); - Tcl_SetErrorCode(zshPtr->interp, "TCL", "ZIP", "CLOSED", NULL); + Tcl_SetErrorCode(zshPtr->interp, "TCL", "ZIP", "CLOSED", (void *)NULL); } return TCL_ERROR; } @@ -1466,7 +1466,7 @@ Tcl_ZlibStreamGet( "unexpected zlib internal state during" " decompression", -1)); Tcl_SetErrorCode(zshPtr->interp, "TCL", "ZIP", "STATE", - NULL); + (void *)NULL); } Tcl_SetByteArrayLength(data, existing); return TCL_ERROR; @@ -2226,7 +2226,7 @@ ZlibCmd( badLevel: Tcl_SetObjResult(interp, Tcl_NewStringObj("level must be 0 to 9", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMPRESSIONLEVEL", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMPRESSIONLEVEL", (void *)NULL); if (extraInfoStr) { Tcl_AddErrorInfo(interp, extraInfoStr); } @@ -2235,7 +2235,7 @@ ZlibCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "buffer size must be %d to %d", MIN_NONSTREAM_BUFFER_SIZE, MAX_BUFFER_SIZE)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", (void *)NULL); return TCL_ERROR; } @@ -2370,7 +2370,7 @@ ZlibStreamSubcmd( return TCL_ERROR; } else if (level < 0 || level > 9) { Tcl_SetObjResult(interp, Tcl_NewStringObj("level must be 0 to 9",-1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMPRESSIONLEVEL", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMPRESSIONLEVEL", (void *)NULL); Tcl_AddErrorInfo(interp, "\n (in -level option)"); return TCL_ERROR; } @@ -2489,13 +2489,13 @@ ZlibPushSubcmd( if (mode == TCL_ZLIB_STREAM_DEFLATE && !(chanMode & TCL_WRITABLE)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "compression may only be applied to writable channels", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "UNWRITABLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "UNWRITABLE", (void *)NULL); return TCL_ERROR; } if (mode == TCL_ZLIB_STREAM_INFLATE && !(chanMode & TCL_READABLE)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "decompression may only be applied to readable channels", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "UNREADABLE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "UNREADABLE", (void *)NULL); return TCL_ERROR; } @@ -2512,7 +2512,7 @@ ZlibPushSubcmd( if (++i > objc-1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value missing for %s option", pushOptions[option])); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", (void *)NULL); return TCL_ERROR; } switch ((enum pushOptionsEnum) option) { @@ -2530,7 +2530,7 @@ ZlibPushSubcmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "level must be 0 to 9", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "COMPRESSIONLEVEL", - NULL); + (void *)NULL); goto genericOptionError; } break; @@ -2542,7 +2542,7 @@ ZlibPushSubcmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "read ahead limit must be 1 to %d", MAX_BUFFER_SIZE)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", (void *)NULL); goto genericOptionError; } break; @@ -2551,7 +2551,7 @@ ZlibPushSubcmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "a compression dictionary may not be set in the " "gzip format", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "BADOPT", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "BADOPT", (void *)NULL); goto genericOptionError; } compDictObj = objv[i]; @@ -2763,7 +2763,7 @@ ZlibStreamAddCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-buffer\" option must be followed by integer " "decompression buffersize", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", (void *)NULL); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[++i], &buffersize) != TCL_OK) { @@ -2773,7 +2773,7 @@ ZlibStreamAddCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "buffer size must be 1 to %d", MAX_BUFFER_SIZE)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BUFFERSIZE", (void *)NULL); return TCL_ERROR; } break; @@ -2782,7 +2782,7 @@ ZlibStreamAddCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-dictionary\" option must be followed by" " compression dictionary bytes", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", (void *)NULL); return TCL_ERROR; } compDictObj = objv[++i]; @@ -2793,7 +2793,7 @@ ZlibStreamAddCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-flush\", \"-fullflush\" and \"-finalize\" options" " are mutually exclusive", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "EXCLUSIVE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "EXCLUSIVE", (void *)NULL); return TCL_ERROR; } } @@ -2890,7 +2890,7 @@ ZlibStreamPutCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-dictionary\" option must be followed by" " compression dictionary bytes", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", (void *)NULL); return TCL_ERROR; } compDictObj = objv[++i]; @@ -2900,7 +2900,7 @@ ZlibStreamPutCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-flush\", \"-fullflush\" and \"-finalize\" options" " are mutually exclusive", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "EXCLUSIVE", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "EXCLUSIVE", (void *)NULL); return TCL_ERROR; } } @@ -2948,7 +2948,7 @@ ZlibStreamHeaderCmd( || zshPtr->format != TCL_ZLIB_FORMAT_GZIP) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "only gunzip streams can produce header information", -1)); - Tcl_SetErrorCode(interp, "TCL", "ZIP", "BADOP", NULL); + Tcl_SetErrorCode(interp, "TCL", "ZIP", "BADOP", (void *)NULL); return TCL_ERROR; } @@ -3391,7 +3391,7 @@ ZlibTransformSetOption( /* not used */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown -flush type \"%s\": must be full or sync", value)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "FLUSH", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "FLUSH", (void *)NULL); return TCL_ERROR; } @@ -3410,7 +3410,7 @@ ZlibTransformSetOption( /* not used */ } else if (newLimit < 1 || newLimit > MAX_BUFFER_SIZE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "-limit must be between 1 and 65536", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "READLIMIT", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "READLIMIT", (void *)NULL); return TCL_ERROR; } } diff --git a/libtommath/bn_s_mp_balance_mul.c b/libtommath/bn_s_mp_balance_mul.c index 7ece5d7..557cc1d 100644 --- a/libtommath/bn_s_mp_balance_mul.c +++ b/libtommath/bn_s_mp_balance_mul.c @@ -19,7 +19,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) if ((err = mp_init_size(&a0, bsize + 2)) != MP_OKAY) { return err; } - if ((err = mp_init_multi(&tmp, &r, NULL)) != MP_OKAY) { + if ((err = mp_init_multi(&tmp, &r, (void *)NULL)) != MP_OKAY) { mp_clear(&a0); return err; } @@ -75,7 +75,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) mp_exch(&r,c); LBL_ERR: - mp_clear_multi(&a0, &tmp, &r,NULL); + mp_clear_multi(&a0, &tmp, &r, (void *)NULL); return err; } #endif diff --git a/libtommath/bn_s_mp_toom_mul.c b/libtommath/bn_s_mp_toom_mul.c index 86901b0..c7db3a5 100644 --- a/libtommath/bn_s_mp_toom_mul.c +++ b/libtommath/bn_s_mp_toom_mul.c @@ -36,7 +36,7 @@ mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) mp_err err; /* init temps */ - if ((err = mp_init_multi(&S1, &S2, &T1, NULL)) != MP_OKAY) { + if ((err = mp_init_multi(&S1, &S2, &T1, (void *)NULL)) != MP_OKAY) { return err; } @@ -208,7 +208,7 @@ LBL_ERRa2: LBL_ERRa1: mp_clear(&a0); LBL_ERRa0: - mp_clear_multi(&S1, &S2, &T1, NULL); + mp_clear_multi(&S1, &S2, &T1, (void *)NULL); return err; } diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 0fbc7a3..eb40b3b 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -203,7 +203,7 @@ TclMacOSXGetFileAttribute( #else Tcl_SetObjResult(interp, Tcl_NewStringObj( "Mac OS X file attributes not supported", -1)); - Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (void *)NULL); return TCL_ERROR; #endif /* HAVE_GETATTRLIST */ } @@ -335,7 +335,7 @@ TclMacOSXSetFileAttribute( if (newRsrcForkSize != 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "setting nonzero rsrclength not supported", -1)); - Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (void *)NULL); return TCL_ERROR; } @@ -376,7 +376,7 @@ TclMacOSXSetFileAttribute( #else Tcl_SetObjResult(interp, Tcl_NewStringObj( "Mac OS X file attributes not supported", -1)); - Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", NULL); + Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (void *)NULL); return TCL_ERROR; #endif } @@ -647,7 +647,7 @@ SetOSTypeFromAny( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected Macintosh OS type but got \"%s\": ", string)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "MAC_OSTYPE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "MAC_OSTYPE", (void *)NULL); } result = TCL_ERROR; } else { diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index 9e9f64f..165c5e3 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -56,7 +56,7 @@ Pkgb_SubObjCmd( || (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) { char buf[TCL_INTEGER_SPACE]; snprintf(buf, sizeof(buf), "%d", Tcl_GetErrorLine(interp)); - Tcl_AppendResult(interp, " in line: ", buf, NULL); + Tcl_AppendResult(interp, " in line: ", buf, (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second)); diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c index e0aa45c..60e3864 100644 --- a/unix/dltest/pkgooa.c +++ b/unix/dltest/pkgooa.c @@ -108,18 +108,18 @@ Pkgooa_Init( } if (tclStubsPtr == NULL) { Tcl_AppendResult(interp, "Tcl stubs are not initialized, " - "did you compile using -DUSE_TCL_STUBS? ", NULL); + "did you compile using -DUSE_TCL_STUBS? ", (void *)NULL); return TCL_ERROR; } if (Tcl_OOInitStubs(interp) == NULL) { return TCL_ERROR; } if (tclOOStubsPtr == NULL) { - Tcl_AppendResult(interp, "TclOO stubs are not initialized", NULL); + Tcl_AppendResult(interp, "TclOO stubs are not initialized", (void *)NULL); return TCL_ERROR; } if (tclOOIntStubsPtr == NULL) { - Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", NULL); + Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", (void *)NULL); return TCL_ERROR; } diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index afceafd..13b183b 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -224,7 +224,7 @@ FindSymbol( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\": %s", symbol, errorStr)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, - NULL); + (void *)NULL); } } return proc; diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 854d4bd..b831e36 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -410,7 +410,7 @@ FindSymbol( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\": %s", symbol, errMsg)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, - NULL); + (void *)NULL); } return (void *)proc; } diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c index dc827fc..b52fa2a 100644 --- a/unix/tclLoadNext.c +++ b/unix/tclLoadNext.c @@ -146,7 +146,7 @@ FindSymbol( if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (void *)NULL); } return proc; } diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c index 03698fa..81468b8 100644 --- a/unix/tclLoadOSF.c +++ b/unix/tclLoadOSF.c @@ -164,7 +164,7 @@ FindSymbol( if (retval == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (void *)NULL); } return retval; } diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 696d938..5a32d03 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -112,7 +112,7 @@ typedef struct { if (interp) { \ Tcl_SetObjResult(interp, Tcl_ObjPrintf( \ "%s not supported for this platform", (detail))); \ - Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", NULL); \ + Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (void *)NULL); \ } /* @@ -910,7 +910,7 @@ TtySetOptionProc( "bad value for -handshake: must be one of" " xonxoff, rtscts, dtrdsr or none", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } return TCL_ERROR; } @@ -931,7 +931,7 @@ TtySetOptionProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -xchar: should be a list of" " two elements with each a single 8-bit character", -1)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", (void *)NULL); } ckfree(argv); return TCL_ERROR; @@ -997,7 +997,7 @@ TtySetOptionProc( "bad value for -ttycontrol: should be a list of" " signal,value pairs", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } ckfree(argv); return TCL_ERROR; @@ -1039,7 +1039,7 @@ TtySetOptionProc( "bad signal \"%s\" for -ttycontrol: must be" " DTR, RTS or BREAK", argv[i])); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } ckfree(argv); return TCL_ERROR; @@ -1071,7 +1071,7 @@ TtySetOptionProc( "bad mode \"%s\" for -closemode: must be" " default, discard, or drain", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } return TCL_ERROR; } @@ -1129,7 +1129,7 @@ TtySetOptionProc( "bad mode \"%s\" for -inputmode: must be" " normal, password, raw, or reset", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } return TCL_ERROR; } @@ -1707,7 +1707,7 @@ TtyParseMode( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s: should be baud,parity,data,stop", bad)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (void *)NULL); } return TCL_ERROR; } @@ -1737,7 +1737,7 @@ TtyParseMode( "n, o, or e" #endif /* PAREXT */ )); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (void *)NULL); } return TCL_ERROR; } @@ -1746,7 +1746,7 @@ TtyParseMode( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s data: should be 5, 6, 7, or 8", bad)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (void *)NULL); } return TCL_ERROR; } @@ -1754,7 +1754,7 @@ TtyParseMode( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s stop: should be 1 or 2", bad)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (void *)NULL); } return TCL_ERROR; } @@ -1861,7 +1861,7 @@ TclpOpenFileChannel( if (interp != (Tcl_Interp *) NULL) { Tcl_AppendResult(interp, "couldn't open \"", TclGetString(pathPtr), "\": filename is invalid on this platform", - NULL); + (void *)NULL); } return NULL; } @@ -2149,13 +2149,13 @@ Tcl_GetOpenFile( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" wasn't opened for writing", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_WRITABLE", - NULL); + (void *)NULL); return TCL_ERROR; } else if (!forWriting && !(chanMode & TCL_READABLE)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" wasn't opened for reading", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_READABLE", - NULL); + (void *)NULL); return TCL_ERROR; } @@ -2187,7 +2187,7 @@ Tcl_GetOpenFile( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot get a FILE * for \"%s\"", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", - "FILE_FAILURE", NULL); + "FILE_FAILURE", (void *)NULL); return TCL_ERROR; } *filePtr = f; @@ -2198,7 +2198,7 @@ Tcl_GetOpenFile( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" cannot be used to get a FILE *", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NO_DESCRIPTOR", - NULL); + (void *)NULL); return TCL_ERROR; } diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index f8eaeb5..b009d97 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1515,7 +1515,7 @@ SetGroupAttribute( " group \"%s\" does not exist", TclGetString(fileName), string)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETGRP", - "NO_GROUP", NULL); + "NO_GROUP", (void *)NULL); } return TCL_ERROR; } @@ -1581,7 +1581,7 @@ SetOwnerAttribute( " user \"%s\" does not exist", TclGetString(fileName), string)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETOWN", - "NO_USER", NULL); + "NO_USER", (void *)NULL); } return TCL_ERROR; } @@ -1676,7 +1676,7 @@ SetPermissionsAttribute( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown permission string format \"%s\"", modeStringPtr)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "PERMISSION", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "PERMISSION", (void *)NULL); } return TCL_ERROR; } diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index ee1229b..bade827 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -162,7 +162,7 @@ TestfilehandlerCmd( return TCL_ERROR; } if (i >= MAX_PIPES) { - Tcl_AppendResult(interp, "bad index ", objv[2], NULL); + Tcl_AppendResult(interp, "bad index ", objv[2], (void *)NULL); return TCL_ERROR; } pipePtr = &testPipes[i]; @@ -191,7 +191,7 @@ TestfilehandlerCmd( return TCL_ERROR; } snprintf(buf, sizeof(buf), "%d %d", pipePtr->readCount, pipePtr->writeCount); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } else if (strcmp(Tcl_GetString(objv[1]), "create") == 0) { if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "index readMode writeMode"); @@ -200,7 +200,7 @@ TestfilehandlerCmd( if (pipePtr->readFile == NULL) { if (!TclpCreatePipe(&pipePtr->readFile, &pipePtr->writeFile)) { Tcl_AppendResult(interp, "couldn't open pipe: ", - Tcl_PosixError(interp), NULL); + Tcl_PosixError(interp), (void *)NULL); return TCL_ERROR; } #ifdef O_NONBLOCK @@ -208,7 +208,7 @@ TestfilehandlerCmd( fcntl(GetFd(pipePtr->writeFile), F_SETFL, O_NONBLOCK); #else Tcl_AppendResult(interp, "can't make pipes non-blocking", - NULL); + (void *)NULL); return TCL_ERROR; #endif } @@ -224,7 +224,7 @@ TestfilehandlerCmd( Tcl_CreateFileHandler(GetFd(pipePtr->readFile), 0, TestFileHandlerProc, pipePtr); } else { - Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[3]), "\"", NULL); + Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[3]), "\"", (void *)NULL); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[4]), "writable") == 0) { @@ -236,7 +236,7 @@ TestfilehandlerCmd( Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), 0, TestFileHandlerProc, pipePtr); } else { - Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[4]), "\"", NULL); + Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[4]), "\"", (void *)NULL); return TCL_ERROR; } } else if (strcmp(Tcl_GetString(objv[1]), "empty") == 0) { @@ -268,7 +268,7 @@ TestfilehandlerCmd( memset(buffer, 'b', 10); TclFormatInt(buf, write(GetFd(pipePtr->writeFile), buffer, 10)); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } else if (strcmp(Tcl_GetString(objv[1]), "oneevent") == 0) { Tcl_DoOneEvent(TCL_FILE_EVENTS|TCL_DONT_WAIT); } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) { @@ -277,7 +277,7 @@ TestfilehandlerCmd( return TCL_ERROR; } if (pipePtr->readFile == NULL) { - Tcl_AppendResult(interp, "pipe ", Tcl_GetString(objv[2]), " doesn't exist", NULL); + Tcl_AppendResult(interp, "pipe ", Tcl_GetString(objv[2]), " doesn't exist", (void *)NULL); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) { @@ -302,7 +302,7 @@ TestfilehandlerCmd( } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), "\": must be close, clear, counts, create, empty, fill, " - "fillpartial, oneevent, wait, or windowevent", NULL); + "fillpartial, oneevent, wait, or windowevent", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -357,7 +357,7 @@ TestfilewaitCmd( Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout"); return TCL_ERROR; } - channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); + channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), (void *)NULL); if (channel == NULL) { return TCL_ERROR; } @@ -369,13 +369,13 @@ TestfilewaitCmd( mask = TCL_WRITABLE|TCL_READABLE; } else { Tcl_AppendResult(interp, "bad argument \"", Tcl_GetString(objv[2]), - "\": must be readable, writable, or both", NULL); + "\": must be readable, writable, or both", (void *)NULL); return TCL_ERROR; } if (Tcl_GetChannelHandle(channel, (mask & TCL_READABLE) ? TCL_READABLE : TCL_WRITABLE, (ClientData*) &data) != TCL_OK) { - Tcl_AppendResult(interp, "couldn't get channel file", NULL); + Tcl_AppendResult(interp, "couldn't get channel file", (void *)NULL); return TCL_ERROR; } fd = PTR2INT(data); @@ -467,7 +467,7 @@ TestforkCmd( pid = fork(); if (pid == -1) { Tcl_AppendResult(interp, - "Cannot fork", NULL); + "Cannot fork", (void *)NULL); return TCL_ERROR; } /* Only needed when pthread_atfork is not present, @@ -522,7 +522,7 @@ TestalarmCmd( action.sa_flags = SA_RESTART; if (sigaction(SIGALRM, &action, NULL) < 0) { - Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), NULL); + Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), (void *)NULL); return TCL_ERROR; } (void) alarm(sec); @@ -531,7 +531,7 @@ TestalarmCmd( Tcl_AppendResult(interp, "warning: sigaction SA_RESTART not support on this platform", - NULL); + (void *)NULL); return TCL_ERROR; #endif } @@ -582,7 +582,7 @@ TestgotsigCmd( TCL_UNUSED(int) /*objc*/, TCL_UNUSED(Tcl_Obj *const *)) { - Tcl_AppendResult(interp, gotsig, NULL); + Tcl_AppendResult(interp, gotsig, (void *)NULL); gotsig = "0"; return TCL_OK; } @@ -634,7 +634,7 @@ TestchmodCmd( } if (chmod(translated, mode) != 0) { Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp), - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_DStringFree(&buffer); diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c index 882f497..e660c69 100644 --- a/unix/tclXtTest.c +++ b/unix/tclXtTest.c @@ -117,7 +117,7 @@ TesteventloopCmd( framePtr = oldFramePtr; } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), - "\": must be done or wait", NULL); + "\": must be done or wait", (void *)NULL); return TCL_ERROR; } return TCL_OK; diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 6558718..9285dcc 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -1254,7 +1254,7 @@ TclpOpenFileChannel( "couldn't open \"%s\": bad file type", TclGetString(pathPtr))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "BAD_TYPE", - NULL); + (void *)NULL); break; } diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 47aba5d..bf5da4d 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -2292,7 +2292,7 @@ ConsoleSetOptionProc( "bad mode \"%s\" for -inputmode: must be" " normal, password, raw, or reset", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } return TCL_ERROR; } diff --git a/win/tclWinFile.c b/win/tclWinFile.c index adc1d7d..5e47098 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -2476,7 +2476,7 @@ TclpFilesystemPathType( return NULL; } - firstSeparator = strchr(path, '/'); + firstSeparator = strchr((char *)path, '/'); if (firstSeparator == NULL) { found = GetVolumeInformationW((const WCHAR *)Tcl_FSGetNativePath(pathPtr), NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index df49337..faf80ee 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -133,32 +133,32 @@ TclpDlopen( if (interp) { switch (lastError) { case ERROR_MOD_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", (void *)NULL); goto notFoundMsg; case ERROR_DLL_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", (void *)NULL); notFoundMsg: Tcl_AppendToObj(errMsg, "this library or a dependent library" " could not be found in library path", TCL_INDEX_NONE); break; case ERROR_PROC_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", (void *)NULL); Tcl_AppendToObj(errMsg, "A function specified in the import" " table could not be resolved by the system. Windows" " is not telling which one, I'm sorry.", TCL_INDEX_NONE); break; case ERROR_INVALID_DLL: - Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", (void *)NULL); Tcl_AppendToObj(errMsg, "this library or a dependent library" " is damaged", TCL_INDEX_NONE); break; case ERROR_DLL_INIT_FAILED: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", (void *)NULL); Tcl_AppendToObj(errMsg, "the library initialization" " routine failed", TCL_INDEX_NONE); break; case ERROR_BAD_EXE_FORMAT: - Tcl_SetErrorCode(interp, "WIN_LOAD", "BAD_EXE_FORMAT", NULL); + Tcl_SetErrorCode(interp, "WIN_LOAD", "BAD_EXE_FORMAT", (void *)NULL); Tcl_AppendToObj(errMsg, "Bad exe format. Possibly a 32/64-bit mismatch.", TCL_INDEX_NONE); break; default: @@ -227,7 +227,7 @@ FindSymbol( if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (void *)NULL); } return proc; } diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 372b77a..bc6dcc6 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1662,7 +1662,7 @@ SerialSetOptionProc( "bad mode \"%s\" for -closemode: must be" " default, discard, or drain", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", - "VALUE", NULL); + "VALUE", (void *)NULL); } return TCL_ERROR; } @@ -1687,7 +1687,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -mode: should be baud,parity,data,stop", value)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (void *)NULL); } return TCL_ERROR; } @@ -1751,7 +1751,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -handshake: must be one of" " xonxoff, rtscts, dtrdsr or none", value)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "HANDSHAKE", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "HANDSHAKE", (void *)NULL); } return TCL_ERROR; } @@ -1780,7 +1780,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -xchar: should be a list of" " two elements with each a single 8-bit character", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", (void *)NULL); } ckfree(argv); return TCL_ERROR; @@ -1837,7 +1837,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -ttycontrol: should be " "a list of signal,value pairs", value)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "TTYCONTROL", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "TTYCONTROL", (void *)NULL); } ckfree(argv); return TCL_ERROR; @@ -1855,7 +1855,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set DTR signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", - "FCONFIGURE", "TTY_SIGNAL", NULL); + "FCONFIGURE", "TTY_SIGNAL", (void *)NULL); } res = TCL_ERROR; break; @@ -1867,7 +1867,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set RTS signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", - "FCONFIGURE", "TTY_SIGNAL", NULL); + "FCONFIGURE", "TTY_SIGNAL", (void *)NULL); } res = TCL_ERROR; break; @@ -1879,7 +1879,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set BREAK signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", - "FCONFIGURE", "TTY_SIGNAL", NULL); + "FCONFIGURE", "TTY_SIGNAL", (void *)NULL); } res = TCL_ERROR; break; @@ -1890,7 +1890,7 @@ SerialSetOptionProc( "bad signal name \"%s\" for -ttycontrol: must be" " DTR, RTS or BREAK", argv[i])); Tcl_SetErrorCode(interp, "TCL", "VALUE", "TTY_SIGNAL", - NULL); + (void *)NULL); } res = TCL_ERROR; break; @@ -1930,7 +1930,7 @@ SerialSetOptionProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -sysbuffer: should be " "a list of one or two integers > 0", value)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "SYS_BUFFER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "SYS_BUFFER", (void *)NULL); } return TCL_ERROR; } diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 0f65268..86f36b4 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -152,7 +152,7 @@ TesteventloopCmd( framePtr = oldFramePtr; } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), - "\": must be done or wait", NULL); + "\": must be done or wait", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -206,11 +206,11 @@ TestvolumetypeCmd( if (found == 0) { Tcl_AppendResult(interp, "could not get volume type for \"", - (path?path:""), "\"", NULL); + (path?path:""), "\"", (void *)NULL); Tcl_WinConvertError(GetLastError()); return TCL_ERROR; } - Tcl_AppendResult(interp, volType, NULL); + Tcl_AppendResult(interp, volType, (void *)NULL); return TCL_OK; #undef VOL_BUF_SIZE } @@ -686,7 +686,7 @@ TestchmodCmd( } if (TestplatformChmod(translated, mode) != 0) { Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp), - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_DStringFree(&buffer); -- cgit v0.12 From 9d3abb8846c9436ab40ac8ed9ecbaa9195f6e1f2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Oct 2023 18:25:25 +0000 Subject: (cherry-pick): document available TCL_TCPSERVER_* flags --- doc/OpenTcp.3 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 index ca26b59..e72556a 100644 --- a/doc/OpenTcp.3 +++ b/doc/OpenTcp.3 @@ -50,7 +50,7 @@ If nonzero, the client socket is connected asynchronously to the server. .AP int backlog in Length of OS listen backlog queue. Use -1 for default value. .AP "unsigned int" flags in -ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional +ORed combination of \fBTCL_TCPSERVER_*\fR flags that specify additional informations about the socket being created. .AP ClientData sock in Platform-specific handle for client TCP socket. @@ -173,7 +173,10 @@ replacement for the standard channel. .PP \fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but gives more flexibility to the user by providing a mean to further customize some -aspects of the socket via the \fIflags\fR parameter. +aspects of the socket via the \fIflags\fR parameter. Available +flags (dependent on platform) are +\fITCL_TCPSERVER_REUSEADDR\fR +\fITCL_TCPSERVER_REUSEPORT\fR .SH "PLATFORM ISSUES" .PP On Unix platforms, the socket handle is a Unix file descriptor as -- cgit v0.12 From c28fb81c1299e87584ea2ecd22107f3649d6d20b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 20 Oct 2023 08:24:47 +0000 Subject: Fix [9d216917e]: nmakehlp.c: remove unused include math.h --- win/nmakehlp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index c8b39a7..b0799f8 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -19,7 +19,6 @@ #pragma comment (lib, "kernel32.lib") #endif #include -#include /* * This library is required for x64 builds with _some_ versions of MSVC @@ -272,7 +271,7 @@ CheckForCompilerFeature( if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, - "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); + "Tried to launch: \"%s\", but got error [%lu]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], @@ -406,7 +405,7 @@ CheckForLinkerFeature( if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, - "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); + "Tried to launch: \"%s\", but got error [%lu]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], -- cgit v0.12 From 0da684fdc5bb947113ddb2a6760ade2b688fe36b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 20 Oct 2023 09:35:20 +0000 Subject: (cherrypick) small part of: [26870862f0]: Wrong sentinel in Tcl_SetErrorCode usage; Handle any C++-compiler as well --- compat/zlib/contrib/minizip/crypt.h | 2 +- libtommath/bn_mp_div.c | 4 ++-- libtommath/bn_s_mp_balance_mul.c | 4 ++-- libtommath/bn_s_mp_toom_mul.c | 4 ++-- unix/dltest/pkgb.c | 2 +- unix/dltest/pkgooa.c | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compat/zlib/contrib/minizip/crypt.h b/compat/zlib/contrib/minizip/crypt.h index f4b93b7..8bde464 100644 --- a/compat/zlib/contrib/minizip/crypt.h +++ b/compat/zlib/contrib/minizip/crypt.h @@ -50,7 +50,7 @@ static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c) (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { - register int keyshift = (int)((*(pkeys+1)) >> 24); + int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c index 71de55b..bca227d 100644 --- a/libtommath/bn_mp_div.c +++ b/libtommath/bn_mp_div.c @@ -31,7 +31,7 @@ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) } /* init our temps */ - if ((err = mp_init_multi(&ta, &tb, &tq, &q, NULL)) != MP_OKAY) { + if ((err = mp_init_multi(&ta, &tb, &tq, &q, (void *)NULL)) != MP_OKAY) { return err; } @@ -64,7 +64,7 @@ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) d->sign = MP_IS_ZERO(d) ? MP_ZPOS : n; } LBL_ERR: - mp_clear_multi(&ta, &tb, &tq, &q, NULL); + mp_clear_multi(&ta, &tb, &tq, &q, (void *)NULL); return err; } diff --git a/libtommath/bn_s_mp_balance_mul.c b/libtommath/bn_s_mp_balance_mul.c index 7ece5d7..557cc1d 100644 --- a/libtommath/bn_s_mp_balance_mul.c +++ b/libtommath/bn_s_mp_balance_mul.c @@ -19,7 +19,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) if ((err = mp_init_size(&a0, bsize + 2)) != MP_OKAY) { return err; } - if ((err = mp_init_multi(&tmp, &r, NULL)) != MP_OKAY) { + if ((err = mp_init_multi(&tmp, &r, (void *)NULL)) != MP_OKAY) { mp_clear(&a0); return err; } @@ -75,7 +75,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) mp_exch(&r,c); LBL_ERR: - mp_clear_multi(&a0, &tmp, &r,NULL); + mp_clear_multi(&a0, &tmp, &r, (void *)NULL); return err; } #endif diff --git a/libtommath/bn_s_mp_toom_mul.c b/libtommath/bn_s_mp_toom_mul.c index 86901b0..c7db3a5 100644 --- a/libtommath/bn_s_mp_toom_mul.c +++ b/libtommath/bn_s_mp_toom_mul.c @@ -36,7 +36,7 @@ mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) mp_err err; /* init temps */ - if ((err = mp_init_multi(&S1, &S2, &T1, NULL)) != MP_OKAY) { + if ((err = mp_init_multi(&S1, &S2, &T1, (void *)NULL)) != MP_OKAY) { return err; } @@ -208,7 +208,7 @@ LBL_ERRa2: LBL_ERRa1: mp_clear(&a0); LBL_ERRa0: - mp_clear_multi(&S1, &S2, &T1, NULL); + mp_clear_multi(&S1, &S2, &T1, (void *)NULL); return err; } diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index b221518..75d1eac 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -56,7 +56,7 @@ Pkgb_SubObjCmd( || (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) { char buf[TCL_INTEGER_SPACE]; snprintf(buf, sizeof(buf), "%d", Tcl_GetErrorLine(interp)); - Tcl_AppendResult(interp, " in line: ", buf, NULL); + Tcl_AppendResult(interp, " in line: ", buf, (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second)); diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c index aed89fe..6a78692 100644 --- a/unix/dltest/pkgooa.c +++ b/unix/dltest/pkgooa.c @@ -108,18 +108,18 @@ Pkgooa_Init( } if (tclStubsPtr == NULL) { Tcl_AppendResult(interp, "Tcl stubs are not initialized, " - "did you compile using -DUSE_TCL_STUBS? ", NULL); + "did you compile using -DUSE_TCL_STUBS? ", (void *)NULL); return TCL_ERROR; } if (Tcl_OOInitStubs(interp) == NULL) { return TCL_ERROR; } if (tclOOStubsPtr == NULL) { - Tcl_AppendResult(interp, "TclOO stubs are not initialized", NULL); + Tcl_AppendResult(interp, "TclOO stubs are not initialized", (void *)NULL); return TCL_ERROR; } if (tclOOIntStubsPtr == NULL) { - Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", NULL); + Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", (void *)NULL); return TCL_ERROR; } -- cgit v0.12 From 6aa2bc6d5c78c18a1562bdae776914890037f24f Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 20 Oct 2023 16:53:14 +0000 Subject: Add test to trigger bug 33b2486199 --- tests/zipfs.test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/zipfs.test b/tests/zipfs.test index c1cde5e..d8817f8 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -19,6 +19,7 @@ if {"::tcltest" ni [namespace children]} { source [file join [file dirname [info script]] tcltests.tcl] testConstraint zipfs [expr {[llength [info commands zipfs]]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.8-}]}] set ziproot [zipfs root] @@ -1923,6 +1924,14 @@ namespace eval test_ns_zipfs { zipfs unmount $mt } -result "" + test bug-33b2486199 "zipfs unmounted on thread exit" -constraints { + thread + } -body { + set before [lsort [zipfs mount]] + thread::release [thread::create] + after 100; # Needed to allow the spawned thread to exit to trigger bug + string equal $before [lsort [zipfs mount]] + } -result 1 } -- cgit v0.12 From d5396e3590b3fbcab61454db55688bd81fe1a59d Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 20 Oct 2023 17:01:48 +0000 Subject: Potential fix --- generic/tclZipfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 6ef921a..c7a194a 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -6287,6 +6287,9 @@ ZipfsAppHookFindTclInit( void TclZipfsFinalize(void) { + if (!TclInExit()) + return; + /* * Finalization steps: * For every mounted archive, if it no longer has any open handles -- cgit v0.12 From a21682acad5156d66092b97a3072e5ace01234b0 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 21 Oct 2023 04:14:33 +0000 Subject: Move zipfs finalization to TclFinalizeFilesystem --- generic/tclIO.c | 1 - generic/tclIOUtil.c | 1 + generic/tclZipfs.c | 58 ++++++++++++++++++++++++++--------------------------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index d79397b..0d047aa 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -706,7 +706,6 @@ TclFinalizeIOSubsystem(void) TclpFinalizeSockets(); TclpFinalizePipes(); - TclZipfsFinalize(); } /* diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 2cb22f5..7719f35 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -761,6 +761,7 @@ TclFinalizeFilesystem(void) * needed. */ + TclZipfsFinalize(); fsRecPtr = filesystemList; while (fsRecPtr != NULL) { FilesystemRecord *tmpFsRecPtr = fsRecPtr->nextPtr; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index c7a194a..9372079 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -6285,18 +6285,25 @@ ZipfsAppHookFindTclInit( } #endif +/* + *------------------------------------------------------------------------ + * + * TclZipfsFinalize -- + * + * Frees all zipfs resources IRRESPECTIVE of open channels (there should + * not be any!) etc. To be called at process exit time (from + * Tcl_Finalize->TclFinalizeFilesystem) + * + * Results: + * None. + * + * Side effects: + * Frees up archives loaded into memory. + * + *------------------------------------------------------------------------ + */ void TclZipfsFinalize(void) { - if (!TclInExit()) - return; - - /* - * Finalization steps: - * For every mounted archive, if it no longer has any open handles - * clean up the mount and associated zip file entries. - * If there are no more mounted archives, clean up and free the - * ZipFS.fileHash and ZipFS.zipHash tables. - */ WriteLock(); if (!ZipFS.initialized) { Unlock(); @@ -6308,30 +6315,21 @@ void TclZipfsFinalize(void) for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); hPtr; hPtr = Tcl_NextHashEntry(&zipSearch)) { ZipFile *zf = (ZipFile *) Tcl_GetHashValue(hPtr); - if (zf->numOpen == 0) { - Tcl_DeleteHashEntry(hPtr); - CleanupMount(zf); - ZipFSCloseArchive(NULL, zf); - ckfree(zf); - } + Tcl_DeleteHashEntry(hPtr); + CleanupMount(zf); /* Frees file entries belonging to the archive */ + ZipFSCloseArchive(NULL, zf); + ckfree(zf); } - hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &zipSearch); - if (hPtr == NULL) { - hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); - if (hPtr == NULL) { - /* Both hash tables empty. Free all resources */ - Tcl_FSUnregister(&zipfsFilesystem); - Tcl_DeleteHashTable(&ZipFS.fileHash); - Tcl_DeleteHashTable(&ZipFS.zipHash); - if (ZipFS.fallbackEntryEncoding) { - ckfree(ZipFS.fallbackEntryEncoding); - ZipFS.fallbackEntryEncoding = NULL; - } - ZipFS.initialized = 0; - } + Tcl_FSUnregister(&zipfsFilesystem); + Tcl_DeleteHashTable(&ZipFS.fileHash); + Tcl_DeleteHashTable(&ZipFS.zipHash); + if (ZipFS.fallbackEntryEncoding) { + ckfree(ZipFS.fallbackEntryEncoding); + ZipFS.fallbackEntryEncoding = NULL; } + ZipFS.initialized = 0; Unlock(); } -- cgit v0.12 From 16620c09c8652d0c78f5a76db7f0baa5fa3c719d Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 21 Oct 2023 11:29:44 +0000 Subject: Test for Windows socket crash --- tests/socket.test | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/socket.test b/tests/socket.test index 82e908a..1d4e0fc 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -2581,6 +2581,14 @@ foreach {servip sc} $x { } } +test socket-bug-31fc36fe47 "Crash listening in multiple threads" \ + -constraints thread -body { + close [socket -server xxx 0] + set tid [thread::create] + thread::send $tid "socket -server accept 0" + thread::release $tid + } -result {} + ::tcltest::cleanupTests flush stdout return -- cgit v0.12 From 492a02091d66a47de657f3f6cf527100a4485b96 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 21 Oct 2023 13:00:54 +0000 Subject: Proposed fix --- tests/socket.test | 4 +- win/tclWinSock.c | 135 +++++++++++++++++++++++++++--------------------------- 2 files changed, 69 insertions(+), 70 deletions(-) diff --git a/tests/socket.test b/tests/socket.test index 1d4e0fc..b628404 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -2585,9 +2585,9 @@ test socket-bug-31fc36fe47 "Crash listening in multiple threads" \ -constraints thread -body { close [socket -server xxx 0] set tid [thread::create] - thread::send $tid "socket -server accept 0" + thread::send $tid {close [socket -server accept 0]} thread::release $tid - } -result {} + } -result 0 ::tcltest::cleanupTests flush stdout diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 7dd5b41..c34835b 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -229,7 +229,7 @@ static WNDCLASSW windowClass; static int TcpConnect(Tcl_Interp *interp, TcpState *state); -static void InitSockets(void); +static void InitSocketWindowClass(void); static TcpState * NewSocketInfo(SOCKET socket); static void SocketExitHandler(void *clientData); static LRESULT CALLBACK SocketProc(HWND hwnd, UINT message, WPARAM wParam, @@ -419,11 +419,11 @@ Tcl_GetHostName(void) * * TclInitSockets -- * - * This function just calls InitSockets(), but is protected by a mutex. + * Initialization of sockets for the thread. Also creates message + * handling window class for the process if needed. * * Results: - * Returns TCL_OK if the system supports sockets, or TCL_ERROR with an - * error in interp (if non-NULL). + * Nothing. Panics on failure. * * Side effects: * If not already prepared, initializes the TSD structure and socket @@ -436,13 +436,58 @@ Tcl_GetHostName(void) void TclInitSockets() { - if (!initialized) { - Tcl_MutexLock(&socketMutex); - if (!initialized) { - InitSockets(); - } - Tcl_MutexUnlock(&socketMutex); + /* Then Per thread initialization. */ + DWORD id; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); + + if (tsdPtr != NULL) { + return; + } + + InitSocketWindowClass(); + + /* + * OK, this thread has never done anything with sockets before. Construct + * a worker thread to handle asynchronous events related to sockets + * assigned to _this_ thread. + */ + + tsdPtr = TCL_TSD_INIT(&dataKey); + tsdPtr->pendingTcpState = NULL; + tsdPtr->socketList = NULL; + tsdPtr->hwnd = NULL; + tsdPtr->threadId = Tcl_GetCurrentThread(); + tsdPtr->readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if (tsdPtr->readyEvent == NULL) { + goto initFailure; + } + tsdPtr->socketListLock = CreateEventW(NULL, FALSE, TRUE, NULL); + if (tsdPtr->socketListLock == NULL) { + goto initFailure; } + tsdPtr->socketThread = CreateThread(NULL, 256, SocketThread, tsdPtr, 0, + &id); + if (tsdPtr->socketThread == NULL) { + goto initFailure; + } + + SetThreadPriority(tsdPtr->socketThread, THREAD_PRIORITY_HIGHEST); + + /* + * Wait for the thread to signal when the window has been created and if + * it is ready to go. + */ + + WaitForSingleObject(tsdPtr->readyEvent, INFINITE); + + if (tsdPtr->hwnd != NULL) { + Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL); + return; + } + + initFailure: + Tcl_Panic("InitSockets failed"); + return; } /* @@ -2326,28 +2371,27 @@ TcpAccept( /* *---------------------------------------------------------------------- * - * InitSockets -- + * InitSocketWindowClass -- * - * Registers the event window for the socket notifier code. - * - * Assumes socketMutex is held. + * Registers the event window class for the socket notifier code. + * Caller must not hold socket mutex lock. * * Results: * None. * * Side effects: - * Register a new window class and creates a - * window for use in asynchronous socket notification. + * Register a new window class. * *---------------------------------------------------------------------- */ static void -InitSockets(void) +InitSocketWindowClass(void) { - DWORD id; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); - + if (initialized) { + return; + } + Tcl_MutexLock(&socketMutex); if (!initialized) { initialized = 1; TclCreateLateExitHandler(SocketExitHandler, NULL); @@ -2375,57 +2419,12 @@ InitSockets(void) goto initFailure; } } - - /* - * Check for per-thread initialization. - */ - - if (tsdPtr != NULL) { - return; - } - - /* - * OK, this thread has never done anything with sockets before. Construct - * a worker thread to handle asynchronous events related to sockets - * assigned to _this_ thread. - */ - - tsdPtr = TCL_TSD_INIT(&dataKey); - tsdPtr->pendingTcpState = NULL; - tsdPtr->socketList = NULL; - tsdPtr->hwnd = NULL; - tsdPtr->threadId = Tcl_GetCurrentThread(); - tsdPtr->readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - if (tsdPtr->readyEvent == NULL) { - goto initFailure; - } - tsdPtr->socketListLock = CreateEventW(NULL, FALSE, TRUE, NULL); - if (tsdPtr->socketListLock == NULL) { - goto initFailure; - } - tsdPtr->socketThread = CreateThread(NULL, 256, SocketThread, tsdPtr, 0, - &id); - if (tsdPtr->socketThread == NULL) { - goto initFailure; - } - - SetThreadPriority(tsdPtr->socketThread, THREAD_PRIORITY_HIGHEST); - - /* - * Wait for the thread to signal when the window has been created and if - * it is ready to go. - */ - - WaitForSingleObject(tsdPtr->readyEvent, INFINITE); - - if (tsdPtr->hwnd != NULL) { - Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL); - return; - } + Tcl_MutexUnlock(&socketMutex); + return; initFailure: + Tcl_MutexUnlock(&socketMutex); /* Probably pointless before panicing */ Tcl_Panic("InitSockets failed"); - return; } /* -- cgit v0.12 From 2d34656de08ad9831a1d29466ceeb4f532aa3b3f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 22 Oct 2023 19:49:24 +0000 Subject: Remaining fixes for [26870862f0]: Wrong sentinel in Tcl_SetErrorCode usage --- generic/tclBinary.c | 4 ++-- generic/tclCompile.c | 2 +- generic/tclIOGT.c | 2 +- generic/tclObj.c | 6 +++--- generic/tclScan.c | 2 +- generic/tclStubInit.c | 8 ++++---- generic/tclUtil.c | 7 +------ 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index f97c3c7..a09eacb 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -400,7 +400,7 @@ TclGetBytesFromObj( if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "byte sequence length exceeds INT_MAX", -1)); - Tcl_SetErrorCode(interp, "TCL", "API", "OUTDATED", NULL); + Tcl_SetErrorCode(interp, "TCL", "API", "OUTDATED", (void *)NULL); } return NULL; } else { @@ -519,7 +519,7 @@ MakeByteArray( "expected byte sequence but character %" TCL_Z_MODIFIER "u was '%1s' (U+%06X)", dst - byteArrayPtr->bytes, src, ch)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", (void *)NULL); } Tcl_Free(byteArrayPtr); *byteArrayPtrPtr = NULL; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 5ff0c18..e93fd4a 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2197,7 +2197,7 @@ TclCompileScript( Tcl_ObjPrintf("Script length %" TCL_SIZE_MODIFIER "d exceeds max permitted length %d.", numBytes, INT_MAX-1)); - Tcl_SetErrorCode(interp, "TCL", "LIMIT", "SCRIPTLENGTH", NULL); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "SCRIPTLENGTH", (void *)NULL); TclCompileSyntaxError(interp, envPtr); return; } diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index f577599..b2b959d 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -474,7 +474,7 @@ ExecuteCallback( } nonBytes: Tcl_AppendResult(interp, "chan transform callback received non-bytes", - NULL); + (void *)NULL); Tcl_Release(eval); return TCL_ERROR; diff --git a/generic/tclObj.c b/generic/tclObj.c index 5ae433e..aed24cd 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3658,9 +3658,9 @@ Tcl_GetNumber( } if (numBytes > INT_MAX) { if (interp) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "max size for a Tcl value (%d bytes) exceeded", INT_MAX)); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max size for a Tcl value (%d bytes) exceeded", INT_MAX)); + Tcl_SetErrorCode(interp, "TCL", "MEMORY", (void *)NULL); } return TCL_ERROR; } diff --git a/generic/tclScan.c b/generic/tclScan.c index 17fd1a9..222b06d 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -368,7 +368,7 @@ ValidateFormat( ull, (Tcl_Size)TCL_SIZE_MAX-1)); Tcl_SetErrorCode( - interp, "TCL", "FORMAT", "WIDTHLIMIT", NULL); + interp, "TCL", "FORMAT", "WIDTHLIMIT", (void *)NULL); goto error; } flags |= SCAN_WIDTH; diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 4ed0651..754023c 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -112,7 +112,7 @@ int TclListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, if (objcPtr) { if ((sizeof(int) != sizeof(size_t)) && (result == TCL_OK) && (n > INT_MAX)) { if (interp) { - Tcl_AppendResult(interp, "List too large to be processed", NULL); + Tcl_AppendResult(interp, "List too large to be processed", (void *)NULL); } return TCL_ERROR; } @@ -127,7 +127,7 @@ int TclListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, if (lengthPtr) { if ((sizeof(int) != sizeof(size_t)) && (result == TCL_OK) && (n > INT_MAX)) { if (interp) { - Tcl_AppendResult(interp, "List too large to be processed", NULL); + Tcl_AppendResult(interp, "List too large to be processed", (void *)NULL); } return TCL_ERROR; } @@ -142,7 +142,7 @@ int TclDictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, if (sizePtr) { if ((sizeof(int) != sizeof(size_t)) && (result == TCL_OK) && (n > INT_MAX)) { if (interp) { - Tcl_AppendResult(interp, "Dict too large to be processed", NULL); + Tcl_AppendResult(interp, "Dict too large to be processed", (void *)NULL); } return TCL_ERROR; } @@ -157,7 +157,7 @@ int TclSplitList(Tcl_Interp *interp, const char *listStr, void *argcPtr, if (argcPtr) { if ((sizeof(int) != sizeof(size_t)) && (result == TCL_OK) && (n > INT_MAX)) { if (interp) { - Tcl_AppendResult(interp, "List too large to be processed", NULL); + Tcl_AppendResult(interp, "List too large to be processed", (void *)NULL); } Tcl_Free((void *)*argvPtr); return TCL_ERROR; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 4f1a741..579d822 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3925,12 +3925,7 @@ rangeerror: Tcl_SetObjResult( interp, Tcl_ObjPrintf("index \"%s\" out of range", TclGetString(objPtr))); - Tcl_SetErrorCode(interp, - "TCL", - "VALUE", - "INDEX" - "OUTOFRANGE", - NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", "OUTOFRANGE", (void *)NULL); } return TCL_ERROR; } -- cgit v0.12 From 0b4cf50a01e85aca7d33768c49c90511ed613082 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Oct 2023 13:53:38 +0000 Subject: Fix build-info for 64-bit Windows: This is not an "ilp32" platform --- generic/tclEvent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index cd1b5da..ef87c47 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1093,7 +1093,7 @@ static const struct { #ifdef __INTEL_COMPILER ".icc-" STRINGIFY(__INTEL_COMPILER) #endif -#if (defined(_WIN32) && !defined(_WIN64)) || (ULONG_MAX == 0xffffffffUL) +#if (defined(_WIN32) || (ULONG_MAX == 0xffffffffUL)) && !defined(_WIN64) ".ilp32" #endif #ifdef TCL_MEM_DEBUG -- cgit v0.12 From ae695082eef0d6fb62c464f80649af308c951062 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 25 Oct 2023 19:18:14 +0000 Subject: Obsolete tests unixInit-2.* testing older versions of the internal routine TclpInitLibraryPath() have been skipped since at least Tcl 8.5.2. Remove them. --- tests/unixInit.test | 243 ---------------------------------------------------- 1 file changed, 243 deletions(-) diff --git a/tests/unixInit.test b/tests/unixInit.test index 51ecafe..5f02031 100644 --- a/tests/unixInit.test +++ b/tests/unixInit.test @@ -81,249 +81,6 @@ test unixInit-1.2 {initialisation: standard channel type deduction} {unix stdio} } } {OK} -# The unixInit-2.* tests were written to test the internal routine, -# TclpInitLibraryPath. That routine no longer does the things it used to do -# so those tests are obsolete. Skip them. - -skip [concat [skip] unixInit-2.*] - -test unixInit-2.0 {TclpInitLibraryPath: setting tclDefaultEncodingDir} { - set origDir [testgetdefenc] - testsetdefenc slappy - set path [testgetdefenc] - testsetdefenc $origDir - set path -} {slappy} -test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - unset env(TCL_LIBRARY) - } -} -body { - set path [getlibpath] - set installLib lib/tcl[info tclversion] - set developLib tcl[info patchlevel]/library - set prefix [file dirname [file dirname [interpreter]]] - list [string equal [lindex $path 0] $prefix/$installLib] \ - [string equal [lindex $path 4] [file dirname $prefix]/$developLib] -} -cleanup { - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result {1 1} -test unixInit-2.2 {TclpInitLibraryPath: TCL_LIBRARY} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } -} -body { - # ((str != NULL) && (str[0] != '\0')) - set env(TCL_LIBRARY) sparkly - lindex [getlibpath] 0 -} -cleanup { - unset -nocomplain env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result "sparkly" -test unixInit-2.3 {TclpInitLibraryPath: TCL_LIBRARY wrong version} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } -} -body { - # ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc - 1]) != 0)) - set env(TCL_LIBRARY) /a/b/tcl1.7 - lrange [getlibpath] 0 1 -} -cleanup { - unset -nocomplain env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result [list /a/b/tcl1.7 /a/b/tcl[info tclversion]] -test unixInit-2.4 {TclpInitLibraryPath: TCL_LIBRARY: INTL} -setup { - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } -} -body { - # Child process translates env variable from native encoding. - set env(TCL_LIBRARY) "\xa7" - lindex [getlibpath] 0 -} -cleanup { - unset -nocomplain env(TCL_LIBRARY) env(LANG) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result "\xa7" -test unixInit-2.5 {TclpInitLibraryPath: compiled-in library path} { - # cannot test -} {} -test unixInit-2.6 {TclpInitLibraryPath: executable relative} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } - set env(TCL_LIBRARY) [info library] - makeDirectory tmp - makeDirectory [file join tmp sparkly] - makeDirectory [file join tmp sparkly bin] - file copy [interpreter] [file join [temporaryDirectory] tmp sparkly \ - bin tcltest] - makeDirectory [file join tmp sparkly lib] - makeDirectory [file join tmp sparkly lib tcl[info tclversion]] - makeFile {} [file join tmp sparkly lib tcl[info tclversion] init.tcl] -} -body { - lrange [getlibpath [file join [temporaryDirectory] tmp sparkly \ - bin tcltest]] 1 2 -} -cleanup { - removeFile [file join tmp sparkly lib tcl[info tclversion] init.tcl] - removeDirectory [file join tmp sparkly lib tcl[info tclversion]] - removeDirectory [file join tmp sparkly lib] - removeDirectory [file join tmp sparkly bin] - removeDirectory [file join tmp sparkly] - removeDirectory tmp - unset env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result [list [temporaryDirectory]/tmp/sparkly/lib/tcl[info tclversion] [temporaryDirectory]/tmp/lib/tcl[info tclversion]] -test unixInit-2.7 {TclpInitLibraryPath: compiled-in library path} { - # would need test command to get defaultLibDir and compare it to - # [lindex $auto_path end] -} {} -# -# The following two tests write to the directory /tmp/sparkly instead of to -# [temporaryDirectory]. This is because the failures tested by these tests -# need paths near the "root" of the file system to present themselves. -# -test unixInit-2.8 {TclpInitLibraryPath: all absolute pathtype} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } - set env(TCL_LIBRARY) [info library] - # Checking for Bug 219416 - # When a program that embeds the Tcl library, like tcltest, is installed - # near the "root" of the file system, there was a problem constructing - # directories relative to the executable. When a relative ".." went past - # the root, relative path names were created rather than absolute - # pathnames. In some cases, accessing past the root caused memory access - # violations too. - # - # The bug is now fixed, but here we check for it by making sure that the - # directories constructed relative to the executable are all absolute - # pathnames, even when the executable is installed near the root of the - # filesystem. - # - # The only directory near the root we are likely to have write access to - # is /tmp. - file delete -force /tmp/sparkly - file delete -force /tmp/lib/tcl[info tclversion] - file mkdir /tmp/sparkly - file copy [interpreter] /tmp/sparkly/tcltest - # Keep any existing /tmp/lib directory - set deletelib 1 - if {[file exists /tmp/lib]} { - if {[file isdirectory /tmp/lib]} { - set deletelib 0 - } else { - file delete -force /tmp/lib - } - } - # For a successful Tcl_Init, we need a [source]-able init.tcl in - # ../lib/tcl$version relative to the executable. - file mkdir /tmp/lib/tcl[info tclversion] - close [open /tmp/lib/tcl[info tclversion]/init.tcl w] -} -body { - # Check that all directories in the library path are absolute pathnames - set allAbsolute 1 - foreach dir [getlibpath /tmp/sparkly/tcltest] { - set allAbsolute [expr {$allAbsolute \ - && [string equal absolute [file pathtype $dir]]}] - } - set allAbsolute -} -cleanup { - # Clean up temporary installation - file delete -force /tmp/sparkly - file delete -force /tmp/lib/tcl[info tclversion] - if {$deletelib} {file delete -force /tmp/lib} - unset env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result 1 -test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -setup { - # Checking for Bug 438014 - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } - set env(TCL_LIBRARY) [info library] - file delete -force /tmp/sparkly - file delete -force /tmp/library - file mkdir /tmp/sparkly - file copy [interpreter] /tmp/sparkly/tcltest - file mkdir /tmp/library/ - close [open /tmp/library/init.tcl w] -} -body { - lrange [getlibpath /tmp/sparkly/tcltest] 1 5 -} -cleanup { - file delete -force /tmp/sparkly - file delete -force /tmp/library - unset env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result [list /tmp/lib/tcl[info tclversion] /lib/tcl[info tclversion] \ - /tmp/library /library /tcl[info patchlevel]/library] -test unixInit-2.10 {TclpInitLibraryPath: executable relative} -setup { - unset -nocomplain oldlibrary - if {[info exists env(TCL_LIBRARY)]} { - set oldlibrary $env(TCL_LIBRARY) - } - set env(TCL_LIBRARY) [info library] - set tmpDir [makeDirectory tmp] - set sparklyDir [makeDirectory sparkly $tmpDir] - set execPath [file join [makeDirectory bin $sparklyDir] tcltest] - file copy [interpreter] $execPath - set libDir [makeDirectory lib $sparklyDir] - set scriptDir [makeDirectory tcl[info tclversion] $libDir] - makeFile {} init.tcl $scriptDir - set saveDir [pwd] - cd $libDir -} -body { - # Checking for Bug 832657 - set x [lrange [getlibpath [file join .. bin tcltest]] 3 4] - foreach p $x { - lappend y [file normalize $p] - } - set y -} -cleanup { - cd $saveDir - removeFile init.tcl $scriptDir - removeDirectory tcl[info tclversion] $libDir - file delete $execPath - removeDirectory bin $sparklyDir - removeDirectory lib $sparklyDir - removeDirectory sparkly $tmpDir - removeDirectory tmp - unset -nocomplain saveDir scriptDir libDir execPath sparklyDir tmpDir - unset -nocomplain x p y env(TCL_LIBRARY) - if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary - unset oldlibrary - } -} -result [list [file join [temporaryDirectory] tmp sparkly library] \ - [file join [temporaryDirectory] tmp library] ] - test unixInit-3.1 {TclpSetInitialEncodings} -constraints { unix stdio } -body { -- cgit v0.12 From c0a807097346d519940330d1ed1ae11c4fe9af22 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Oct 2023 20:08:53 +0000 Subject: Final fix for [8ab8a138c9]: functions passed to Tcl_EventuallyFree() must be declared/defined as Tcl_FreeProc. Don't try to suppress the warning any more, as it even confuses UBSan more than that it helps --- generic/tclDecls.h | 8 --- generic/tclTest.c | 178 ++++++++++++++++++++++++++--------------------------- 2 files changed, 89 insertions(+), 97 deletions(-) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 78eba87..0fe582e 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4149,14 +4149,6 @@ extern const TclStubs *tclStubsPtr; # define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp)) # define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) -#ifndef __cplusplus -# undef Tcl_EventuallyFree -# define Tcl_EventuallyFree \ - ((void (*)(void *,void *))(void *)(tclStubsPtr->tcl_EventuallyFree)) /* 132 */ -# undef Tcl_SetResult -# define Tcl_SetResult \ - ((void (*)(Tcl_Interp *, char *, void *))(void *)(tclStubsPtr->tcl_SetResult)) /* 232 */ -#endif #endif #if defined(_WIN32) && defined(UNICODE) diff --git a/generic/tclTest.c b/generic/tclTest.c index 6cd29f2..f4ae941 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -882,7 +882,7 @@ TestasyncCmd( if (argc < 2) { wrongNumArgs: - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "create") == 0) { @@ -971,7 +971,7 @@ TestasyncCmd( if (Tcl_CreateThread(&threadID, AsyncThreadProc, INT2PTR(id), TCL_THREAD_STACK_DEFAULT, TCL_THREAD_NOFLAGS) != TCL_OK) { - Tcl_AppendResult(interp, "can't create thread", NULL); + Tcl_AppendResult(interp, "can't create thread", (void *)NULL); Tcl_MutexUnlock(&asyncTestMutex); return TCL_ERROR; } @@ -981,7 +981,7 @@ TestasyncCmd( Tcl_MutexUnlock(&asyncTestMutex); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, delete, int, mark, or marklater", NULL); + "\": must be create, delete, int, mark, or marklater", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1141,17 +1141,17 @@ TestcmdinfoObjCmd( break; case CMDINFO_GET: if (Tcl_GetCommandInfo(interp, Tcl_GetString(objv[2]), &info) ==0) { - Tcl_AppendResult(interp, "??", NULL); + Tcl_AppendResult(interp, "??", (void *)NULL); return TCL_OK; } if (info.proc == CmdProc1) { Tcl_AppendResult(interp, "CmdProc1", " ", - (char *) info.clientData, NULL); + (char *) info.clientData, (void *)NULL); } else if (info.proc == CmdProc2) { Tcl_AppendResult(interp, "CmdProc2", " ", - (char *) info.clientData, NULL); + (char *) info.clientData, (void *)NULL); } else { - Tcl_AppendResult(interp, "unknown", NULL); + Tcl_AppendResult(interp, "unknown", (void *)NULL); } if (info.deleteProc == CmdDelProc1) { Tcl_AppendResult(interp, " CmdDelProc1", " ", @@ -1160,15 +1160,15 @@ TestcmdinfoObjCmd( Tcl_AppendResult(interp, " CmdDelProc2", " ", (char *) info.deleteData, NULL); } else { - Tcl_AppendResult(interp, " unknown", NULL); + Tcl_AppendResult(interp, " unknown", (void *)NULL); } - Tcl_AppendResult(interp, " ", info.namespacePtr->fullName, NULL); + Tcl_AppendResult(interp, " ", info.namespacePtr->fullName, (void *)NULL); if (info.isNativeObjectProc == 0) { - Tcl_AppendResult(interp, " stringProc", NULL); + Tcl_AppendResult(interp, " stringProc", (void *)NULL); } else if (info.isNativeObjectProc == 1) { - Tcl_AppendResult(interp, " nativeObjectProc", NULL); + Tcl_AppendResult(interp, " nativeObjectProc", (void *)NULL); } else if (info.isNativeObjectProc == 2) { - Tcl_AppendResult(interp, " nativeObjectProc2", NULL); + Tcl_AppendResult(interp, " nativeObjectProc2", (void *)NULL); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf("Invalid isNativeObjectProc value %d", info.isNativeObjectProc)); @@ -1204,7 +1204,7 @@ CmdProc0( TCL_UNUSED(const char **) /*argv*/) { TestCommandTokenRef *refPtr = (TestCommandTokenRef *) clientData; - Tcl_AppendResult(interp, "CmdProc1 ", refPtr->value, NULL); + Tcl_AppendResult(interp, "CmdProc1 ", refPtr->value, (void *)NULL); return TCL_OK; } @@ -1215,7 +1215,7 @@ CmdProc1( TCL_UNUSED(int) /*argc*/, TCL_UNUSED(const char **) /*argv*/) { - Tcl_AppendResult(interp, "CmdProc1 ", (char *) clientData, NULL); + Tcl_AppendResult(interp, "CmdProc1 ", (char *) clientData, (void *)NULL); return TCL_OK; } @@ -1226,7 +1226,7 @@ CmdProc2( TCL_UNUSED(int) /*argc*/, TCL_UNUSED(const char **) /*argv*/) { - Tcl_AppendResult(interp, "CmdProc2 ", (char *) clientData, NULL); + Tcl_AppendResult(interp, "CmdProc2 ", (char *) clientData, (void *)NULL); return TCL_OK; } @@ -1300,7 +1300,7 @@ TestcmdtokenCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option arg\"", NULL); + " option arg\"", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "create") == 0) { @@ -1317,7 +1317,7 @@ TestcmdtokenCmd( } else { if (sscanf(argv[2], "%d", &id) != 1) { Tcl_AppendResult(interp, "bad command token \"", argv[2], - "\"", NULL); + "\"", (void *)NULL); return TCL_ERROR; } @@ -1330,7 +1330,7 @@ TestcmdtokenCmd( if (refPtr == NULL) { Tcl_AppendResult(interp, "bad command token \"", argv[2], - "\"", NULL); + "\"", (void *)NULL); return TCL_ERROR; } @@ -1346,7 +1346,7 @@ TestcmdtokenCmd( Tcl_DecrRefCount(objPtr); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, name, or free", NULL); + "\": must be create, name, or free", (void *)NULL); return TCL_ERROR; } } @@ -1384,7 +1384,7 @@ TestcmdtraceCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option script\"", NULL); + " option script\"", (void *)NULL); return TCL_ERROR; } @@ -1394,7 +1394,7 @@ TestcmdtraceCmd( result = Tcl_EvalEx(interp, argv[2], TCL_INDEX_NONE, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); - Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); + Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), (void *)NULL); } Tcl_DeleteTrace(interp, cmdTrace); Tcl_DStringFree(&buffer); @@ -1416,7 +1416,7 @@ TestcmdtraceCmd( result = Tcl_EvalEx(interp, argv[2], TCL_INDEX_NONE, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); - Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); + Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), (void *)NULL); } Tcl_DeleteTrace(interp, cmdTrace); Tcl_DStringFree(&buffer); @@ -1434,7 +1434,7 @@ TestcmdtraceCmd( result = Tcl_EvalEx(interp, argv[2], TCL_INDEX_NONE, 0); Tcl_DeleteTrace(interp, cmdTrace); if (!deleteCalled) { - Tcl_AppendResult(interp, "Delete wasn't called", NULL); + Tcl_AppendResult(interp, "Delete wasn't called", (void *)NULL); return TCL_ERROR; } else { return result; @@ -1448,14 +1448,14 @@ TestcmdtraceCmd( result = Tcl_EvalEx(interp, argv[2], TCL_INDEX_NONE, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); - Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); + Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), (void *)NULL); } Tcl_DeleteTrace(interp, t2); Tcl_DeleteTrace(interp, t1); Tcl_DStringFree(&buffer); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be tracetest, deletetest, doubletest or resulttest", NULL); + "\": must be tracetest, deletetest, doubletest or resulttest", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1573,7 +1573,7 @@ TestcreatecommandCmd( { if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option\"", NULL); + " option\"", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "create") == 0) { @@ -1588,7 +1588,7 @@ TestcreatecommandCmd( Tcl_DeleteCommand(interp, "value:at:"); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, delete, create2, or delete2", NULL); + "\": must be create, delete, create2, or delete2", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1612,7 +1612,7 @@ CreatedCommandProc( return TCL_ERROR; } Tcl_AppendResult(interp, "CreatedCommandProc in ", - info.namespacePtr->fullName, NULL); + info.namespacePtr->fullName, (void *)NULL); return TCL_OK; } @@ -1629,11 +1629,11 @@ CreatedCommandProc2( found = Tcl_GetCommandInfo(interp, "value:at:", &info); if (!found) { Tcl_AppendResult(interp, "CreatedCommandProc2 could not get command info for test_ns_basic::createdcommand", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_AppendResult(interp, "CreatedCommandProc2 in ", - info.namespacePtr->fullName, NULL); + info.namespacePtr->fullName, (void *)NULL); return TCL_OK; } @@ -1729,7 +1729,7 @@ TestdelCmd( Tcl_Interp *child; if (argc != 4) { - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } @@ -1757,7 +1757,7 @@ DelCmdProc( { DelCmd *dPtr = (DelCmd *) clientData; - Tcl_AppendResult(interp, dPtr->deleteCmd, NULL); + Tcl_AppendResult(interp, dPtr->deleteCmd, (void *)NULL); ckfree(dPtr->deleteCmd); ckfree(dPtr); return TCL_OK; @@ -1802,7 +1802,7 @@ TestdelassocdataCmd( { if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key\"", NULL); + " data_key\"", (void *)NULL); return TCL_ERROR; } Tcl_DeleteAssocData(interp, argv[1]); @@ -1928,7 +1928,7 @@ TestdstringCmd( if (argc < 2) { wrongNumArgs: - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "append") == 0) { @@ -1964,9 +1964,9 @@ TestdstringCmd( goto wrongNumArgs; } if (strcmp(argv[2], "staticsmall") == 0) { - Tcl_AppendResult(interp, "short", NULL); + Tcl_AppendResult(interp, "short", (void *)NULL); } else if (strcmp(argv[2], "staticlarge") == 0) { - Tcl_AppendResult(interp, "first0 first1 first2 first3 first4 first5 first6 first7 first8 first9\nsecond0 second1 second2 second3 second4 second5 second6 second7 second8 second9\nthird0 third1 third2 third3 third4 third5 third6 third7 third8 third9\nfourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9\nfifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9\nsixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9\nseventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9\n", NULL); + Tcl_AppendResult(interp, "first0 first1 first2 first3 first4 first5 first6 first7 first8 first9\nsecond0 second1 second2 second3 second4 second5 second6 second7 second8 second9\nthird0 third1 third2 third3 third4 third5 third6 third7 third8 third9\nfourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9\nfifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9\nsixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9\nseventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9\n", (void *)NULL); } else if (strcmp(argv[2], "free") == 0) { char *s = (char *)ckalloc(100); strcpy(s, "This is a malloc-ed string"); @@ -1978,7 +1978,7 @@ TestdstringCmd( } else { Tcl_AppendResult(interp, "bad gresult option \"", argv[2], "\": must be staticsmall, staticlarge, free, or special", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_DStringGetResult(interp, &dstring); @@ -2014,7 +2014,7 @@ TestdstringCmd( } else { Tcl_AppendResult(interp, "bad option \"", argv[1], "\": must be append, element, end, free, get, gresult, length, " - "result, start, toobj, or trunc", NULL); + "result, start, toobj, or trunc", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -2485,7 +2485,7 @@ TestevalexObjCmd( const char *global = Tcl_GetString(objv[2]); if (strcmp(global, "global") != 0) { Tcl_AppendResult(interp, "bad value \"", global, - "\": must be global", NULL); + "\": must be global", (void *)NULL); return TCL_ERROR; } flags = TCL_EVAL_GLOBAL; @@ -2754,7 +2754,7 @@ TestexithandlerCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " create|delete value\"", NULL); + " create|delete value\"", (void *)NULL); return TCL_ERROR; } if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) { @@ -2768,7 +2768,7 @@ TestexithandlerCmd( INT2PTR(value)); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create or delete", NULL); + "\": must be create or delete", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -2832,7 +2832,7 @@ TestexprlongCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " expression\"", NULL); + " expression\"", (void *)NULL); return TCL_ERROR; } Tcl_AppendResult(interp, "This is a result", NULL); @@ -2841,7 +2841,7 @@ TestexprlongCmd( return result; } snprintf(buf, sizeof(buf), ": %ld", exprResult); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } @@ -2877,13 +2877,13 @@ TestexprlongobjCmd( Tcl_WrongNumArgs(interp, 1, objv, "expression"); return TCL_ERROR; } - Tcl_AppendResult(interp, "This is a result", NULL); + Tcl_AppendResult(interp, "This is a result", (void *)NULL); result = Tcl_ExprLongObj(interp, objv[1], &exprResult); if (result != TCL_OK) { return result; } snprintf(buf, sizeof(buf), ": %ld", exprResult); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } @@ -2917,17 +2917,17 @@ TestexprdoubleCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " expression\"", NULL); + " expression\"", (void *)NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, "This is a result", NULL); + Tcl_AppendResult(interp, "This is a result", (void *)NULL); result = Tcl_ExprDouble(interp, argv[1], &exprResult); if (result != TCL_OK) { return result; } strcpy(buf, ": "); Tcl_PrintDouble(interp, exprResult, buf+2); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } @@ -2963,14 +2963,14 @@ TestexprdoubleobjCmd( Tcl_WrongNumArgs(interp, 1, objv, "expression"); return TCL_ERROR; } - Tcl_AppendResult(interp, "This is a result", NULL); + Tcl_AppendResult(interp, "This is a result", (void *)NULL); result = Tcl_ExprDoubleObj(interp, objv[1], &exprResult); if (result != TCL_OK) { return result; } strcpy(buf, ": "); Tcl_PrintDouble(interp, exprResult, buf+2); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } @@ -2999,7 +2999,7 @@ TestexprstringCmd( { if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " expression\"", NULL); + " expression\"", (void *)NULL); return TCL_ERROR; } return Tcl_ExprString(interp, argv[1]); @@ -3048,7 +3048,7 @@ TestfilelinkCmd( Tcl_AppendResult(interp, "could not create link from \"", Tcl_GetString(objv[1]), "\" to \"", Tcl_GetString(objv[2]), "\": ", - Tcl_PosixError(interp), NULL); + Tcl_PosixError(interp), (void *)NULL); return TCL_ERROR; } } else { @@ -3057,7 +3057,7 @@ TestfilelinkCmd( if (contents == NULL) { Tcl_AppendResult(interp, "could not read link \"", Tcl_GetString(objv[1]), "\": ", - Tcl_PosixError(interp), NULL); + Tcl_PosixError(interp), (void *)NULL); return TCL_ERROR; } } @@ -3100,12 +3100,12 @@ TestgetassocdataCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key\"", NULL); + " data_key\"", (void *)NULL); return TCL_ERROR; } res = (char *) Tcl_GetAssocData(interp, argv[1], NULL); if (res != NULL) { - Tcl_AppendResult(interp, res, NULL); + Tcl_AppendResult(interp, res, (void *)NULL); } return TCL_OK; } @@ -3141,11 +3141,11 @@ TestgetplatformCmd( if (argc != 1) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - NULL); + (void *)NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, platformStrings[*platform], NULL); + Tcl_AppendResult(interp, platformStrings[*platform], (void *)NULL); return TCL_OK; } @@ -3178,7 +3178,7 @@ TestinterpdeleteCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " path\"", NULL); + " path\"", (void *)NULL); return TCL_ERROR; } childToDelete = Tcl_GetChild(interp, argv[1]); @@ -3236,7 +3236,7 @@ TestlinkCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " option ?arg arg arg arg arg arg arg arg arg arg arg arg" - " arg arg?\"", NULL); + " arg arg?\"", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "create") == 0) { @@ -3244,7 +3244,7 @@ TestlinkCmd( Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ", argv[1], " intRO realRO boolRO stringRO wideRO charRO ucharRO shortRO" - " ushortRO uintRO longRO ulongRO floatRO uwideRO\"", NULL); + " ushortRO uintRO longRO ulongRO floatRO uwideRO\"", (void *)NULL); return TCL_ERROR; } if (created) { @@ -3453,7 +3453,7 @@ TestlinkCmd( argv[0], " ", argv[1], " intValue realValue boolValue stringValue wideValue" " charValue ucharValue shortValue ushortValue uintValue" - " longValue ulongValue floatValue uwideValue\"", NULL); + " longValue ulongValue floatValue uwideValue\"", (void *)NULL); return TCL_ERROR; } if (argv[2][0] != 0) { @@ -3557,7 +3557,7 @@ TestlinkCmd( argv[0], " ", argv[1], " intValue realValue boolValue stringValue wideValue" " charValue ucharValue shortValue ushortValue uintValue" - " longValue ulongValue floatValue uwideValue\"", NULL); + " longValue ulongValue floatValue uwideValue\"", (void *)NULL); return TCL_ERROR; } if (argv[2][0] != 0) { @@ -3669,7 +3669,7 @@ TestlinkCmd( } } else { Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": should be create, delete, get, set, or update", NULL); + "\": should be create, delete, get, set, or update", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -3868,7 +3868,7 @@ TestlistrepCmd( } resultObj = TclListTestObj(length, leadSpace, endSpace); if (resultObj == NULL) { - Tcl_AppendResult(interp, "List capacity exceeded", NULL); + Tcl_AppendResult(interp, "List capacity exceeded", (void *)NULL); return TCL_ERROR; } } @@ -4565,7 +4565,7 @@ TestregexpObjCmd( value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", - varName, "\"", NULL); + varName, "\"", (void *)NULL); return TCL_ERROR; } } else if (cflags & TCL_REG_CANMATCH) { @@ -4579,7 +4579,7 @@ TestregexpObjCmd( value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", - varName, "\"", NULL); + varName, "\"", (void *)NULL); return TCL_ERROR; } } @@ -4800,7 +4800,7 @@ TestsetassocdataCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key data_item\"", NULL); + " data_key data_item\"", (void *)NULL); return TCL_ERROR; } @@ -4853,7 +4853,7 @@ TestsetplatformCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " platform\"", NULL); + " platform\"", (void *)NULL); return TCL_ERROR; } @@ -4864,7 +4864,7 @@ TestsetplatformCmd( *platform = TCL_PLATFORM_WINDOWS; } else { Tcl_AppendResult(interp, "unsupported platform: should be one of " - "unix, or windows", NULL); + "unix, or windows", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -4899,7 +4899,7 @@ TeststaticlibraryCmd( if (argc != 4) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " prefix safe loaded\"", NULL); + argv[0], " prefix safe loaded\"", (void *)NULL); return TCL_ERROR; } if (Tcl_GetInt(interp, argv[2], &safe) != TCL_OK) { @@ -4951,14 +4951,14 @@ TesttranslatefilenameCmd( if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " path\"", NULL); + argv[0], " path\"", (void *)NULL); return TCL_ERROR; } result = Tcl_TranslateFileName(interp, argv[1], &buffer); if (result == NULL) { return TCL_ERROR; } - Tcl_AppendResult(interp, result, NULL); + Tcl_AppendResult(interp, result, (void *)NULL); Tcl_DStringFree(&buffer); return TCL_OK; } @@ -4991,7 +4991,7 @@ TestupvarCmd( if ((argc != 5) && (argc != 6)) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " level name ?name2? dest global\"", NULL); + argv[0], " level name ?name2? dest global\"", (void *)NULL); return TCL_ERROR; } @@ -5040,7 +5040,7 @@ TestseterrorcodeCmd( const char **argv) /* Argument strings. */ { if (argc > 6) { - Tcl_AppendResult(interp, "too many args", NULL); + Tcl_AppendResult(interp, "too many args", (void *)NULL); return TCL_ERROR; } switch (argc) { @@ -5125,13 +5125,13 @@ TestfeventCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option ?arg ...?", NULL); + " option ?arg ...?", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[1], "cmd") == 0) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " cmd script", NULL); + " cmd script", (void *)NULL); return TCL_ERROR; } if (interp2 != NULL) { @@ -5141,7 +5141,7 @@ TestfeventCmd( } else { Tcl_AppendResult(interp, "called \"testfevent code\" before \"testfevent create\"", - NULL); + (void *)NULL); return TCL_ERROR; } } else if (strcmp(argv[1], "create") == 0) { @@ -5257,11 +5257,11 @@ TestfileCmd( if (result != TCL_OK) { if (error != NULL) { if (Tcl_GetString(error)[0] != '\0') { - Tcl_AppendResult(interp, Tcl_GetString(error), " ", NULL); + Tcl_AppendResult(interp, Tcl_GetString(error), " ", (void *)NULL); } Tcl_DecrRefCount(error); } - Tcl_AppendResult(interp, Tcl_ErrnoId(), NULL); + Tcl_AppendResult(interp, Tcl_ErrnoId(), (void *)NULL); } end: @@ -5702,7 +5702,7 @@ TestsetbytearraylengthObjCmd( if (obj != objv[1]) { Tcl_DecrRefCount(obj); } - Tcl_AppendResult(interp, "expected bytes", NULL); + Tcl_AppendResult(interp, "expected bytes", (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, obj); @@ -5749,7 +5749,7 @@ TestbytestringObjCmd( return TCL_ERROR; } if (x.m != 1) { - Tcl_AppendResult(interp, "Tcl_GetBytesFromObj() overwrites variable", NULL); + Tcl_AppendResult(interp, "Tcl_GetBytesFromObj() overwrites variable", (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj(p, x.n)); @@ -5821,7 +5821,7 @@ TestsetCmd( const char *value; if (argc == 2) { - Tcl_AppendResult(interp, "before get", NULL); + Tcl_AppendResult(interp, "before get", (void *)NULL); value = Tcl_GetVar2(interp, argv[1], NULL, flags); if (value == NULL) { return TCL_ERROR; @@ -5829,7 +5829,7 @@ TestsetCmd( Tcl_AppendElement(interp, value); return TCL_OK; } else if (argc == 3) { - Tcl_AppendResult(interp, "before set", NULL); + Tcl_AppendResult(interp, "before set", (void *)NULL); value = Tcl_SetVar2(interp, argv[1], NULL, argv[2], flags); if (value == NULL) { return TCL_ERROR; @@ -5838,7 +5838,7 @@ TestsetCmd( return TCL_OK; } else { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " varName ?newValue?\"", NULL); + argv[0], " varName ?newValue?\"", (void *)NULL); return TCL_ERROR; } } @@ -5853,7 +5853,7 @@ Testset2Cmd( const char *value; if (argc == 3) { - Tcl_AppendResult(interp, "before get", NULL); + Tcl_AppendResult(interp, "before get", (void *)NULL); value = Tcl_GetVar2(interp, argv[1], argv[2], flags); if (value == NULL) { return TCL_ERROR; @@ -5861,7 +5861,7 @@ Testset2Cmd( Tcl_AppendElement(interp, value); return TCL_OK; } else if (argc == 4) { - Tcl_AppendResult(interp, "before set", NULL); + Tcl_AppendResult(interp, "before set", (void *)NULL); value = Tcl_SetVar2(interp, argv[1], argv[2], argv[3], flags); if (value == NULL) { return TCL_ERROR; @@ -5870,7 +5870,7 @@ Testset2Cmd( return TCL_OK; } else { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " varName elemName ?newValue?\"", NULL); + argv[0], " varName elemName ?newValue?\"", (void *)NULL); return TCL_ERROR; } } @@ -6003,9 +6003,9 @@ TestsaveresultCmd( static void TestsaveresultFree( #if TCL_MAJOR_VERSION > 8 - (TCL_UNUSED void *)) + TCL_UNUSED(void *)) #else - (TCL_UNUSED char *)) + TCL_UNUSED(char *)) #endif { freeCount++; -- cgit v0.12 From da07fbe0220630931595f469782262f84303e064 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 27 Oct 2023 15:03:27 +0000 Subject: More C++-sentinel-related fixes (hopefully, those are the last ones) --- generic/tclTest.c | 194 ++++++++++++++++++++++++------------------------ generic/tclThreadTest.c | 10 +-- unix/tclUnixTest.c | 2 +- 3 files changed, 103 insertions(+), 103 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index f4ae941..8159e19 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -5931,10 +5931,10 @@ TestsaveresultCmd( objPtr = NULL; switch ((enum options) index) { case RESULT_SMALL: - Tcl_AppendResult(interp, "small result", NULL); + Tcl_AppendResult(interp, "small result", (void *)NULL); break; case RESULT_APPEND: - Tcl_AppendResult(interp, "append result", NULL); + Tcl_AppendResult(interp, "append result", (void *)NULL); break; case RESULT_FREE: { char *buf = (char *)ckalloc(200); @@ -6042,7 +6042,7 @@ TestmainthreadCmd( Tcl_SetObjResult(interp, idObj); return TCL_OK; } else { - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } } @@ -6168,7 +6168,7 @@ TestChannelCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " subcommand ?additional args..?\"", NULL); + " subcommand ?additional args..?\"", (void *)NULL); return TCL_ERROR; } cmdName = argv[1]; @@ -6251,7 +6251,7 @@ TestChannelCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " cut channelName\"", NULL); + " cut channelName\"", (void *)NULL); return TCL_ERROR; } @@ -6274,7 +6274,7 @@ TestChannelCmd( (strncmp(cmdName, "clearchannelhandlers", len) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " clearchannelhandlers channelName\"", NULL); + " clearchannelhandlers channelName\"", (void *)NULL); return TCL_ERROR; } Tcl_ClearChannelHandlers(chan); @@ -6284,7 +6284,7 @@ TestChannelCmd( if ((cmdName[0] == 'i') && (strncmp(cmdName, "info", len) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " info channelName\"", NULL); + " info channelName\"", (void *)NULL); return TCL_ERROR; } Tcl_AppendElement(interp, argv[2]); @@ -6376,40 +6376,40 @@ TestChannelCmd( if ((cmdName[0] == 'i') && (strncmp(cmdName, "inputbuffered", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } IOQueued = Tcl_InputBuffered(chan); TclFormatInt(buf, IOQueued); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } if ((cmdName[0] == 'i') && (strncmp(cmdName, "isshared", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } TclFormatInt(buf, Tcl_IsChannelShared(chan)); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } if ((cmdName[0] == 'i') && (strncmp(cmdName, "isstandard", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } TclFormatInt(buf, Tcl_IsStandardChannel(chan)); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } if ((cmdName[0] == 'm') && (strncmp(cmdName, "mode", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6428,7 +6428,7 @@ TestChannelCmd( if ((cmdName[0] == 'm') && (strncmp(cmdName, "maxmode", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6447,7 +6447,7 @@ TestChannelCmd( if ((cmdName[0] == 'm') && (strncmp(cmdName, "mremove-rd", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6456,7 +6456,7 @@ TestChannelCmd( if ((cmdName[0] == 'm') && (strncmp(cmdName, "mremove-wr", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6465,7 +6465,7 @@ TestChannelCmd( if ((cmdName[0] == 'm') && (strncmp(cmdName, "mthread", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6476,10 +6476,10 @@ TestChannelCmd( if ((cmdName[0] == 'n') && (strncmp(cmdName, "name", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, statePtr->channelName, NULL); + Tcl_AppendResult(interp, statePtr->channelName, (void *)NULL); return TCL_OK; } @@ -6499,20 +6499,20 @@ TestChannelCmd( if ((cmdName[0] == 'o') && (strncmp(cmdName, "outputbuffered", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } IOQueued = Tcl_OutputBuffered(chan); TclFormatInt(buf, IOQueued); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } if ((cmdName[0] == 'q') && (strncmp(cmdName, "queuedcr", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6540,12 +6540,12 @@ TestChannelCmd( if ((cmdName[0] == 'r') && (strncmp(cmdName, "refcount", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } TclFormatInt(buf, statePtr->refCount); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); return TCL_OK; } @@ -6558,7 +6558,7 @@ TestChannelCmd( if ((cmdName[0] == 's') && (strncmp(cmdName, "splice", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } @@ -6572,10 +6572,10 @@ TestChannelCmd( if ((cmdName[0] == 't') && (strncmp(cmdName, "type", len) == 0)) { if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", NULL); + Tcl_AppendResult(interp, "channel name required", (void *)NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, Tcl_ChannelName(chanPtr->typePtr), NULL); + Tcl_AppendResult(interp, Tcl_ChannelName(chanPtr->typePtr), (void *)NULL); return TCL_OK; } @@ -6602,7 +6602,7 @@ TestChannelCmd( if (argc != 5) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " transform channelId -command cmd\"", NULL); + " transform channelId -command cmd\"", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[3], "-command") != 0) { @@ -6622,7 +6622,7 @@ TestChannelCmd( if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " unstack channel\"", NULL); + " unstack channel\"", (void *)NULL); return TCL_ERROR; } return Tcl_UnstackChannel(interp, chan); @@ -6630,7 +6630,7 @@ TestChannelCmd( Tcl_AppendResult(interp, "bad option \"", cmdName, "\": should be " "cut, clearchannelhandlers, info, isshared, mode, open, " - "readable, splice, writable, transform, unstack", NULL); + "readable, splice, writable, transform, unstack", (void *)NULL); return TCL_ERROR; } @@ -6667,7 +6667,7 @@ TestChannelEventCmd( if ((argc < 3) || (argc > 5)) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName cmd ?arg1? ?arg2?\"", NULL); + " channelName cmd ?arg1? ?arg2?\"", (void *)NULL); return TCL_ERROR; } chanPtr = (Channel *) Tcl_GetChannel(interp, argv[1], NULL); @@ -6681,7 +6681,7 @@ TestChannelEventCmd( if ((cmd[0] == 'a') && (strncmp(cmd, "add", len) == 0)) { if (argc != 5) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName add eventSpec script\"", NULL); + " channelName add eventSpec script\"", (void *)NULL); return TCL_ERROR; } if (strcmp(argv[3], "readable") == 0) { @@ -6692,7 +6692,7 @@ TestChannelEventCmd( mask = 0; } else { Tcl_AppendResult(interp, "bad event name \"", argv[3], - "\": must be readable, writable, or none", NULL); + "\": must be readable, writable, or none", (void *)NULL); return TCL_ERROR; } @@ -6715,7 +6715,7 @@ TestChannelEventCmd( if ((cmd[0] == 'd') && (strncmp(cmd, "delete", len) == 0)) { if (argc != 4) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName delete index\"", NULL); + " channelName delete index\"", (void *)NULL); return TCL_ERROR; } if (Tcl_GetInt(interp, argv[3], &index) == TCL_ERROR) { @@ -6723,7 +6723,7 @@ TestChannelEventCmd( } if (index < 0) { Tcl_AppendResult(interp, "bad event index: ", argv[3], - ": must be nonnegative", NULL); + ": must be nonnegative", (void *)NULL); return TCL_ERROR; } for (i = 0, esPtr = statePtr->scriptRecordPtr; @@ -6733,7 +6733,7 @@ TestChannelEventCmd( } if (esPtr == NULL) { Tcl_AppendResult(interp, "bad event index ", argv[3], - ": out of range", NULL); + ": out of range", (void *)NULL); return TCL_ERROR; } if (esPtr == statePtr->scriptRecordPtr) { @@ -6761,7 +6761,7 @@ TestChannelEventCmd( if ((cmd[0] == 'l') && (strncmp(cmd, "list", len) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName list\"", NULL); + " channelName list\"", (void *)NULL); return TCL_ERROR; } resultListPtr = Tcl_GetObjResult(interp); @@ -6784,7 +6784,7 @@ TestChannelEventCmd( if ((cmd[0] == 'r') && (strncmp(cmd, "removeall", len) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName removeall\"", NULL); + " channelName removeall\"", (void *)NULL); return TCL_ERROR; } for (esPtr = statePtr->scriptRecordPtr; @@ -6803,7 +6803,7 @@ TestChannelEventCmd( if ((cmd[0] == 's') && (strncmp(cmd, "set", len) == 0)) { if (argc != 5) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName delete index event\"", NULL); + " channelName delete index event\"", (void *)NULL); return TCL_ERROR; } if (Tcl_GetInt(interp, argv[3], &index) == TCL_ERROR) { @@ -6811,7 +6811,7 @@ TestChannelEventCmd( } if (index < 0) { Tcl_AppendResult(interp, "bad event index: ", argv[3], - ": must be nonnegative", NULL); + ": must be nonnegative", (void *)NULL); return TCL_ERROR; } for (i = 0, esPtr = statePtr->scriptRecordPtr; @@ -6821,7 +6821,7 @@ TestChannelEventCmd( } if (esPtr == NULL) { Tcl_AppendResult(interp, "bad event index ", argv[3], - ": out of range", NULL); + ": out of range", (void *)NULL); return TCL_ERROR; } @@ -6833,7 +6833,7 @@ TestChannelEventCmd( mask = 0; } else { Tcl_AppendResult(interp, "bad event name \"", argv[4], - "\": must be readable, writable, or none", NULL); + "\": must be readable, writable, or none", (void *)NULL); return TCL_ERROR; } esPtr->mask = mask; @@ -6842,7 +6842,7 @@ TestChannelEventCmd( return TCL_OK; } Tcl_AppendResult(interp, "bad command ", cmd, ", must be one of " - "add, delete, list, set, or removeall", NULL); + "add, delete, list, set, or removeall", (void *)NULL); return TCL_ERROR; } @@ -6879,7 +6879,7 @@ TestSocketCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " subcommand ?additional args..?\"", NULL); + " subcommand ?additional args..?\"", (void *)NULL); return TCL_ERROR; } cmdName = argv[1]; @@ -6896,18 +6896,18 @@ TestSocketCmd( */ if (argc < 4) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " testflags channel flags\"", NULL); + " testflags channel flags\"", (void *)NULL); return TCL_ERROR; } hChannel = Tcl_GetChannel(interp, argv[2], &modePtr); if ( NULL == hChannel ) { - Tcl_AppendResult(interp, "unknown channel:", argv[2], NULL); + Tcl_AppendResult(interp, "unknown channel:", argv[2], (void *)NULL); return TCL_ERROR; } statePtr = (TcpState *)Tcl_GetChannelInstanceData(hChannel); if ( NULL == statePtr) { Tcl_AppendResult(interp, "No channel instance data:", argv[2], - NULL); + (void *)NULL); return TCL_ERROR; } if (Tcl_GetBoolean(interp, argv[3], &testMode) != TCL_OK) { @@ -6922,7 +6922,7 @@ TestSocketCmd( } Tcl_AppendResult(interp, "bad option \"", cmdName, "\": should be " - "testflags", NULL); + "testflags", (void *)NULL); return TCL_ERROR; } @@ -6956,7 +6956,7 @@ TestServiceModeCmd( int newmode, oldmode; if (argc > 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ?newmode?\"", NULL); + " ?newmode?\"", (void *)NULL); return TCL_ERROR; } oldmode = (Tcl_GetServiceMode() != TCL_SERVICE_NONE); @@ -7018,7 +7018,7 @@ TestWrongNumArgsObjCmd( * Asked for more arguments than were given. */ insufArgs: - Tcl_AppendResult(interp, "insufficient arguments", NULL); + Tcl_AppendResult(interp, "insufficient arguments", (void *)NULL); return TCL_ERROR; } @@ -7071,15 +7071,15 @@ TestGetIndexFromObjStructObjCmd( return TCL_ERROR; } if (idx[0] != 85 || idx[2] != 85) { - Tcl_AppendResult(interp, "Tcl_GetIndexFromObjStruct overwrites bytes near index variable", NULL); + Tcl_AppendResult(interp, "Tcl_GetIndexFromObjStruct overwrites bytes near index variable", (void *)NULL); return TCL_ERROR; } else if (idx[1] != target) { char buffer[64]; snprintf(buffer, sizeof(buffer), "%d", idx[1]); Tcl_AppendResult(interp, "index value comparison failed: got ", - buffer, NULL); + buffer, (void *)NULL); snprintf(buffer, sizeof(buffer), "%d", target); - Tcl_AppendResult(interp, " when ", buffer, " expected", NULL); + Tcl_AppendResult(interp, " when ", buffer, " expected", (void *)NULL); return TCL_ERROR; } Tcl_WrongNumArgs(interp, objc, objv, NULL); @@ -7586,7 +7586,7 @@ SimpleOpenFileChannel( Tcl_Channel chan; if ((mode != 0) && !(mode & O_RDONLY)) { - Tcl_AppendResult(interp, "read-only", NULL); + Tcl_AppendResult(interp, "read-only", (void *)NULL); return NULL; } @@ -7672,7 +7672,7 @@ TestUtfNextCmd( /* Run Tcl_UtfNext with many more possible bytes at src[-1], all should give the same result */ result = Tcl_UtfNext(buffer + 1); if (first != result) { - Tcl_AppendResult(interp, "Tcl_UtfNext is not supposed to read src[-1]", NULL); + Tcl_AppendResult(interp, "Tcl_UtfNext is not supposed to read src[-1]", (void *)NULL); return TCL_ERROR; } } @@ -7944,7 +7944,7 @@ TestHashSystemHashCmd( Tcl_InitCustomHashTable(&hash, TCL_CUSTOM_TYPE_KEYS, &hkType); if (hash.numEntries != 0) { - Tcl_AppendResult(interp, "non-zero initial size", NULL); + Tcl_AppendResult(interp, "non-zero initial size", (void *)NULL); Tcl_DeleteHashTable(&hash); return TCL_ERROR; } @@ -7961,7 +7961,7 @@ TestHashSystemHashCmd( } if (hash.numEntries != (Tcl_Size)limit) { - Tcl_AppendResult(interp, "unexpected maximal size", NULL); + Tcl_AppendResult(interp, "unexpected maximal size", (void *)NULL); Tcl_DeleteHashTable(&hash); return TCL_ERROR; } @@ -7984,13 +7984,13 @@ TestHashSystemHashCmd( } if (hash.numEntries != 0) { - Tcl_AppendResult(interp, "non-zero final size", NULL); + Tcl_AppendResult(interp, "non-zero final size", (void *)NULL); Tcl_DeleteHashTable(&hash); return TCL_ERROR; } Tcl_DeleteHashTable(&hash); - Tcl_AppendResult(interp, "OK", NULL); + Tcl_AppendResult(interp, "OK", (void *)NULL); return TCL_OK; } @@ -8006,7 +8006,7 @@ TestgetintCmd( const char **argv) { if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } else { int val, i, total=0; @@ -8033,7 +8033,7 @@ TestlongsizeCmd( TCL_UNUSED(const char **) /*argv*/) { if (argc != 1) { - Tcl_AppendResult(interp, "wrong # args", NULL); + Tcl_AppendResult(interp, "wrong # args", (void *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(long))); @@ -8184,21 +8184,21 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (a) concatObj does not have refCount 0", NULL); + "\n\t* (a) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (a) concatObj is not a new obj ", - NULL); + (void *)NULL); switch (tmpPtr->refCount) { case 0: - Tcl_AppendResult(interp, "(no new refCount)", NULL); + Tcl_AppendResult(interp, "(no new refCount)", (void *)NULL); break; case 1: - Tcl_AppendResult(interp, "(refCount added)", NULL); + Tcl_AppendResult(interp, "(refCount added)", (void *)NULL); break; default: - Tcl_AppendResult(interp, "(more than one refCount added!)", NULL); + Tcl_AppendResult(interp, "(more than one refCount added!)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); } tmpPtr = Tcl_DuplicateObj(list1Ptr); @@ -8211,26 +8211,26 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (b) concatObj does not have refCount 0", NULL); + "\n\t* (b) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (b) concatObj is not a new obj ", - NULL); + (void *)NULL); switch (tmpPtr->refCount) { case 0: - Tcl_AppendResult(interp, "(refCount removed?)", NULL); + Tcl_AppendResult(interp, "(refCount removed?)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); break; case 1: - Tcl_AppendResult(interp, "(no new refCount)", NULL); + Tcl_AppendResult(interp, "(no new refCount)", (void *)NULL); break; case 2: - Tcl_AppendResult(interp, "(refCount added)", NULL); + Tcl_AppendResult(interp, "(refCount added)", (void *)NULL); Tcl_DecrRefCount(tmpPtr); break; default: - Tcl_AppendResult(interp, "(more than one refCount added!)", NULL); + Tcl_AppendResult(interp, "(more than one refCount added!)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); } tmpPtr = Tcl_DuplicateObj(list1Ptr); @@ -8245,21 +8245,21 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (c) concatObj does not have refCount 0", NULL); + "\n\t* (c) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (c) concatObj is not a new obj ", - NULL); + (void *)NULL); switch (tmpPtr->refCount) { case 0: - Tcl_AppendResult(interp, "(no new refCount)", NULL); + Tcl_AppendResult(interp, "(no new refCount)", (void *)NULL); break; case 1: - Tcl_AppendResult(interp, "(refCount added)", NULL); + Tcl_AppendResult(interp, "(refCount added)", (void *)NULL); break; default: - Tcl_AppendResult(interp, "(more than one refCount added!)", NULL); + Tcl_AppendResult(interp, "(more than one refCount added!)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); } tmpPtr = Tcl_DuplicateObj(list1Ptr); @@ -8272,22 +8272,22 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (d) concatObj does not have refCount 0", NULL); + "\n\t* (d) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (d) concatObj is not a new obj ", - NULL); + (void *)NULL); switch (tmpPtr->refCount) { case 0: - Tcl_AppendResult(interp, "(refCount removed?)", NULL); + Tcl_AppendResult(interp, "(refCount removed?)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); break; case 1: - Tcl_AppendResult(interp, "(no new refCount)", NULL); + Tcl_AppendResult(interp, "(no new refCount)", (void *)NULL); break; case 2: - Tcl_AppendResult(interp, "(refCount added)", NULL); + Tcl_AppendResult(interp, "(refCount added)", (void *)NULL); Tcl_DecrRefCount(tmpPtr); break; default: @@ -8310,20 +8310,20 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (e) concatObj does not have refCount 0", NULL); + "\n\t* (e) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (e) concatObj is not a new obj ", - NULL); + (void *)NULL); (void) Tcl_ListObjLength(NULL, concatPtr, &len); switch (tmpPtr->refCount) { case 3: - Tcl_AppendResult(interp, "(failed to concat)", NULL); + Tcl_AppendResult(interp, "(failed to concat)", (void *)NULL); break; default: - Tcl_AppendResult(interp, "(corrupted input!)", NULL); + Tcl_AppendResult(interp, "(corrupted input!)", (void *)NULL); } if (Tcl_IsShared(tmpPtr)) { Tcl_DecrRefCount(tmpPtr); @@ -8340,20 +8340,20 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (f) concatObj does not have refCount 0", NULL); + "\n\t* (f) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (f) concatObj is not a new obj ", - NULL); + (void *)NULL); (void) Tcl_ListObjLength(NULL, concatPtr, &len); switch (tmpPtr->refCount) { case 3: - Tcl_AppendResult(interp, "(failed to concat)", NULL); + Tcl_AppendResult(interp, "(failed to concat)", (void *)NULL); break; default: - Tcl_AppendResult(interp, "(corrupted input!)", NULL); + Tcl_AppendResult(interp, "(corrupted input!)", (void *)NULL); } if (Tcl_IsShared(tmpPtr)) { Tcl_DecrRefCount(tmpPtr); @@ -8371,20 +8371,20 @@ TestconcatobjCmd( if (concatPtr->refCount != 0) { result = TCL_ERROR; Tcl_AppendResult(interp, - "\n\t* (g) concatObj does not have refCount 0", NULL); + "\n\t* (g) concatObj does not have refCount 0", (void *)NULL); } if (concatPtr == tmpPtr) { result = TCL_ERROR; Tcl_AppendResult(interp, "\n\t* (g) concatObj is not a new obj ", - NULL); + (void *)NULL); (void) Tcl_ListObjLength(NULL, concatPtr, &len); switch (tmpPtr->refCount) { case 3: - Tcl_AppendResult(interp, "(failed to concat)", NULL); + Tcl_AppendResult(interp, "(failed to concat)", (void *)NULL); break; default: - Tcl_AppendResult(interp, "(corrupted input!)", NULL); + Tcl_AppendResult(interp, "(corrupted input!)", (void *)NULL); } Tcl_DecrRefCount(tmpPtr); if (Tcl_IsShared(tmpPtr)) { @@ -8758,7 +8758,7 @@ TestInterpResolverCmd( if (objc == 3) { interp = Tcl_GetChild(interp, Tcl_GetString(objv[2])); if (interp == NULL) { - Tcl_AppendResult(interp, "provided interpreter not found", NULL); + Tcl_AppendResult(interp, "provided interpreter not found", (void *)NULL); return TCL_ERROR; } } @@ -8774,7 +8774,7 @@ TestInterpResolverCmd( case 0: /*down*/ if (!Tcl_RemoveInterpResolvers(interp, RESOLVER_KEY)) { Tcl_AppendResult(interp, "could not remove the resolver scheme", - NULL); + (void *)NULL); return TCL_ERROR; } } diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 99f9838..7b158b4 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -370,7 +370,7 @@ ThreadObjCmd( char buf[TCL_INTEGER_SPACE]; snprintf(buf, sizeof(buf), "%" TCL_LL_MODIFIER "d", (long long)id); - Tcl_AppendResult(interp, "cannot join thread ", buf, NULL); + Tcl_AppendResult(interp, "cannot join thread ", buf, (void *)NULL); } return result; } @@ -508,7 +508,7 @@ ThreadCreate( if (Tcl_CreateThread(&id, NewTestThread, &ctrl, TCL_THREAD_STACK_DEFAULT, joinable) != TCL_OK) { Tcl_MutexUnlock(&threadMutex); - Tcl_AppendResult(interp, "can't create a new thread", NULL); + Tcl_AppendResult(interp, "can't create a new thread", (void *)NULL); return TCL_ERROR; } @@ -819,7 +819,7 @@ ThreadSend( } if (!found) { Tcl_MutexUnlock(&threadMutex); - Tcl_AppendResult(interp, "invalid thread id", NULL); + Tcl_AppendResult(interp, "invalid thread id", (void *)NULL); return TCL_ERROR; } @@ -921,7 +921,7 @@ ThreadSend( ckfree(resultPtr->errorInfo); } } - Tcl_AppendResult(interp, resultPtr->result, NULL); + Tcl_AppendResult(interp, resultPtr->result, (void *)NULL); Tcl_ConditionFinalize(&resultPtr->done); code = resultPtr->code; @@ -972,7 +972,7 @@ ThreadCancel( } if (!found) { Tcl_MutexUnlock(&threadMutex); - Tcl_AppendResult(interp, "invalid thread id", NULL); + Tcl_AppendResult(interp, "invalid thread id", (void *)NULL); return TCL_ERROR; } diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index bade827..4f052a8 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -357,7 +357,7 @@ TestfilewaitCmd( Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout"); return TCL_ERROR; } - channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), (void *)NULL); + channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); if (channel == NULL) { return TCL_ERROR; } -- cgit v0.12 From 14ab5ccf54dac59237afc1a65d09a4a4860f197b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 27 Oct 2023 17:13:59 +0000 Subject: [26870862f0] follow-up: of course it was not complete yet --- generic/tclTest.c | 28 ++++++++++++++-------------- generic/tclTestObj.c | 10 +++++----- generic/tclTestProcBodyObj.c | 6 +++--- generic/tclThreadTest.c | 2 +- win/tclWinDde.c | 18 +++++++++--------- win/tclWinReg.c | 6 +++--- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 8159e19..6a90b67 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -1155,10 +1155,10 @@ TestcmdinfoObjCmd( } if (info.deleteProc == CmdDelProc1) { Tcl_AppendResult(interp, " CmdDelProc1", " ", - (char *) info.deleteData, NULL); + (char *) info.deleteData, (void *)NULL); } else if (info.deleteProc == CmdDelProc2) { Tcl_AppendResult(interp, " CmdDelProc2", " ", - (char *) info.deleteData, NULL); + (char *) info.deleteData, (void *)NULL); } else { Tcl_AppendResult(interp, " unknown", (void *)NULL); } @@ -1313,7 +1313,7 @@ TestcmdtokenCmd( refPtr->nextPtr = firstCommandTokenRef; firstCommandTokenRef = refPtr; snprintf(buf, sizeof(buf), "%d", refPtr->id); - Tcl_AppendResult(interp, buf, NULL); + Tcl_AppendResult(interp, buf, (void *)NULL); } else { if (sscanf(argv[2], "%d", &id) != 1) { Tcl_AppendResult(interp, "bad command token \"", argv[2], @@ -1608,7 +1608,7 @@ CreatedCommandProc( &info); if (!found) { Tcl_AppendResult(interp, "CreatedCommandProc could not get command info for test_ns_basic::createdcommand", - NULL); + (void *)NULL); return TCL_ERROR; } Tcl_AppendResult(interp, "CreatedCommandProc in ", @@ -2835,7 +2835,7 @@ TestexprlongCmd( " expression\"", (void *)NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, "This is a result", NULL); + Tcl_AppendResult(interp, "This is a result", (void *)NULL); result = Tcl_ExprLong(interp, argv[1], &exprResult); if (result != TCL_OK) { return result; @@ -5045,23 +5045,23 @@ TestseterrorcodeCmd( } switch (argc) { case 1: - Tcl_SetErrorCode(interp, "NONE", NULL); + Tcl_SetErrorCode(interp, "NONE", (void *)NULL); break; case 2: - Tcl_SetErrorCode(interp, argv[1], NULL); + Tcl_SetErrorCode(interp, argv[1], (void *)NULL); break; case 3: - Tcl_SetErrorCode(interp, argv[1], argv[2], NULL); + Tcl_SetErrorCode(interp, argv[1], argv[2], (void *)NULL); break; case 4: - Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], NULL); + Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], (void *)NULL); break; case 5: - Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4], NULL); + Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4], (void *)NULL); break; case 6: Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4], - argv[5], NULL); + argv[5], (void *)NULL); } return TCL_ERROR; } @@ -6517,7 +6517,7 @@ TestChannelCmd( } Tcl_AppendResult(interp, - (statePtr->flags & INPUT_SAW_CR) ? "1" : "0", NULL); + (statePtr->flags & INPUT_SAW_CR) ? "1" : "0", (void *)NULL); return TCL_OK; } @@ -6607,7 +6607,7 @@ TestChannelCmd( } if (strcmp(argv[3], "-command") != 0) { Tcl_AppendResult(interp, "bad argument \"", argv[3], - "\": should be \"-command\"", NULL); + "\": should be \"-command\"", (void *)NULL); return TCL_ERROR; } @@ -8291,7 +8291,7 @@ TestconcatobjCmd( Tcl_DecrRefCount(tmpPtr); break; default: - Tcl_AppendResult(interp, "(more than one refCount added!)", NULL); + Tcl_AppendResult(interp, "(more than one refCount added!)", (void *)NULL); Tcl_Panic("extremely unsafe behaviour by Tcl_ConcatObj()"); } tmpPtr = Tcl_DuplicateObj(list1Ptr); diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index b4d70f0..3b958dd 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -420,7 +420,7 @@ TestbooleanobjCmd( } else { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, or not", NULL); + "\": must be set, get, or not", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -537,7 +537,7 @@ TestdoubleobjCmd( } else { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, mult10, or div10", NULL); + "\": must be set, get, mult10, or div10", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -826,7 +826,7 @@ TestintobjCmd( } else { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, get2, mult10, or div10", NULL); + "\": must be set, get, get2, mult10, or div10", (void *)NULL); return TCL_ERROR; } return TCL_OK; @@ -1199,7 +1199,7 @@ TestobjCmd( } if ((targetType = Tcl_GetObjType(Tcl_GetString(objv[3]))) == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "no type ", Tcl_GetString(objv[3]), " found", NULL); + "no type ", Tcl_GetString(objv[3]), " found", (void *)NULL); return TCL_ERROR; } if (Tcl_ConvertToType(interp, varPtr[varIndex], targetType) @@ -1356,7 +1356,7 @@ TeststringobjCmd( Tcl_AppendStringsToObj(varPtr[varIndex], strings[0], strings[1], strings[2], strings[3], strings[4], strings[5], strings[6], strings[7], strings[8], strings[9], - strings[10], strings[11]); + strings[10], strings[11], (void *)NULL); Tcl_SetObjResult(interp, varPtr[varIndex]); break; case 2: /* get */ diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 07800ca..2139b81 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -263,7 +263,7 @@ ProcBodyTestProcObjCmd( if (cmdPtr->objClientData != TclIsProc(cmdPtr)) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "command \"", fullName, "\" is not a Tcl procedure", NULL); + "command \"", fullName, "\" is not a Tcl procedure", (void *)NULL); return TCL_ERROR; } @@ -274,7 +274,7 @@ ProcBodyTestProcObjCmd( procPtr = (Proc *) cmdPtr->objClientData; if (procPtr == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "procedure \"", - fullName, "\" does not have a Proc struct!", NULL); + fullName, "\" does not have a Proc struct!", (void *)NULL); return TCL_ERROR; } @@ -286,7 +286,7 @@ ProcBodyTestProcObjCmd( if (bodyObjPtr == NULL) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "failed to create a procbody object for procedure \"", - fullName, "\"", NULL); + fullName, "\"", (void *)NULL); return TCL_ERROR; } Tcl_IncrRefCount(bodyObjPtr); diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 7b158b4..cd74071 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -913,7 +913,7 @@ ThreadSend( if (resultPtr->code != TCL_OK) { if (resultPtr->errorCode) { - Tcl_SetErrorCode(interp, resultPtr->errorCode, NULL); + Tcl_SetErrorCode(interp, resultPtr->errorCode, (void *)NULL); ckfree(resultPtr->errorCode); } if (resultPtr->errorInfo) { diff --git a/win/tclWinDde.c b/win/tclWinDde.c index d01e7ae..7db5312 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -574,7 +574,7 @@ ExecuteRemoteObject( Tcl_SetObjResult(riPtr->interp, Tcl_NewStringObj("permission denied: " "a handler procedure must be defined for use in a safe " "interp", TCL_INDEX_NONE)); - Tcl_SetErrorCode(riPtr->interp, "TCL", "DDE", "SECURITY_CHECK", NULL); + Tcl_SetErrorCode(riPtr->interp, "TCL", "DDE", "SECURITY_CHECK", (void *)NULL); result = TCL_ERROR; } @@ -1046,7 +1046,7 @@ MakeDdeConnection( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no registered server named \"%s\"", Tcl_DStringValue(&dString))); Tcl_DStringFree(&dString); - Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", (void *)NULL); } return TCL_ERROR; } @@ -1277,7 +1277,7 @@ SetDdeError( } Tcl_SetObjResult(interp, Tcl_NewStringObj(errorMessage, TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "DDE", errorCode, NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", errorCode, (void *)NULL); } /* @@ -1564,7 +1564,7 @@ DdeObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot execute null data", TCL_INDEX_NONE)); Tcl_DStringFree(&dsBuf); - Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (void *)NULL); result = TCL_ERROR; break; } @@ -1614,7 +1614,7 @@ DdeObjCmd( if (length == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot request value of null data", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (void *)NULL); result = TCL_ERROR; goto cleanup; } @@ -1680,7 +1680,7 @@ DdeObjCmd( if (length == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot have a null item", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (void *)NULL); result = TCL_ERROR; goto cleanup; } @@ -1734,7 +1734,7 @@ DdeObjCmd( if (serviceName == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid service name \"\"", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", (void *)NULL); result = TCL_ERROR; goto cleanup; } @@ -1783,7 +1783,7 @@ DdeObjCmd( "permission denied: a handler procedure must be" " defined for use in a safe interp", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "DDE", "SECURITY_CHECK", - NULL); + (void *)NULL); result = TCL_ERROR; } @@ -1848,7 +1848,7 @@ DdeObjCmd( invalidServerResponse: Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid data returned from server", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TCL", "DDE", "BAD_RESPONSE", NULL); + Tcl_SetErrorCode(interp, "TCL", "DDE", "BAD_RESPONSE", (void *)NULL); result = TCL_ERROR; goto cleanup; } diff --git a/win/tclWinReg.c b/win/tclWinReg.c index 1ccb105..4157380 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -462,7 +462,7 @@ DeleteKey( if (*keyName == '\0') { Tcl_SetObjResult(interp, Tcl_NewStringObj("bad key: cannot delete root keys", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "WIN_REG", "DEL_ROOT_KEY", NULL); + Tcl_SetErrorCode(interp, "WIN_REG", "DEL_ROOT_KEY", (void *)NULL); Tcl_Free(buffer); return TCL_ERROR; } @@ -1143,7 +1143,7 @@ ParseKeyName( if (!rootName) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad key \"%s\": must start with a valid root", name)); - Tcl_SetErrorCode(interp, "WIN_REG", "NO_ROOT_KEY", NULL); + Tcl_SetErrorCode(interp, "WIN_REG", "NO_ROOT_KEY", (void *)NULL); return TCL_ERROR; } @@ -1535,7 +1535,7 @@ AppendSystemError( } snprintf(id, sizeof(id), "%ld", error); - Tcl_SetErrorCode(interp, "WINDOWS", id, msg, NULL); + Tcl_SetErrorCode(interp, "WINDOWS", id, msg, (void *)NULL); Tcl_AppendToObj(resultPtr, msg, length); Tcl_SetObjResult(interp, resultPtr); -- cgit v0.12 From 07279ebb64ef3359cd341e8ef7f8f99ea36dedd1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 29 Oct 2023 21:45:31 +0000 Subject: Fix [0219fb7511]: tclIO.c: avoid -Wstrict-prototypes warning. Some code cleanup --- generic/tclIO.c | 120 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 7e83e89..0f79f1e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -103,7 +103,7 @@ typedef struct CopyState { Tcl_Interp *interp; /* Interp that started the copy. */ Tcl_Obj *cmdPtr; /* Command to be invoked at completion. */ int bufSize; /* Size of appended buffer. */ - char buffer[1]; /* Copy buffer, this must be the last + char buffer[TCLFLEXARRAY]; /* Copy buffer, this must be the last * field. */ } CopyState; @@ -557,7 +557,6 @@ TclInitIOSubsystem(void) *------------------------------------------------------------------------- */ - /* ARGSUSED */ void TclFinalizeIOSubsystem(void) { @@ -1444,7 +1443,7 @@ Tcl_GetChannel( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can not find channel named \"%s\"", chanName)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanName, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CHANNEL", chanName, (void *)NULL); return NULL; } @@ -1457,7 +1456,7 @@ Tcl_GetChannel( chanPtr = (Channel *)Tcl_GetHashValue(hPtr); chanPtr = chanPtr->state->bottomChanPtr; if (modePtr != NULL) { - *modePtr = chanPtr->state->flags & (TCL_READABLE|TCL_WRITABLE); + *modePtr = GotFlag(chanPtr->state, TCL_READABLE|TCL_WRITABLE); } return (Tcl_Channel) chanPtr; @@ -1553,7 +1552,7 @@ TclGetChannelFromObj( *channelPtr = (Tcl_Channel) statePtr->bottomChanPtr; if (modePtr != NULL) { - *modePtr = statePtr->flags & (TCL_READABLE|TCL_WRITABLE); + *modePtr = GotFlag(statePtr, TCL_READABLE|TCL_WRITABLE); } return TCL_OK; @@ -1847,7 +1846,7 @@ Tcl_StackChannel( * --+---+---+---+----+ */ - if ((mask & (statePtr->flags & (TCL_READABLE | TCL_WRITABLE))) == 0) { + if ((mask & GotFlag(statePtr, TCL_READABLE|TCL_WRITABLE)) == 0) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "reading and writing both disallowed for channel \"%s\"", @@ -2345,7 +2344,7 @@ Tcl_GetChannelMode( ChannelState *statePtr = ((Channel *) chan)->state; /* State of actual channel. */ - return (statePtr->flags & (TCL_READABLE | TCL_WRITABLE)); + return GotFlag(statePtr, TCL_READABLE|TCL_WRITABLE); } /* @@ -2529,7 +2528,7 @@ RecycleBuffer( * This is to honor dynamic changes of the buffe rsize made by the user. */ - if ((bufPtr->bufLength - BUFFER_PADDING) != statePtr->bufSize) { + if ((bufPtr->bufLength) != statePtr->bufSize + BUFFER_PADDING) { ReleaseChannelBuffer(bufPtr); return; } @@ -2850,8 +2849,8 @@ FlushChannel( * queued. */ - DiscardOutputQueued(statePtr); ReleaseChannelBuffer(bufPtr); + DiscardOutputQueued(statePtr); break; } else { /* @@ -3360,7 +3359,6 @@ Tcl_SpliceChannel( *---------------------------------------------------------------------- */ - /* ARGSUSED */ int Tcl_Close( Tcl_Interp *interp, /* Interpreter for errors. */ @@ -3554,7 +3552,6 @@ Tcl_Close( *---------------------------------------------------------------------- */ - /* ARGSUSED */ int Tcl_CloseEx( Tcl_Interp *interp, /* Interpreter for errors. */ @@ -3609,7 +3606,7 @@ Tcl_CloseEx( * opened for that direction). */ - if (!(statePtr->flags & (TCL_READABLE | TCL_WRITABLE) & flags)) { + if (!(GotFlag(statePtr, TCL_READABLE|TCL_WRITABLE) & flags)) { const char *msg; if (flags & TCL_CLOSE_READ) { @@ -3628,7 +3625,7 @@ Tcl_CloseEx( * That won't do. */ - if (statePtr->flags & CHANNEL_INCLOSE) { + if (GotFlag(statePtr, CHANNEL_INCLOSE)) { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "illegal recursive call to close through close-handler" @@ -4065,7 +4062,8 @@ Tcl_WriteRaw( Channel *chanPtr = ((Channel *) chan); ChannelState *statePtr = chanPtr->state; /* State info for channel */ - int errorCode, written; + int errorCode; + int written; if (CheckChannelErrors(statePtr, TCL_WRITABLE | CHANNEL_RAW_MODE) != 0) { return -1; @@ -4282,13 +4280,14 @@ static int Write( Channel *chanPtr, /* The channel to buffer output for. */ const char *src, /* UTF-8 string to write. */ - int srcLen, /* Length of UTF-8 string in bytes. */ + int srcLen, /* Length of UTF-8 string in bytes. */ Tcl_Encoding encoding) { ChannelState *statePtr = chanPtr->state; /* State info for channel */ char *nextNewLine = NULL; - int endEncoding, saved = 0, total = 0, flushed = 0, needNlFlush = 0; + int endEncoding, needNlFlush = 0; + int saved = 0, total = 0, flushed = 0; char safe[BUFFER_PADDING]; int encodingError = 0; @@ -4301,7 +4300,6 @@ Write( */ endEncoding = ((statePtr->outputEncodingFlags & TCL_ENCODING_END) != 0); - if (GotFlag(statePtr, CHANNEL_LINEBUFFERED) || (statePtr->outputTranslation != TCL_TRANSLATE_LF)) { nextNewLine = (char *)memchr(src, '\n', srcLen); @@ -4310,7 +4308,8 @@ Write( while (srcLen + saved + endEncoding > 0 && !encodingError) { ChannelBuffer *bufPtr; char *dst; - int result, srcRead, dstLen, dstWrote, srcLimit = srcLen; + int result, srcRead, dstLen, dstWrote; + int srcLimit = srcLen; if (nextNewLine) { srcLimit = nextNewLine - src; @@ -4527,7 +4526,8 @@ Tcl_GetsObj( ChannelState *statePtr = chanPtr->state; /* State info for channel */ ChannelBuffer *bufPtr; - int inEofChar, skip, copiedTotal, oldLength, oldFlags, oldRemoved; + int inEofChar, skip, copiedTotal, oldFlags, oldRemoved; + int oldLength; Tcl_Encoding encoding; char *dst, *dstEnd, *eol, *eof; Tcl_EncodingState oldState; @@ -5208,7 +5208,7 @@ FreeBinaryEncoding( } static Tcl_Encoding -GetBinaryEncoding() +GetBinaryEncoding(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); @@ -5352,6 +5352,7 @@ FilterInputBytes( *gsPtr->dstPtr = dst; } gsPtr->state = statePtr->inputEncodingState; + result = Tcl_ExternalToUtf(NULL, gsPtr->encoding, raw, rawLen, statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE, &statePtr->inputEncodingState, dst, spaceLeft, &gsPtr->rawRead, @@ -5752,7 +5753,7 @@ int Tcl_ReadChars( Tcl_Channel chan, /* The channel to read. */ Tcl_Obj *objPtr, /* Input data is stored in this object. */ - int toRead, /* Maximum number of characters to store, or + int toRead, /* Maximum number of characters to store, or * -1 to read all available data (up to EOF or * when channel blocks). */ int appendFlag) /* If non-zero, data read from the channel @@ -5808,7 +5809,7 @@ static int DoReadChars( Channel *chanPtr, /* The channel to read. */ Tcl_Obj *objPtr, /* Input data is stored in this object. */ - int toRead, /* Maximum number of characters to store, or + int toRead, /* Maximum number of characters to store, or * -1 to read all available data (up to EOF or * when channel blocks). */ int appendFlag) /* If non-zero, data read from the channel @@ -5819,7 +5820,8 @@ DoReadChars( ChannelState *statePtr = chanPtr->state; /* State info for channel */ ChannelBuffer *bufPtr; - int copied, copiedNow, result; + int copied; + int result; Tcl_Encoding encoding = statePtr->encoding; int binaryMode; #define UTF_EXPANSION_FACTOR 1024 @@ -5859,7 +5861,7 @@ DoReadChars( assert(statePtr->inputEncodingFlags & TCL_ENCODING_END); assert(!GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR)); - /* TODO: We don't need this call? */ + /* TODO: UpdateInterest not needed here? */ UpdateInterest(chanPtr); return 0; } @@ -5873,7 +5875,7 @@ DoReadChars( } ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF); statePtr->inputEncodingFlags &= ~TCL_ENCODING_END; - /* TODO: We don't need this call? */ + /* TODO: UpdateInterest not needed here? */ UpdateInterest(chanPtr); return 0; } @@ -5895,7 +5897,7 @@ DoReadChars( ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF); statePtr->inputEncodingFlags &= ~TCL_ENCODING_END; for (copied = 0; (unsigned) toRead > 0; ) { - copiedNow = -1; + int copiedNow = -1; if (statePtr->inQueueHead != NULL) { if (binaryMode) { copiedNow = ReadBytes(statePtr, objPtr, toRead); @@ -5904,7 +5906,7 @@ DoReadChars( } /* - * If the current buffer is empty recycle it. + * Recycle current buffer if empty. */ bufPtr = statePtr->inQueueHead; @@ -5956,7 +5958,7 @@ DoReadChars( } /* - * Regenerate the top channel, in case it was changed due to + * Regenerate chanPtr in case it was changed due to * self-modifying reflected transforms. */ @@ -6300,7 +6302,7 @@ ReadChars( return 1; } - } else if (statePtr->flags & CHANNEL_EOF) { + } else if (GotFlag(statePtr, CHANNEL_EOF)) { /* * The bare \r is the only char and we will never read a * subsequent char to make the determination. @@ -6403,7 +6405,7 @@ ReadChars( * precautions. */ - if (nextPtr->nextRemoved - srcLen < 0) { + if (nextPtr->nextRemoved < srcLen) { Tcl_Panic("Buffer Underflow, BUFFER_PADDING not enough"); } @@ -6566,7 +6568,7 @@ TranslateInputEOL( char *dst = dstStart; int lesser; - if ((statePtr->flags & INPUT_SAW_CR) && srcLen) { + if (GotFlag(statePtr, INPUT_SAW_CR) && srcLen) { if (*src == '\n') { src++; srcLen--; } ResetFlag(statePtr, INPUT_SAW_CR); } @@ -6900,7 +6902,7 @@ GetInput( */ if ((bufPtr != NULL) - && (bufPtr->bufLength - BUFFER_PADDING != statePtr->bufSize)) { + && (bufPtr->bufLength != statePtr->bufSize + BUFFER_PADDING)) { ReleaseChannelBuffer(bufPtr); bufPtr = NULL; } @@ -7370,7 +7372,7 @@ CheckChannelErrors( * Fail if the channel is not opened for desired operation. */ - if ((statePtr->flags & direction) == 0) { + if (GotFlag(statePtr, direction) == 0) { Tcl_SetErrno(EACCES); return -1; } @@ -7480,7 +7482,7 @@ Tcl_InputBuffered( } /* - * Don't forget the bytes in the topmost pushback area. + * Remember the bytes in the topmost pushback area. */ for (bufPtr = statePtr->topChanPtr->inQueueHead; bufPtr != NULL; @@ -8690,7 +8692,7 @@ Tcl_CreateChannelHandler( /* * The remainder of the initialization below is done regardless of whether - * or not this is a new record or a modification of an old one. + * this is a new record or a modification of an old one. */ chPtr->mask = mask; @@ -9004,7 +9006,6 @@ TclChannelEventScriptInvoker( *---------------------------------------------------------------------- */ - /* ARGSUSED */ int Tcl_FileEventObjCmd( ClientData dummy, /* Not used. */ @@ -9040,7 +9041,7 @@ Tcl_FileEventObjCmd( } chanPtr = (Channel *) chan; statePtr = chanPtr->state; - if ((statePtr->flags & mask) == 0) { + if (GotFlag(statePtr, mask) == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("channel is not %s", (mask == TCL_READABLE) ? "readable" : "writable")); return TCL_ERROR; @@ -9225,7 +9226,7 @@ TclCopyChannel( * completed. */ - csPtr = (CopyState *)ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize); + csPtr = (CopyState *)ckalloc(offsetof(CopyState, buffer) + 1U + !moveBytes * inStatePtr->bufSize); csPtr->bufSize = !moveBytes * inStatePtr->bufSize; csPtr->readPtr = inPtr; csPtr->writePtr = outPtr; @@ -9415,13 +9416,13 @@ MBWrite( if (bufPtr) { /* Split the overflowing buffer in two */ int extra = (int) (inBytes - csPtr->toRead); - /* Note that going with int for extra assumes that inBytes is not too - * much over toRead to require a wide itself. If that gets violated - * then the calculations involving extra must be made wide too. - * - * Noted with Win32/MSVC debug build treating the warning (possible of - * data in __int64 to int conversion) as error. - */ + /* Note that going with int for extra assumes that inBytes is not too + * much over toRead to require a wide itself. If that gets violated + * then the calculations involving extra must be made wide too. + * + * Noted with Win32/MSVC debug build treating the warning (possible of + * data in __int64 to int conversion) as error. + */ bufPtr = AllocChannelBuffer(extra); @@ -9519,8 +9520,10 @@ CopyData( Tcl_Obj *cmdPtr, *errObj = NULL, *bufObj = NULL, *msg = NULL; Tcl_Channel inChan, outChan; ChannelState *inStatePtr, *outStatePtr; - int result = TCL_OK, size, sizeb; + int result = TCL_OK; + int sizeb; Tcl_WideInt total; + int size; const char *buffer; int inBinary, outBinary, sameEncoding; /* Encoding control */ @@ -9603,12 +9606,12 @@ CopyData( if (interp) { TclNewObj(errObj); Tcl_AppendStringsToObj(errObj, "error reading \"", - Tcl_GetChannelName(inChan), "\": ", NULL); + Tcl_GetChannelName(inChan), "\": ", (void *)NULL); if (msg != NULL) { Tcl_AppendObjToObj(errObj, msg); } else { Tcl_AppendStringsToObj(errObj, Tcl_PosixError(interp), - NULL); + (void *)NULL); } } if (msg != NULL) { @@ -9684,12 +9687,12 @@ CopyData( if (interp) { TclNewObj(errObj); Tcl_AppendStringsToObj(errObj, "error writing \"", - Tcl_GetChannelName(outChan), "\": ", NULL); + Tcl_GetChannelName(outChan), "\": ", (void *)NULL); if (msg != NULL) { Tcl_AppendObjToObj(errObj, msg); } else { Tcl_AppendStringsToObj(errObj, Tcl_PosixError(interp), - NULL); + (void *)NULL); } } if (msg != NULL) { @@ -9985,7 +9988,7 @@ DoRead( * There's no more buffered data... */ - if (statePtr->flags & CHANNEL_EOF) { + if (GotFlag(statePtr, CHANNEL_EOF)) { /* * ...and there never will be. */ @@ -9993,7 +9996,7 @@ DoRead( *p++ = '\r'; bytesToRead--; bufPtr->nextRemoved++; - } else if (statePtr->flags & CHANNEL_BLOCKED) { + } else if (GotFlag(statePtr, CHANNEL_BLOCKED)) { /* * ...and we cannot get more now. */ @@ -10126,20 +10129,20 @@ StopCopy( */ nonBlocking = csPtr->readFlags & CHANNEL_NONBLOCKING; - if (nonBlocking != (inStatePtr->flags & CHANNEL_NONBLOCKING)) { + if (nonBlocking != GotFlag(inStatePtr, CHANNEL_NONBLOCKING)) { SetBlockMode(NULL, csPtr->readPtr, nonBlocking ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING); } if (csPtr->readPtr != csPtr->writePtr) { nonBlocking = csPtr->writeFlags & CHANNEL_NONBLOCKING; - if (nonBlocking != (outStatePtr->flags & CHANNEL_NONBLOCKING)) { + if (nonBlocking != GotFlag(outStatePtr, CHANNEL_NONBLOCKING)) { SetBlockMode(NULL, csPtr->writePtr, nonBlocking ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING); } } ResetFlag(outStatePtr, CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED); - outStatePtr->flags |= - csPtr->writeFlags & (CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED); + SetFlag(outStatePtr, + csPtr->writeFlags & (CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED)); if (csPtr->cmdPtr) { Tcl_DeleteChannelHandler(inChan, CopyEventProc, csPtr); @@ -11011,7 +11014,8 @@ static Tcl_Obj * FixLevelCode( Tcl_Obj *msg) { - int explicitResult, numOptions, lc, lcn; + int explicitResult, numOptions, lcn; + int lc; Tcl_Obj **lv, **lvn; int res, i, j, val, lignore, cignore; int newlevel = -1, newcode = -1; @@ -11304,8 +11308,8 @@ DumpFlags( char *str, int flags) { - char buf[20]; int i = 0; + char buf[24]; #define ChanFlag(chr, bit) (buf[i++] = ((flags & (bit)) ? (chr) : '_')) -- cgit v0.12