Commit graph

57 commits

Author SHA1 Message Date
David Given
92b3dfb42c Apparently Windows doesn't have strndup or index. 2022-07-17 00:47:49 +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
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
7973e87b2f Additional check with NULL or empty string (now same behaviour as POSIX version) 2019-03-26 00:58:14 +08: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
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
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
George Koehler
b5b1da6f1a Adjust dependencies in modules/src{print,string,system}
Drop dependency on <ansi.h> in modules+headers; assume that compiler
knows ANSI C89.

Add missing dependency from print to string; #include <ack_string.h>.

Because <print.h> had commented out the declarations of sys_lock() and
sys_unlock(), I now stop building lock.c and unlock.c.
2017-11-10 17:56:42 -05:00
David Given
64f2fa9d46 Stop using mktemp() --- on Haiku, it always generates the same filenames,
pretty much guaranteeing temporary file overwrites on parallel builds. Use
mkstemp() instead which creates the files atomically.
2017-08-06 13:22:05 +02:00
David Given
57cb99ade1 Remove sys_time in favour of directly calling time(). 2016-11-09 21:52:04 +01:00
David Given
7f64fe96c7 Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
David Given
f67c98e239 Distributions are a pain --- let's not bother any more. Instead, we just tag
the repository and download a complete snapshot, old and ancient stuff and all.
2016-09-02 23:00:38 +02:00
David Given
612e38f1c6 Remove the old make-based build system, plus some big chunks of horribly
obsolete protomake build system.
2016-09-02 22:17:51 +02:00
David Given
2770a83837 More programs, more libraries. src/modules build files are now saner. 2016-07-23 00:30:31 +02:00
David Given
88bd7ce126 Remove defunct pmfiles.
--HG--
branch : default-branch
2016-06-03 13:56:50 +02:00
David Given
11377070fd Update distribution files.
--HG--
branch : dtrg-buildsystem
2013-05-15 23:46:15 +01:00
David Given
c1aca7dae5 First milestone of replacing the build system.
--HG--
branch : dtrg-buildsystem
rename : lang/cem/cpp.ansi/Parameters => lang/cem/cpp.ansi/parameters.h
2013-05-12 20:45:55 +01:00
George Koehler
0131ca4d46 Delete 689 undead files.
These files "magically reappeared" after the conversion from CVS to
Mercurial.  The old CVS repository deleted these files but did not
record *when* it deleted these files.  The conversion resurrected these
files because they have no history of deletion.  These files were
probably deleted before year 1995.  The CVS repository begins to record
deletions around 1995.

These files may still appear in older revisions of this Mercurial
repository, when they should already be deleted.  There is no way to fix
this, because the CVS repository provides no dates of deletion.

See http://sourceforge.net/mailarchive/message.php?msg_id=29823032
2012-09-20 22:26:32 -04:00
dtrg
b611731ec3 Updated .distr files for the new release. 2007-02-25 12:51:55 +00:00
dtrg
bbd94dc2dc Changed to no longer build sys_lock() and sys_unlock(); they only work
on platforms that support hardlinks, and nobody uses them anyway.
2006-07-26 12:40:59 +00:00
dtrg
3494ffb302 Fixed to use rename() for renaming files, not link()/unlink(). 2006-07-26 12:40:25 +00:00
dtrg
014be56fb0 Replaced calls to the custom strindex() and strrindex() functions with the
exactly equivalent and standard strchr() and strrchr() functions instead.
2006-07-23 20:01:02 +00:00
dtrg
097c640a6c First version in CVS. 2006-07-20 23:24:28 +00:00
dtrg
4c0a0e6119 Rationalised use of #includes to be more standards-compliant. 2006-07-18 17:10:29 +00:00
dtrg
35bd1df1aa Now includes stdlib.h to avoid implicit call declarations. 2005-06-25 15:50:40 +00:00
ceriel
7b6d8fbe56 Added copyright notice 1995-07-31 09:10:42 +00:00
ceriel
b71c0ca9a3 Added Amake.srclist 1995-03-21 09:39:29 +00:00
ceriel
5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel
d7b6b9a5ce Added prototyping stuff 1993-11-10 12:32:42 +00:00
ceriel
799f0600ef Added prototypes 1993-10-22 13:49:04 +00:00
ceriel
f4ecd50601 made more acceptable for ANSI C 1991-11-26 14:48:27 +00:00
ceriel
4e99d889ff Changed manual page installation mechanism 1991-11-05 15:31:14 +00:00
ceriel
18897487a9 do not do lintlib installation on 'make install', also make sure
that every proto.make has a lintlib entry
1991-10-09 19:02:55 +00:00
ceriel
7551b8e83a Changes to manual page 1991-10-01 12:18:39 +00:00
ceriel
73177ad913 New installation mechanism 1991-08-26 16:50:25 +00:00
ceriel
d9815cadcd fixed bug with APPEND in sys_open() 1991-01-11 13:19:36 +00:00
ceriel
f5b29d9ccc creat mode 666 1990-01-26 11:02:34 +00:00
ceriel
46b57440a0 made a bit more robust 1989-06-30 14:46:27 +00:00
ceriel
9751e398e3 Made easier to use other compiler 1989-02-16 16:33:29 +00:00
ceriel
751854f36a prevent multiple includes 1988-09-27 09:50:34 +00:00
ceriel
c03e25dc0d Added sys_rename 1988-06-28 11:12:18 +00:00
ceriel
ea4b32d326 parameterize archiver used 1988-01-14 14:10:51 +00:00
ceriel
1eda133f01 Added register decl, re-arranged some code 1987-09-23 14:22:39 +00:00
ceriel
dd320002c2 time must be called with a 0-pointer, not with 0! Erikje toch! 1987-09-01 14:18:20 +00:00
ceriel
1487265556 Added seek.c, an interface to the lseek systemcall 1987-07-01 13:00:43 +00:00
ceriel
66bcbd7d66 declare mktemp and strcpy 1987-05-18 14:27:06 +00:00