Commit Graph

305 Commits

Author SHA1 Message Date
dwarning 02abb65c59 rm obsolete #ifdef HAVE_QUERY in windows block 2024-12-06 22:39:06 +01:00
dwarning 3d20dc0da7 format - white spaces 2024-12-06 22:38:26 +01:00
dwarning bf6ffd357d Keep it simple: use only one structure and get_time function 2024-12-06 22:38:16 +01:00
dwarning 60554855d8 seconds() gives difftime to program start, lower priority for getrusage() and times() 2024-12-06 22:38:00 +01:00
dwarning 821733a5f6 suppress compiler warning 2024-12-06 22:37:39 +01:00
dwarning 40aa445ee8 unify os dependent time code in one file - rm win_time.c 2024-12-06 22:37:30 +01:00
dwarning 3faed1647a Reorder and renovate timer functions taking into account ngspice multiprocessor capabilities
by using available high performance functions first.
Deprecated ftime() still acts as a backup function.
Solution is portable for today's operating systems and compilers.
2024-12-06 22:35:02 +01:00
Mamoru TASAKA 099c0e65c2 misc/string.c: fix one byte ahead access in dup_string
In dup_string in misc/string.c , even if the destination
buffer is allocated with n_char bytes,
the source buffer `str` can be accessed up to only n_char bytes.
2024-11-02 22:22:06 +01:00
Holger Vogt 29c4a2a151 Improve error message if malloc or realloc fails. 2024-05-14 16:32:38 +02:00
Holger Vogt fc7ba6ee8f Add a fcn wl_delete to free the wordlist, but not its wl_word contents. 2024-05-14 16:30:49 +02:00
Holger Vogt 902a62d2f4 win_time.c as extra distribution, used only by MSVC 2023-12-27 19:41:13 +01:00
Holger Vogt 70e366021b Generate seed numbers from a microseconds clock, not a seconds clock 2023-11-17 18:35:21 +01:00
Holger Vogt d4c54123d4 Revert "Add code in ivars.c to look for a SPICE_ROOT environment variable"
This reverts commit 6b0ab44f1e.
2023-08-06 16:27:33 +02:00
Giles Atkinson 6b0ab44f1e Add code in ivars.c to look for a SPICE_ROOT environment variable
that gives the location of the ngspice installation.  That allows
binaries to be installed in a different directory to the one
compiled in.  The spinit startup file is made location-independent
by passing a variable giving the location of loadable modules,
so this fixes Bug #615 -
"spinit contains arch dependent paths, but is installed as noarch DATA".
2023-07-31 14:29:23 +02:00
Holger Vogt ff9c98f597 Patch 112 by Robert Turnbull
Remove compiler warning.
2023-03-18 14:30:15 +01:00
Holger Vogt 2e2b74c188 In the ngspice shared library the fcn ivers is called
with a NULL argument. The fix safeguards against argv0
being NULL.
In this case Spice_Exec_Path is set to NULL, it is
safeguarded against NULL when being used.
2023-01-30 10:58:50 +01:00
Holger Vogt 6ef94cb9f2 Prevent from endless loop 2023-01-28 17:01:03 +01:00
Holger Vogt 6da2659026 Remove the debug printout 2023-01-27 16:44:54 +01:00
Holger Vogt 167c708e69 Add searchpath for *.osdi relative to ngspice executable 2023-01-27 16:10:28 +01:00
Holger Vogt 59413a7f71 Add error messages when controlled_exit is called:
No exit without message.
2022-12-11 15:29:47 +01:00
Holger Vogt e6772f4e4e Prevent crash in gettok() and similar functions by checking for NULL
input. Return NULL instead.
2022-10-07 13:23:25 +02:00
Holger Vogt 1329942865 Add a new function char* gettok_np(char** s)
which finds a token, while scanning over (), like
they were white spaces. It also proceeds with s while
still finding (), (which gettok_noparens does not do).
2022-10-07 13:00:44 +02:00
Holger Vogt e80dad01fc Fix bug 581, reported by Adam Denton 2022-05-09 10:07:20 +02:00
Holger Vogt 08a12b5355 Add a function itoa10 and use it
instead of non-standard itoa.
2022-04-26 10:36:10 +02:00
Holger Vogt 7c38699cd7 Add missing function nghash_delete_special(),
developed for branch gc-local
2021-10-30 10:39:19 +02:00
Holger Vogt a6079781ea Fix previous commit, enable name upgrade for Linux and other non-Win OSs 2021-07-05 14:22:10 +02:00
Holger Vogt 604c4624d1 Within a single run, allow multiple plots with different names:
Add an increasing number to the id file name.
2021-07-05 14:21:16 +02:00
Holger Vogt d2f6ad239f If the input file path contains ANSI-encoded special characters,
utf-8 conversion and thus file opening will fail.

This patch then in addition tries opening the file with standard fopen.
2021-07-05 14:03:21 +02:00
dwarning a08f120518 TEMPFORMAT has already leading / in defines.h 2021-07-05 14:02:21 +02:00
Holger Vogt 736d42a5b0 remove unused 2021-03-14 15:32:39 +01:00
Holger Vogt 5747982ae8 Re-enable devices like E2 1 0 (2,3) 1
Add a new function nexttok_noparens(const char *s) which
skips tokens. Characters , ( and ) are treated like spaces.
2021-01-28 17:06:02 +01:00
Holger Vogt 4a8065c3ee replace strncpy by memcpy to prevent valgrind error message
on uninitialized string.
2021-01-05 17:21:23 +01:00
Holger Vogt 238f8d393a Suppress some compiler warnings 2020-12-22 17:56:19 +01:00
Holger Vogt ced7604fc4 fix comment 2020-12-22 17:56:18 +01:00
Holger Vogt 2335639848 License 3-clause BSD
Update to license information
2020-10-10 12:22:01 +02:00
Holger Vogt 02fdcaff2d try first storing the temporary file in user directory,
only then in current directory
2020-05-13 22:14:52 +02:00
Holger Vogt 913635d252 remove unused function 2020-05-03 00:47:45 +02:00
Holger Vogt e2ddc5c06b exclude unused function 2020-05-01 18:40:56 +02:00
Holger Vogt a40f06de52 add #include <stdint.h> for SIZE_MAX 2020-04-27 10:27:20 +02:00
Holger Vogt e1a69e3fc5 controlled_exit only for WinGUI and shared ngspice 2020-04-27 10:27:00 +02:00
Jim Monte 654c9767d6 add fcn product_overflow() 2020-04-27 10:25:19 +02:00
Jim Monte 1d62ae2d97 type casts 2020-04-27 10:22:40 +02:00
Holger Vogt a7e664a5c2 fix bug no. 484, correct TREALLOC usage 2020-04-21 19:55:04 +02:00
Holger Vogt 02cf88c119 correct the return values 2020-03-15 08:51:18 +01:00
Holger Vogt d967e18632 compatibility to old vsnprintf() in MINGW is no longer needed.
Compiling with -D__USE_MINGW_ANSI_STDIO=1 enables C99 compatibility.
2020-03-15 08:51:18 +01:00
Holger Vogt 1398ee7aa0 set the proper preprocessor flag __MINGW32__ 2020-03-15 08:51:17 +01:00
Holger Vogt 249304a06f Instantiations of string and dstring functions as inline
This will remove the redundant-decls warning
2020-03-15 08:51:17 +01:00
Holger Vogt bcfdc806a5 work around a bug in MINGW
Reported in
https://github.com/msys2/MINGW-packages/issues/6254
2020-03-15 08:51:17 +01:00
Holger Vogt 4ddcff55e7 add const declaration to newfopen 2020-03-15 08:51:13 +01:00
Holger Vogt 7f085144a9 remove all the remains of quote() and strip() that had been
used to modify the eigths bit of a character or string.
The functions had been switched off some time ago.
We now need all bits of a char for extended ascii or utf8
2020-03-15 08:51:12 +01:00