5 ms·
I had actually got this to build and run. These are the changes I made to get it to compile under gcc 4.6.3 with -std=gnu89: --- stoical-0.1.8-old/src/debug.
by compressedgas 5y ago
I had actually got this to build and run. These are the changes I made to get it to compile under gcc 4.6.3 with -std=gnu89:
--- stoical-0.1.8-old/src/debug.c 2002-05-05 06:41:19.000000000 -0400
+++ stoical-0.1.8-new/src/debug.c 2020-10-01 14:32:34.000000000 -0400
@@ -139,7 +139,8 @@
else if ( strcmp( (*p)->name, "l()" ) == 0 )
{
p++;
- st_pcell( ((cell*)p)++ );
+ st_pcell( ((cell*)p) );
+ p = (cell*)p + 1;
p--;
}
else if ( strcmp( (*p)->name, "r()" ) == 0 ||
diff -ru stoical-0.1.8-old/src/help.h stoical-0.1.8-new/src/help.h
--- stoical-0.1.8-old/src/help.h 2002-04-25 16:06:20.000000000 -0400
+++ stoical-0.1.8-new/src/help.h 2020-10-01 09:26:45.000000000 -0400
@@ -1,18 +1,18 @@
-const char help[] = "S t o i c a l %s
-Copyright (c) 2002 Jonathan Moore Liles.
-Released under the GNU General Public License (see COPYING)
-
-usage:
-stoical [ option ] ... [ file ] [ arg ] ...
-
-The available options include:
-
--h - Print this help and exit.
--v - Print version information and exit.
--e code - Exectue the instructions 'code'.
--l path - Change STOICAL root library path.
--f file - Run 'file' (useful when file begins with a '-').
-
-";
+const char help[] = "S t o i c a l %s "
+"Copyright (c) 2002 Jonathan Moore Liles."
+"Released under the GNU General Public License (see COPYING)"
+""
+"usage:"
+"stoical [ option ] ... [ file ] [ arg ] ... "
+""
+"The available options include:"
+""
+"-h - Print this help and exit."
+"-v - Print version information and exit."
+"-e code - Exectue the instructions 'code'."
+"-l path - Change STOICAL root library path."
+"-f file - Run 'file' (useful when file begins with a '-')."
+""
+"";
diff -ru stoical-0.1.8-old/src/words.c stoical-0.1.8-new/src/words.c
--- stoical-0.1.8-old/src/words.c 2002-05-07 06:54:02.000000000 -0400
+++ stoical-0.1.8-new/src/words.c 2020-10-01 14:33:49.000000000 -0400
@@ -2009,8 +2009,8 @@
begin(hash_put)
/* Place character represented by the value at TOS into
* the buffer. Decrement the pointer, and increment the count. */
- *(--(char*)hash_ptr.parm.v.p) = fpop(sst);
-
+ *((char*)hash_ptr.parm.v.p) = fpop(sst);
+ hash_ptr.parm.v.p = (char*)hash_ptr.parm.v.p - 1;
hash_cnt.parm.v.f++;
end()
begin(hash_a)
@@ -2789,7 +2789,8 @@
ip++;
a = (cell*)ip;
- ((cell*)ip)++;
+ ip = (cell*)ip + 1;
ip--;
push(sst,*a);
- compressedgas 5y agoI think the third chunk should have its two new lines swapped.
- ketchupdog 5y agoDid the examples work for you? I got the threads example to run on an M1 building with clang, but the dir example fails.
- compressedgas 5y agoI didn't test the examples. I sort of stopped once I got `1 2 +` to work.
- zoomablemind 5y ago> ... /* Place character represented by the value at TOS into * the buffer. Decrement the pointer, and increment the count. */ - *(--(char*)hash_ptr.parm.v.p) = fpop(sst); - + *((char*)hash_ptr.parm.v.p) = fpop(sst); + hash_ptr.parm.v.p = (char*)hash_ptr.parm.v.p - 1; Are you sure that making assignment before the predecrement is how this fragment should be functioning?
- compressedgas 5y agoThe two lines should be swapped.