1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00

Merge pull request #439 from RainRat/main

fix typos
This commit is contained in:
Roland Heyder 2024-01-29 09:23:57 +01:00 committed by GitHub
commit 3bb59266ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 154 additions and 154 deletions

View file

@ -24,7 +24,7 @@ Download the appropriate package for your operating system over at https://githu
Make sure to extract the package contents to a folder with full write permissions (failing to do so may result in IDE or compilation errors). Make sure to extract the package contents to a folder with full write permissions (failing to do so may result in IDE or compilation errors).
* It is advisable to to whitelist the 'qb64pe' folder in your antivirus/antimalware software * * It is advisable to whitelist the 'qb64pe' folder in your antivirus/antimalware software *
<a name="macOS"></a> <a name="macOS"></a>
## macOS ## macOS

View file

@ -79,7 +79,7 @@ Repository Layout
- `dist_tests.sh` - `dist_tests.sh`
- Verifies the output of `make-dist.sh` is a functioning distribution of QB64-PE - Verifies the output of `make-dist.sh` is a functioning distribution of QB64-PE
- `run_dist_tests.sh` - `run_dist_tests.sh`
- Runs the distribution test collecitons. - Runs the distribution test collections.
- `run_tests.sh` - `run_tests.sh`
- Runs all individual test collections. - Runs all individual test collections.
- `run_c_tests.sh` - `run_c_tests.sh`

View file

@ -11,7 +11,7 @@ QB64-based Tests
The QB64-based tests live in `./tests/compile_tests`. Each folder in that The QB64-based tests live in `./tests/compile_tests`. Each folder in that
directory represents a different category of tests, and within each of those directory represents a different category of tests, and within each of those
category folders are `*.bas` files. Accompanying each `*.bas` file is either an category folders are `*.bas` files. Accompanying each `*.bas` file is either an
`*.output` or `*.err` file with the same base name as a coresponding `.bas` `*.output` or `*.err` file with the same base name as a corresponding `.bas`
file. For test with an `*.output`, the `*.output` file contains the text that file. For test with an `*.output`, the `*.output` file contains the text that
the program compiled from the `*.bas` file should produce. For `*.err` tests, the program compiled from the `*.bas` file should produce. For `*.err` tests,
the `*.err` file contains the text of the error the QB64-PE compiler should the `*.err` file contains the text of the error the QB64-PE compiler should

View file

@ -242,7 +242,7 @@ struct img_struct {
uint8 print_mode; uint8 print_mode;
// BEGIN apm ('active page migration') // BEGIN apm ('active page migration')
// everything between apm points is migrated during active page changes // everything between apm points is migrated during active page changes
// note: apm data is only relevent to graphics modes // note: apm data is only relevant to graphics modes
uint8 apm_p1; uint8 apm_p1;
int32 view_x1, view_y1, view_x2, view_y2; int32 view_x1, view_y1, view_x2, view_y2;
int32 view_offset_x, view_offset_y; int32 view_offset_x, view_offset_y;
@ -312,7 +312,7 @@ struct device_struct {
int32 type; int32 type;
// 0=Unallocated // 0=Unallocated
// 1=Joystick/Gamepad // 1=Joystick/Gamepad
// 2=Keybaord // 2=Keyboard
// 3=Mouse // 3=Mouse
char *name; char *name;
int32 connected; int32 connected;

View file

@ -166,7 +166,7 @@ int32 environment_2d__screen_x1 = 0; // offsets of 'screen' within the window
int32 environment_2d__screen_y1 = 0; int32 environment_2d__screen_y1 = 0;
int32 environment_2d__screen_x2 = 0; int32 environment_2d__screen_x2 = 0;
int32 environment_2d__screen_y2 = 0; int32 environment_2d__screen_y2 = 0;
int32 environment_2d__screen_scaled_width = 640; // inital values prevent _SCALEDWIDTH/_SCALEDHEIGHT returning 0 int32 environment_2d__screen_scaled_width = 640; // initial values prevent _SCALEDWIDTH/_SCALEDHEIGHT returning 0
int32 environment_2d__screen_scaled_height = 400; int32 environment_2d__screen_scaled_height = 400;
float environment_2d__screen_x_scale = 1.0f; float environment_2d__screen_x_scale = 1.0f;
float environment_2d__screen_y_scale = 1.0f; float environment_2d__screen_y_scale = 1.0f;
@ -2184,7 +2184,7 @@ int32 lprint_locked = 0; // set to 1 to deny access by QB64 program
multiplatform compatibility. 'Pure' C-based routines may not allow certain functionality, multiplatform compatibility. 'Pure' C-based routines may not allow certain functionality,
such as partial file locking. such as partial file locking.
GFS handles/indexes are independent of QB64 handles/indexes to allow for internal files GFS handles/indexes are independent of QB64 handles/indexes to allow for internal files
to be open but not intefere with the QB64 file handle numbers. to be open but not interfere with the QB64 file handle numbers.
GFS error codes: GFS error codes:
-1 non-specific fail -1 non-specific fail
@ -4160,13 +4160,13 @@ void pset(int32 x, int32 y, uint32 col) {
case 0x0: // 0%(0) alpha, so no pset (very fast) case 0x0: // 0%(0) alpha, so no pset (very fast)
return; return;
break; break;
case 0x80000000: //~50% alpha (optomized) case 0x80000000: //~50% alpha (optimized)
o32 = write_page->offset32 + (y * write_page->width + x); o32 = write_page->offset32 + (y * write_page->width + x);
*o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend128[*o32 >> 24] << 24); *o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend128[*o32 >> 24] << 24);
return; return;
break; break;
case 0x7F000000: //~50% alpha (optomized) case 0x7F000000: //~50% alpha (optimized)
o32 = write_page->offset32 + (y * write_page->width + x); o32 = write_page->offset32 + (y * write_page->width + x);
*o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend127[*o32 >> 24] << 24); *o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend127[*o32 >> 24] << 24);
return; return;
@ -4534,7 +4534,7 @@ int32 imgnew(int32 x, int32 y, int32 bpp) {
return i; return i;
} }
void sub__font(int32 f, int32 i, int32 passed); // foward def void sub__font(int32 f, int32 i, int32 passed); // forward def
void flush_old_hardware_commands() { void flush_old_hardware_commands() {
static int32 old_command; static int32 old_command;
@ -5242,7 +5242,7 @@ stretch:
return; return;
if (dy1 > dy2) if (dy1 > dy2)
return; return;
// all values are now within the boundries of the source & dest // all values are now within the boundaries of the source & dest
stretch_noreverse_noclip: stretch_noreverse_noclip:
w = dx2 - dx1 + 1; w = dx2 - dx1 + 1;
@ -5635,7 +5635,7 @@ clip:
return; return;
if (dy1 > dy2) if (dy1 > dy2)
return; return;
// all values are now within the boundries of the source & dest // all values are now within the boundaries of the source & dest
// mirror put // mirror put
if (mirror) { if (mirror) {
@ -7177,7 +7177,7 @@ int32 asciicode_reading = 0;
int32 lock_display = 0; int32 lock_display = 0;
int32 lock_display_required = 0; int32 lock_display_required = 0;
// cost delay, made obselete by managing thread priorities (consider removal) // cost delay, made obsolete by managing thread priorities (consider removal)
#define cost_limit 10000 #define cost_limit 10000
#define cost_delay 0 #define cost_delay 0
uint32 cost = 0; uint32 cost = 0;
@ -7200,7 +7200,7 @@ uint64 build_uint64(uint32 val2, uint32 val1) {
return val; return val;
} }
// nb. abreviations are used in variable names to save typing, here are some of the expansions // nb. abbreviations are used in variable names to save typing, here are some of the expansions
// cmem=conventional memory // cmem=conventional memory
// qbs=qbick basic string (refers to the emulation of quick basic strings) // qbs=qbick basic string (refers to the emulation of quick basic strings)
// sp=stack pointer // sp=stack pointer
@ -7623,7 +7623,7 @@ extern uint8 *mem_static_limit;
uint8 *mem_static_malloc(uint32 size) { uint8 *mem_static_malloc(uint32 size) {
size += 7; size += 7;
size -= (size & 7); // align to 8 byte boundry size -= (size & 7); // align to 8 byte boundary
if ((mem_static_pointer += size) < mem_static_limit) if ((mem_static_pointer += size) < mem_static_limit)
return mem_static_pointer - size; return mem_static_pointer - size;
mem_static_size = (mem_static_size << 1) + size; mem_static_size = (mem_static_size << 1) + size;
@ -8214,7 +8214,7 @@ qbs *qbs_set(qbs *deststr, qbs *srcstr) {
} }
// non-fixed deststr // non-fixed deststr
// can srcstr be aquired by deststr? // can srcstr be acquired by deststr?
if (srcstr->tmp) { if (srcstr->tmp) {
if (srcstr->fixed == 0) { if (srcstr->fixed == 0) {
if (srcstr->readonly == 0) { if (srcstr->readonly == 0) {
@ -8289,7 +8289,7 @@ qbs *qbs_set(qbs *deststr, qbs *srcstr) {
// all next indexes invalid! // all next indexes invalid!
qbs_cmem_list_nexti = deststr->listi + 1; // adjust nexti qbs_cmem_list_nexti = deststr->listi + 1; // adjust nexti
if (((ptrszint)deststr->chr + srcstr->len) <= (dblock + cmem_sp)) { // space available if (((ptrszint)deststr->chr + srcstr->len) <= (dblock + cmem_sp)) { // space available
memmove(deststr->chr, srcstr->chr, srcstr->len); // overlap possible due to sometimes aquiring srcstr's space memmove(deststr->chr, srcstr->chr, srcstr->len); // overlap possible due to sometimes acquiring srcstr's space
deststr->len = srcstr->len; deststr->len = srcstr->len;
qbs_cmem_sp = ((ptrszint)deststr->chr) + (ptrszint)deststr->len - dblock; qbs_cmem_sp = ((ptrszint)deststr->chr) + (ptrszint)deststr->len - dblock;
goto qbs_set_return; goto qbs_set_return;
@ -8346,7 +8346,7 @@ skippedtmpsrcindex2:
qbs_list_nexti = deststr->listi + 1; // adjust nexti qbs_list_nexti = deststr->listi + 1; // adjust nexti
if (((ptrszint)deststr->chr + srcstr->len) <= ((ptrszint)qbs_data + qbs_data_size)) { // space available if (((ptrszint)deststr->chr + srcstr->len) <= ((ptrszint)qbs_data + qbs_data_size)) { // space available
memmove(deststr->chr, srcstr->chr, srcstr->len); // overlap possible due to sometimes aquiring srcstr's space memmove(deststr->chr, srcstr->chr, srcstr->len); // overlap possible due to sometimes acquiring srcstr's space
deststr->len = srcstr->len; deststr->len = srcstr->len;
qbs_sp = ((ptrszint)deststr->chr) + (ptrszint)deststr->len - (ptrszint)qbs_data; qbs_sp = ((ptrszint)deststr->chr) + (ptrszint)deststr->len - (ptrszint)qbs_data;
goto qbs_set_return; goto qbs_set_return;
@ -10972,7 +10972,7 @@ void qbsub_width(int32 option, int32 value1, int32 value2, int32 value3, int32 v
if ((write_page->compatible_mode == 32) || (write_page->compatible_mode == 256)) { if ((write_page->compatible_mode == 32) || (write_page->compatible_mode == 256)) {
if (!(passed & 1)) { // width ommited if (!(passed & 1)) { // width omitted
width = write_page->width; width = write_page->width;
} else { } else {
if (width <= 0) if (width <= 0)
@ -10983,7 +10983,7 @@ void qbsub_width(int32 option, int32 value1, int32 value2, int32 value3, int32 v
width *= i; width *= i;
} }
if (!(passed & 2)) { // height ommited if (!(passed & 2)) { // height omitted
height = write_page->height; height = write_page->height;
} else { } else {
if (height <= 0) if (height <= 0)
@ -11060,7 +11060,7 @@ void qbsub_width(int32 option, int32 value1, int32 value2, int32 value3, int32 v
} // 32/256 } // 32/256
if (!(passed & 1)) { // width ommited if (!(passed & 1)) { // width omitted
if (height <= 0) if (height <= 0)
goto error; goto error;
@ -11669,12 +11669,12 @@ void pset_and_clip(int32 x, int32 y, uint32 col) {
case 0x0: // 0%(0) alpha, so no pset (very fast) case 0x0: // 0%(0) alpha, so no pset (very fast)
return; return;
break; break;
case 0x80000000: //~50% alpha (optomized) case 0x80000000: //~50% alpha (optimized)
o32 = write_page->offset32 + (y * write_page->width + x); o32 = write_page->offset32 + (y * write_page->width + x);
*o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend128[*o32 >> 24] << 24); *o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend128[*o32 >> 24] << 24);
return; return;
break; break;
case 0x7F000000: //~50% alpha (optomized) case 0x7F000000: //~50% alpha (optimized)
o32 = write_page->offset32 + (y * write_page->width + x); o32 = write_page->offset32 + (y * write_page->width + x);
*o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend127[*o32 >> 24] << 24); *o32 = (((*o32 & 0xFEFEFE) + (col & 0xFEFEFE)) >> 1) + (ablend127[*o32 >> 24] << 24);
return; return;
@ -11773,7 +11773,7 @@ void qb32_boxfill(float x1f, float y1f, float x2f, float y2f, uint32 col) {
} // 1 } // 1
// assume 32-bit // assume 32-bit
// optomized // optimized
// alpha disabled or full alpha? // alpha disabled or full alpha?
a = col >> 24; a = col >> 24;
if ((write_page->alpha_disabled) || (a == 255)) { if ((write_page->alpha_disabled) || (a == 255)) {
@ -11870,7 +11870,7 @@ void fast_boxfill(int32 x1, int32 y1, int32 x2, int32 y2, uint32 col) {
} // 1 } // 1
// assume 32-bit // assume 32-bit
// optomized // optimized
// alpha disabled or full alpha? // alpha disabled or full alpha?
a = col >> 24; a = col >> 24;
if ((write_page->alpha_disabled) || (a == 255)) { if ((write_page->alpha_disabled) || (a == 255)) {
@ -13201,7 +13201,7 @@ void sub_circle(double x, double y, double r, uint32 col, double start, double e
write_page->x = x; write_page->x = x;
write_page->y = y; // set graphics cursor position to circle's centre write_page->y = y; // set graphics cursor position to circle's centre
r = x + r; // the differece between x & x+r in pixels will be the radius in pixels r = x + r; // the difference between x & x+r in pixels will be the radius in pixels
// resolve coordinates (but keep as floats) // resolve coordinates (but keep as floats)
if (write_page->clipping_or_scaling) { if (write_page->clipping_or_scaling) {
if (write_page->clipping_or_scaling == 2) { if (write_page->clipping_or_scaling == 2) {
@ -14120,7 +14120,7 @@ void qbs_print(qbs *str, int32 finish_on_new_line) {
if (character == 30) { if (character == 30) {
// previous row, same column // previous row, same column
// no change if cursor not within view print boundries // no change if cursor not within view print boundaries
if ((write_page->cursor_y > write_page->top_row) && (write_page->cursor_y <= write_page->bottom_row)) { if ((write_page->cursor_y > write_page->top_row) && (write_page->cursor_y <= write_page->bottom_row)) {
write_page->cursor_y--; write_page->cursor_y--;
} }
@ -14129,7 +14129,7 @@ void qbs_print(qbs *str, int32 finish_on_new_line) {
if (character == 31) { if (character == 31) {
// next row, same column // next row, same column
// no change if cursor not within view print boundries // no change if cursor not within view print boundaries
if ((write_page->cursor_y >= write_page->top_row) && (write_page->cursor_y < write_page->bottom_row)) { if ((write_page->cursor_y >= write_page->top_row) && (write_page->cursor_y < write_page->bottom_row)) {
write_page->cursor_y++; write_page->cursor_y++;
} }
@ -14599,7 +14599,7 @@ void qbg_sub_view(int32 x1, int32 y1, int32 x2, int32 y2, int32 fillcolor, int32
if (!write_page->clipping_or_scaling) if (!write_page->clipping_or_scaling)
write_page->clipping_or_scaling = 1; write_page->clipping_or_scaling = 1;
} else { } else {
// no argurments passed // no arguments passed
write_page->view_x1 = 0; write_page->view_x1 = 0;
write_page->view_y1 = 0; write_page->view_y1 = 0;
write_page->view_x2 = write_page->width - 1; write_page->view_x2 = write_page->width - 1;
@ -15271,8 +15271,8 @@ qbs_input_sep_arg_done:
if (toomany) if (toomany)
goto backspace; goto backspace;
// validate current arguements // validate current arguments
// ASSUME LEADING & TRALING SPACES REMOVED! // ASSUME LEADING & TRAILING SPACES REMOVED!
uint8 valid; uint8 valid;
uint8 neg; uint8 neg;
int32 completewith; int32 completewith;
@ -17225,7 +17225,7 @@ uint16 n_digits;
uint8 n_digit[256]; uint8 n_digit[256];
int64 n_exp; // if 0, there is one digit in front of the decimal place int64 n_exp; // if 0, there is one digit in front of the decimal place
uint8 n_neg; // if 1, the number is negative uint8 n_neg; // if 1, the number is negative
uint8 n_hex; // if 1, the digits are in hexidecimal and n_exp should be ignored uint8 n_hex; // if 1, the digits are in hexadecimal and n_exp should be ignored
// if 2, the digits are in octal and n_exp should be ignored // if 2, the digits are in octal and n_exp should be ignored
// if 3, the digits are in binary and n_exp should be ignored // if 3, the digits are in binary and n_exp should be ignored
//(consider revising variable name n_hex) //(consider revising variable name n_hex)
@ -19176,7 +19176,7 @@ void sub_graphics_get(float x1f, float y1f, float x2f, float y2f, void *element,
sx = read_page->width; sx = read_page->width;
sy = read_page->height; sy = read_page->height;
// boundry checking (if no mask colour was passed) // boundary checking (if no mask colour was passed)
if (!(passed & 4)) { if (!(passed & 4)) {
if ((x1 < 0) || (y1 < 0) || (x2 >= sx) || (y2 >= sy)) { if ((x1 < 0) || (y1 < 0) || (x2 >= sx) || (y2 >= sy)) {
error(5); error(5);
@ -19466,7 +19466,7 @@ void sub_graphics_put(float x1f, float y1f, void *element, int32 option, uint32
x2 = x1 + w - 1; x2 = x1 + w - 1;
y2 = y1 + h - 1; y2 = y1 + h - 1;
// boundry checking (if CLIP option was not used) // boundary checking (if CLIP option was not used)
if (!clip) { if (!clip) {
if ((x1 < 0) || (y1 < 0) || (x2 >= sx) || (y2 >= sy)) { if ((x1 < 0) || (y1 < 0) || (x2 >= sx) || (y2 >= sy)) {
error(5); error(5);
@ -21061,7 +21061,7 @@ int32 func_eof(int32 i) {
else if (sh->index == 2) else if (sh->index == 2)
return 0; return 0;
// Only report EOF() if the program had read all incomming data and // Only report EOF() if the program had read all incoming data and
// the connection is finished. // the connection is finished.
if (libqb_http_connected(x)) if (libqb_http_connected(x))
return 0; return 0;
@ -23535,7 +23535,7 @@ void call_int(int32 i) {
if (cpu.cx >= (display_page->width * 8)) if (cpu.cx >= (display_page->width * 8))
cpu.cx = (display_page->width * 8) - 1; cpu.cx = (display_page->width * 8) - 1;
// note: a range from 0 to rows*8-1 is returned regardless of the number of actual pixels // note: a range from 0 to rows*8-1 is returned regardless of the number of actual pixels
// obselete line of code: // obsolete line of code:
// cpu.dx=(((float)cpu.dx)/((float)(display_page->height*fontheight[display_page->font])))*((float)(display_page->height*8));//(mouse_y/height_in_pixels)*(rows*8) // cpu.dx=(((float)cpu.dx)/((float)(display_page->height*fontheight[display_page->font])))*((float)(display_page->height*8));//(mouse_y/height_in_pixels)*(rows*8)
cpu.dx = (my - 0.5) * 8.0; cpu.dx = (my - 0.5) * 8.0;
if (cpu.dx >= (display_page->height * 8)) if (cpu.dx >= (display_page->height * 8))
@ -24061,7 +24061,7 @@ void sub__setalpha(int32 a, uint32 c, uint32 c2, int32 i, int32 passed) {
return; return;
} }
// Finding infomation about an image surface: // Finding information about an image surface:
int32 func__width(int32 i, int32 passed) { int32 func__width(int32 i, int32 passed) {
if (new_error) if (new_error)
@ -24697,7 +24697,7 @@ int32 func__printwidth(qbs *text, int32 screenhandle, int32 passed) {
} }
auto fonthandle = img[screenhandle].font; // Get the font used in screenhandle auto fonthandle = img[screenhandle].font; // Get the font used in screenhandle
auto fwidth = func__fontwidth(fonthandle, 1); // Try and get the font width auto fwidth = func__fontwidth(fonthandle, 1); // Try to get the font width
if (fwidth) if (fwidth)
return fwidth * text->len; // if it's not a variable width font, return the width * the letter count return fwidth * text->len; // if it's not a variable width font, return the width * the letter count
@ -24711,7 +24711,7 @@ int32 func__printwidth(qbs *text, int32 screenhandle, int32 passed) {
/// @param requirements This can be monospace, dontblend, unicode, memory /// @param requirements This can be monospace, dontblend, unicode, memory
/// @param font_index The index of the font to load from a font collection /// @param font_index The index of the font to load from a font collection
/// @param passed Which optional arguments were passed /// @param passed Which optional arguments were passed
/// @return Retuns a valid handle on success or zero on failure /// @return Returns a valid handle on success or zero on failure
int32_t func__loadfont(qbs *file_name, int32_t size, qbs *requirements, int32_t font_index, int32_t passed) { int32_t func__loadfont(qbs *file_name, int32_t size, qbs *requirements, int32_t font_index, int32_t passed) {
// Some QB strings that we'll need // Some QB strings that we'll need
static qbs *fileNameZ = nullptr; static qbs *fileNameZ = nullptr;
@ -25656,7 +25656,7 @@ numeric_spacer:
return 0; return 0;
} }
// reduce digits before point appropriatly // reduce digits before point appropriately
extra_sign_space = 0; extra_sign_space = 0;
if (exponent_digits) { if (exponent_digits) {
if ((leading_plus == 0) && (trailing_plus == 0) && (trailing_minus == 0)) { if ((leading_plus == 0) && (trailing_plus == 0) && (trailing_minus == 0)) {
@ -34072,7 +34072,7 @@ void prepare_environment_2d() { // called prior to rendering 2D content
can_scale = 1; can_scale = 1;
if (full_screen == 2) if (full_screen == 2)
need_square_pixels = 1; need_square_pixels = 1;
// note: 'letter-boxing' is only requred where the size of the window // note: 'letter-boxing' is only required where the size of the window
// cannot be controlled, and the only place where this is the // cannot be controlled, and the only place where this is the
// case is full screen mode _SQUAREPIXELS // case is full screen mode _SQUAREPIXELS
environment_2d__screen_smooth = fullscreen_smooth; environment_2d__screen_smooth = fullscreen_smooth;
@ -35301,7 +35301,7 @@ void GLUT_DISPLAY_REQUEST() {
glutEnterGameMode(); glutEnterGameMode();
fullscreen_width=display_frame[i].w; fullscreen_width=display_frame[i].w;
fullscreen_height=display_frame[i].h; reinit_glut_callbacks(); fullscreen_height=display_frame[i].h; reinit_glut_callbacks();
full_screen=full_screen_set;//it's currently irrelavent if it is full_screen=full_screen_set;//it's currently irrelevant if it is
stretched or 1:1 full_screen_set=-1; return; }else{ //native dimensions stretched or 1:1 full_screen_set=-1; return; }else{ //native dimensions
not possible not possible
//attempt full screen using desktop dimensions //attempt full screen using desktop dimensions
@ -36632,7 +36632,7 @@ uint8 *pixeldata = (uint8 *)malloc(1);
int32 pixeldatasize = 1; int32 pixeldatasize = 1;
uint32 paldata[256]; uint32 paldata[256];
// note: temporarily swapping a source palette is far more effecient than converting the resulting image pixels // note: temporarily swapping a source palette is far more efficient than converting the resulting image pixels
void swap_paldata_BGRA_with_RGBA() { void swap_paldata_BGRA_with_RGBA() {
static uint32 col; static uint32 col;
static uint32 *pos; static uint32 *pos;
@ -36735,7 +36735,7 @@ void display() {
z = 0; //? z = 0; //?
conversion_required = 0; conversion_required = 0;
pixel = display_surface_offset; //<-will be made obselete pixel = display_surface_offset; //<-will be made obsolete
if (!display_page->compatible_mode) { // text if (!display_page->compatible_mode) { // text
@ -36777,7 +36777,7 @@ void display() {
// Check/Prepare palette-buffer // Check/Prepare palette-buffer
if (!check_last) { if (!check_last) {
// set pal_last (no prev pal was avilable to compare to) // set pal_last (no prev pal was available to compare to)
memcpy(&paldata, display_page->pal, 256 * 4); memcpy(&paldata, display_page->pal, 256 * 4);
} else { } else {
// if palette has changed, update paldata and draw all characters // if palette has changed, update paldata and draw all characters
@ -38262,7 +38262,7 @@ void keydown(uint32 x) {
if (b2 = scancode_lookup[x * 10 + 1]) { // table entry exists if (b2 = scancode_lookup[x * 10 + 1]) { // table entry exists
scancodedown(b2); scancodedown(b2);
// check for relevent table modifiers // check for relevant table modifiers
shift = 0; shift = 0;
if (keyheld(VK + QBVK_LSHIFT) || keyheld(VK + QBVK_RSHIFT)) if (keyheld(VK + QBVK_LSHIFT) || keyheld(VK + QBVK_RSHIFT))
shift = 1; shift = 1;
@ -38327,7 +38327,7 @@ void keydown(uint32 x) {
r = (x >> 8) + 256; r = (x >> 8) + 256;
if (scancode_lookup[r * 10 + 2]) { if (scancode_lookup[r * 10 + 2]) {
scancodedown(scancode_lookup[r * 10 + 1]); scancodedown(scancode_lookup[r * 10 + 1]);
// check relevent modifiers // check relevant modifiers
shift = 0; shift = 0;
if (keyheld(VK + QBVK_LSHIFT) || keyheld(VK + QBVK_RSHIFT)) if (keyheld(VK + QBVK_LSHIFT) || keyheld(VK + QBVK_RSHIFT))
shift = 1; shift = 1;
@ -38739,7 +38739,7 @@ void sub__consolefont(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;
if (!OneTimePause) { // a slight delay so the console can be properly created and registered with Windows, before we try and change fonts with it. if (!OneTimePause) { // a slight delay so the console can be properly created and registered with Windows, before we try to change fonts with it.
Sleep(500); Sleep(500);
OneTimePause = 1; // after the first pause, the console should be created, so we don't need any more delays in the future. OneTimePause = 1; // after the first pause, the console should be created, so we don't need any more delays in the future.
} }

View file

@ -14,10 +14,10 @@ void libqb_condvar_free(struct libqb_condvar *);
// Mutex while checking the Condition Variable // Mutex while checking the Condition Variable
void libqb_condvar_wait(struct libqb_condvar *, struct libqb_mutex *); void libqb_condvar_wait(struct libqb_condvar *, struct libqb_mutex *);
// Singals a single thread waiting on the Condition Variable // Signals a single thread waiting on the Condition Variable
void libqb_condvar_signal(struct libqb_condvar *); void libqb_condvar_signal(struct libqb_condvar *);
// Signals all threads waiting on the Condtiion Variable // Signals all threads waiting on the Condition Variable
void libqb_condvar_broadcast(struct libqb_condvar *); void libqb_condvar_broadcast(struct libqb_condvar *);
#endif #endif

View file

@ -22,7 +22,7 @@ void libqb_process_glut_queue();
// special care to not seg-fault when exiting the program. // special care to not seg-fault when exiting the program.
void libqb_exit(int); void libqb_exit(int);
// These functions perform the same actions as their coresponding glut* functions. // These functions perform the same actions as their corresponding glut* functions.
// They tell the GLUT thread to perform the command, returning the result if applicable // They tell the GLUT thread to perform the command, returning the result if applicable
void libqb_glut_set_cursor(int style); void libqb_glut_set_cursor(int style);
void libqb_glut_warp_pointer(int x, int y); void libqb_glut_warp_pointer(int x, int y);
@ -34,7 +34,7 @@ void libqb_glut_hide_window();
void libqb_glut_set_window_title(const char *title); void libqb_glut_set_window_title(const char *title);
void libqb_glut_exit_program(int exitcode); void libqb_glut_exit_program(int exitcode);
// Convinence macros, exists a function depending on the state of GLUT // Convenience macros, exists a function depending on the state of GLUT
#define NEEDS_GLUT(error_result) do { \ #define NEEDS_GLUT(error_result) do { \
if (!libqb_is_glut_up()) { \ if (!libqb_is_glut_up()) { \
error(5); \ error(5); \

View file

@ -17,7 +17,7 @@ int libqb_http_connected(int handle);
// Get length of bytes waiting to be read. // Get length of bytes waiting to be read.
// //
// Note that more bytes may come in after calling function, but you're guarenteed to at least have this many bytes // Note that more bytes may come in after calling function, but you're guaranteed to at least have this many bytes
int libqb_http_get_length(int handle, size_t *length); int libqb_http_get_length(int handle, size_t *length);
// Gets the value from the Content-Length HTTP header. If none was provided, returns an error // Gets the value from the Content-Length HTTP header. If none was provided, returns an error
@ -36,7 +36,7 @@ const char *libqb_http_get_url(int handle);
// Reads up to length bytes into buf. Length is modified if less bytes than requested are returned // Reads up to length bytes into buf. Length is modified if less bytes than requested are returned
int libqb_http_get(int handle, char *buf, size_t *length); int libqb_http_get(int handle, char *buf, size_t *length);
// Returns an error if less than length bytes are availiable to read // Returns an error if less than length bytes are available to read
int libqb_http_get_fixed(int handle, char *buf, size_t length); int libqb_http_get_fixed(int handle, char *buf, size_t length);
#endif #endif

View file

@ -614,7 +614,7 @@ static const char *FS_GetDirectoryEntryName(const char *fileSpec) {
/// @brief This mimics MS BASIC PDS 7.1 & VBDOS 1.0 DIR$() function /// @brief This mimics MS BASIC PDS 7.1 & VBDOS 1.0 DIR$() function
/// @param qbsFileSpec This can be a path with wildcard for the final level (i.e. C:/Windows/*.* or /usr/lib/* etc.) /// @param qbsFileSpec This can be a path with wildcard for the final level (i.e. C:/Windows/*.* or /usr/lib/* etc.)
/// @param passed Flags for optional parameters /// @param passed Flags for optional parameters
/// @return Retuns a qbs with the directory entry name or an empty string if there are no more entries /// @return Returns a qbs with the directory entry name or an empty string if there are no more entries
qbs *func__files(qbs *qbsFileSpec, int32_t passed) { qbs *func__files(qbs *qbsFileSpec, int32_t passed) {
static std::string directory; static std::string directory;
std::string pathName; std::string pathName;

View file

@ -23,9 +23,9 @@ class glut_message {
public: public:
// Calling this indicates to the creator of the message that it has been // Calling this indicates to the creator of the message that it has been
// completed, and any response data is availiable to be read. // completed, and any response data is available to be read.
// //
// If `finsihed` is NULL that means nobody is waiting for the response. In // If `finished` is NULL that means nobody is waiting for the response. In
// that situation we're free to simply delete the object. // that situation we're free to simply delete the object.
void finish() { void finish() {
if (finished) if (finished)

View file

@ -100,8 +100,8 @@ struct RawStream {
maEngine = pmaEngine; // Save the pointer to the ma_engine object (this should come from the QBPE sound engine) maEngine = pmaEngine; // Save the pointer to the ma_engine object (this should come from the QBPE sound engine)
sampleRate = ma_engine_get_sample_rate(maEngine); // Save the sample rate sampleRate = ma_engine_get_sample_rate(maEngine); // Save the sample rate
buffer[0].cursor = buffer[1].cursor = 0; // reset the cursors buffer[0].cursor = buffer[1].cursor = 0; // reset the cursors
buffer[0].data.reserve(DEFAULT_SIZE); // ensure we have a contigious block to account for expansion without reallocation buffer[0].data.reserve(DEFAULT_SIZE); // ensure we have a contiguous block to account for expansion without reallocation
buffer[1].data.reserve(DEFAULT_SIZE); // ensure we have a contigious block to account for expansion without reallocation buffer[1].data.reserve(DEFAULT_SIZE); // ensure we have a contiguous block to account for expansion without reallocation
consumer = &buffer[0]; // set default consumer consumer = &buffer[0]; // set default consumer
producer = &buffer[1]; // set default producer producer = &buffer[1]; // set default producer
stop = false; // by default we will send silent samples to keep the playback going stop = false; // by default we will send silent samples to keep the playback going
@ -1416,7 +1416,7 @@ struct AudioEngine {
if (h >= vectorSize) { if (h >= vectorSize) {
// Scan through the entire vector and return a slot that is not being used // Scan through the entire vector and return a slot that is not being used
// Ideally this should execute in extremely few (if at all) senarios // Ideally this should execute in extremely few (if at all) scenarios
// Also, this loop should not execute if size is 0 // Also, this loop should not execute if size is 0
for (h = 0; h < vectorSize; h++) { for (h = 0; h < vectorSize; h++) {
if (!soundHandles[h]->isUsed) { if (!soundHandles[h]->isUsed) {
@ -1940,7 +1940,7 @@ void sub__sndplaycopy(int32_t src_handle, double volume, double x, double y, dou
/// Playback starts asynchronously. /// Playback starts asynchronously.
/// </summary> /// </summary>
/// <param name="fileName">The is the name of the file to be played</param> /// <param name="fileName">The is the name of the file to be played</param>
/// <param name="sync">This paramater is ignored</param> /// <param name="sync">This parameter is ignored</param>
/// <param name="volume">This the sound playback volume (0 - silent ... 1 - full)</param> /// <param name="volume">This the sound playback volume (0 - silent ... 1 - full)</param>
/// <param name="passed">How many parameters were passed?</param> /// <param name="passed">How many parameters were passed?</param>
void sub__sndplayfile(qbs *fileName, int32_t sync, double volume, int32_t passed) { void sub__sndplayfile(qbs *fileName, int32_t sync, double volume, int32_t passed) {
@ -2139,7 +2139,7 @@ void sub__sndsetpos(int32_t handle, double seconds) {
return; return;
audioEngine.maResult = ma_sound_seek_to_pcm_frame(&audioEngine.soundHandles[handle]->maSound, audioEngine.maResult = ma_sound_seek_to_pcm_frame(&audioEngine.soundHandles[handle]->maSound,
lengthSampleFrames * (seconds / lengthSeconds)); // Set the postion in PCM frames lengthSampleFrames * (seconds / lengthSeconds)); // Set the position in PCM frames
AUDIO_DEBUG_CHECK(audioEngine.maResult == MA_SUCCESS); AUDIO_DEBUG_CHECK(audioEngine.maResult == MA_SUCCESS);
} }
} }
@ -2282,7 +2282,7 @@ int32_t func__sndnew(int32_t frames, int32_t channels, int32_t bits) {
return INVALID_SOUND_HANDLE; return INVALID_SOUND_HANDLE;
} }
// Alocate a sound handle // Allocate a sound handle
int32_t handle = audioEngine.CreateHandle(); int32_t handle = audioEngine.CreateHandle();
if (handle < 1) if (handle < 1)
return INVALID_SOUND_HANDLE; return INVALID_SOUND_HANDLE;
@ -2382,10 +2382,10 @@ mem_block func__memsound(int32_t handle, int32_t targetChannel, int32_t passed)
return mb; return mb;
} }
// Check if the data is one contigious buffer or a link list of decoded pages // Check if the data is one contiguous buffer or a link list of decoded pages
// We cannot have a mem object for a link list of decoded pages for obvious reasons // We cannot have a mem object for a link list of decoded pages for obvious reasons
if (ds->pNode->data.type != ma_resource_manager_data_supply_type::ma_resource_manager_data_supply_type_decoded) { if (ds->pNode->data.type != ma_resource_manager_data_supply_type::ma_resource_manager_data_supply_type_decoded) {
AUDIO_DEBUG_PRINT("Data is not a contigious buffer. Type = %u", ds->pNode->data.type); AUDIO_DEBUG_PRINT("Data is not a contiguous buffer. Type = %u", ds->pNode->data.type);
return mb; return mb;
} }
@ -2520,7 +2520,7 @@ void snd_un_init() {
// Free all sound handles here // Free all sound handles here
for (size_t handle = 0; handle < audioEngine.soundHandles.size(); handle++) { for (size_t handle = 0; handle < audioEngine.soundHandles.size(); handle++) {
audioEngine.ReleaseHandle(handle); // let ReleaseHandle do it's thing audioEngine.ReleaseHandle(handle); // let ReleaseHandle do its thing
delete audioEngine.soundHandles[handle]; // now free the object created by CreateHandle() delete audioEngine.soundHandles[handle]; // now free the object created by CreateHandle()
} }
@ -2557,7 +2557,7 @@ void snd_mainloop() {
case SoundHandle::Type::RAW: case SoundHandle::Type::RAW:
// Dispose the sound if it has finished playing // Dispose the sound if it has finished playing
// Note that this means that temporary looping sounds will never close // Note that this means that temporary looping sounds will never close
// Well thats on the programmer. Probably they want it that way // Well that's on the programmer. Probably they want it that way
if (!ma_sound_is_playing(&audioEngine.soundHandles[handle]->maSound)) if (!ma_sound_is_playing(&audioEngine.soundHandles[handle]->maSound))
audioEngine.ReleaseHandle(handle); audioEngine.ReleaseHandle(handle);

View file

@ -7,7 +7,7 @@ MINIAUDIO_STUB_SRCS := \
stub_audio.cpp stub_audio.cpp
# We always produce both lists so that `make clean` will clean them up even # We always produce both lists so that `make clean` will clean them up even
# when not passed a paticular DEP_* flag # when not passed a particular DEP_* flag
MINIAUDIO_REAL_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/audio/%.o,$(MINIAUDIO_REAL_SRCS)) MINIAUDIO_REAL_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/audio/%.o,$(MINIAUDIO_REAL_SRCS))
MINIAUDIO_STUB_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/audio/%.o,$(MINIAUDIO_STUB_SRCS)) MINIAUDIO_STUB_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/audio/%.o,$(MINIAUDIO_STUB_SRCS))

View file

@ -22,7 +22,7 @@
#include "vtables.h" #include "vtables.h"
constexpr auto MAX_HIVELY_FRAMES = 10 * 60 * 50; // maximium *hively* frames before timeout constexpr auto MAX_HIVELY_FRAMES = 10 * 60 * 50; // maximum *hively* frames before timeout
struct ma_hively { struct ma_hively {
// This part is for miniaudio // This part is for miniaudio
@ -299,7 +299,7 @@ static ma_result ma_hively_init_internal(const ma_decoding_backend_config *pConf
} }
// This help us calculate the total frame size of the tune // This help us calculate the total frame size of the tune
// Note that this must be called before rendering the tune as it actually "plays" it to a dummy buffer to calulate the length // Note that this must be called before rendering the tune as it actually "plays" it to a dummy buffer to calculate the length
static ma_uint64 ma_hively_get_length_in_pcm_frames_internal(ma_hively *pmaHively) { static ma_uint64 ma_hively_get_length_in_pcm_frames_internal(ma_hively *pmaHively) {
ma_uint64 totalFramesRead = 0; ma_uint64 totalFramesRead = 0;

View file

@ -360,7 +360,7 @@ ma_result ma_tsf_load_memory(ma_tsf *pTsf) {
// Attempt to load a SoundFont from memory // Attempt to load a SoundFont from memory
pTsf->tinySoundFont = tsf_load_memory(SOUNDFONT_BIN, SOUNDFONT_SIZE); pTsf->tinySoundFont = tsf_load_memory(SOUNDFONT_BIN, SOUNDFONT_SIZE);
// Return failue if loading from memory also failed. This should not happen though // Return failure if loading from memory also failed. This should not happen though
return pTsf->tinySoundFont ? MA_SUCCESS : MA_OUT_OF_MEMORY; return pTsf->tinySoundFont ? MA_SUCCESS : MA_OUT_OF_MEMORY;
} }

View file

@ -3,7 +3,7 @@
-copied headers in 'include' folder of download to src -copied headers in 'include' folder of download to src
-created QB64 program to help locally build freeglut without makefiles -created QB64 program to help locally build freeglut without makefiles
note: this program is for reference purposes only, do not run it unless you fully understand it note: this program is for reference purposes only, do not run it unless you fully understand it
note: for rebuilding edits to the exisiting source, simple run the batch/script file provided note: for rebuilding edits to the existing source, simple run the batch/script file provided
########################### QB64 PROGRAM TO MANAGE FREEGLUT LIBRARY ###################################### ########################### QB64 PROGRAM TO MANAGE FREEGLUT LIBRARY ######################################
'FreeGLUT Source Manipulation 'FreeGLUT Source Manipulation

View file

@ -1900,7 +1900,7 @@ void FGAPIENTRY glutLeaveMainLoop( void )
#if TARGET_HOST_MS_WINDOWS #if TARGET_HOST_MS_WINDOWS
/* /*
* Determine a GLUT modifer mask based on MS-WINDOWS system info. * Determine a GLUT modifier mask based on MS-WINDOWS system info.
*/ */
static int fghGetWin32Modifiers (void) static int fghGetWin32Modifiers (void)
{ {
@ -2118,7 +2118,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
} }
window->State.NeedToResize = GL_TRUE; window->State.NeedToResize = GL_TRUE;
/* if we used CW_USEDEFAULT (thats a negative value) for the size /* if we used CW_USEDEFAULT (that's a negative value) for the size
* of the window, query the window now for the size at which it * of the window, query the window now for the size at which it
* was created. * was created.
*/ */

View file

@ -876,7 +876,7 @@ if (pixelformat==0) alert("noooo!");
if (acc2) alert("acc!"); if (acc2) alert("acc!");
*/ */
/* windows hack for multismapling/sRGB */ /* windows hack for multisampling/sRGB */
if ( ( fgState.DisplayMode & GLUT_MULTISAMPLE ) || if ( ( fgState.DisplayMode & GLUT_MULTISAMPLE ) ||
( fgState.DisplayMode & GLUT_SRGB ) ) ( fgState.DisplayMode & GLUT_SRGB ) )
{ {

View file

@ -17,7 +17,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
/// @brief Splits a string delimted by '|' into an array of strings /// @brief Splits a string delimited by '|' into an array of strings
/// @param input The string to be parsed /// @param input The string to be parsed
/// @param count Point to an integer that will hold the count of tokens. This cannot be NULL /// @param count Point to an integer that will hold the count of tokens. This cannot be NULL
/// @return Array of string tokens. This must be freed using gui_free_tokens() /// @return Array of string tokens. This must be freed using gui_free_tokens()
@ -333,7 +333,7 @@ qbs *func__guiSaveFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbs
/// @param message The message the will show inside the dialog box /// @param message The message the will show inside the dialog box
/// @param title The dialog box title /// @param title The dialog box title
/// @param type The type of dialog box (see tinyfd_messageBox) /// @param type The type of dialog box (see tinyfd_messageBox)
/// @return returns the value retured by tinyfd_messageBox /// @return returns the value returned by tinyfd_messageBox
int gui_alert(const char *message, const char *title, const char *type) { return tinyfd_messageBox(title, message, type, "error", 1); } int gui_alert(const char *message, const char *title, const char *type) { return tinyfd_messageBox(title, message, type, "error", 1); }
/// @brief This is used internally by libqb to show warning and failure messages /// @brief This is used internally by libqb to show warning and failure messages

View file

@ -117,7 +117,7 @@ int tinyfd_winUtf8 = 1; /* on windows char strings can be 1:UTF-8(default) or 0:
int tinyfd_verbose = 0 ; /* on unix: prints the command line calls */ int tinyfd_verbose = 0 ; /* on unix: prints the command line calls */
int tinyfd_silent = 1 ; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */ int tinyfd_silent = 1 ; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */
/* Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslah */ /* Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslash */
int tinyfd_allowCursesDialogs = 0 ; /* 0 (default) or 1 */ int tinyfd_allowCursesDialogs = 0 ; /* 0 (default) or 1 */
int tinyfd_forceConsole = 0 ; /* 0 (default) or 1 */ int tinyfd_forceConsole = 0 ; /* 0 (default) or 1 */
/* for unix & windows: 0 (graphic mode) or 1 (console mode). /* for unix & windows: 0 (graphic mode) or 1 (console mode).
@ -1008,7 +1008,7 @@ static HWND CreateHiddenWindow()
static HWND windowForDialogs = 0; static HWND windowForDialogs = 0;
// Returns a window handle sutable for displaying dialogs and notifications // Returns a window handle suitable for displaying dialogs and notifications
// //
// We attempt to find a window associated with the program, if none exists then // We attempt to find a window associated with the program, if none exists then
// we'll create a hidden one. // we'll create a hidden one.
@ -1027,14 +1027,14 @@ static HWND GetDialogWindow()
if (windowForDialogs) if (windowForDialogs)
return windowForDialogs; return windowForDialogs;
// No sutable window could be found, create a hidden one for us to use // No suitable window could be found, create a hidden one for us to use
windowForDialogs = CreateHiddenWindow(); windowForDialogs = CreateHiddenWindow();
return windowForDialogs; return windowForDialogs;
} }
#endif /* _WIN32 */ #endif /* _WIN32 */
/* source and destination can be the same or ovelap*/ /* source and destination can be the same or overlap*/
static char * ensureFilesExist(char * aDestination, static char * ensureFilesExist(char * aDestination,
char const * aSourcePathsAndNames) char const * aSourcePathsAndNames)
{ {
@ -1346,7 +1346,7 @@ static LRESULT displayInputBox(HINSTANCE hinst, HWND hwndOwner, const wchar_t *t
lpw = (LPWORD)lpwsz; lpw = (LPWORD)lpwsz;
//----------------------- //-----------------------
// Define a edit text control. // Define an edit text control.
//----------------------- //-----------------------
lpw = lpwAlignDWORD(lpw); // Align DLGITEMTEMPLATE on DWORD boundary lpw = lpwAlignDWORD(lpw); // Align DLGITEMTEMPLATE on DWORD boundary
lpdit = (LPDLGITEMTEMPLATE)lpw; lpdit = (LPDLGITEMTEMPLATE)lpw;
@ -3907,13 +3907,13 @@ void tinyfd_beep(void)
} }
// Concats the source string to the destination string, and escapes the single // Concats the source string to the destination string, and escapes the single
// quotes in a way sutable for bash // quotes in a way suitable for bash
static void concatAndEscapeSingleQuote(char *dest, const char *source) static void concatAndEscapeSingleQuote(char *dest, const char *source)
{ {
tfd_replaceSubStrConCat(source, "'", "'\\''", dest); tfd_replaceSubStrConCat(source, "'", "'\\''", dest);
} }
// Concats the source string to the destination string, and escapes sutable for // Concats the source string to the destination string, and escapes suitable for
// osascript run via sh. // osascript run via sh.
// //
// This is achieved by first escaping double quotes, and then escaping single // This is achieved by first escaping double quotes, and then escaping single
@ -4775,7 +4775,7 @@ int tinyfd_notifyPopup(
} }
else if ( (tfd_zenity3Present()>=5) ) else if ( (tfd_zenity3Present()>=5) )
{ {
/* zenity 2.32 & 3.14 has the notification but with a bug: it doesnt return from it */ /* zenity 2.32 & 3.14 has the notification but with a bug: it doesn't return from it */
/* zenity 3.8 show the notification as an alert ok cancel box */ /* zenity 3.8 show the notification as an alert ok cancel box */
if ( tfd_zenity3Present()>=5 ) if ( tfd_zenity3Present()>=5 )
{ {

View file

@ -76,7 +76,7 @@ char * tinyfd_utf16to8(wchar_t const * aUtf16string);
/******************************************************************************************************/ /******************************************************************************************************/
/******************************************************************************************************/ /******************************************************************************************************/
/************* 3 funtions for C# (you don't need this in C or C++) : */ /************* 3 functions for C# (you don't need this in C or C++) : */
char const * tinyfd_getGlobalChar(char const * aCharVariableName); /* returns NULL on error */ char const * tinyfd_getGlobalChar(char const * aCharVariableName); /* returns NULL on error */
int tinyfd_getGlobalInt(char const * aIntVariableName); /* returns -1 on error */ int tinyfd_getGlobalInt(char const * aIntVariableName); /* returns -1 on error */
int tinyfd_setGlobalInt(char const * aIntVariableName, int aValue); /* returns -1 on error */ int tinyfd_setGlobalInt(char const * aIntVariableName, int aValue); /* returns -1 on error */
@ -91,7 +91,7 @@ extern char tinyfd_needs[]; /* info about requirements */
extern int tinyfd_verbose; /* 0 (default) or 1 : on unix, prints the command line calls */ extern int tinyfd_verbose; /* 0 (default) or 1 : on unix, prints the command line calls */
extern int tinyfd_silent; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */ extern int tinyfd_silent; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */
/* Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslah */ /* Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslash */
extern int tinyfd_allowCursesDialogs; /* 0 (default) or 1 */ extern int tinyfd_allowCursesDialogs; /* 0 (default) or 1 */
extern int tinyfd_forceConsole; /* 0 (default) or 1 */ extern int tinyfd_forceConsole; /* 0 (default) or 1 */
@ -291,7 +291,7 @@ wchar_t * tinyfd_colorChooserW(
- tinyfd_forceConsole=1; at run time, forces dialogs into console mode. - tinyfd_forceConsole=1; at run time, forces dialogs into console mode.
- On windows, console mode only make sense for console applications. - On windows, console mode only make sense for console applications.
- On windows, console mode is not implemented for wchar_T UTF-16. - On windows, console mode is not implemented for wchar_T UTF-16.
- Mutiple selects are not possible in console mode. - Multiple selects are not possible in console mode.
- The package dialog must be installed to run in curses dialogs in console mode. - The package dialog must be installed to run in curses dialogs in console mode.
It is already installed on most unix systems. It is already installed on most unix systems.
- On osx, the package dialog can be installed via - On osx, the package dialog can be installed via

View file

@ -127,7 +127,7 @@ static void onDeviceAttached(struct Gamepad_device *device, void *context) {
int i, x, x2; int i, x, x2;
// re-aquire a potentially dropped device in its original index // re-acquire a potentially dropped device in its original index
for (i = 1; i <= device_last; i++) { for (i = 1; i <= device_last; i++) {
if (devices[i].used) { if (devices[i].used) {
if (devices[i].type == 1) { // it's a joystick/gamepad if (devices[i].type == 1) { // it's a joystick/gamepad
@ -137,7 +137,7 @@ static void onDeviceAttached(struct Gamepad_device *device, void *context) {
if (device->vendorID == devices[i].vendor_id) { if (device->vendorID == devices[i].vendor_id) {
if (device->numAxes == devices[i].axes) { if (device->numAxes == devices[i].axes) {
if (device->numButtons == devices[i].buttons) { if (device->numButtons == devices[i].buttons) {
//(sometimes when gamepads are re-plugged they receieve a generic name) //(sometimes when gamepads are re-plugged they receive a generic name)
// if (strlen(device->description)==strlen(devices[i].description)){//same name length // if (strlen(device->description)==strlen(devices[i].description)){//same name length
// if (strcmp(device->description,devices[i].description)==0){//same name content // if (strcmp(device->description,devices[i].description)==0){//same name content
// re-acquire device // re-acquire device

View file

@ -895,7 +895,7 @@ int32_t FontPrintWidthASCII(int32_t fh, const uint8_t *codepoint, int32_t codepo
if (codepoints > 0) { if (codepoints > 0) {
FONT_DEBUG_CHECK(IS_VALID_FONT_HANDLE(fh)); FONT_DEBUG_CHECK(IS_VALID_FONT_HANDLE(fh));
// Atempt to convert the string to UTF32 and get the actual width in pixels // Attempt to convert the string to UTF32 and get the actual width in pixels
auto count = utf32.ConvertASCII(codepoint, codepoints); auto count = utf32.ConvertASCII(codepoint, codepoints);
return FontPrintWidthUTF32(fh, utf32.codepoints.data(), count); return FontPrintWidthUTF32(fh, utf32.codepoints.data(), count);
} }
@ -998,7 +998,7 @@ bool FontRenderTextASCII(int32_t fh, const uint8_t *codepoint, int32_t codepoint
if (codepoints > 0) { if (codepoints > 0) {
FONT_DEBUG_CHECK(IS_VALID_FONT_HANDLE(fh)); FONT_DEBUG_CHECK(IS_VALID_FONT_HANDLE(fh));
// Atempt to convert the string to UTF32 and forward to FontRenderTextUTF32() // Attempt to convert the string to UTF32 and forward to FontRenderTextUTF32()
auto count = utf32.ConvertASCII(codepoint, codepoints); auto count = utf32.ConvertASCII(codepoint, codepoints);
return FontRenderTextUTF32(fh, utf32.codepoints.data(), count, options, out_data, out_x, out_y); return FontRenderTextUTF32(fh, utf32.codepoints.data(), count, options, out_data, out_x, out_y);
} }

View file

@ -270,7 +270,7 @@ QB45TOKENS:
' declmod::=SHARED ' declmod::=SHARED
' '
' If a pipe symbol is used, the next rule will inherit the "declmod" (or ' If a pipe symbol is used, the next rule will inherit the "declmod" (or
' whatever symbol), unless it explicitly defines it's own. Rules defined ' whatever symbol), unless it explicitly defines its own. Rules defined
' on separate lines use the default symbol which, initially, is nothing, but ' on separate lines use the default symbol which, initially, is nothing, but
' may be overridden using the ".default" directive. This is only really used ' may be overridden using the ".default" directive. This is only really used
' in the second half of the rule list, where almost every token is an ' in the second half of the rule list, where almost every token is an
@ -369,7 +369,7 @@ DATA 0x012,2,"{0}.{#id} = {1}"
DATA 0x015,4,"astype::={#tabi:2}AS {#type:0}" DATA 0x015,4,"astype::={#tabi:2}AS {#type:0}"
DATA 0x016,4,"astype::={#tabi:2}AS {#type:0}" DATA 0x016,4,"astype::={#tabi:2}AS {#type:0}"
' 0x017 - used for unkown type assignments? ' 0x017 - used for unknown type assignments?
DATA 0x017,0,"" DATA 0x017,0,""
DATA 0x018,"" DATA 0x018,""
@ -1236,7 +1236,7 @@ END FUNCTION
' '
' Reads a literal 64-bit float from the p-code and returns its string ' Reads a literal 64-bit float from the p-code and returns its string
' representation. Using the "{dbl}" tag in the SHIFT procedure is a more ' representation. Using the "{dbl}" tag in the SHIFT procedure is a more
' convienient method to extract literals. ' convenient method to extract literals.
' '
' The IP is passed by reference, and will be incremented to the code ' The IP is passed by reference, and will be incremented to the code
' following the literal. There is no radix option for floating point values. ' following the literal. There is no radix option for floating point values.
@ -1264,7 +1264,7 @@ END FUNCTION
' '
' Reads a literal 16-bit integer from the code and returns its string ' Reads a literal 16-bit integer from the code and returns its string
' representation. Using the "{int}" tag in ExecuteParseRule is a more ' representation. Using the "{int}" tag in ExecuteParseRule is a more
' convienient method to extract literals. ' convenient method to extract literals.
' '
' The Radix parameter may be 8, 10 or 16 to produce ' The Radix parameter may be 8, 10 or 16 to produce
' the desired number format, or use the "{int&o}" and "{int&h}" tags. ' the desired number format, or use the "{int&o}" and "{int&h}" tags.
@ -1297,7 +1297,7 @@ END FUNCTION
' '
' Reads a literal 32-bit integer from the code and returns its string ' Reads a literal 32-bit integer from the code and returns its string
' representation. Using the "{lng}" tag in ExecuteParseRule is a more ' representation. Using the "{lng}" tag in ExecuteParseRule is a more
' convienient method to extract literals. ' convenient method to extract literals.
' '
' The Radix parameter may be 8, 10 or 16 to produce the desired number ' The Radix parameter may be 8, 10 or 16 to produce the desired number
' format, or use the "{lng&o}" and "{lng&h}" tags. ' format, or use the "{lng&o}" and "{lng&h}" tags.
@ -1332,7 +1332,7 @@ END FUNCTION
' '
' Reads a literal 32-bit float from the p-code and returns its string ' Reads a literal 32-bit float from the p-code and returns its string
' representation. Using the "{sng}" tag in the SHIFT procedure is a more ' representation. Using the "{sng}" tag in the SHIFT procedure is a more
' convienient method to extract literals. ' convenient method to extract literals.
' '
' The IP is passed by reference, and will be incremented to the code ' The IP is passed by reference, and will be incremented to the code
' following the literal. There is no radix option for floating point values. ' following the literal. There is no radix option for floating point values.
@ -1931,7 +1931,7 @@ END SUB
' '
' Returns the token id of the next unprocessed token without modifying IP. ' Returns the token id of the next unprocessed token without modifying IP.
' Neccessary for REDIM, which causes an array expression to behave like ' Necessary for REDIM, which causes an array expression to behave like
' an array declaration, for reasons best known to the QB45 dev team. ' an array declaration, for reasons best known to the QB45 dev team.
' '
FUNCTION LookAhead FUNCTION LookAhead
@ -2693,7 +2693,7 @@ FUNCTION ReadToken
' soldier on and parse the rest of the file ' soldier on and parse the rest of the file
'---------------------------------------------------------------------------- '----------------------------------------------------------------------------
IF ParseRules(PCODE) = "" THEN IF ParseRules(PCODE) = "" THEN
AOutput "REM ®QB45BIN¯ Unkown token - " + HEX$(PCODE) AOutput "REM ®QB45BIN¯ Unknown token - " + HEX$(PCODE)
IP = IP + 1 IP = IP + 1
EXIT FUNCTION EXIT FUNCTION
END IF END IF
@ -3132,7 +3132,7 @@ FUNCTION SubstTagVERB$
END FUNCTION END FUNCTION
' '
' Splits a {ruletag} into it's constituent components. ' Splits a {ruletag} into its constituent components.
' '
FUNCTION TokenizeTag (TagTxt AS STRING, TagParam AS INTEGER) FUNCTION TokenizeTag (TagTxt AS STRING, TagParam AS INTEGER)

View file

@ -79,7 +79,7 @@ These libraries are pulled in if `_INFLATE$()` or `_DEFLATE$()` are used.
## Http Support ## Http Support
These libraries are pulled in if `_OPENCLIENT()` and `$Unstable:Http` areused: These libraries are pulled in if `_OPENCLIENT()` and `$Unstable:Http` are used:
| Library | License | License file | Location | | Library | License | License file | Location |
| :------ | :-----: | :----------- | :------- | | :------ | :-----: | :----------- | :------- |

View file

@ -101,7 +101,7 @@ elif [ "$DISTRO" == "voidlinux" ]; then
elif [ -z "$DISTRO" ]; then elif [ -z "$DISTRO" ]; then
echo "Unable to detect distro, skipping package installation" echo "Unable to detect distro, skipping package installation"
echo "Please be aware that for QB64-PE to compile, you will need the following installed:" echo "Please be aware that for QB64-PE to compile, you will need the following installed:"
echo " OpenGL developement libraries" echo " OpenGL development libraries"
echo " ALSA development libraries" echo " ALSA development libraries"
echo " GNU C++ Compiler (g++)" echo " GNU C++ Compiler (g++)"
echo " zlib" echo " zlib"

View file

@ -444,14 +444,14 @@ IniSetAddQuotes 0
IF ReadConfigSetting(windowSettingsSection$, "IDE_TopPosition", value$) THEN IF ReadConfigSetting(windowSettingsSection$, "IDE_TopPosition", value$) THEN
IDE_TopPosition = VAL(value$) IDE_TopPosition = VAL(value$)
ELSE ELSE
IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try to auto-position to our last setting.
IDE_TopPosition = 0 IDE_TopPosition = 0
END IF END IF
IF ReadConfigSetting(windowSettingsSection$, "IDE_LeftPosition", value$) THEN IF ReadConfigSetting(windowSettingsSection$, "IDE_LeftPosition", value$) THEN
IDE_LeftPosition = VAL(value$) IDE_LeftPosition = VAL(value$)
ELSE ELSE
IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try to auto-position to our last setting.
IDE_LeftPosition = 0 IDE_LeftPosition = 0
END IF END IF

View file

@ -13674,7 +13674,7 @@ FUNCTION idesubs$
SortedSubsFlag = o(3).sel SortedSubsFlag = o(3).sel
IF SortedSubsFlag = 0 THEN IF SortedSubsFlag = 0 THEN
'Replace list contents with unsorted version while mantaining current selection. 'Replace list contents with unsorted version while maintaining current selection.
PreviousSelection = -1 PreviousSelection = -1
IF o(1).sel > 0 THEN IF o(1).sel > 0 THEN
TargetSourceLine$ = MID$(lySorted$, o(1).sel * 4 - 3, 4) TargetSourceLine$ = MID$(lySorted$, o(1).sel * 4 - 3, 4)
@ -13693,7 +13693,7 @@ FUNCTION idesubs$
o(1).sel = PreviousSelection o(1).sel = PreviousSelection
focus = 1 focus = 1
ELSE ELSE
'Replace list contents with sorted version while mantaining current selection. 'Replace list contents with sorted version while maintaining current selection.
PreviousSelection = -1 PreviousSelection = -1
IF o(1).sel > 0 THEN IF o(1).sel > 0 THEN
TargetSourceLine$ = MID$(ly$, o(1).sel * 4 - 3, 4) TargetSourceLine$ = MID$(ly$, o(1).sel * 4 - 3, 4)
@ -14935,8 +14935,8 @@ END FUNCTION
'f$ is altered to only contain the name of the actual file 'f$ is altered to only contain the name of the actual file
'root$ is the path to apply relative paths to 'root$ is the path to apply relative paths to
FUNCTION idezgetfilepath$ (root$, f$) FUNCTION idezgetfilepath$ (root$, f$)
'step #1: seperate file's name from its path (if any) 'step #1: separate file's name from its path (if any)
p$ = ideztakepath$(f$) 'note: this is a simple seperation of the string p$ = ideztakepath$(f$) 'note: this is a simple separation of the string
'step #2: if path was undefined, set it to root 'step #2: if path was undefined, set it to root
IF LEN(p$) = 0 THEN p$ = root$ IF LEN(p$) = 0 THEN p$ = root$
@ -14944,7 +14944,7 @@ FUNCTION idezgetfilepath$ (root$, f$)
'step #3: if path is relative, make it relative to root$ 'step #3: if path is relative, make it relative to root$
IF _DIREXISTS(root$ + idepathsep$ + p$) THEN p$ = root$ + idepathsep$ + p$ IF _DIREXISTS(root$ + idepathsep$ + p$) THEN p$ = root$ + idepathsep$ + p$
'step #4: attempt a CHDIR to the path to (i) validate its existance 'step #4: attempt a CHDIR to the path to (i) validate its existence
' & (ii) allow listing the paths full name ' & (ii) allow listing the paths full name
ideerror = 4 'path not found ideerror = 4 'path not found
p2$ = p$ p2$ = p$
@ -19457,7 +19457,7 @@ FUNCTION idef1box$ (lnks$, lnks)
END FUNCTION END FUNCTION
'After Cormen, Leiserson, Rivest & Stein "Introduction To Algoritms" via Wikipedia 'After Cormen, Leiserson, Rivest & Stein "Introduction To Algorithms" via Wikipedia
SUB sort (arr() AS STRING * 998) SUB sort (arr() AS STRING * 998)
FOR i& = LBOUND(arr) + 1 TO UBOUND(arr) FOR i& = LBOUND(arr) + 1 TO UBOUND(arr)
x$ = arr(i&) x$ = arr(i&)
@ -19472,7 +19472,7 @@ SUB sort (arr() AS STRING * 998)
END SUB END SUB
FUNCTION FindProposedTitle$ FUNCTION FindProposedTitle$
'Finds the first occurence of _TITLE to suggest a file name 'Finds the first occurrence of _TITLE to suggest a file name
'when saving for the first time or saving as. 'when saving for the first time or saving as.
DIM c AS _BYTE, q AS _BYTE, i DIM c AS _BYTE, q AS _BYTE, i
@ -20402,11 +20402,11 @@ END FUNCTION
SUB ExportCodeAs (docFormat$) SUB ExportCodeAs (docFormat$)
' Get the current source code, convert it to the desired document format and ' Get the current source code, convert it to the desired document format and
' then write the result into a file (program name or "Untitled" + extension). ' then write the result into a file (program name or "Untitled" + extension).
' Forum and Wiki exports are pushed directly to the Clipboard and can directy ' Forum and Wiki exports are pushed directly to the Clipboard and can directly
' be pasted into the Forum post or Wiki page. The exported code is highlighted ' be pasted into the Forum post or Wiki page. The exported code is highlighted
' according to the internal keyword lists and the keywords are linked to its ' according to the internal keyword lists and the keywords are linked to its
' respective Wiki pages. Documents will use the current IDE colors, the Forum ' respective Wiki pages. Documents will use the current IDE colors, the Forum
' and Wiki exports use its own fixed blue theme for higlighting. Further in ' and Wiki exports use its own fixed blue theme for highlighting. Further in
' documents the extended ASCII codes (>127) are encoded as UTF-8 to get them ' documents the extended ASCII codes (>127) are encoded as UTF-8 to get them
' displayed correctly. However, the Forum and Wiki exports keep the original ' displayed correctly. However, the Forum and Wiki exports keep the original
' codepage encoding. Note that this actually might cause wrong characters in ' codepage encoding. Note that this actually might cause wrong characters in
@ -20471,7 +20471,7 @@ SUB ExportCodeAs (docFormat$)
nl% = -1 '=> new line indicator nl% = -1 '=> new line indicator
nt% = -1 '=> new token indicator nt% = -1 '=> new token indicator
'---------- '----------
nc% = 0 '=> paranthesis nesting counter nc% = 0 '=> parenthesis nesting counter
in% = 0 '=> ignore next keyword in% = 0 '=> ignore next keyword
sk% = 0 '=> skip copying current char sk% = 0 '=> skip copying current char
'---------- '----------

View file

@ -173,7 +173,7 @@ REDIM SHARED T(1 TO OptMax) AS INTEGER 'The type of the entry
' t is 0 for ? opts ' t is 0 for ? opts
' ---------- 0 means ? , 1+ means a symbol or {}block ---------- ' ---------- 0 means ? , 1+ means a symbol or {}block ----------
' t is 1 for symbol opts ' t is 1 for symbol opts
' t is the number of rhs opt () index enteries for {READ|WRITE|READ WRITE} like opts ' t is the number of rhs opt () index entries for {READ|WRITE|READ WRITE} like opts
REDIM SHARED Lev(1 TO OptMax) AS INTEGER 'The indwelling level of each opt () element (the lowest is 0) REDIM SHARED Lev(1 TO OptMax) AS INTEGER 'The indwelling level of each opt () element (the lowest is 0)
REDIM SHARED EntryLev(1 TO OptMax) AS INTEGER 'The level required from which this opt () can be validly be entered/checked-for REDIM SHARED EntryLev(1 TO OptMax) AS INTEGER 'The level required from which this opt () can be validly be entered/checked-for
REDIM SHARED DitchLev(1 TO OptMax) AS INTEGER 'The lowest level recorded between the previous Opt and this Opt REDIM SHARED DitchLev(1 TO OptMax) AS INTEGER 'The lowest level recorded between the previous Opt and this Opt
@ -1669,7 +1669,7 @@ DO
IF a$ <> "" THEN GOTO errmes IF a$ <> "" THEN GOTO errmes
IF result <> 0 THEN IF result <> 0 THEN
ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and condition found
END IF END IF
GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code. GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.
END IF END IF
@ -1702,7 +1702,7 @@ DO
IF a$ <> "" THEN GOTO errmes IF a$ <> "" THEN GOTO errmes
IF result <> 0 THEN IF result <> 0 THEN
ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and condition found
END IF END IF
GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code. GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.
END IF END IF
@ -2934,7 +2934,7 @@ DO
IF a$ <> "" THEN GOTO errmes IF a$ <> "" THEN GOTO errmes
IF result <> 0 THEN IF result <> 0 THEN
ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and condition found
END IF END IF
controllevel = controllevel + 1 controllevel = controllevel + 1
@ -2974,7 +2974,7 @@ DO
IF a$ <> "" THEN GOTO errmes IF a$ <> "" THEN GOTO errmes
IF result <> 0 THEN IF result <> 0 THEN
ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and condition found
END IF END IF
END IF END IF
@ -7692,7 +7692,7 @@ DO
'new dim syntax for SHARED! 'new dim syntax for SHARED!
i = i - 1 'relocate back to "AS" i = i - 1 'relocate back to "AS"
'estabilish the data type: 'establish the data type:
t$ = "" t$ = ""
ts$ = "" ts$ = ""
t3$ = "" t3$ = ""
@ -8228,11 +8228,11 @@ DO
dimgottyp: dimgottyp:
IF d$ <> "" AND d$ <> "," THEN a$ = "DIM: Expected ,": GOTO errmes IF d$ <> "" AND d$ <> "," THEN a$ = "DIM: Expected ,": GOTO errmes
'In QBASIC, if no type info is given it can refer to an expeicit/formally defined array 'In QBASIC, if no type info is given it can refer to an explicit/formally defined array
IF notype <> 0 AND dimoption <> 3 AND dimoption <> 1 THEN 'not DIM or STATIC which only create new content IF notype <> 0 AND dimoption <> 3 AND dimoption <> 1 THEN 'not DIM or STATIC which only create new content
IF LEN(elements$) THEN 'an array IF LEN(elements$) THEN 'an array
IF FindArray(varname$) THEN IF FindArray(varname$) THEN
IF LEN(RTRIM$(id.mayhave)) THEN 'explict/formally defined IF LEN(RTRIM$(id.mayhave)) THEN 'explicit/formally defined
typ$ = id2fulltypename$ 'adopt type typ$ = id2fulltypename$ 'adopt type
dimmethod = 0 'set as formally defined dimmethod = 0 'set as formally defined
END IF END IF
@ -8492,7 +8492,7 @@ DO
IF x = 0 THEN x = idn + 1 IF x = 0 THEN x = idn + 1
'note: the following code only adds include directives, everything else is defered 'note: the following code only adds include directives, everything else is deferred
ChainTxtBuf = OpenBuffer%("A", tmpdir$ + "chain.txt") ChainTxtBuf = OpenBuffer%("A", tmpdir$ + "chain.txt")
'include directive 'include directive
WriteBufLine ChainTxtBuf, "#include " + CHR$(34) + "chain" + str2$(x) + ".txt" + CHR$(34) WriteBufLine ChainTxtBuf, "#include " + CHR$(34) + "chain" + str2$(x) + ".txt" + CHR$(34)
@ -8696,7 +8696,7 @@ DO
i = i + 1 'skip "AS" i = i + 1 'skip "AS"
newDimSyntaxTypePassBack = 0 newDimSyntaxTypePassBack = 0
'estabilish the data type: 'establish the data type:
appendname$ = "" appendname$ = ""
appendtype$ = sp + SCase$("As") appendtype$ = sp + SCase$("As")
typ$ = "" typ$ = ""
@ -10610,9 +10610,9 @@ DO
IF RTRIM$(id2.callname) = "sub_get" OR RTRIM$(id2.callname) = "sub_put" THEN IF RTRIM$(id2.callname) = "sub_get" OR RTRIM$(id2.callname) = "sub_put" THEN
IF passed AND 2 THEN IF passed AND 2 THEN
'regular GET/PUT call with variable provided 'regular GET/PUT call with variable provided
passed = passed - 2 'for complience with existing methods, remove 'passed' flag for the passing of a variable passed = passed - 2 'for compliance with existing methods, remove 'passed' flag for the passing of a variable
ELSE ELSE
'FIELD GET/PUT call with variable omited 'FIELD GET/PUT call with variable omitted
IF RTRIM$(id2.callname) = "sub_get" THEN IF RTRIM$(id2.callname) = "sub_get" THEN
fieldcall = 1 fieldcall = 1
subcall$ = "field_get(" subcall$ = "field_get("
@ -10877,7 +10877,7 @@ DO
'pass by reference 'pass by reference
IF (targettyp AND ISPOINTER) THEN IF (targettyp AND ISPOINTER) THEN
IF dereference = 0 THEN 'check deferencing wasn't used IF dereference = 0 THEN 'check dereferencing wasn't used
'note: array pointer 'note: array pointer
IF (targettyp AND ISARRAY) THEN IF (targettyp AND ISARRAY) THEN
@ -10927,7 +10927,7 @@ DO
END IF END IF
IF id.linkid = 0 THEN IF id.linkid = 0 THEN
'if id.linkid is 0, it means the number of array elements is definietly 'if id.linkid is 0, it means the number of array elements is definitely
'known of the array being passed, this is not some "fake"/unknown array. 'known of the array being passed, this is not some "fake"/unknown array.
'using the numer of array elements of a fake array would be dangerous! 'using the numer of array elements of a fake array would be dangerous!
@ -11041,7 +11041,7 @@ DO
END IF 'similar END IF 'similar
END IF 'reference END IF 'reference
ELSE 'not a string ELSE 'not a string
'its a string 'it's a string
IF (sourcetyp AND ISREFERENCE) THEN IF (sourcetyp AND ISREFERENCE) THEN
idnum = VAL(LEFT$(e$, INSTR(e$, sp3) - 1)) 'id# of sourcetyp idnum = VAL(LEFT$(e$, INSTR(e$, sp3) - 1)) 'id# of sourcetyp
IF MID$(sfcmemargs(targetid), i, 1) = CHR$(1) THEN 'cmem required? IF MID$(sfcmemargs(targetid), i, 1) = CHR$(1) THEN 'cmem required?
@ -11051,7 +11051,7 @@ DO
END IF END IF
END IF END IF
END IF 'reference END IF 'reference
END IF 'its a string END IF 'it's a string
END IF 'dereference check END IF 'dereference check
END IF 'target is a pointer END IF 'target is a pointer
@ -13103,7 +13103,7 @@ IF idemode AND qberrorhappenedvalue >= 0 THEN
END IF END IF
IF qberrorhappenedvalue >= 0 THEN IF qberrorhappenedvalue >= 0 THEN
a$ = "UNEXPECTED INTERNAL COMPILER ERROR!": GOTO errmes 'internal comiler error a$ = "UNEXPECTED INTERNAL COMPILER ERROR!": GOTO errmes 'internal compiler error
END IF END IF
@ -13620,9 +13620,9 @@ FUNCTION allocarray (n2$, elements$, elementsize, udt)
'__ARRAY_SINGLE_A[6]=1; '__ARRAY_SINGLE_A[6]=1;
IF cmem AND stringarray = 0 THEN IF cmem AND stringarray = 0 THEN
'Note: A string array's pointers are always stored in 64bit memory 'Note: A string array's pointers are always stored in 64bit memory
'(static)CONVENTINAL memory '(static)CONVENTIONAL memory
WriteBufLine DataTxtBuf, n$ + "[0]=(ptrszint)cmem_static_pointer;" WriteBufLine DataTxtBuf, n$ + "[0]=(ptrszint)cmem_static_pointer;"
'alloc mem & check if static memory boundry has oversteped dynamic memory boundry 'alloc mem & check if static memory boundary has overstepped dynamic memory boundary
WriteBufLine DataTxtBuf, "if ((cmem_static_pointer+=((" + sizestr$ + ")+15)&-16)>cmem_dynamic_base) error(257);" WriteBufLine DataTxtBuf, "if ((cmem_static_pointer+=((" + sizestr$ + ")+15)&-16)>cmem_dynamic_base) error(257);"
'64K check '64K check
WriteBufLine DataTxtBuf, "if ((" + sizestr$ + ")>65536) error(257);" WriteBufLine DataTxtBuf, "if ((" + sizestr$ + ")>65536) error(257);"
@ -15904,7 +15904,7 @@ FUNCTION evaluate$ (a2$, typ AS LONG)
'identify any referencable values 'identify any referenceable values
FOR i = 1 TO blockn FOR i = 1 TO blockn
IF isoperator(block(i)) = 0 THEN IF isoperator(block(i)) = 0 THEN
IF evaledblock(i) = 0 THEN IF evaledblock(i) = 0 THEN
@ -17459,7 +17459,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
'------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------
'note: this comment makes no sense... 'note: this comment makes no sense...
'any numeric variable, but it must be type-speficied 'any numeric variable, but it must be type-specified
IF targettyp = -2 THEN IF targettyp = -2 THEN
e$ = evaluatetotyp(e2$, -2) e$ = evaluatetotyp(e2$, -2)
@ -17496,7 +17496,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
'pointer? 'pointer?
IF (targettyp AND ISPOINTER) THEN IF (targettyp AND ISPOINTER) THEN
IF dereference = 0 THEN 'check deferencing wasn't used IF dereference = 0 THEN 'check dereferencing wasn't used
@ -17552,7 +17552,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
IF id.linkid = 0 THEN IF id.linkid = 0 THEN
'if id.linkid is 0, it means the number of array elements is definietly 'if id.linkid is 0, it means the number of array elements is definitely
'known of the array being passed, this is not some "fake"/unknown array. 'known of the array being passed, this is not some "fake"/unknown array.
'using the numer of array elements of a fake array would be dangerous! 'using the numer of array elements of a fake array would be dangerous!
@ -17693,7 +17693,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
END IF 'source is a reference END IF 'source is a reference
ELSE 'string ELSE 'string
'its a string 'it's a string
IF (sourcetyp AND ISREFERENCE) THEN IF (sourcetyp AND ISREFERENCE) THEN
idnum = VAL(LEFT$(e$, INSTR(e$, sp3) - 1)) 'id# of sourcetyp idnum = VAL(LEFT$(e$, INSTR(e$, sp3) - 1)) 'id# of sourcetyp
@ -17860,7 +17860,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
' Add on any extra optional arguments that were not provided ' Add on any extra optional arguments that were not provided
' '
' Overloaded functions do not require the omited arguments to be provided ' Overloaded functions do not require the omitted arguments to be provided
IF curarg <= id2.args AND NOT id2.overloaded THEN IF curarg <= id2.args AND NOT id2.overloaded THEN
FOR i = curarg TO id2.args FOR i = curarg TO id2.args
IF i = 1 THEN r$ = r$ + "NULL" ELSE r$ = r$ + ",NULL" IF i = 1 THEN r$ = r$ + "NULL" ELSE r$ = r$ + ",NULL"
@ -17873,7 +17873,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG)
IF n$ = "UBOUND" THEN r2$ = "func_ubound(" ELSE r2$ = "func_lbound(" IF n$ = "UBOUND" THEN r2$ = "func_ubound(" ELSE r2$ = "func_lbound("
e$ = refer$(ulboundarray$, sourcetyp, 1) e$ = refer$(ulboundarray$, sourcetyp, 1)
IF Error_Happened THEN EXIT FUNCTION IF Error_Happened THEN EXIT FUNCTION
'note: ID contins refer'ed array info 'note: ID contains refer'ed array info
arrayelements = id.arrayelements '2009 arrayelements = id.arrayelements '2009
IF arrayelements = -1 THEN arrayelements = 1 '2009 IF arrayelements = -1 THEN arrayelements = 1 '2009
@ -19574,7 +19574,7 @@ FUNCTION fixoperationorder$ (savea$)
'----------------I. Pass (){}bracketed items (if any) to fixoperationorder & build return---------------- '----------------I. Pass (){}bracketed items (if any) to fixoperationorder & build return----------------
'note: items seperated by commas are done seperately 'note: items separated by commas are done separately
ff$ = "" ff$ = ""
b = 0 b = 0
@ -20389,7 +20389,7 @@ FUNCTION lineformat$ (a$)
IF c = 38 THEN Give_Error "Expected &H... or &O...": EXIT FUNCTION IF c = 38 THEN Give_Error "Expected &H... or &O...": EXIT FUNCTION
'----------------variable/name---------------- '----------------variable/name----------------
'*trailing _ is treated as a seperate line extension* '*trailing _ is treated as a separate line extension*
IF (c >= 65 AND c <= 90) OR c = 95 THEN 'A-Z(a-z) or _ IF (c >= 65 AND c <= 90) OR c = 95 THEN 'A-Z(a-z) or _
IF c = 95 THEN p2 = 0 ELSE p2 = i IF c = 95 THEN p2 = 0 ELSE p2 = i
FOR i2 = i + 1 TO n FOR i2 = i + 1 TO n

View file

@ -191,7 +191,7 @@ SUB gl_scan_header
var_name$ = readchunk(a$, l$) var_name$ = readchunk(a$, l$)
IF LEFT$(var_name$, 1) = "*" THEN var_type$ = var_type$ + "*": var_name$ = RIGHT$(var_name$, LEN(var_name$) - 1) IF LEFT$(var_name$, 1) = "*" THEN var_type$ = var_type$ + "*": var_name$ = RIGHT$(var_name$, LEN(var_name$) - 1)
IF LEFT$(var_name$, 1) = "*" THEN var_type$ = var_type$ + "*": var_name$ = RIGHT$(var_name$, LEN(var_name$) - 1) IF LEFT$(var_name$, 1) = "*" THEN var_type$ = var_type$ + "*": var_name$ = RIGHT$(var_name$, LEN(var_name$) - 1)
'Note: could be a poiner to a pointer 'Note: could be a pointer to a pointer
ELSE ELSE
var_name$ = "no_name" var_name$ = "no_name"
END IF END IF

View file

@ -2604,8 +2604,8 @@ id.subfunc = 2
id.callname = "sub_get" id.callname = "sub_get"
id.args = 3 id.args = 3
id.arg = MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(-4) id.arg = MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(-4)
'id.specialformat = "[#]?,[?],?" 'non field complient definition 'id.specialformat = "[#]?,[?],?" 'non field compliant definition
id.specialformat = "[#]?[,[?][,?]]" 'field complient definition id.specialformat = "[#]?[,[?][,?]]" 'field compliant definition
id.hr_syntax = "GET #fileNumber&, [position][, targetVariable|targetArray()}]" id.hr_syntax = "GET #fileNumber&, [position][, targetVariable|targetArray()}]"
regid regid
@ -2615,8 +2615,8 @@ id.subfunc = 2
id.callname = "sub_put" id.callname = "sub_put"
id.args = 3 id.args = 3
id.arg = MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(-4) id.arg = MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(-4)
'id.specialformat = "[#]?,[?],?" 'non field complient definition 'id.specialformat = "[#]?,[?],?" 'non field compliant definition
id.specialformat = "[#]?[,[?][,?]]" 'field complient definition id.specialformat = "[#]?[,[?][,?]]" 'field compliant definition
id.hr_syntax = "PUT #filenumber&, [position][, {holdingvariable|holdingarray()}]" id.hr_syntax = "PUT #filenumber&, [position][, {holdingvariable|holdingarray()}]"
regid regid
@ -3489,7 +3489,7 @@ id.n = qb64prefix$ + "Atan2" 'The name of our new one
id.subfunc = 1 'And this is a function id.subfunc = 1 'And this is a function
id.callname = "std::atan2" 'The C name of the function id.callname = "std::atan2" 'The C name of the function
id.args = 2 'It takes 2 parameters to work id.args = 2 'It takes 2 parameters to work
id.arg = MKL$(FLOATTYPE - ISPOINTER) + MKL$(FLOATTYPE - ISPOINTER) 'These simply add up to represent the 2 patameters from what I can tell id.arg = MKL$(FLOATTYPE - ISPOINTER) + MKL$(FLOATTYPE - ISPOINTER) 'These simply add up to represent the 2 parameters from what I can tell
id.ret = FLOATTYPE - ISPOINTER 'we want it to return to us a nice _FLOAT value id.ret = FLOATTYPE - ISPOINTER 'we want it to return to us a nice _FLOAT value
id.hr_syntax = "_ATAN2(y, x)" id.hr_syntax = "_ATAN2(y, x)"
regid 'and we're finished with ID registration regid 'and we're finished with ID registration
@ -3499,7 +3499,7 @@ id.n = qb64prefix$ + "Hypot" 'The name of our new one
id.subfunc = 1 'And this is a function id.subfunc = 1 'And this is a function
id.callname = "std::hypot" 'The C name of the function id.callname = "std::hypot" 'The C name of the function
id.args = 2 'It takes 2 parameters to work id.args = 2 'It takes 2 parameters to work
id.arg = MKL$(FLOATTYPE - ISPOINTER) + MKL$(FLOATTYPE - ISPOINTER) 'These simply add up to represent the 2 patameters from what I can tell id.arg = MKL$(FLOATTYPE - ISPOINTER) + MKL$(FLOATTYPE - ISPOINTER) 'These simply add up to represent the 2 parameters from what I can tell
id.ret = FLOATTYPE - ISPOINTER 'we want it to return to us a nice _FLOAT value id.ret = FLOATTYPE - ISPOINTER 'we want it to return to us a nice _FLOAT value
id.hr_syntax = "_HYPOT(x, y)" id.hr_syntax = "_HYPOT(x, y)"
regid 'and we're finished with ID registration regid 'and we're finished with ID registration

View file

@ -907,7 +907,7 @@ FUNCTION EvaluateFunction$ (p, args AS STRING)
SELECT CASE ConstFuncs(p).nam 'Depending on our operator.. SELECT CASE ConstFuncs(p).nam 'Depending on our operator..
CASE "_PI" CASE "_PI"
'Future compatable in case something ever stores extra digits for PI 'Future compatible in case something ever stores extra digits for PI
n1 = 3.14159265358979323846264338327950288## * args(1).f n1 = 3.14159265358979323846264338327950288## * args(1).f
CASE "_ACOS": n1 = _ACOS(args(1).f) CASE "_ACOS": n1 = _ACOS(args(1).f)

View file

@ -278,8 +278,8 @@ FUNCTION hasFunctionElement (a$, element)
count = count + 1 count = count + 1
IF element = count THEN IF element = count THEN
' We have a element here if there's any elements ' We have an element here if there's any elements
' inbetween the previous comma and this one ' in-between the previous comma and this one
hasFunctionElement = (i <> 1) AND (i - 2 <> start) hasFunctionElement = (i <> 1) AND (i - 2 <> start)
EXIT FUNCTION EXIT FUNCTION
END IF END IF

View file

@ -130,7 +130,7 @@ END FUNCTION
' '
' Reads the integer setting at section:setting. If it is not there or invalid, writes the default value to it ' Reads the integer setting at section:setting. If it is not there or invalid, writes the default value to it
' '
' Verfies the value is positive and non-zero ' Verifies the value is positive and non-zero
' '
FUNCTION ReadWriteLongSettingValue& (section AS STRING, setting AS STRING, default AS LONG) FUNCTION ReadWriteLongSettingValue& (section AS STRING, setting AS STRING, default AS LONG)
DIM value AS STRING DIM value AS STRING