Skip to content

Commit

Permalink
Merge pull request #558 from QB64-Phoenix-Edition/various-things
Browse files Browse the repository at this point in the history
Various things
  • Loading branch information
RhoSigma-QB64 authored Oct 15, 2024
2 parents b8edf33 + 5aa9789 commit 4df0c90
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 158 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ internal/temp*
internal/config*.txt
internal/config.ini
internal/help
!internal/support/**
internal/commit.txt
tempfoldersearch.bin
internal/c/qbx[2-9].cpp
Expand Down
8 changes: 4 additions & 4 deletions internal/source/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212349,12 +212349,12 @@ S_62294:;
if ((qbs_cleanup(qbs_tmp_base,func_instr(NULL,func__os(),qbs_new_txt_len("WIN",3),0)))||is_error_pending()){
if(qbevent){evnt(23652,117,"file_converters.bas");if(r)goto S_62294;}
do{
qbs_set(_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY,qbs_new_txt_len("internal\\utilities\\addprefix.exe",32));
qbs_set(_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY,qbs_new_txt_len("internal\\utilities\\AddPREFIX.exe",32));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(23652,118,"file_converters.bas");}while(r);
}else{
do{
qbs_set(_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY,qbs_new_txt_len("internal/utilities/addprefix",28));
qbs_set(_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY,qbs_new_txt_len("internal/utilities/AddPREFIX",28));
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(23652,120,"file_converters.bas");}while(r);
}
Expand All @@ -212373,12 +212373,12 @@ S_62303:;
if ((qbs_cleanup(qbs_tmp_base,func_instr(NULL,func__os(),qbs_new_txt_len("WIN",3),0)))||is_error_pending()){
if(qbevent){evnt(23652,124,"file_converters.bas");if(r)goto S_62303;}
do{
sub_shell2(qbs_add(qbs_new_txt_len("qb64pe -x internal/support/addprefix/addprefix.bas -o ",54),_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY),2);
sub_shell2(qbs_add(qbs_new_txt_len("qb64pe -x internal/support/converter/AddPREFIX.bas -o ",54),_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY),2);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(23652,125,"file_converters.bas");}while(r);
}else{
do{
sub_shell2(qbs_add(qbs_new_txt_len("./qb64pe -x ./internal/support/addprefix/addprefix.bas -o ",58),_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY),2);
sub_shell2(qbs_add(qbs_new_txt_len("./qb64pe -x ./internal/support/converter/AddPREFIX.bas -o ",58),_FUNC_OFFERNOPREFIXCONVERSION_STRING_CONVERTUTILITY),2);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(23652,127,"file_converters.bas");}while(r);
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion source/ide/config/cfg_methods.bas
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ SUB ReadInitialConfig
result = ReadConfigSetting(generalSettingsSection$, "BackupSize", value$)
idebackupsize = VAL(value$)
IF idebackupsize < 10 OR idebackupsize > 2000 THEN
idebackupsize = 100: WriteConfigSetting generalSettingsSection$, "BackupSize", "100"
idebackupsize = 500: WriteConfigSetting generalSettingsSection$, "BackupSize", "500"
END IF

result = ReadConfigSetting(generalSettingsSection$, "MaxRecentFiles", value$)
Expand Down
8 changes: 4 additions & 4 deletions source/ide/file_converters.bas
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ FUNCTION OfferNoprefixConversion% (file$)
PCOPY 3, 0

IF INSTR(_OS$, "WIN") THEN
convertUtility$ = "internal\utilities\addprefix.exe"
convertUtility$ = "internal\utilities\AddPREFIX.exe"
ELSE
convertUtility$ = "internal/utilities/addprefix"
convertUtility$ = "./internal/utilities/AddPREFIX"
END IF
IF NOT _FILEEXISTS(convertUtility$) THEN
IF _DIREXISTS("./internal/utilities") = 0 THEN MKDIR "./internal/utilities"
IF INSTR(_OS$, "WIN") THEN
SHELL _HIDE "qb64pe -x internal/support/addprefix/addprefix.bas -o " + convertUtility$
SHELL _HIDE "qb64pe -x internal/support/converter/AddPREFIX.bas -o " + convertUtility$
ELSE
SHELL _HIDE "./qb64pe -x ./internal/support/addprefix/addprefix.bas -o " + convertUtility$
SHELL _HIDE "./qb64pe -x ./internal/support/converter/AddPREFIX.bas -o " + convertUtility$
END IF
END IF

Expand Down
16 changes: 7 additions & 9 deletions source/qb64pe.bas
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ REDIM SHARED UserDefine(1, 100) AS STRING '0 element is the name, 1 element is t
REDIM SHARED InvalidLine(10000) AS _BYTE 'True for lines to be excluded due to preprocessor commands
DIM DefineElse(255) AS _BYTE
DIM SHARED UserDefineCount AS INTEGER, UserDefineList$
UserDefineList$ = "@DEFINED@UNDEFINED@WINDOWS@WIN@LINUX@MAC@MACOSX@32BIT@64BIT@VERSION@"
UserDefineList$ = "@DEFINED@UNDEFINED@WINDOWS@WIN@LINUX@MAC@MACOSX@32BIT@64BIT@VERSION@QB64PE@"
UserDefine(0, 0) = "WINDOWS": UserDefine(0, 1) = "WIN"
UserDefine(0, 2) = "LINUX"
UserDefine(0, 3) = "MAC": UserDefine(0, 4) = "MACOSX"
UserDefine(0, 5) = "32BIT": UserDefine(0, 6) = "64BIT"
UserDefine(0, 7) = "VERSION"
UserDefine(0, 7) = "VERSION": UserDefine(0, 8) = "QB64PE"
IF INSTR(_OS$, "WIN") THEN UserDefine(1, 0) = "-1": UserDefine(1, 1) = "-1" ELSE UserDefine(1, 0) = "0": UserDefine(1, 1) = "0"
IF INSTR(_OS$, "LINUX") THEN UserDefine(1, 2) = "-1" ELSE UserDefine(1, 2) = "0"
IF INSTR(_OS$, "MAC") THEN UserDefine(1, 3) = "-1": UserDefine(1, 4) = "-1" ELSE UserDefine(1, 3) = "0": UserDefine(1, 4) = "0"
IF INSTR(_OS$, "32BIT") THEN UserDefine(1, 5) = "-1": UserDefine(1, 6) = "0" ELSE UserDefine(1, 5) = "0": UserDefine(1, 6) = "-1"
UserDefine(1, 7) = Version$
UserDefine(1, 7) = Version$: UserDefine(1, 8) = "-1"

DIM SHARED QB64_uptime#

Expand Down Expand Up @@ -1326,7 +1326,7 @@ closedsubfunc = 0
subfunc = ""
SelectCaseCounter = 0
ExecCounter = 0
UserDefineCount = 7
UserDefineCount = 8
totalVariablesCreated = 0
typeDefinitions$ = ""
totalMainVariablesCreated = 0
Expand Down Expand Up @@ -1652,7 +1652,7 @@ DO
NEXT
r$ = r1$
'First look to see if we have an existing setting like this and if so, update it
FOR i = 8 TO UserDefineCount 'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version
FOR i = 9 TO UserDefineCount 'UserDefineCount 0-8 are reserved for OS/BIT/Compiler detection & version
IF UserDefine(0, i) = l$ THEN UserDefine(1, i) = r$: GOTO finishedlinepp
NEXT
'Otherwise create a new setting and set the initial value for it
Expand Down Expand Up @@ -2638,7 +2638,7 @@ subfuncn = 0
lastLineReturn = 0
lastLine = 0
firstLine = 1
UserDefineCount = 7
UserDefineCount = 8

FOR i = 0 TO constlast: constdefined(i) = 0: NEXT 'undefine constants

Expand Down Expand Up @@ -2909,7 +2909,7 @@ DO
l$ = RTRIM$(LEFT$(temp$, temp - 1)): r$ = LTRIM$(MID$(temp$, temp + 1))
layout$ = SCase$("$Let ") + l$ + " = " + r$
'First look to see if we have an existing setting like this and if so, update it
FOR i = 7 TO UserDefineCount 'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version
FOR i = 9 TO UserDefineCount 'UserDefineCount 0-8 are reserved for OS/BIT/Compiler detection & version
IF UserDefine(0, i) = l$ THEN UserDefine(1, i) = r$: GOTO finishednonexec
NEXT
'Otherwise create a new setting and set the initial value for it
Expand Down Expand Up @@ -12437,7 +12437,6 @@ IF os$ = "WIN" THEN
IF n = 0 THEN 'attempt to locate simple function name without brackets
s$ = ResolveStaticFunction_Name(x)
fh = OpenBuffer%("I", nm_output_file$)
ConvBufToLnxMacEol fh
DO UNTIL EndOfBuf%(fh)
a$ = ReadBufLine$(fh)
IF LEN(a$) THEN
Expand Down Expand Up @@ -12499,7 +12498,6 @@ IF os$ = "WIN" THEN
IF n = 0 THEN 'a C dynamic object library?
s$ = ResolveStaticFunction_Name(x)
fh = OpenBuffer%("I", nm_output_file_dynamic$)
ConvBufToLnxMacEol fh
DO UNTIL EndOfBuf%(fh)
a$ = ReadBufLine$(fh)
IF LEN(a$) THEN
Expand Down
3 changes: 3 additions & 0 deletions source/utilities/s-buffer/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ forum thread here:

Note: The sb_qb64_extension.bi/.bm files are not part of the buffer system.
These files provide glue code for use of the buffers inside qb64pe.

Note also: Functions currently not used in qb64pe were commented out in
order to avoid unnecessary bloat of the qb64pe executable.
4 changes: 2 additions & 2 deletions source/utilities/s-buffer/sb_qb64pe_extension.bm
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ FUNCTION OpenBuffer% (sbMode$, sbName$)
EXIT FUNCTION
'----------
newBuf:
buf% = CreateBuf%
buf% = CreateBuf%: ConvBufToNativeEol buf%
IF buf% > UBOUND(SBufN) THEN REDIM _PRESERVE SBufN(0 TO buf% + 99) AS STRING 'extend by 100 buffers
SBufN(buf%) = sbName$
RETURN
'----------
loadBuf:
buf% = FileToBuf%(sbName$)
buf% = FileToBuf%(sbName$): ConvBufToNativeEol buf%
IF buf% > UBOUND(SBufN) THEN REDIM _PRESERVE SBufN(0 TO buf% + 99) AS STRING 'extend by 100 buffers
SBufN(buf%) = sbName$
RETURN
Expand Down
Loading

0 comments on commit 4df0c90

Please sign in to comment.