1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-08 06:45:16 +00:00

Minor change to bit routines, added ability to ignore warnings in IDE

This commit is contained in:
SteveMcNeill 2019-12-04 12:30:02 -05:00
parent 472bf29d99
commit 58b82dff13
5 changed files with 93 additions and 68 deletions

View file

@ -29589,23 +29589,8 @@ void reinit_glut_callbacks(){
} }
//CFont commented out as it requires more modern versions of Windows to run and work.
//Adding it into QB64 would mean that we would no longer run on Windows XP and such,
//and at this time, it's been decided that we dont actually want to drop compatability with those older operating systems.
//I'll leave the code in here, in case it's decided later that we're no longer to stick
//to Windows XP compatability.
//For now, the easiest solution to this dilemma seems to be to just leave the code here,
//and place a stub which does nothing in place of it.
//If people with newer operating systems want to make use of it, all they'd need to do is
//comment out the stub and uncomment the actual working code, and then purge_libqb.bat to rebuild the library we link to.
void CFont(qbs* FontName, int FontSize){ void CFont(qbs* FontName, int FontSize){
return; //you can't get much stubbier than this! LOL!
}
/* /*
void CFont(qbs* FontName, int FontSize){
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1}; SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0); HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
static int OneTimePause; static int OneTimePause;
@ -29626,8 +29611,9 @@ void reinit_glut_callbacks(){
} }
SetCurrentConsoleFontEx(cl_conout, NULL, &info); SetCurrentConsoleFontEx(cl_conout, NULL, &info);
}
*/ */
}
void sub__console_cursor(int32 visible, int32 cursorsize, int32 passed){ void sub__console_cursor(int32 visible, int32 cursorsize, int32 passed){
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);

View file

@ -982,16 +982,16 @@ inline int64 func__shr(int64 a1,int b1)
{return a1>>b1;} {return a1>>b1;}
inline int64 func__readbit(int64 a1, int b1) inline int64 func__readbit(int64 a1, int b1)
{if (a1 & 1<<b1) return -1; else return 0;} {if (a1 & 1ull<<b1) return -1; else return 0;}
inline int64 func__setbit(int64 a1, int b1) inline int64 func__setbit(int64 a1, int b1)
{return a1 | 1<<b1;} {return a1 | 1ull<<b1;}
inline int64 func__resetbit(int64 a1, int b1) inline int64 func__resetbit(int64 a1, int b1)
{return a1 & ~(1<<b1);} {return a1 & ~(1ull<<b1);}
inline int64 func__togglebit(int64 a1, int b1) inline int64 func__togglebit(int64 a1, int b1)
{return a1 ^ 1<<b1;} {return a1 ^ 1ull<<b1;}
//Working with 32bit colors: //Working with 32bit colors:
inline uint32 func__rgb32(int32 r,int32 g,int32 b,int32 a){ inline uint32 func__rgb32(int32 r,int32 g,int32 b,int32 a){

View file

@ -13,6 +13,7 @@ DIM SHARED PasteCursorAtEnd AS _BYTE
DIM SHARED SaveExeWithSource AS _BYTE, EnableQuickNav AS _BYTE DIM SHARED SaveExeWithSource AS _BYTE, EnableQuickNav AS _BYTE
DIM SHARED IDEShowErrorsImmediately AS _BYTE DIM SHARED IDEShowErrorsImmediately AS _BYTE
DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE
DIM SHARED IgnoreWarnings AS _BYTE
IF LoadedIDESettings = 0 THEN IF LoadedIDESettings = 0 THEN
'We only want to load the file once when QB64 first starts 'We only want to load the file once when QB64 first starts
@ -326,6 +327,17 @@ IF LoadedIDESettings = 0 THEN
IDE_LeftPosition = 0 IDE_LeftPosition = 0
END IF END IF
result = ReadConfigSetting("IgnoreWarnings", value$)
IF result THEN
IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
IgnoreWarnings = -1
ELSE
IgnoreWarnings = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
END IF
END IF
'I was going to do some basic error checking for screen position to make certain that we appeared on the monitor, 'I was going to do some basic error checking for screen position to make certain that we appeared on the monitor,
'but I decided not to. Some people (like me) may have multiple monitors set up and may wish for QB64 to pop-up at 'but I decided not to. Some people (like me) may have multiple monitors set up and may wish for QB64 to pop-up at
'a coordinate which seems insane at first glance (-1000,0 for instance), but which may move the IDE window to the 'a coordinate which seems insane at first glance (-1000,0 for instance), but which may move the IDE window to the

View file

@ -332,6 +332,12 @@ FUNCTION ide2 (ignore)
menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately) = CHR$(7) + menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately) menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately) = CHR$(7) + menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately)
END IF END IF
OptionsMenuIgnoreWarnings = i
menu$(m, 11) = "Ignore Warnings": i = 12
IF IgnoreWarnings THEN menu$(OptionsMenuID, 11) = CHR$(7) + "Ignore Warnings"
menusize(m) = i - 1 menusize(m) = i - 1
m = m + 1: i = 0 m = m + 1: i = 0
@ -4658,6 +4664,22 @@ FUNCTION ide2 (ignore)
GOTO ideloop GOTO ideloop
END IF END IF
IF RIGHT$(menu$(m, s), 15) = "Ignore Warnings" THEN
PCOPY 2, 0
IF Ignorewarnings = 0 THEN
Ignorewarnings = -1
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "TRUE"
menu$(OptionsMenuID, 11) = CHR$(7) + "Ignore Warnings"
ELSE
Ignorewarnings = 0
WriteConfigSetting "'[GENERAL SETTINGS]", "IgnoreWarnings", "FALSE"
menu$(OptionsMenuID, 11) = "Ignore Warnings"
END IF
idechangemade = 1
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
GOTO ideloop
END IF
IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN
PCOPY 2, 0 PCOPY 2, 0
SaveExeWithSource = NOT SaveExeWithSource SaveExeWithSource = NOT SaveExeWithSource

View file

@ -2317,6 +2317,7 @@ DO
END IF END IF
END IF END IF
IF issueWarning THEN IF issueWarning THEN
IF NOT IgnoreWarnings THEN
addWarning 0, "Constant already defined (same value):" addWarning 0, "Constant already defined (same value):"
addWarning linenumber, n$ addWarning linenumber, n$
IF idemode = 0 THEN IF idemode = 0 THEN
@ -2330,6 +2331,7 @@ DO
END IF END IF
END IF END IF
END IF END IF
END IF
GOTO constAddDone GOTO constAddDone
ELSE ELSE
a$ = "Name already in use": GOTO errmes a$ = "Name already in use": GOTO errmes
@ -11835,7 +11837,7 @@ OPEN compilelog$ FOR OUTPUT AS #1: CLOSE #1 'Clear log
'OPEN "unusedVariableList.txt" FOR BINARY AS #1 'OPEN "unusedVariableList.txt" FOR BINARY AS #1
'PUT #1, 1, usedVariableList$ 'warning$(1) 'PUT #1, 1, usedVariableList$ 'warning$(1)
'CLOSE #1 'CLOSE #1
IF NOT IgnoreWarnings THEN
IF totalUnusedVariables > 0 THEN IF totalUnusedVariables > 0 THEN
IF idemode = 0 THEN IF idemode = 0 THEN
PRINT "WARNING:"; STR$(totalUnusedVariables); " unused variable"; PRINT "WARNING:"; STR$(totalUnusedVariables); " unused variable";
@ -11886,6 +11888,7 @@ IF totalUnusedVariables > 0 THEN
LOOP LOOP
END IF END IF
END IF END IF
END IF
IF idemode THEN GOTO ideret5 IF idemode THEN GOTO ideret5
ide6: ide6:
@ -25184,6 +25187,7 @@ SUB manageVariableList (name$, __cname$, action AS _BYTE)
END SUB END SUB
SUB addWarning (lineNumber AS LONG, text$) SUB addWarning (lineNumber AS LONG, text$)
IF NOT IgnoreWarnings THEN
IF lineNumber > 0 THEN IF lineNumber > 0 THEN
totalWarnings = totalWarnings + 1 totalWarnings = totalWarnings + 1
ELSE ELSE
@ -25197,6 +25201,7 @@ SUB addWarning (lineNumber AS LONG, text$)
warningListItems = warningListItems + 1 warningListItems = warningListItems + 1
IF warningListItems > UBOUND(warning$) THEN REDIM _PRESERVE warning$(warningListItems + 999) IF warningListItems > UBOUND(warning$) THEN REDIM _PRESERVE warning$(warningListItems + 999)
warning$(warningListItems) = MKL$(lineNumber) + text$ warning$(warningListItems) = MKL$(lineNumber) + text$
end if
END SUB END SUB
'$INCLUDE:'utilities\strings.bas' '$INCLUDE:'utilities\strings.bas'