Commit graph

534 commits

Author SHA1 Message Date
David Given 2abcd7d3bd Fix CRLF issues on Windows. 2022-07-16 23:47:31 +02:00
David Given bb0236cbf7 ego uses fork/exec too, so factor out the new system() code from ack and use it
there.
2022-07-16 23:14:39 +02:00
David Given 81d706ff38 Warning fix. 2022-07-16 17:58:15 +02:00
David Given 0eae0d5d71 Replace the terrible ed script in em_code with our new Lua script. 2022-07-16 13:37:13 +02:00
David Given 7298be8964 Move the em_table_lib.lua helper file elsewhere because we're going to need it. 2022-07-16 13:25:13 +02:00
David Given 1ceaf6ea0f Remove the terrible and problematic shell script with cleaner Lua scripts for generating the em_table stuff. 2022-07-16 13:12:52 +02:00
David Given 6443647c8c Typo fix. 2022-07-16 11:54:17 +02:00
David Given e564ec311a I hate CRLF files. 2022-07-16 01:07:55 +02:00
David Given 0900dcc6c9 Typo fix. 2022-07-16 01:02:56 +02:00
David Given 5c7566044a Begin to get an idea of why this keeps failing. 2022-07-16 00:59:20 +02:00
David Given 6568ea4549 Adjust debugging. 2022-07-16 00:47:24 +02:00
David Given eb0175591c Adjust debugging. 2022-07-16 00:38:58 +02:00
David Given 057aad7f44 Add debugging. 2022-07-16 00:11:08 +02:00
David Given 9519588f59 Convert all the things to Unix format. 2022-07-16 00:02:46 +02:00
David Given 25b6712e63 Rework all the ackbuilder scripts not to use wildcards, because we can't expand
them without luaposix, which isn't available (easily) on OSX or Windows.
2022-07-14 23:57:54 +02:00
George Koehler 36f16b0cb8 Cut down some clang warnings
Edit C code to reduce warnings from clang.  Most warnings are for
implicit declarations of functions, but some warnings want me to add
parentheses or curly braces, or to cast arguments for printf().

Make a few other changes, like declaring float_cst() in h/con_float to
be static, and using C99 bool in ego/ra/makeitems.c and
ego/share/makecldef.c.  Such changes don't silence warnings; I make
such changes while I silence warnings in the same file.  In
float_cst(), rename parameter `str` to `float_str`, so it doesn't
share a name with the global variable `str`.

Remove `const` from `newmodule(const char *)` in mach/proto/as to
silence a warning.  I wrongly added the `const` in d347207.

For warnings about implicit declarations of functions, the fix is to
declare the function before calling it.  For example, my OpenBSD
system needs <sys/wait.h> to declare wait().

In util/int, add "whatever.h" to declare more functions.  Remove old
declarations from "mem.h", to prefer the newer declarations of the
same functions in "data.h" and "stack.h".
2019-10-30 18:36:38 -04:00
carl b1f6d5d827 ANSI C compilation fixes 2019-05-14 23:22:38 +08:00
carl ccfd8a3e18 rename rd_long/wr_long to rd_int4/wr_int4 for consistency. Align declaration and definition name of parameters and adapt man page accordingly. 2019-05-11 01:03:36 +08:00
carl bb6540c5f4 Adapt man page with correct prototype information. 2019-05-11 01:01:52 +08:00
carl 3466e84f46 ANSI C conversion of code, adapt man pages accordingly. Some autodocs added. 2019-05-11 01:01:21 +08:00
carl 8b290cf68a ANSI C conversion of code, rename some parameters to better names and adapt man page accordingly. 2019-05-11 00:57:58 +08:00
carl add131b6f9 ANSI C conversion of code, rename some parameters to better names and adapt man page accordingly. 2019-05-11 00:56:13 +08:00
carl dc269e57d8 ANSI C conversion of code and adapt man page accordingly. 2019-05-11 00:53:52 +08:00
carl 5bb20bdb9e Add init/free functions and rename parameters. 2019-05-11 00:52:40 +08:00
carl 7cb2b3de7f Fix syntax mistake in man page. 2019-05-11 00:51:42 +08:00
carl 7973e87b2f Additional check with NULL or empty string (now same behaviour as POSIX version) 2019-03-26 00:58:14 +08:00
carl 78899705d5 Bug of fseek and wrong setting of position. 2019-03-25 02:20:50 +08:00
carl 8457ec6791 Object module now uses ANSI C I/O 2019-03-25 00:07:12 +08:00
carl 56e64a1fd0 Merge remote-tracking branch 'upstream/default' into carl-ansi-part1
# Conflicts:
#	util/arch/archiver.c
#	util/led/finish.c
#	util/led/output.c
2019-03-24 21:42:56 +08:00
carl 75394c93e1 Better ANSI C portability. 2019-03-24 17:40:27 +08:00
George Koehler bec236c108 Include more headers to declare functions.
This causes clang to give fewer warnings of implicit declarations of
functions.

In mach/pdp/cv/cv.c, rename wr_int2() to cv_int2() because it
conflicts with wr_int2() in <object.h>.

In util/ack, rename F_OK to F_TRANSFORM because it conflicts with F_OK
for access() in <unistd.h>.
2019-03-22 15:59:35 -04:00
George Koehler cdbff0dd1c Include <fcntl.h> or <unistd.h>
This silences some clang warnings of implicit declarations of
functions.  The `register int` silences a warning of implicit int.
2019-03-22 14:19:02 -04:00
George Koehler f8cbe04447 Include <unistd.h> for lseek()
This unbreaks my build in OpenBSD.  The old `long lseek()` conflicts
with `off_t lseek()` in OpenBSD headers, because long and off_t are
different types.  Commit b4df26e caused "system.h" to include some
headers where OpenBSD declares lseek().

Manuals for lseek() say to #include <unistd.h>.  Do so to be portable
to systems where other headers don't declare lseek().
2019-03-22 13:18:07 -04:00
carl 6bfac1d24d + Add sys_tmpnam() and sys_basename() 2019-03-17 22:46:31 +08:00
carl da71e5a018 Addition of tmpnam system function. 2019-03-17 22:46:31 +08:00
carl 91adc2849b + Have the DEBUG version compile 2019-03-17 22:46:31 +08:00
carl 9e93eb642b Better type checking on function callback. 2019-03-17 22:46:31 +08:00
carl 4b5de6c203 Remove unused variable. 2019-02-21 00:43:49 +08:00
carl f7ba3eec50 Remove CMake changes and generic sed scripts so they are move to a separate branch. 2019-02-21 00:43:04 +08:00
carl a80248f204 * Was trying to use the new system API which is not ready causing stack issues. 2019-02-20 00:44:32 +08:00
carl b4df26e79d Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
+ Added support for sys_tmpdir for better portability.
2019-02-19 00:54:23 +08:00
carl 7317ae3291 * Initial support of CMake 2019-02-19 00:54:23 +08:00
carl 3214ddfa68 Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
2019-02-19 00:54:23 +08:00
carl 288e81355e * Add missing header file. 2019-02-19 00:54:23 +08:00
carl bd25701a3f * Initial support of CMake 2019-02-19 00:54:23 +08:00
carl 18730a361d * Adapt to new sys_filesize prototype. 2019-02-19 00:54:23 +08:00
carl 8c7de90005 * Initial support of CMake 2019-02-19 00:54:23 +08:00
carl 7c7379c46f Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h (TMPDIR is no longer hard coded)
2019-02-19 00:54:23 +08:00
carl a4650360a3 * Initial support of CMake
+ Generation of header files is now made through a C program to make it more portable.
2019-02-19 00:54:23 +08:00
carl 0ac16f6116 Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
2019-02-19 00:54:23 +08:00