Skip to content

Commit

Permalink
Merge pull request #101 from chrisws/0_12_19
Browse files Browse the repository at this point in the history
12 19
  • Loading branch information
chrisws authored Jul 16, 2020
2 parents adedde2 + 00bc338 commit 0926dfb
Show file tree
Hide file tree
Showing 64 changed files with 860 additions and 647 deletions.
47 changes: 47 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
2020-07-16 (12.19)
COMMON: Fix 'Print #' on Windows to use Windows line endings

2020-07-12 (12.19)
ANDROID: fix layout issue with samsung mobiles
ANDROID: save and restore the selected theme
ANDROID: fix access to external storage

2020-06-14 (12.19)
UI: Use theme colours in main display #94
UI: Added theme menu

2020-06-14 (12.19)
FLTK: line numbers colours #93
SDL: restore window size #95

2020-06-06 (12.19)
COMMON: minor performance tweak

2020-05-11 (12.19)
ANDROID: complain when samsung keyboard detected
COMMON: fix compile warnings

2020-05-11 (12.19)
FLTK: Fix compile warnings with updated gcc

2020-05-10 (12.19)
COMMON: Fix ABSMIN/ABSMAX transposed #96

2020-05-09 (12.19)
COMMON: Fix crash when passing non-array to CHART
SDL: show icon in linux build

2020-05-07 (12.19)
COMMON: Fix image.save() to array destination

2020-05-04 (12.19)
COMMON: INPUT crash #99
COMMON: Fix compile warnings with updated gcc

2020-03-07 (12.19)
COMMON: implement DEFINEKEY undo #92
UI: added R157 colour theme #94

2020-02-13 (12.19)
AUDIO: fix integration with latest version of miniaudio library

2020-02-13 (0.12.18)
Fix path for HOME constant

Expand Down
19 changes: 14 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dnl This program is distributed under the terms of the GPL v2.0
dnl Download the GNU Public License (GPL) from www.gnu.org
dnl

AC_INIT([smallbasic], [0.12.18])
AC_INIT([smallbasic], [12.19])
AC_CONFIG_SRCDIR([configure.ac])

AC_CANONICAL_TARGET
Expand Down Expand Up @@ -74,8 +74,8 @@ function checkDebugMode() {
AC_MSG_RESULT([$with_debug])
if test "$with_debug" = "yes" || test "$with_debug" = "full"
then
CFLAGS="${CFLAGS} -g -O0"
CXXFLAGS="${CXXFLAGS} -g -O0"
CFLAGS="${CFLAGS} -g -O0 -fstack-protector-all"
CXXFLAGS="${CXXFLAGS} -g -O0 -fstack-protector-all"
AC_DEFINE(_DEBUG, 1, [debugging build enabled])
fi
AC_SUBST(CFLAGS)
Expand Down Expand Up @@ -204,14 +204,16 @@ function buildSDL() {

PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS}"

(cd images && xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h)

dnl backlinking support for modules
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`"
esac

PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg-config freetype2 --cflags` -fno-exceptions"
CXXFLAGS="${CXXFLAGS} -fno-rtti -std=c++11"
CXXFLAGS="${CXXFLAGS} -fno-rtti -std=c++14"

dnl preconfigured values for SDL build
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
Expand Down Expand Up @@ -343,7 +345,7 @@ function buildFLTK() {
esac

FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk-config --cxxflags`"
FLTK_CXXFLAGS="${FLTK_CXXFLAGS} -fno-exceptions -fno-rtti -std=c++11 -Wno-unknown-pragmas"
FLTK_CXXFLAGS="${FLTK_CXXFLAGS} -fno-exceptions -fno-rtti -std=c++14 -Wno-unknown-pragmas"
PACKAGE_LIBS="${PACKAGE_LIBS} `fltk-config --ldstaticflags --use-images`"

dnl do not depend on cygwin.dll under cygwin build
Expand Down Expand Up @@ -441,6 +443,13 @@ echo ${TARGET}
echo "CFLAGS=${CFLAGS}"
echo "CXXFLAGS=${CXXFLAGS}"
echo "PACKAGE_LIBS=${PACKAGE_LIBS}"

if test x$ac_build_sdl = xyes; then
echo
echo "sdl2: `sdl2-config --version`"
echo "freetype: `pkg-config --version freetype2`"
fi

echo

if test x$ac_build_dist = xyes; then
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
smallbasic (0.12.19) unstable; urgency=low
* Various see web site

-- Chris Warren-Smith <[email protected]> Sun, 22 Mar 2020 09:45:25 +1000

smallbasic (0.12.18) unstable; urgency=low
* Various see web site

Expand Down
3 changes: 3 additions & 0 deletions samples/distro-examples/tests/input.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v = "111111111111111111111111111111111111111111111111111111111111111111111111111"
sinput v; k
print k
35 changes: 35 additions & 0 deletions samples/distro-examples/tests/keymap.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
sub foo
? "f"
end

definekey 2, foo
definekey 1, foo
definekey 1, foo
definekey 1, foo
definekey 1, 1
definekey 1, 2
definekey 1, 3
definekey 1, 2
definekey 1, 3
definekey 2, 0
definekey 2, 0
definekey 2, 0
definekey 2, 0

definekey asc("x"), foo
definekey asc("x"), foo
definekey asc("y"), foo
definekey asc("z"), foo
definekey asc("f"), foo
definekey asc("x"), 0
definekey asc("y"), 0
definekey asc("z"), 0

if (instr(sbver, "SDL") <> 0) then
while 1
? ".";
delay 10
wend
endif

print "done"
4 changes: 2 additions & 2 deletions samples/distro-examples/tests/output/all.out
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ VIEW:
WINDOW:
WRITE:
ABS:12.2222
ABSMAX:1
ABSMIN:9
ABSMAX:9
ABSMIN:1
ACOS:nan
ACOSH:3.2010898763691
ACOT:0.0811223921009
Expand Down
1 change: 1 addition & 0 deletions samples/distro-examples/tests/output/input.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.11111111111111E+74
1 change: 1 addition & 0 deletions samples/distro-examples/tests/output/keymap.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
done
22 changes: 14 additions & 8 deletions src/common/blib.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void cmd_print(int output) {
if (code_peek() == kwTYPE_EOC || code_peek() == kwTYPE_LINE) {
// There are no parameters
if (dev_fstatus(handle)) {
dev_fwrite(handle, (byte *) "\n", 1);
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
} else {
err_fopen();
}
Expand Down Expand Up @@ -642,7 +642,7 @@ void cmd_print(int output) {
};

if (last_op == 0) {
pv_write("\n", output, handle);
pv_write(output == PV_FILE ? OS_LINESEPARATOR : "\n", output, handle);
}
}

Expand Down Expand Up @@ -751,7 +751,7 @@ void cmd_input(int input) {
inps = malloc(SB_TEXTLINE_SIZE + 1);
if (prompt.v.p.ptr) {
// prime output buffer with prompt text
int prompt_len = strlen(prompt.v.p.ptr);
int prompt_len = v_strlen(&prompt);
int len = prompt_len < SB_TEXTLINE_SIZE ? prompt_len : SB_TEXTLINE_SIZE;
strncpy(inps, prompt.v.p.ptr, len);
inps[len] = 0;
Expand Down Expand Up @@ -2835,14 +2835,20 @@ void cmd_definekey(void) {

if (!prog_error) {
par_getcomma();

if (code_peek() != kwTYPE_CALL_UDF) {
err_syntax(kwDEFINEKEY, "%I,%G");
} else {
switch (code_peek()) {
case kwTYPE_INT:
prog_ip++;
keymap_remove(key, code_getint());
break;
case kwTYPE_CALL_UDF:
keymap_add(key, prog_ip);

// skip ahead to avoid immediate call
prog_ip += BC_CTRLSZ + 1;
break;
default:
err_syntax(kwDEFINEKEY, "%I,%G");
break;
}
}
v_free(&var);
Expand Down Expand Up @@ -2902,7 +2908,7 @@ void cmd_call_vfunc() {
if (code_peek() == kwTYPE_LEVEL_BEGIN) {
code_skipnext();
}
v_func->v.fn.cb(map);
v_func->v.fn.cb(map, NULL);
if (code_peek() == kwTYPE_LEVEL_END) {
code_skipnext();
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/blib_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ void cmd_fsaveln() {
for (int i = 0; i < v_asize(array_p); i++) {
var_p = v_elem(array_p, i);
fprint_var(handle, var_p);
dev_fwrite(handle, (byte *)"\n", 1);
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
}
} else {
// parameter is an string
Expand Down
11 changes: 6 additions & 5 deletions src/common/blib_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,20 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
v_set(r, elem_p);
}
break;
default: // numeric
default:
// numeric
n = v_getval(elem_p);

switch (funcCode) {
case kwABSMIN:
n = fabsl(n);
if (r->v.n < n) {
if (n < r->v.n) {
r->v.n = n;
}
break;
case kwABSMAX:
n = fabsl(n);
if (r->v.n > n) {
if (n > r->v.n) {
r->v.n = n;
}
break;
Expand All @@ -145,8 +146,8 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
case kwSUMSV:
r->v.n += (n * n);
break;
} // sw2
} // sw1
}
}
}

/*
Expand Down
Loading

0 comments on commit 0926dfb

Please sign in to comment.