mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 10:00:23 +00:00
Minor change to bit routines, added ability to ignore warnings in IDE
This commit is contained in:
parent
472bf29d99
commit
58b82dff13
|
@ -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){
|
||||
return; //you can't get much stubbier than this! LOL!
|
||||
}
|
||||
|
||||
/*
|
||||
void CFont(qbs* FontName, int FontSize){
|
||||
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);
|
||||
static int OneTimePause;
|
||||
|
@ -29626,8 +29611,9 @@ void reinit_glut_callbacks(){
|
|||
}
|
||||
|
||||
SetCurrentConsoleFontEx(cl_conout, NULL, &info);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void sub__console_cursor(int32 visible, int32 cursorsize, int32 passed){
|
||||
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
|
|
@ -982,16 +982,16 @@ inline int64 func__shr(int64 a1,int b1)
|
|||
{return a1>>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)
|
||||
{return a1 | 1<<b1;}
|
||||
{return a1 | 1ull<<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)
|
||||
{return a1 ^ 1<<b1;}
|
||||
{return a1 ^ 1ull<<b1;}
|
||||
|
||||
//Working with 32bit colors:
|
||||
inline uint32 func__rgb32(int32 r,int32 g,int32 b,int32 a){
|
||||
|
|
|
@ -13,6 +13,7 @@ DIM SHARED PasteCursorAtEnd AS _BYTE
|
|||
DIM SHARED SaveExeWithSource AS _BYTE, EnableQuickNav AS _BYTE
|
||||
DIM SHARED IDEShowErrorsImmediately AS _BYTE
|
||||
DIM SHARED ShowLineNumbersSeparator AS _BYTE, ShowLineNumbersUseBG AS _BYTE
|
||||
DIM SHARED IgnoreWarnings AS _BYTE
|
||||
|
||||
IF LoadedIDESettings = 0 THEN
|
||||
'We only want to load the file once when QB64 first starts
|
||||
|
@ -326,6 +327,17 @@ IF LoadedIDESettings = 0 THEN
|
|||
IDE_LeftPosition = 0
|
||||
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,
|
||||
'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
|
||||
|
|
|
@ -332,6 +332,12 @@ FUNCTION ide2 (ignore)
|
|||
menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately) = CHR$(7) + menu$(OptionsMenuID, OptionsMenuShowErrorsImmediately)
|
||||
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
|
||||
|
||||
m = m + 1: i = 0
|
||||
|
@ -4658,6 +4664,22 @@ FUNCTION ide2 (ignore)
|
|||
GOTO ideloop
|
||||
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
|
||||
PCOPY 2, 0
|
||||
SaveExeWithSource = NOT SaveExeWithSource
|
||||
|
|
|
@ -2317,6 +2317,7 @@ DO
|
|||
END IF
|
||||
END IF
|
||||
IF issueWarning THEN
|
||||
IF NOT IgnoreWarnings THEN
|
||||
addWarning 0, "Constant already defined (same value):"
|
||||
addWarning linenumber, n$
|
||||
IF idemode = 0 THEN
|
||||
|
@ -2330,6 +2331,7 @@ DO
|
|||
END IF
|
||||
END IF
|
||||
END IF
|
||||
END IF
|
||||
GOTO constAddDone
|
||||
ELSE
|
||||
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
|
||||
'PUT #1, 1, usedVariableList$ 'warning$(1)
|
||||
'CLOSE #1
|
||||
|
||||
IF NOT IgnoreWarnings THEN
|
||||
IF totalUnusedVariables > 0 THEN
|
||||
IF idemode = 0 THEN
|
||||
PRINT "WARNING:"; STR$(totalUnusedVariables); " unused variable";
|
||||
|
@ -11886,6 +11888,7 @@ IF totalUnusedVariables > 0 THEN
|
|||
LOOP
|
||||
END IF
|
||||
END IF
|
||||
END IF
|
||||
|
||||
IF idemode THEN GOTO ideret5
|
||||
ide6:
|
||||
|
@ -25184,6 +25187,7 @@ SUB manageVariableList (name$, __cname$, action AS _BYTE)
|
|||
END SUB
|
||||
|
||||
SUB addWarning (lineNumber AS LONG, text$)
|
||||
IF NOT IgnoreWarnings THEN
|
||||
IF lineNumber > 0 THEN
|
||||
totalWarnings = totalWarnings + 1
|
||||
ELSE
|
||||
|
@ -25197,6 +25201,7 @@ SUB addWarning (lineNumber AS LONG, text$)
|
|||
warningListItems = warningListItems + 1
|
||||
IF warningListItems > UBOUND(warning$) THEN REDIM _PRESERVE warning$(warningListItems + 999)
|
||||
warning$(warningListItems) = MKL$(lineNumber) + text$
|
||||
end if
|
||||
END SUB
|
||||
|
||||
'$INCLUDE:'utilities\strings.bas'
|
||||
|
|
Loading…
Reference in a new issue