Commit Graph

255 Commits

Author SHA1 Message Date
Holger Vogt 52a65f0aac return NULL upon NULL input 2020-02-22 09:45:30 +01:00
h_vogt e46aab1788 function newfopen to replace fopen
by reading wide char strings
2020-02-22 09:36:05 +01:00
Jim Monte 38fb2e205f Fixed incorrect type of variable ch_cur. It was from const char * but should have been const char. 2020-02-14 19:41:26 +01:00
Jim Monte 2035442a9f fixed path created by ngdirname in Windows. Also added const to parameters whose arguments do not change and fixed some potential buffer overruns. 2020-02-12 22:40:46 +01:00
Jim Monte 31c7b69d39 Fixed compile warning about signed/unsigned comparison. 2020-02-12 22:31:55 +01:00
Holger Vogt 047dbc4765 use only TMALLOC and TREALLOC for memory allocation 2020-01-05 14:50:43 +01:00
Jim Monte f9e6664929 Fixed resolution of ~ to home directory. (Bug #405) Also fixed potential buffer overruns in glob expansion 2020-01-04 15:27:58 +01:00
Jim Monte bb10b84045 Fixed buffer resizing, made string utilities more modular, and added several new utilities, some which do not require a null termination, potentially avoiding the need to copy a string. Also some substring utilities using the Rabin-Karp algorithm were added. 2020-01-04 11:19:16 +01:00
Jim Monte 713fad1664 Fixed potential infinite loop (until memory is exhausted) and added several utility functions for processing strings. 2020-01-04 11:18:37 +01:00
Jim Monte b4bbcb1497 Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM. 2020-01-04 11:17:54 +01:00
Jim Monte 9644f2ae4c Dynamic string (dstring) rework 2020-01-04 10:22:35 +01:00
Holger Vogt c50dfa2be8 prevent crash if function is called with NULL argument 2019-08-13 23:31:01 +02:00
Jim Monte e92e2c7362 [PATCH #62] Fixed buffer overrun. Reworked to not use dstring for more
efficient parsing.
2019-08-13 23:30:31 +02:00
Jim Monte ea81da2b01 [PATCH #55-1] Fixed some compiler warnings added by Visual Studio 2019 2019-08-13 23:29:13 +02:00
Jim Monte 1c5176282b [PATCH #52] General cleanup of word list processing, such as adding
comments and const. Also added a new function wl_from_string() to convert a
 single word into a word list. This function can be useful when calling a
 function taking a single-word word list.
2019-08-13 23:28:49 +02:00
Jim Monte b66412f517 [PATCH] Changed prototypes of some functions having parameters that
should not be changed to const and added assorted comments. Also two very
 minor efficiency improvements.
2019-08-13 23:20:21 +02:00
Holger Vogt 61039c2736 add a new function gettok_model to consider {...} expressions
in VDMOS .model statements
2019-08-13 23:17:14 +02:00
Jim Monte 0ddd4a8456 Fixed excess buffer allocation and converted wordlist to string more efficiently
Signed-off-by: Holger Vogt <holger.vogt@uni-due.de>
2019-08-13 23:14:27 +02:00
Holger Vogt 7f3f46ebea license modified to be compatible to 3-clause BSD according to
https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/getopt_long.c
2018-12-17 23:03:00 +01:00
dwarning cf24081507 prevent unused warning 2018-10-27 11:12:56 +02:00
Holger Vogt f31f044e30 set the search path for the code models relative to ngspice.exe
(for Windows GUI and console)
2018-10-18 21:39:33 +02:00
Holger Vogt cffc7d27ff beautify code with astyle 2018-08-07 19:58:52 +02:00
Holger Vogt a98d01e5f8 Use only internal memory functions, replace
free->tfree, malloc->tmalloc, realloc->trealloc
2018-07-21 23:54:43 +02:00
h_vogt 07ea6466ad configure option --enable-relpath
add relative path ../lib to spinit for codemodels
and search path in ivars.c, independently from
install path which has to be an absolute path
2017-08-12 17:37:19 +02:00
rlar 900bed550d string.c, #6/6, use skip_ws() and skip_back_ws() 2017-04-09 15:35:44 +02:00
rlar 0da47c644b string.c, #5/6, cleanup 2017-04-09 15:35:41 +02:00
rlar 5b23b54769 string.c, #4/6, cleanup token fetching 2017-04-09 15:35:38 +02:00
rlar c6a3438408 string.c, #3/6, cleanup 'return' 2017-04-09 15:35:35 +02:00
rlar ed13e8a15a string.c, #2/7, drop 'register' 2017-04-09 15:35:32 +02:00
rlar d48bec757c string.c, #1/6, whitespace 2017-04-09 15:35:29 +02:00
rlar dc6e1cb064 use strchr() instead of strstr() 2017-03-19 20:24:49 +01:00
rlar 7a42510cc0 const'ify some 'skip'ing functions 2017-03-19 20:12:25 +01:00
rlar 45ad60b738 rename gettok_nc() --> nexttok(), and functionalize it 2017-03-19 20:11:01 +01:00
rlar 52a1a58e14 wlist.c, wl_find(), avoid crash when `string' argument is NULL 2016-11-01 11:56:47 +01:00
h_vogt 6a0a6071a0 gettok_nc(&line): like gettok(), move pointer beyond next token in line, but without returning a string, without TMALLOC. Replaces constructs like tfree(gettok(&line)). 2016-10-15 15:06:20 +02:00
h_vogt 33b11f9598 comments improved 2016-08-15 11:26:55 +02:00
rlar d298d5cc2f use memset() instead of deprecated bzero() 2016-07-30 20:58:33 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
rlar 994bec7859 declare free() / realloc() arguments `const void *'
to avoid extra casting when freeing `const' strings
2016-07-17 11:19:34 +02:00
rlar 5e04924890 cleanup `skip_ws()' usage 2016-03-22 15:26:11 +01:00
rlar b1d8b99018 skip-ws, #6/6, rename to match inpcom.c 2016-03-22 15:26:10 +01:00
rlar 22875d056b skip-ws, #5/6, use functional style 2016-03-22 15:26:09 +01:00
rlar d12679fccd skip-ws, #4/6, drop `TEMPORARY_SKIP_WS_X0'
use TEMPORARY_SKIP_WS_X1 instead of TEMPORARY_SKIP_WS_X0
2016-03-22 15:26:08 +01:00
rlar a86f2068c8 skip-ws, #3/6, use TEMPORARY macros, obj-invariant 2016-03-22 15:26:06 +01:00
rlar 6d1171ad6f skip-ws, #2/6, introduce "ngspice/stringskip.h"
with some temporary macros to skip whitespace
2016-03-22 15:26:05 +01:00
rlar 4b5669a51c frontend/resource.c, fix bizarre time mathematics 2016-03-22 15:24:25 +01:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar f84d2d4e44 misc/wlist.c, minor cleanup 2016-03-22 11:22:53 +01:00
rlar 4c1c95e20f everywhere, use `TMALLOC()' instead of `alloc()' 2016-03-21 21:22:07 +01:00
rlar 726d0be34c use char variants of the <ctype.h> toxxxx() family 2016-03-09 20:24:36 +01:00