mirror of
https://github.com/QB64Official/qb64.git
synced 2024-05-12 12:00:14 +00:00
Compare commits
11 commits
aa0e525b49
...
15f570cc11
Author | SHA1 | Date | |
---|---|---|---|
15f570cc11 | |||
391983b6da | |||
f785c79164 | |||
c9e0fc37a1 | |||
97be38ec96 | |||
319fc322ee | |||
fcc61cc722 | |||
3fead708b4 | |||
24f1893c39 | |||
a568095ad0 | |||
bfb244cf50 |
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Bootstrap compiler
|
||||
|
|
2
.github/workflows/push.yml
vendored
2
.github/workflows/push.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Bootstrap compiler
|
||||
|
|
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Bootstrap compiler
|
||||
|
@ -29,7 +29,7 @@ jobs:
|
|||
runs-on: macos-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh osx
|
||||
- name: Compile
|
||||
|
@ -49,7 +49,7 @@ jobs:
|
|||
env:
|
||||
PLATFORM: x86
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap32.bat
|
||||
- name: Compile
|
||||
|
@ -70,7 +70,7 @@ jobs:
|
|||
env:
|
||||
PLATFORM: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
|
|
10
findcurl.cmd
10
findcurl.cmd
|
@ -15,14 +15,18 @@ rem Check if curl exists
|
|||
curl --version 2>NUL 1>&2
|
||||
|
||||
|
||||
if %ERRORLEVEL == 9009 (
|
||||
if %ERRORLEVEL% == 9009 (
|
||||
rem check if we have it already
|
||||
if exist internal\curl\curl.exe goto gotcurl
|
||||
mkdir internal\curl >NUL
|
||||
echo Fetching %LINK%
|
||||
explorer %LINK%
|
||||
|
||||
rem we should wait until the file is downloaded, because explorer returns straight away
|
||||
:keeptesting
|
||||
rem sleep 5 - we need to find something that'll work on XP, as timeout doesn't exist
|
||||
rem if not exist "%USERPROFILE%\Desktop\%CURLVERSION%" goto keeptesting
|
||||
"%SystemRoot%\system32\expand.exe" "%USERPROFILE%\Desktop\%CURLVERSION%" /F:%ARCH%\* internal\curl
|
||||
|
||||
:gotcurl
|
||||
rem Add to path
|
||||
PATH=%PATH%;%~dp0\internal\curl
|
||||
) ELSE (
|
||||
|
|
|
@ -6948,9 +6948,58 @@ qbs *qbs_str(float value){
|
|||
qbs *qbs_str(double value){
|
||||
static qbs *tqbs;
|
||||
tqbs=qbs_new(32,1);
|
||||
static char ch;
|
||||
static int32 l,i,i2,i3,digits,exponent;
|
||||
static int32 mult,exp,index;
|
||||
|
||||
l=sprintf((char*)&qbs_str_buffer,"% .15E",value);
|
||||
|
||||
// the "new version"...
|
||||
|
||||
// scan the result (in reverse) to determine the exponent.
|
||||
exponent = 0; mult = 1;
|
||||
for (i = l; i > 0; i--) {
|
||||
if (!(qbs_str_buffer[i] == 0 || qbs_str_buffer[i] == 32)) { // not null or space...
|
||||
if (qbs_str_buffer[i] == 43) {
|
||||
break; // if a +, exit for.
|
||||
} else if (qbs_str_buffer[i] == 45) {
|
||||
exponent = -exponent;
|
||||
break; // a -, negate exponent and exit for.
|
||||
} else {
|
||||
exponent += (qbs_str_buffer[i] - 48) * mult;
|
||||
mult *= 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
digits = 0; exp = 0;
|
||||
for (i = l; i > 0; i--) {
|
||||
if (exp == 0) {
|
||||
if (qbs_str_buffer[i] == 69) { exp = i; } // location of the E
|
||||
} else if (qbs_str_buffer[i] != 48 && qbs_str_buffer[i] != 46) {
|
||||
digits = i; break;
|
||||
}
|
||||
}
|
||||
if (digits==0){
|
||||
tqbs->len=2; tqbs->chr[0]=32; tqbs->chr[1]=48; // tqbs=[space][0]
|
||||
return tqbs;
|
||||
}
|
||||
if (exponent >= 16 || exponent <= -17) {
|
||||
index=0;
|
||||
for (i = 0; i < digits + 1; i++) {
|
||||
ch = qbs_str_buffer[i];
|
||||
tqbs->chr[index++] = ch;
|
||||
}
|
||||
tqbs->chr[index++] = 68;
|
||||
for (i = exp + 1; i < l; i++) {
|
||||
ch = qbs_str_buffer[i];
|
||||
tqbs->chr[index++] = ch;
|
||||
}
|
||||
tqbs->len=index;
|
||||
return tqbs;
|
||||
}
|
||||
|
||||
/* ----- the "old way"; which has problems with formatting certain exponents properly.
|
||||
|
||||
//IMPORTANT: assumed l==23
|
||||
if (l==22){memmove(&qbs_str_buffer[21],&qbs_str_buffer[20],2); qbs_str_buffer[20]=48; l=23;}
|
||||
|
||||
|
@ -6979,6 +7028,7 @@ qbs *qbs_str(double value){
|
|||
if (qbs_str_buffer[19]==45) exponent=-exponent;
|
||||
//OLD if ((exponent<=15)&&((exponent-digits)>=-16)) goto asdecimal;
|
||||
if ((exponent<=15)&&((exponent-digits)>=-17)) goto asdecimal;
|
||||
|
||||
//fix up exponent to conform to QBASIC standards
|
||||
//i. cull trailing 0's after decimal point (use digits to help)
|
||||
//ii. cull leading 0's of exponent
|
||||
|
@ -6997,6 +7047,8 @@ qbs *qbs_str(double value){
|
|||
return tqbs;
|
||||
/////////////////////
|
||||
asdecimal:
|
||||
*/
|
||||
|
||||
//calculate digits after decimal point in var. i
|
||||
i=-(exponent-digits+1);
|
||||
if (i<0) i=0;
|
||||
|
|
|
@ -55,8 +55,12 @@ rem )
|
|||
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && goto chose32 || goto choose
|
||||
|
||||
:choose
|
||||
choice /c 12 /M "Use (1) 64-bit or (2) 32-bit MINGW? "
|
||||
if errorlevel == 1 goto chose64
|
||||
if not exist %SystemRoot%\system32\choice.exe (
|
||||
set /p errorlevel="Install (1) 64-bit or (2) 32-bit MINGW? "
|
||||
) else (
|
||||
choice /c 12 /M "Install (1) 64-bit or (2) 32-bit MINGW? "
|
||||
)
|
||||
if errorlevel 1 goto chose64
|
||||
goto chose32
|
||||
|
||||
:chose32
|
||||
|
@ -74,18 +78,34 @@ goto chosen
|
|||
echo Downloading %url%...
|
||||
curl -L %url% -o temp.7z
|
||||
|
||||
echo Downloading 7zr.exe...
|
||||
curl -L https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
echo Testing for 7zip
|
||||
7z >NUL 2>&1
|
||||
|
||||
echo Extracting C++ Compiler...
|
||||
7zr.exe x temp.7z -y
|
||||
if ERRORLEVEL 9009 (
|
||||
|
||||
echo Downloading 7zr.exe...
|
||||
rem Check for XP (either 32-bit or 64-bit)
|
||||
ver | findstr /R /C:"Version 5.[12]"
|
||||
if errorlevel 0 (
|
||||
curl -Lk https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
) else (
|
||||
curl -L https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
)
|
||||
|
||||
echo Extracting C++ Compiler...
|
||||
7zr.exe x temp.7z -y
|
||||
) else (
|
||||
echo Extracting C++ Compiler...
|
||||
7z x temp.7z -y
|
||||
)
|
||||
|
||||
echo Moving C++ compiler...
|
||||
for /f %%a in ('dir %MINGW% /b') do move /y "%MINGW%\%%a" internal\c\c_compiler\
|
||||
|
||||
echo Cleaning up..
|
||||
rd %MINGW%
|
||||
del 7zr.exe
|
||||
if exist 7zr.exe del 7zr.exe
|
||||
|
||||
del temp.7z
|
||||
|
||||
:skipccompsetup
|
||||
|
|
Loading…
Reference in a new issue