Compare commits
10
Commits
main
...
bug-45ddcfc3b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7f842fd2b | ||
|
|
d13753ac7b | ||
|
|
acea73bacc | ||
|
|
298bb3ebea | ||
|
|
9e2e706285 | ||
|
|
410d88ef42 | ||
|
|
0c9a91be97 | ||
|
|
c1778f1359 | ||
|
|
bf5bde4b2a | ||
|
|
ad1af6e204 |
@@ -9,8 +9,6 @@ jobs:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "CFLAGS=-DTCL_UTF_MAX=3"
|
||||
- "CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- "--disable-shared"
|
||||
- "--enable-symbols"
|
||||
- "--enable-symbols=mem"
|
||||
@@ -29,7 +27,7 @@ jobs:
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
mkdir "${HOME}/install dir"
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
./configure ${CFGOPT} CFLAGS=-DTCL_WIDE_INT_TYPE=__int128 "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
env:
|
||||
CFGOPT: ${{ matrix.cfgopt }}
|
||||
- name: Build
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
name: macOS
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
xcode:
|
||||
runs-on: macos-11
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: macosx
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
working-directory: generic
|
||||
- name: Build
|
||||
run: make all
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
- name: Run Tests
|
||||
run: make test styles=develop
|
||||
env:
|
||||
ERROR_ON_FAILURES: 1
|
||||
MAC_CI: 1
|
||||
clang:
|
||||
runs-on: macos-11
|
||||
strategy:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "--disable-shared"
|
||||
- "--enable-symbols"
|
||||
- "--enable-symbols=mem"
|
||||
- "--enable-symbols=all"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: unix
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
mkdir "$HOME/install dir"
|
||||
working-directory: generic
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
# Note that macOS is always a 64 bit platform
|
||||
run: ./configure --enable-dtrace --enable-framework ${CFGOPT} "--prefix=$HOME/install" || (cat config.log && exit 1)
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
CFGOPT: ${{ matrix.cfgopt }}
|
||||
- name: Build
|
||||
run: |
|
||||
make all tcltest
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
- name: Run Tests
|
||||
run: |
|
||||
make test
|
||||
env:
|
||||
ERROR_ON_FAILURES: 1
|
||||
MAC_CI: 1
|
||||
@@ -1,146 +0,0 @@
|
||||
name: Build Binaries
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
mkdir 1dist
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
working-directory: .
|
||||
- name: Configure
|
||||
run: ./configure --disable-symbols --disable-shared --enable-zipfs
|
||||
working-directory: unix
|
||||
- name: Build
|
||||
run: |
|
||||
make tclsh
|
||||
make shell SCRIPT="$VER_PATH $GITHUB_ENV"
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: unix
|
||||
- name: Package
|
||||
run: |
|
||||
cp ../unix/tclsh tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
chmod +x tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
tar -cf tclsh${TCL_PATCHLEVEL}_snapshot.tar tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot)
|
||||
path: 1dist/*.tar
|
||||
macos:
|
||||
name: macOS
|
||||
runs-on: macos-11
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout create-dmg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: create-dmg/create-dmg
|
||||
ref: v1.0.8
|
||||
path: create-dmg
|
||||
- name: Prepare
|
||||
run: |
|
||||
mkdir 1dist
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c || true
|
||||
wget https://github.com/culler/macher/releases/download/v1.3/macher
|
||||
sudo cp macher /usr/local/bin
|
||||
sudo chmod a+x /usr/local/bin/macher
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV
|
||||
echo "CFLAGS=-arch x86_64 -arch arm64e" >> $GITHUB_ENV
|
||||
- name: Configure
|
||||
run: ./configure --disable-symbols --disable-shared --enable-zipfs
|
||||
working-directory: unix
|
||||
- name: Build
|
||||
run: |
|
||||
make tclsh
|
||||
make shell SCRIPT="$VER_PATH $GITHUB_ENV"
|
||||
echo "TCL_BIN=`pwd`/tclsh" >> $GITHUB_ENV
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: unix
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir contents
|
||||
cp $TCL_BIN contents/tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
chmod +x contents/tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
cat > contents/README.txt <<EOF
|
||||
This is a single-file executable developer preview of Tcl $TCL_PATCHLEVEL
|
||||
|
||||
It is not intended as an official release at all, so it is unsigned and unnotarized.
|
||||
Use strictly at your own risk.
|
||||
|
||||
To run it, you need to copy the executable out and run:
|
||||
xattr -d com.apple.quarantine tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
to mark the executable as runnable on your machine.
|
||||
EOF
|
||||
$CREATE_DMG \
|
||||
--volname "Tcl $TCL_PATCHLEVEL (snapshot)" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 800 400 \
|
||||
"Tcl-$TCL_PATCHLEVEL-(snapshot).dmg" \
|
||||
"contents/"
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (snapshot)
|
||||
path: 1dist/*.dmg
|
||||
win:
|
||||
name: Windows
|
||||
runs-on: windows-2019
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
CC: gcc
|
||||
CFGOPT: --disable-symbols --disable-shared
|
||||
steps:
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
install: git mingw-w64-ucrt-x86_64-toolchain make zip
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
mkdir 1dist
|
||||
working-directory: .
|
||||
- name: Configure
|
||||
run: ./configure $CFGOPT
|
||||
working-directory: win
|
||||
- name: Build
|
||||
run: |
|
||||
make binaries libraries
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: win
|
||||
- name: Get Exact Version
|
||||
run: |
|
||||
./tclsh*.exe $VER_PATH $GITHUB_ENV
|
||||
working-directory: win
|
||||
- name: Set Executable Name
|
||||
run: |
|
||||
cp ../win/tclsh*.exe tclsh${TCL_PATCHLEVEL}_snapshot.exe
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (snapshot)
|
||||
path: '1dist/*_snapshot.exe'
|
||||
@@ -1,90 +0,0 @@
|
||||
name: Windows
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
ERROR_ON_FAILURES: 1
|
||||
jobs:
|
||||
msvc:
|
||||
runs-on: windows-2022
|
||||
defaults:
|
||||
run:
|
||||
shell: powershell
|
||||
working-directory: win
|
||||
strategy:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "OPTS=utf16"
|
||||
- "CHECKS=nodep"
|
||||
- "OPTS=static"
|
||||
- "OPTS=symbols"
|
||||
- "OPTS=symbols STATS=compdbg,memdbg"
|
||||
# Using powershell means we need to explicitly stop on failure
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Init MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: Build ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
&nmake -f makefile.vc ${{ matrix.cfgopt }} all
|
||||
if ($lastexitcode -ne 0) {
|
||||
throw "nmake exit code: $lastexitcode"
|
||||
}
|
||||
- name: Build Test Harness ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
&nmake -f makefile.vc ${{ matrix.cfgopt }} tcltest
|
||||
if ($lastexitcode -ne 0) {
|
||||
throw "nmake exit code: $lastexitcode"
|
||||
}
|
||||
- name: Run Tests ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
&nmake -f makefile.vc ${{ matrix.cfgopt }} test
|
||||
if ($lastexitcode -ne 0) {
|
||||
throw "nmake exit code: $lastexitcode"
|
||||
}
|
||||
gcc:
|
||||
runs-on: windows-2022
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
working-directory: win
|
||||
strategy:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "CFLAGS=-DTCL_UTF_MAX=3"
|
||||
- "CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- "--disable-shared"
|
||||
- "--enable-symbols"
|
||||
- "--enable-symbols=mem"
|
||||
- "--enable-symbols=all"
|
||||
# Using powershell means we need to explicitly stop on failure
|
||||
steps:
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
install: git mingw-w64-x86_64-toolchain make
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
mkdir "${HOME}/install dir"
|
||||
working-directory: generic
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
env:
|
||||
CFGOPT: --enable-64bit ${{ matrix.cfgopt }}
|
||||
- name: Build
|
||||
run: make all
|
||||
- name: Build Test Harness
|
||||
run: make tcltest
|
||||
- name: Run Tests
|
||||
run: make test
|
||||
|
||||
# If you add builds with Wine, be sure to define the environment variable
|
||||
# CI_USING_WINE when running them so that broken tests know not to run.
|
||||
+1
-1
@@ -8279,7 +8279,7 @@ ExprWideFunc(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclGetWideBitsFromObj(NULL, Tcl_GetObjResult(interp), &wResult);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(wResult));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((int64_t)wResult));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
+18
-17
@@ -2211,6 +2211,7 @@ FormatNumber(
|
||||
if (TclGetWideBitsFromObj(interp, src, &wvalue) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
wvalue &= ULLONG_MAX;
|
||||
if (NeedReversing(type)) {
|
||||
*(*cursorPtr)++ = UCHAR(wvalue);
|
||||
*(*cursorPtr)++ = UCHAR(wvalue >> 8);
|
||||
@@ -2321,7 +2322,7 @@ ScanNumber(
|
||||
long value;
|
||||
float fvalue;
|
||||
double dvalue;
|
||||
Tcl_WideUInt uwvalue;
|
||||
uint64_t uwvalue;
|
||||
|
||||
/*
|
||||
* We cannot rely on the compiler to properly sign extend integer values
|
||||
@@ -2447,23 +2448,23 @@ ScanNumber(
|
||||
case 'W':
|
||||
case 'm':
|
||||
if (NeedReversing(type)) {
|
||||
uwvalue = ((Tcl_WideUInt) buffer[0])
|
||||
| (((Tcl_WideUInt) buffer[1]) << 8)
|
||||
| (((Tcl_WideUInt) buffer[2]) << 16)
|
||||
| (((Tcl_WideUInt) buffer[3]) << 24)
|
||||
| (((Tcl_WideUInt) buffer[4]) << 32)
|
||||
| (((Tcl_WideUInt) buffer[5]) << 40)
|
||||
| (((Tcl_WideUInt) buffer[6]) << 48)
|
||||
| (((Tcl_WideUInt) buffer[7]) << 56);
|
||||
uwvalue = ((uint64_t) buffer[0])
|
||||
| (((uint64_t) buffer[1]) << 8)
|
||||
| (((uint64_t) buffer[2]) << 16)
|
||||
| (((uint64_t) buffer[3]) << 24)
|
||||
| (((uint64_t) buffer[4]) << 32)
|
||||
| (((uint64_t) buffer[5]) << 40)
|
||||
| (((uint64_t) buffer[6]) << 48)
|
||||
| (((uint64_t) buffer[7]) << 56);
|
||||
} else {
|
||||
uwvalue = ((Tcl_WideUInt) buffer[7])
|
||||
| (((Tcl_WideUInt) buffer[6]) << 8)
|
||||
| (((Tcl_WideUInt) buffer[5]) << 16)
|
||||
| (((Tcl_WideUInt) buffer[4]) << 24)
|
||||
| (((Tcl_WideUInt) buffer[3]) << 32)
|
||||
| (((Tcl_WideUInt) buffer[2]) << 40)
|
||||
| (((Tcl_WideUInt) buffer[1]) << 48)
|
||||
| (((Tcl_WideUInt) buffer[0]) << 56);
|
||||
uwvalue = ((uint64_t) buffer[7])
|
||||
| (((uint64_t) buffer[6]) << 8)
|
||||
| (((uint64_t) buffer[5]) << 16)
|
||||
| (((uint64_t) buffer[4]) << 24)
|
||||
| (((uint64_t) buffer[3]) << 32)
|
||||
| (((uint64_t) buffer[2]) << 40)
|
||||
| (((uint64_t) buffer[1]) << 48)
|
||||
| (((uint64_t) buffer[0]) << 56);
|
||||
}
|
||||
if (flags & BINARY_UNSIGNED) {
|
||||
Tcl_Obj *bigObj = NULL;
|
||||
|
||||
+2
-1
@@ -1754,7 +1754,8 @@ StringIsCmd(
|
||||
}
|
||||
break;
|
||||
case STR_IS_WIDE:
|
||||
if (TCL_OK == TclGetWideIntFromObj(NULL, objPtr, &w)) {
|
||||
if (TCL_OK == TclGetWideIntFromObj(NULL, objPtr, &w) && (sizeof(Tcl_WideInt) <= sizeof(int64_t)
|
||||
|| (((w <= INT64_MAX) && (w >= INT64_MIN))))) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+28
-2
@@ -8171,7 +8171,20 @@ ExecuteExtendedBinaryMathOp(
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
*/
|
||||
|
||||
err = mp_init_i64(&big1, w1);
|
||||
if ((sizeof(Tcl_WideInt) > INT64_MAX) && ((w1 > INT64_MAX)
|
||||
|| (w1 < INT64_MIN))) {
|
||||
Tcl_WideUInt uw1 = (Tcl_WideUInt)w1;
|
||||
if (w1 < 0) {uw1 = -uw1;}
|
||||
err = mp_init(&big1);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_unpack(&big1, 1, 1, sizeof(Tcl_WideInt), 0, 0, &w1);
|
||||
}
|
||||
if ((err == MP_OKAY) && (w1 < 0)) {
|
||||
err = mp_neg(&big1, &big1);
|
||||
}
|
||||
} else {
|
||||
err = mp_init_i64(&big1, w1);
|
||||
}
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
@@ -8838,7 +8851,20 @@ ExecuteExtendedUnaryMathOp(
|
||||
if (w != WIDE_MIN) {
|
||||
WIDE_RESULT(-w);
|
||||
}
|
||||
err = mp_init_i64(&big, w);
|
||||
if ((sizeof(Tcl_WideInt) > sizeof(int64_t)) && ((w > INT64_MAX)
|
||||
|| (w < INT64_MIN))) {
|
||||
Tcl_WideUInt uw = (Tcl_WideUInt)w;
|
||||
if (w < 0) {uw = -uw;}
|
||||
err = mp_init(&big);
|
||||
if (err == MP_OKAY) {
|
||||
err = mp_unpack(&big, 1, 1, sizeof(Tcl_WideInt), 0, 0, &uw);
|
||||
}
|
||||
if ((err == MP_OKAY) && (w < 0)) {
|
||||
err = mp_neg(&big, &big);
|
||||
}
|
||||
} else {
|
||||
err = mp_init_i64(&big, w);
|
||||
}
|
||||
if (err != MP_OKAY) {
|
||||
return OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
+7
-7
@@ -253,13 +253,13 @@ Tcl_Stat(
|
||||
Tcl_DecrRefCount(pathPtr);
|
||||
if (ret != -1) {
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_WideInt tmp1, tmp2, tmp3 = 0;
|
||||
long long tmp1, tmp2, tmp3 = 0;
|
||||
|
||||
# define OUT_OF_RANGE(x) \
|
||||
(((Tcl_WideInt)(x)) < LONG_MIN || \
|
||||
((Tcl_WideInt)(x)) > LONG_MAX)
|
||||
(((long long)(x)) < LONG_MIN || \
|
||||
((long long)(x)) > LONG_MAX)
|
||||
# define OUT_OF_URANGE(x) \
|
||||
(((Tcl_WideUInt)(x)) > ((Tcl_WideUInt)ULONG_MAX))
|
||||
(((unsigned long long)(x)) > ((unsigned long long)ULONG_MAX))
|
||||
|
||||
/*
|
||||
* Perform the result-buffer overflow check manually.
|
||||
@@ -271,10 +271,10 @@ Tcl_Stat(
|
||||
* Tcl_WideInt.
|
||||
*/
|
||||
|
||||
tmp1 = (Tcl_WideInt) buf.st_ino;
|
||||
tmp2 = (Tcl_WideInt) buf.st_size;
|
||||
tmp1 = (long long) buf.st_ino;
|
||||
tmp2 = (long long) buf.st_size;
|
||||
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
|
||||
tmp3 = (Tcl_WideInt) buf.st_blocks;
|
||||
tmp3 = (long long) buf.st_blocks;
|
||||
#endif
|
||||
|
||||
if (OUT_OF_URANGE(tmp1) || OUT_OF_RANGE(tmp2) || OUT_OF_RANGE(tmp3)) {
|
||||
|
||||
+12
-1
@@ -3672,7 +3672,18 @@ GetBignumFromObj(
|
||||
return TCL_OK;
|
||||
}
|
||||
if (objPtr->typePtr == &tclIntType) {
|
||||
if (mp_init_i64(bignumValue,
|
||||
if ((sizeof(Tcl_WideInt) > sizeof(int64_t)) && ((objPtr->internalRep.wideValue > INT64_MAX)
|
||||
|| (objPtr->internalRep.wideValue < INT64_MIN))) {
|
||||
Tcl_WideUInt uw = (Tcl_WideUInt)objPtr->internalRep.wideValue;
|
||||
if (objPtr->internalRep.wideValue < 0) {uw = -uw;}
|
||||
if (mp_init(bignumValue) != MP_OKAY || mp_unpack(bignumValue, 1, 1,
|
||||
sizeof(Tcl_WideInt), 0, 0, &uw) != MP_OKAY) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if ((objPtr->internalRep.wideValue < 0) && (mp_neg(bignumValue, bignumValue) != MP_OKAY)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
} else if (mp_init_i64(bignumValue,
|
||||
objPtr->internalRep.wideValue) != MP_OKAY) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
+8
-2
@@ -917,14 +917,20 @@ Tcl_ScanObjCmd(
|
||||
if (flags & SCAN_LONGER) {
|
||||
if (Tcl_GetWideIntFromObj(NULL, objPtr, &wideValue) != TCL_OK) {
|
||||
if (TclGetString(objPtr)[0] == '-') {
|
||||
wideValue = WIDE_MIN;
|
||||
wideValue = INT64_MIN;
|
||||
}
|
||||
} else if (sizeof(Tcl_WideInt) > sizeof(int64_t)) {
|
||||
if (wideValue > INT64_MAX) {
|
||||
wideValue = INT64_MAX;
|
||||
} else if (wideValue < INT64_MIN) {
|
||||
wideValue = INT64_MIN;
|
||||
} else {
|
||||
wideValue = WIDE_MAX;
|
||||
}
|
||||
}
|
||||
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
|
||||
mp_int big;
|
||||
if (mp_init_u64(&big, (Tcl_WideUInt)wideValue) != MP_OKAY) {
|
||||
if (mp_init_u64(&big, (uint64_t)wideValue) != MP_OKAY) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"insufficient memory to create bignum", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
|
||||
|
||||
+44
-47
@@ -103,11 +103,9 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
|
||||
*/
|
||||
|
||||
#ifdef __hppa
|
||||
# define NAN_START 0x7FF4
|
||||
# define NAN_MASK (((Tcl_WideUInt) 1) << 50)
|
||||
# define NAN_START UINT64_C(0x7FF4)
|
||||
#else
|
||||
# define NAN_START 0x7FF8
|
||||
# define NAN_MASK (((Tcl_WideUInt) 1) << 51)
|
||||
# define NAN_START UINT64_C(0x7FF8)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -261,34 +259,34 @@ static const int log2pow5[27] = {
|
||||
};
|
||||
#define N_LOG2POW5 27
|
||||
|
||||
static const Tcl_WideUInt wuipow5[27] = {
|
||||
(Tcl_WideUInt) 1, /* 5**0 */
|
||||
(Tcl_WideUInt) 5,
|
||||
(Tcl_WideUInt) 25,
|
||||
(Tcl_WideUInt) 125,
|
||||
(Tcl_WideUInt) 625,
|
||||
(Tcl_WideUInt) 3125, /* 5**5 */
|
||||
(Tcl_WideUInt) 3125*5,
|
||||
(Tcl_WideUInt) 3125*25,
|
||||
(Tcl_WideUInt) 3125*125,
|
||||
(Tcl_WideUInt) 3125*625,
|
||||
(Tcl_WideUInt) 3125*3125, /* 5**10 */
|
||||
(Tcl_WideUInt) 3125*3125*5,
|
||||
(Tcl_WideUInt) 3125*3125*25,
|
||||
(Tcl_WideUInt) 3125*3125*125,
|
||||
(Tcl_WideUInt) 3125*3125*625,
|
||||
(Tcl_WideUInt) 3125*3125*3125, /* 5**15 */
|
||||
(Tcl_WideUInt) 3125*3125*3125*5,
|
||||
(Tcl_WideUInt) 3125*3125*3125*25,
|
||||
(Tcl_WideUInt) 3125*3125*3125*125,
|
||||
(Tcl_WideUInt) 3125*3125*3125*625,
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125, /* 5**20 */
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*5,
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*25,
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*125,
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*625,
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*3125, /* 5**25 */
|
||||
(Tcl_WideUInt) 3125*3125*3125*3125*3125*5 /* 5**26 */
|
||||
static const unsigned long long wuipow5[27] = {
|
||||
1ULL, /* 5**0 */
|
||||
5ULL,
|
||||
25ULL,
|
||||
125ULL,
|
||||
625ULL,
|
||||
3125ULL, /* 5**5 */
|
||||
3125ULL*5,
|
||||
3125ULL*25,
|
||||
3125ULL*125,
|
||||
3125ULL*625,
|
||||
3125ULL*3125, /* 5**10 */
|
||||
3125ULL*3125*5,
|
||||
3125ULL*3125*25,
|
||||
3125ULL*3125*125,
|
||||
3125ULL*3125*625,
|
||||
3125ULL*3125*3125, /* 5**15 */
|
||||
3125ULL*3125*3125*5,
|
||||
3125ULL*3125*3125*25,
|
||||
3125ULL*3125*3125*125,
|
||||
3125ULL*3125*3125*625,
|
||||
3125ULL*3125*3125*3125, /* 5**20 */
|
||||
3125ULL*3125*3125*3125*5,
|
||||
3125ULL*3125*3125*3125*25,
|
||||
3125ULL*3125*3125*3125*125,
|
||||
3125ULL*3125*3125*3125*625,
|
||||
3125ULL*3125*3125*3125*3125, /* 5**25 */
|
||||
3125ULL*3125*3125*3125*3125*5 /* 5**26 */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -368,7 +366,7 @@ static double Pow10TimesFrExp(int exponent, double fraction,
|
||||
int *machexp);
|
||||
static double SafeLdExp(double fraction, int exponent);
|
||||
#ifdef IEEE_FLOATING_POINT
|
||||
static Tcl_WideUInt Nokia770Twiddle(Tcl_WideUInt w);
|
||||
static uint64_t Nokia770Twiddle(uint64_t w);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1980,16 +1978,15 @@ MakeNaN(
|
||||
Tcl_WideUInt tags) /* Tag bits to put in the NaN. */
|
||||
{
|
||||
union {
|
||||
Tcl_WideUInt iv;
|
||||
uint64_t iv;
|
||||
double dv;
|
||||
} theNaN;
|
||||
|
||||
theNaN.iv = tags;
|
||||
theNaN.iv &= (((Tcl_WideUInt) 1) << 51) - 1;
|
||||
theNaN.iv = (uint64_t)tags & ((UINT64_C(1) << 51) - 1);
|
||||
if (signum) {
|
||||
theNaN.iv |= ((Tcl_WideUInt) (0x8000 | NAN_START)) << 48;
|
||||
theNaN.iv |= ((UINT64_C(0x8000) | NAN_START)) << 48;
|
||||
} else {
|
||||
theNaN.iv |= ((Tcl_WideUInt) NAN_START) << 48;
|
||||
theNaN.iv |= (NAN_START) << 48;
|
||||
}
|
||||
if (n770_fp) {
|
||||
theNaN.iv = Nokia770Twiddle(theNaN.iv);
|
||||
@@ -3190,13 +3187,13 @@ ShorteningInt64Conversion(
|
||||
{
|
||||
char *retval = (char *)ckalloc(len + 1);
|
||||
/* Output buffer. */
|
||||
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
|
||||
unsigned long long b = (bw * wuipow5[b5]) << b2;
|
||||
/* Numerator of the fraction being
|
||||
* converted. */
|
||||
Tcl_WideUInt S = wuipow5[s5] << s2;
|
||||
unsigned long long S = wuipow5[s5] << s2;
|
||||
/* Denominator of the fraction being
|
||||
* converted. */
|
||||
Tcl_WideUInt mplus, mminus; /* Ranges for testing whether the result is
|
||||
unsigned long long mplus, mminus; /* Ranges for testing whether the result is
|
||||
* within roundoff of being exact. */
|
||||
int digit; /* Current output digit. */
|
||||
char *s = retval; /* Cursor in the output buffer. */
|
||||
@@ -3353,10 +3350,10 @@ StrictInt64Conversion(
|
||||
{
|
||||
char *retval = (char *)ckalloc(len + 1);
|
||||
/* Output buffer. */
|
||||
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
|
||||
unsigned long long b = (bw * wuipow5[b5]) << b2;
|
||||
/* Numerator of the fraction being
|
||||
* converted. */
|
||||
Tcl_WideUInt S = wuipow5[s5] << s2;
|
||||
unsigned long long S = wuipow5[s5] << s2;
|
||||
/* Denominator of the fraction being
|
||||
* converted. */
|
||||
int digit; /* Current output digit. */
|
||||
@@ -4679,7 +4676,7 @@ TclInitDoubleConversion(void)
|
||||
#ifdef IEEE_FLOATING_POINT
|
||||
union {
|
||||
double dv;
|
||||
Tcl_WideUInt iv;
|
||||
uint64_t iv;
|
||||
} bitwhack;
|
||||
#endif
|
||||
mp_err err = MP_OKAY;
|
||||
@@ -4865,7 +4862,7 @@ Tcl_InitBignumFromDouble(
|
||||
err = mp_init(b);
|
||||
mp_zero(b);
|
||||
} else {
|
||||
Tcl_WideInt w = (Tcl_WideInt)ldexp(fract, mantBits);
|
||||
int64_t w = (int64_t) ldexp(fract, mantBits);
|
||||
int shift = expt - mantBits;
|
||||
|
||||
err = mp_init_i64(b, w);
|
||||
@@ -5358,9 +5355,9 @@ TclFormatNaN(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef IEEE_FLOATING_POINT
|
||||
static Tcl_WideUInt
|
||||
static uint64_t
|
||||
Nokia770Twiddle(
|
||||
Tcl_WideUInt w) /* Number to transpose. */
|
||||
uint64_t w) /* Number to transpose. */
|
||||
{
|
||||
return (((w >> 32) & 0xFFFFFFFF) | (w << 32));
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ s,@mandir@,${prefix}/man,;t t
|
||||
s,@build_alias@,,;t t
|
||||
s,@host_alias@,,;t t
|
||||
s,@target_alias@,,;t t
|
||||
s,@DEFS@,-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_DECL_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_DECL_GETHOSTBYADDR_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_MKSTEMPS=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1 ,;t t
|
||||
s,@DEFS@,-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_MKSTEMPS=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1 ,;t t
|
||||
s,@ECHO_C@,,;t t
|
||||
s,@ECHO_N@,-n,;t t
|
||||
s,@ECHO_T@,,;t t
|
||||
@@ -488,7 +488,7 @@ s,@OBJEXT@,o,;t t
|
||||
s,@CPP@,gcc -E,;t t
|
||||
s,@EGREP@,grep -E,;t t
|
||||
s,@TCL_THREADS@,1,;t t
|
||||
s,@TCLSH_PROG@,/usr/bin/tclsh8.6,;t t
|
||||
s,@TCLSH_PROG@,/home/jima/space/ins/lin64/dynamic/main/bin/tclsh8.6,;t t
|
||||
s,@ZLIB_OBJS@,,;t t
|
||||
s,@ZLIB_SRCS@,,;t t
|
||||
s,@ZLIB_INCLUDE@,,;t t
|
||||
@@ -497,7 +497,7 @@ s,@ac_ct_RANLIB@,ranlib,;t t
|
||||
s,@AR@,ar,;t t
|
||||
s,@ac_ct_AR@,ar,;t t
|
||||
s,@LIBOBJS@,,;t t
|
||||
s,@TCL_LIBS@,-ldl -lz -lpthread -lm,;t t
|
||||
s,@TCL_LIBS@,-ldl -lz -lpthread -lieee -lm,;t t
|
||||
s,@DL_LIBS@,-ldl,;t t
|
||||
s,@DL_OBJS@,tclLoadDl.o,;t t
|
||||
s,@PLAT_OBJS@,,;t t
|
||||
@@ -528,7 +528,7 @@ s,@DTRACE@,,;t t
|
||||
s,@TCL_VERSION@,8.6,;t t
|
||||
s,@TCL_MAJOR_VERSION@,8,;t t
|
||||
s,@TCL_MINOR_VERSION@,6,;t t
|
||||
s,@TCL_PATCH_LEVEL@,.10,;t t
|
||||
s,@TCL_PATCH_LEVEL@,.8,;t t
|
||||
s,@TCL_YEAR@,,;t t
|
||||
s,@PKG_CFG_ARGS@,'--prefix=/home/jima/space/ins/lin64/dynamic/main' ,;t t
|
||||
s,@TCL_LIB_FILE@,libtcl8.6.so,;t t
|
||||
|
||||
Reference in New Issue
Block a user