Commit Graph

91 Commits

Author SHA1 Message Date
Giles Atkinson 4fd0a68fb2 Fix memory leak found by valgrind/paranoia. 2022-05-10 08:25:28 +01:00
Giles Atkinson e6bbbefa10 Suppress warnings from function pointer casts seen with gcc 10.2.1. 2022-04-30 15:26:57 +02:00
Holger Vogt cd01f4949e Make error message more verbose 2022-04-11 12:05:54 +02:00
Holger Vogt 6ba484e5d2 Remove redundant redeclaration of ‘ft_getpnames_quotes’ 2021-12-16 08:04:34 +01:00
Holger Vogt 1605d293d0 Add function integ to control language
Trapezoidal rule for integrating a vector.
2021-12-13 21:49:45 +01:00
Holger Vogt bb9f1669f6 Enable math characters also in tokens like i(z/z) by
temporarily putting " around the token.

Improve error message on missing vector
2021-12-13 21:47:54 +01:00
Holger Vogt e93a19e3e8 Allow math characters in node names
Add a function ft_getpnames_quotes()
It puts quotes " around tokens xxx, when these are enclosed as
V(xxx) and contain arithmetic characters. V(R*C) becomes
V("R*C"). After settig up the parse tree, the quotes are removed again.
Thus these math character remain part of the node name and are not
parsed as parts of an equation.
2021-12-13 21:41:16 +01:00
Holger Vogt 0caeaccdd3 fix typo 2020-08-20 15:38:18 +02:00
Holger Vogt 3a00520071 Improve error message 2020-05-02 14:59:31 +02:00
Holger Vogt d3fcf2f43f restrict removal of arg only to comma operator,
otherwise functions with a single variable may fail
2020-04-04 14:13:35 +02:00
Holger Vogt 4a3b193154 remove memory leak in function parser (bug. no 478),
second case
2020-04-04 14:13:01 +02:00
Holger Vogt 11cf6e709b third trial: get the token i(vss) as a whole in the lexer,
this prevents the parser from generating the spurious vector vss.
No need to do an extra translation i(vss) -> vss#branch.
2020-03-15 10:58:56 +01:00
Holger Vogt 89ea46e39a prevent false freeing of vector 2020-03-15 08:51:03 +01:00
Jim Monte de4788cfe5 Added conjugate function conj(). 2020-03-15 08:50:55 +01:00
Jim Monte 068df274bf Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM. 2020-03-15 08:50:52 +01:00
Holger Vogt b9901a2569 [PATCH 47] Refactored ft_getnames() and used the new function in
com_let().
2019-08-13 23:27:49 +02:00
Jim Monte 6bce493d25 Remove memory leak: If the check of the data fails, the data itself is leaked.
Signed-off-by: Holger Vogt <holger.vogt@uni-due.de>
2019-08-13 23:16:02 +02:00
Holger Vogt f33c3f0751 remove memory leak, when ft_getnames ... free_pnode couple
parses a vector like v(1,2)
2018-10-13 18:18:23 +02:00
Holger Vogt 2dd293707b initialize pn in ft_getpnames() parse.c
initialize dwLen in tesCreateSystemInfo() in com_sysinfo.c
Both were reported by MSVC Code Analysis
Crash of ngspice.dll in Eeschema is thus removed
(hopefully in general)
2018-07-21 23:55:00 +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 ae80067fef cmath2.c, new function stddev to calculate the standard deviation of all elements of a vector 2016-10-15 15:06:17 +02:00
Francesco Lannutti ef0dcfe5f2 avoid bison dependency `version >= 2.7' 2016-07-09 20:58:17 +02:00
rlar 4c1c95e20f everywhere, use `TMALLOC()' instead of `alloc()' 2016-03-21 21:22:07 +01:00
rlar 71a7c3459b use char variants of the <ctype.h> isxxxx() family 2016-03-09 20:24:36 +01:00
rlar 8243696338 dvec abstraction, #8/11, upgrade `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 1304001739 dvec abstraction, #6/11, emphasise `v_plot = NULL' initialisation 2015-12-28 20:34:42 +01:00
rlar 8a4a37b5bb dvec abstraction, #4/11, emphasise `ZERO(dvec)' initialisation 2015-12-28 20:34:42 +01:00
rlar 908c650f72 dvec abstraction, #3/11, use `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 08ad3f6ab5 dvec abstraction, #1/11, reorder 2015-12-28 20:34:42 +01:00
rlar d632e3314d frontend/parse.c, PP_mknnode(), reorder 2015-12-22 20:45:08 +01:00
rlar 876086f768 fix commit "frontend/parse.c, bug fix, PPlex(.."dc1.@m1[vth][1]"..)"
which broke
  let something = foo[var]
notably used in
  examples/Monte_Carlo/MC_ring.sp
2015-12-16 19:17:41 +01:00
rlar 29dde7206a frontend/parse.c, introduce `alloc_pnode()' 2015-11-12 18:32:39 +01:00
rlar 45117c94fd drop yyparse() prototypes, require bison >= 2.7 which emits them 2015-10-18 00:46:13 +02:00
rlar a5f933b3ec frontend/parse.c, bug fix, PPlex(.."dc1.@m1[vth][1]"..)
The whole string was lexed into only one TOK_STR
  instead of the actual (quasi) identifier "dc1.@m1[vth]"
2015-09-24 18:25:25 +02:00
rlar 1c6efd9481 polish bison/flex makefile rules 2015-07-05 20:25:23 +02:00
rlar 5ac7858a79 rewrite, use tprintf 2015-03-28 20:10:29 +01:00
rlar c6a8429258 src/maths/cmaths, implement `nint()' (.control language) 2014-09-20 17:15:10 +02:00
rlar 2602a492b2 fix `log' in `B' and in `.control', to base e instead of 10
In the B language this can be considered a bug fix.

In the .control language this is a severe change
  and breaks backwards compatibility.

In all three languages 'numparam' 'B' and '.control' we now have
  ln    to the base e
  log   to the base e
  log10 to the base 10

Thus log and log10 is now consistent
  with the vast majority of programming languages.

ln is merely for convenience.
  very few other languages have it.
  I'd like to discourage its usage.
2014-09-12 19:18:11 +02:00
rlar 99eade8ec9 cleanup, rename cx_ln --> cx_log (.control language) 2014-09-12 19:09:52 +02:00
rlar c926f46986 cleanup, rename rename cx_log --> cx_log10 (.control language) 2014-09-12 19:09:42 +02:00
Y.Niitsu 6e3f60c6bd frontend/parse.c, allow nested `indexing', for example foo[bar[n]]
.control
compose ex1 values 111 222 333
compose ex2 values 1 2 3
print ex1 ex2 ex1[ex2[1]]
.endc
2014-04-02 21:14:10 +02:00
dwarning 075b620a86 introduce `cx_sortorder()' function 2013-12-31 16:18:52 +01:00
dwarning 4635a19ba9 introduce unwrap, minimum and maximum function 2013-12-31 16:13:17 +01:00
dwarning 6a3da0105b fft and ifft as vector functions 2013-12-31 16:13:08 +01:00
rlar f038d59fbe mkfnode(), fix a memory leak 2012-10-17 19:39:02 +02:00
rlar 01ed0ac5d9 com_fft(), com_psd(), com_spec(), cleanup storage more thoroughly
use free_pnode() instead of free_pnode_o()
drop free_pnode_o()
2012-10-06 21:07:27 +02:00
rlar ae5de92c69 cleanup db_print_pnode_tree() 2012-09-27 19:49:42 +02:00
rlar 7454a6d486 src/frontend/**, whitespace, indentation, ...
untabify
delete-trailing-whitespace
braces
...

checked for object file invariance on linux
2012-09-20 20:30:53 +02:00
rlar 15bda2b9e0 fix memory leak in PPparse() 2012-04-05 21:30:05 +02:00
rlar f285dd0aa8 use strchr() instead of index() 2012-02-06 17:46:33 +00:00