Skip to content

Commit 0926dfb

Browse files
authored
Merge pull request #101 from chrisws/0_12_19
12 19
2 parents adedde2 + 00bc338 commit 0926dfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+860
-647
lines changed

ChangeLog

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
2020-07-16 (12.19)
2+
COMMON: Fix 'Print #' on Windows to use Windows line endings
3+
4+
2020-07-12 (12.19)
5+
ANDROID: fix layout issue with samsung mobiles
6+
ANDROID: save and restore the selected theme
7+
ANDROID: fix access to external storage
8+
9+
2020-06-14 (12.19)
10+
UI: Use theme colours in main display #94
11+
UI: Added theme menu
12+
13+
2020-06-14 (12.19)
14+
FLTK: line numbers colours #93
15+
SDL: restore window size #95
16+
17+
2020-06-06 (12.19)
18+
COMMON: minor performance tweak
19+
20+
2020-05-11 (12.19)
21+
ANDROID: complain when samsung keyboard detected
22+
COMMON: fix compile warnings
23+
24+
2020-05-11 (12.19)
25+
FLTK: Fix compile warnings with updated gcc
26+
27+
2020-05-10 (12.19)
28+
COMMON: Fix ABSMIN/ABSMAX transposed #96
29+
30+
2020-05-09 (12.19)
31+
COMMON: Fix crash when passing non-array to CHART
32+
SDL: show icon in linux build
33+
34+
2020-05-07 (12.19)
35+
COMMON: Fix image.save() to array destination
36+
37+
2020-05-04 (12.19)
38+
COMMON: INPUT crash #99
39+
COMMON: Fix compile warnings with updated gcc
40+
41+
2020-03-07 (12.19)
42+
COMMON: implement DEFINEKEY undo #92
43+
UI: added R157 colour theme #94
44+
45+
2020-02-13 (12.19)
46+
AUDIO: fix integration with latest version of miniaudio library
47+
148
2020-02-13 (0.12.18)
249
Fix path for HOME constant
350

configure.ac

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dnl This program is distributed under the terms of the GPL v2.0
77
dnl Download the GNU Public License (GPL) from www.gnu.org
88
dnl
99

10-
AC_INIT([smallbasic], [0.12.18])
10+
AC_INIT([smallbasic], [12.19])
1111
AC_CONFIG_SRCDIR([configure.ac])
1212

1313
AC_CANONICAL_TARGET
@@ -74,8 +74,8 @@ function checkDebugMode() {
7474
AC_MSG_RESULT([$with_debug])
7575
if test "$with_debug" = "yes" || test "$with_debug" = "full"
7676
then
77-
CFLAGS="${CFLAGS} -g -O0"
78-
CXXFLAGS="${CXXFLAGS} -g -O0"
77+
CFLAGS="${CFLAGS} -g -O0 -fstack-protector-all"
78+
CXXFLAGS="${CXXFLAGS} -g -O0 -fstack-protector-all"
7979
AC_DEFINE(_DEBUG, 1, [debugging build enabled])
8080
fi
8181
AC_SUBST(CFLAGS)
@@ -204,14 +204,16 @@ function buildSDL() {
204204

205205
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS}"
206206

207+
(cd images && xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h)
208+
207209
dnl backlinking support for modules
208210
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
209211
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
210212
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`"
211213
esac
212214

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

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

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

349351
dnl do not depend on cygwin.dll under cygwin build
@@ -441,6 +443,13 @@ echo ${TARGET}
441443
echo "CFLAGS=${CFLAGS}"
442444
echo "CXXFLAGS=${CXXFLAGS}"
443445
echo "PACKAGE_LIBS=${PACKAGE_LIBS}"
446+
447+
if test x$ac_build_sdl = xyes; then
448+
echo
449+
echo "sdl2: `sdl2-config --version`"
450+
echo "freetype: `pkg-config --version freetype2`"
451+
fi
452+
444453
echo
445454

446455
if test x$ac_build_dist = xyes; then

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
smallbasic (0.12.19) unstable; urgency=low
2+
* Various see web site
3+
4+
-- Chris Warren-Smith <[email protected]> Sun, 22 Mar 2020 09:45:25 +1000
5+
16
smallbasic (0.12.18) unstable; urgency=low
27
* Various see web site
38

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
v = "111111111111111111111111111111111111111111111111111111111111111111111111111"
2+
sinput v; k
3+
print k
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sub foo
2+
? "f"
3+
end
4+
5+
definekey 2, foo
6+
definekey 1, foo
7+
definekey 1, foo
8+
definekey 1, foo
9+
definekey 1, 1
10+
definekey 1, 2
11+
definekey 1, 3
12+
definekey 1, 2
13+
definekey 1, 3
14+
definekey 2, 0
15+
definekey 2, 0
16+
definekey 2, 0
17+
definekey 2, 0
18+
19+
definekey asc("x"), foo
20+
definekey asc("x"), foo
21+
definekey asc("y"), foo
22+
definekey asc("z"), foo
23+
definekey asc("f"), foo
24+
definekey asc("x"), 0
25+
definekey asc("y"), 0
26+
definekey asc("z"), 0
27+
28+
if (instr(sbver, "SDL") <> 0) then
29+
while 1
30+
? ".";
31+
delay 10
32+
wend
33+
endif
34+
35+
print "done"

samples/distro-examples/tests/output/all.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ VIEW:
8383
WINDOW:
8484
WRITE:
8585
ABS:12.2222
86-
ABSMAX:1
87-
ABSMIN:9
86+
ABSMAX:9
87+
ABSMIN:1
8888
ACOS:nan
8989
ACOSH:3.2010898763691
9090
ACOT:0.0811223921009
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.11111111111111E+74
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
done

src/common/blib.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ void cmd_print(int output) {
530530
if (code_peek() == kwTYPE_EOC || code_peek() == kwTYPE_LINE) {
531531
// There are no parameters
532532
if (dev_fstatus(handle)) {
533-
dev_fwrite(handle, (byte *) "\n", 1);
533+
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
534534
} else {
535535
err_fopen();
536536
}
@@ -642,7 +642,7 @@ void cmd_print(int output) {
642642
};
643643

644644
if (last_op == 0) {
645-
pv_write("\n", output, handle);
645+
pv_write(output == PV_FILE ? OS_LINESEPARATOR : "\n", output, handle);
646646
}
647647
}
648648

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

28362836
if (!prog_error) {
28372837
par_getcomma();
2838-
2839-
if (code_peek() != kwTYPE_CALL_UDF) {
2840-
err_syntax(kwDEFINEKEY, "%I,%G");
2841-
} else {
2838+
switch (code_peek()) {
2839+
case kwTYPE_INT:
2840+
prog_ip++;
2841+
keymap_remove(key, code_getint());
2842+
break;
2843+
case kwTYPE_CALL_UDF:
28422844
keymap_add(key, prog_ip);
28432845

28442846
// skip ahead to avoid immediate call
28452847
prog_ip += BC_CTRLSZ + 1;
2848+
break;
2849+
default:
2850+
err_syntax(kwDEFINEKEY, "%I,%G");
2851+
break;
28462852
}
28472853
}
28482854
v_free(&var);
@@ -2902,7 +2908,7 @@ void cmd_call_vfunc() {
29022908
if (code_peek() == kwTYPE_LEVEL_BEGIN) {
29032909
code_skipnext();
29042910
}
2905-
v_func->v.fn.cb(map);
2911+
v_func->v.fn.cb(map, NULL);
29062912
if (code_peek() == kwTYPE_LEVEL_END) {
29072913
code_skipnext();
29082914
}

src/common/blib_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ void cmd_fsaveln() {
725725
for (int i = 0; i < v_asize(array_p); i++) {
726726
var_p = v_elem(array_p, i);
727727
fprint_var(handle, var_p);
728-
dev_fwrite(handle, (byte *)"\n", 1);
728+
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
729729
}
730730
} else {
731731
// parameter is an string

src/common/blib_func.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,20 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
122122
v_set(r, elem_p);
123123
}
124124
break;
125-
default: // numeric
125+
default:
126+
// numeric
126127
n = v_getval(elem_p);
127128

128129
switch (funcCode) {
129130
case kwABSMIN:
130131
n = fabsl(n);
131-
if (r->v.n < n) {
132+
if (n < r->v.n) {
132133
r->v.n = n;
133134
}
134135
break;
135136
case kwABSMAX:
136137
n = fabsl(n);
137-
if (r->v.n > n) {
138+
if (n > r->v.n) {
138139
r->v.n = n;
139140
}
140141
break;
@@ -145,8 +146,8 @@ void dar_next(long funcCode, var_t *r, var_t *elem_p) {
145146
case kwSUMSV:
146147
r->v.n += (n * n);
147148
break;
148-
} // sw2
149-
} // sw1
149+
}
150+
}
150151
}
151152

152153
/*

0 commit comments

Comments
 (0)