Commit Graph

336 Commits

Author SHA1 Message Date
Holger Vogt 417dbfef72 undo the previous commits dealing with snprintf,
use the C99 compliant function also with MS Visual Studio
2018-05-31 11:37:51 +02:00
Holger Vogt 3b4640dee4 _snprintf in Windows 7 does not automatically put a '\0'
to the end of the buffer, only if there is space available.
That will change in the future if Snprintf is used.
2018-05-31 10:24:09 +02:00
h_vogt c8cd763314 gnuplot.c, add 'noretraceplot' to prevent retracing of the graph if plotting against a vector which is not the original scale vector ('plot vec1 vs vec2') 2018-05-18 17:25:48 +02:00
h_vogt d4adb027d2 avoid retrace in output graph by adding label 'noretraceplot'
to the plot command, that creates a lin plot trying to avoid retracing
2018-05-18 17:08:27 +02:00
Holger Vogt 560cb6e970 plotting/grid.c, bug fix, avoid string buffer overflow
Prevent a crash of example/FFT_test.cir.
Buffer 'buf' in function drawlingrid() has been too small.
Increase 'buf' size, and add some protection.

The example file examples/plot/test-small-plot.cir
shows the limits of plotting:
  difference in two numbers at digit 14 is plotted well.
                            at digit 15 is plotted with bugs.
                            at digit 16 is reduced to integer.

consider compiling with
  -O1 -D_FORTIFY_SOURCE=2
for gcc, and
  /GS
for visual studio.
2018-01-27 21:58:15 +01:00
rlar 91c60c28df whitespace change, avoid gcc warnings due to missleading indentation 2017-09-16 20:38:27 +02:00
h_vogt b3827f6488 gnuplot.c, correct the setting of limits in log plots 2017-09-16 20:37:24 +02:00
h_vogt e5d70d0821 gnuplot.c, bug fix, allow gnuplot with MINGW 2017-04-09 17:53:40 +02:00
rlar 99e864b6bc graf.c, drop an excess cast 2016-10-15 15:06:18 +02:00
rlar aca1b3a374 use 'abs()' 2016-10-15 15:06:17 +02:00
h_vogt 6f609abc27 x11.c, fix bug #330, rename csh variable font -> xfont
reported by graahnul.grom in
  #330 setting xfont in .spiceinit has no effect
  https://sourceforge.net/p/ngspice/bugs/330/
2016-10-15 15:06:16 +02:00
h_vogt c0d5d054ab gnuplot.c, ft_gnuplot(), suppress generating the .eps and .png file
when the given output file name starts with "np_"
2016-10-15 12:58:29 +02:00
h_vogt 42ac9a2859 gnuplot.c, ft_writesimple(), upgrade command 'wrdata'
- remove a bug to allow printing of vectors with differing scale lengths
- add option 'numdgt' to specify the width of the numbers printed
- add variable wr_singlescale
  use 'set wr_singlescale' to print the scale vector only once
  (vectors need to have equal scale lengths)
- add variable wr_vecnames
  use 'set wr_vecnames' to print the vector names to the first row
2016-10-15 12:57:46 +02:00
h_vogt fef2e1439d gnuplot.c, ft_writesimple(), command 'wrdata', use the given filename literally 2016-10-15 12:43:19 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
h_vogt 841f2846fe plotit.c, properly free a reversed wordlist 2016-04-01 18:05:40 +02:00
rlar 9652cc46c8 plotting/graf.c, cleanup 2016-03-23 17:04:55 +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 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 40a0cea0d2 swap some `SWAP' arguments for readability 2016-03-22 15:23:05 +01:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar 6fe937f931 drop unused `SWAPINT' macro 2016-03-21 21:22:23 +01:00
rlar 71a7c3459b use char variants of the <ctype.h> isxxxx() family 2016-03-09 20:24:36 +01:00
rlar 8ce99a3c66 plotting/graf.c, bug fix, dbfree1() is wanted instead of dbfree() 2016-03-09 18:23:22 +01:00
rlar df70661c3a dvec abstraction, #11/11, introduce `dvec_realloc()' 2015-12-28 20:34:42 +01:00
rlar c2a7821449 dvec abstraction, #10/11, introduce `dvec_trunc()' 2015-12-28 20:34:42 +01:00
rlar 3962453739 dvec abstraction, #9/11, introduce `dvec_free()' 2015-12-28 20:34:42 +01:00
rlar 8243696338 dvec abstraction, #8/11, upgrade `dvec_alloc()' 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 68bd883535 plotting/graf.c, collect related global variables in a struct 2015-12-27 12:08:48 +01:00
rlar c405d0ff86 plotting/graf.c, cleanup initialisation, `gr_init()' is in charge to do that 2015-12-27 12:08:44 +01:00
rlar 299849c0db plotting/gnuplot.c, ft_gnuplot(), bug fix, allow plotting a family of curves
in the vein of plotcurv.c, ft_graf()
2015-12-27 12:05:55 +01:00
rlar 5a678e38dc plotting/plotit.c, xtend(), #7/7 reorder 2015-12-27 11:21:46 +01:00
rlar 64d6a5d7c0 plotting/plotit.c, xtend(), #6/7 drop some local variables 2015-12-27 11:21:45 +01:00
rlar d1a68482a5 plotting/plotit.c, xtend(), #5/7 use `TREALLOC()' 2015-12-27 11:21:44 +01:00
rlar 64b43b0c68 plotting/plotit.c, xtend(), #4/7 support vector of zero length 2015-12-27 11:21:43 +01:00
rlar 7c6fc1343b plotting/plotit.c, xtend(), #3/7 complex assignment 2015-12-27 11:21:42 +01:00
rlar 13e649209c plotting/plotit.c, xtend(), #2/7 fix index `i' 2015-12-27 11:21:41 +01:00
rlar 83fc07e770 plotting/plotit.c, xtend(), #1/7 don't free already freed data 2015-12-27 11:21:40 +01:00
rlar 1b62c1f050 plotting/plotit.c, plotit(), `v_length' shall be updated (lpr device, asciiplot) 2015-12-23 10:30:47 +01:00
rlar 9473ec575f drop some remaining `NEW*' macros, use TMALLOC instead 2015-12-19 19:39:29 +01:00
rlar a1439f5d4d plotting/plotit.c, rename local variable `j' --> `y_type' 2015-12-15 19:58:11 +01:00
rlar f97e4a2a35 plotting/plotit.c, cleanup search for common y_type 2015-12-15 19:57:12 +01:00
rlar 73731bdf77 frontend/plotting/plotit.c, cleanup, reduce scope of `struct dvec *dv' 2015-10-04 15:38:27 +02:00
rlar 39fdeb0c9a src/frontend/plotting/gnuplot.c, enforce "noenhanced text" mode
Contrary to older versions gnuplot 5 uses "enhanced text mode" per default.
The strings which we pass to gnuplot don't have "latex" semantics,
  thus consistently enforce "noenhanced text mode".

Add a function quote_gnuplot_string() to escape and quote strings
  in such a way that they will arrive in gnuplot unmodified.
2015-05-17 17:34:29 +02:00
Marcel Hendrix 02fe549be7 src/frontend/plotting/plotit.c, allow "plot xlog ylog" (equiv to "plot loglog") 2015-05-14 15:56:45 +02:00
rlar 7bc6374138 cleanup, use '\0' instead of 0 in char context 2015-05-02 10:24:54 +02:00
rlar 19e427e3a5 cleanup, use NULL instead of 0 in pointer context 2015-05-02 10:24:49 +02:00
rlar 6f21c3b9db use `enum simulation_types' 2015-03-10 18:27:39 +01:00
rlar 2b3220086d graph.h, grid.c, enforce consistent string buffer size (plot "units", LABEL_CHARS) 2015-03-08 19:36:46 +01:00
rlar c5e0bcde04 cleanup using `hypot()' 2014-12-06 20:41:11 +01:00
rlar 45cfdde701 src/frontend/plotting/plotit.c, plotit(), fix command line buffer overflow 2014-11-30 22:15:37 +01:00
Giorgio Vazzana 0348dcd251 bug fix, #286 buffer overflow in src/frontend/plotting/grid.c 2014-06-26 19:50:18 +02:00
rlar 7aa454e5b4 rewrite, using tprintf() 2014-04-05 19:10:12 +02:00
rlar ed23c7e315 set X11 window title from `graph->plotname'
in response to a bug report by Dominique Michel
  "#272 no title in plots"
  http://sourceforge.net/p/ngspice/bugs/272/
2014-01-11 16:24:25 +01:00
h_vogt bd1b4a2162 gnuplot.c: enable correct terminal for non MINGW/MSVC 2014-01-11 16:24:14 +01:00
h_vogt 7bc879726d make database dbs local to each circuit 2013-12-31 12:56:53 +01:00
rlar 6c8f002eea unify #ifndef include wrapper 2013-12-31 12:54:32 +01:00
rlar c377b7a6b3 avoid leading underscore in preprocessor macros 2013-12-31 12:54:27 +01:00
h_vogt 7d45880654 plotit.c: remove memory leaks 2012-12-15 22:59:47 +01:00
h_vogt c5de0c21c9 findvec(), use hash tables for the vector search
patch originally provided by Bill Swartz, 2010
reduces vector search time from O(n) to O(1)
2012-12-09 13:27:53 +01:00
rlar 83e3100917 remove unused variables 2012-12-01 16:05:20 +01:00
dwarning 6abd2e2c0c gnuplot.c: allow png terminal by gnuplot_terminal variable 2012-11-21 22:12:27 +01:00
Francesco Lannutti 08ec219417 remove all .cvsignore files 2012-10-26 18:30:14 +02:00
h_vogt 3ca1235602 gnuplot.c: improve scaling of y axis 2012-10-09 19:47:24 +02:00
rlar 11579d9369 cleanup, ngspice/config.h is already in ngspice/ngspice.h, #1/2 (easy ones) 2012-10-06 12:12:08 +02:00
rlar 35c0e9eca3 variable rename, unify the source
checked for object file invariance
2012-10-01 17:59:40 +02:00
h_vogt 986f9b7535 grid.c: prevent overflow of div_list 2012-09-26 21:12:26 +02:00
h_vogt 0bdc33db40 grid.c: prevent crash if real low and high values are close 2012-09-26 20:58:58 +02:00
rlar fe1acd3757 src/frontend/** remove superfluous `return' invocations 2012-09-22 19:33:55 +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 f3b5336d3a cleanup some macros, try to be more careful 2012-09-19 20:16:27 +02:00
rlar 6c01089be1 plug memory leak in x11.c
try to obey the Xt toolkit protocol when closing widgets and application
2012-08-19 19:18:34 +02:00
rlar d4ced47e8e drop out_pbuf, which was an ancient workaround
obviously an old implementation of out_printf()
  has been unreliable.
2012-08-18 18:27:13 +02:00
rlar 46980f2cc6 plotit.c #9/9, whitespace 2012-08-05 21:41:25 +02:00
rlar 4803d8bba2 plotit.c #8/9, braces 2012-08-05 21:41:25 +02:00
rlar 6a334da2b4 plotit.c #7/9, braces 2012-08-05 21:41:25 +02:00
rlar f587553217 plotit.c #6/9, braces 2012-08-05 21:41:25 +02:00
rlar 088e88d9b2 plotit.c #5/9, localize 2012-08-05 21:41:25 +02:00
rlar 5f1387892c plotit.c #4/9, line wrap 2012-08-05 21:41:25 +02:00
rlar ed4ad1c0dd plotit.c #3/9, drop some comments 2012-08-05 21:41:25 +02:00
rlar 5c43e8f2fc plotit.c #2/9, emphasize maximize/minimize 2012-08-05 21:41:25 +02:00
rlar 406fc29007 plotit.c #1/9, think positive 2012-08-05 21:41:25 +02:00
h_vogt acfc7a2a27 remove memory leaks 2012-08-04 19:09:13 +02:00
rlar cf2a0f3df3 cleanup, linewrap 2012-08-03 20:43:12 +02:00
rlar 5a69b9efc4 cleanup, void return 2012-08-03 20:43:06 +02:00
rlar 64b8dfc570 use wl_delete_slice() 2012-07-29 13:11:43 +02:00
rlar 26468839d4 plotit(), cleanup wordlist processing 2012-07-28 19:55:09 +02:00
rlar b808fcec8a fix typo in the commit `use wl_find()' 2012-07-28 14:52:17 +02:00
rlar 891d99497d use wl_find() 2012-07-28 12:29:23 +02:00
rlar 60398d113c plotit.c, prepare for usage of wl_find() 2012-07-28 12:29:19 +02:00
rlar 05e5854268 plotit.c, whitespace cleanup 2012-07-23 19:17:25 +02:00
rlar 9655b9885a cleanup, use wl_cons(), wl_append_word() and wl_chop_rest() 2012-07-14 10:23:51 +02:00
rlar cb0a48801d introduce AM_CFLAGS = $(STATIC) 2012-07-07 14:51:39 +02:00
rlar d8105873db remove error.h, use fteext.h for controlled_exit() 2012-06-12 21:26:29 +02:00
rlar e91e3c4ec7 lingrid(), avoid buffer overflow
Bug ID: `Buffer overflow detected - ID: 3510521'
    reported by Zsolt Makaró

  The variable `mag3' sometimes seems to take
    unexpected values
    (for example log10 can be -Inf, which will be casted to 0x80000000)
  and seems then to have overflown a buffer buf[LABEL_CHARS]
2012-03-27 21:07:12 +02:00
h_vogt b4516b08ca bug fix, iplot(): Buffer overflow
Thanks to Zsolt Makaró for the bug report in
  Buffer overflow detected - ID: 3510521
  http://sourceforge.net/tracker/?func=detail&aid=3510521&group_id=38962&atid=423915
2012-03-24 18:29:36 +01:00
rlar a056ea3065 #3/4 switch realpart() and imagpart() args from ngcomplex* to ngcomplex 2012-02-07 19:53:12 +00:00
rlar d5f6bcbedf drop some more casts 2012-02-06 20:11:10 +00:00
rlar d3c3741f43 #4/6 config.h --> ngspice/config.h, AM_CPPFLAGS 2011-12-27 12:07:52 +00:00
rlar 4ca58067a2 #2/6 config.h --> ngspice/config.h, #include's 2011-12-27 11:33:01 +00:00
rlar 0b5042e7da remove CVS `Id',`log' etc. keyword incantations 2011-12-13 19:57:45 +00:00
rlar 10346e055c #1/4 #include <ngspice/...> --> #include "ngspice/..." 2011-12-11 18:05:00 +00:00
h_vogt 0ea3e30805 wrdata now prints complex variables and recognizes 'appendwrite' 2011-11-25 23:04:09 +00:00
h_vogt ccd115c6e2 Error message on exceeding resolution limit 2011-09-11 12:55:30 +00:00
rlar d26015586c #1/7 use a subdirectory "ngspice" for includes to create a uniq namespace 2011-08-20 17:27:09 +00:00
rlar f8e41f9fb5 remove second incarnation of `grid.h' 2011-08-12 09:31:52 +00:00
rlar 9e86e5ca66 rewrite (double)literal --> floating-point-literal 2011-08-09 08:07:56 +00:00
rlar 27f1d7bb45 cleanup getlims() and plug a memory leak 2011-07-24 20:30:44 +00:00
h_vogt 5b4e11dbb4 no double definition 2011-07-20 16:46:06 +00:00
h_vogt dea300d88d command 'remcirc' 2011-07-19 23:06:29 +00:00
rlar b998b92720 cleanup, `getlims()' has to be used with number arg >= 1 2011-07-17 16:44:07 +00:00
rlar af420a6a01 remove compiler warnings by explicit casting double -> int etc. 2011-06-30 18:48:05 +00:00
rlar d59845b427 graf.c, swallow type conversion warning 2011-06-25 17:05:29 +00:00
rlar aa0b602b87 cleanup some reoccuring function prototypes 2011-06-22 17:06:40 +00:00
h_vogt 3547fdc5f3 explicit casts double -> int 2011-06-11 18:38:38 +00:00
h_vogt e6c86b4d98 explicit casting double -> int etc. 2011-06-11 17:07:38 +00:00
rlar 2d1e44787b fix a segfault, when invoking `destroy' while running in batch mode on unix 2011-06-02 13:28:36 +00:00
h_vogt 7365459f75 move #define NUMCOLORS to x11.c 2011-05-03 21:19:57 +00:00
rlar 55638c8023 various cleanups 2011-04-30 12:29:19 +00:00
rlar 23056573d8 code cleanup, drop NULL pointer casts 2011-04-28 15:59:36 +00:00
rlar a987113675 cleanup x11 code 2011-04-28 10:52:26 +00:00
rlar e55f9c7fab bugfix, segfault when closing a plot window 2011-04-09 18:50:14 +00:00
rlar 6268d236f0 bug fix a segfault when closing a second x11-window, then resizing the first 2011-04-02 17:16:29 +00:00
dwarning 29179938c7 x-axis label for misc. sweep types 2011-03-16 21:28:10 +00:00
rlar a2303d4d78 bug fix a segfault when closing a second X11 window, then resizing the first 2011-02-11 19:02:49 +00:00
h_vogt f601632453 line 139: test for v_plot 2011-01-18 22:50:59 +00:00
dwarning 3ab9e6d060 cvs ignore .libs 2010-12-12 09:42:47 +00:00
dwarning b964cf949c cvs ignore *.lo and *.la 2010-12-12 09:34:10 +00:00
rlar eb06eeb4d9 swallow type conversion warnings 2010-11-23 19:26:00 +00:00
rlar 05441d5823 Nr 5/5 (x = ...) == NULL , swallow warnings 2010-11-19 18:54:40 +00:00
rlar e6c30efe46 Nr 4/5 (x = ...) != NULL , swallow warnings 2010-11-19 18:52:44 +00:00
rlar acb1c33d66 Nr 1/5 (x = ...) == 0 , swallow warnings 2010-11-19 18:46:58 +00:00
rlar abb87a6115 rename `IGNORE()' --> `NG_IGNORE()' 2010-11-16 20:38:24 +00:00
rlar 80286e0032 pour `IGNORE()' all over the source 2010-11-16 19:11:32 +00:00
rlar 75b6eeb94a add `int' casts to some strlen() expressions, and center labels on a xlog scale 2010-11-06 20:17:19 +00:00
rlar 1779d62558 add some `int' and `size_t' casts 2010-11-06 20:14:21 +00:00
rlar 8cd9d88d40 tiny rewrite, avoid type conversion warnings 2010-11-06 18:08:27 +00:00
rlar 5f4b0aa798 (int) cast the return value of some strlen() invocations 2010-11-06 16:54:11 +00:00
rlar 3afbeb53e2 minor rewrite, fix a minor bug in the x11 zoom-in function 2010-11-04 19:42:09 +00:00
rlar 0eccd17d9a add casts for x11 operations, to silence type conversion warnings 2010-11-04 19:35:57 +00:00
rlar 3affeff848 move device dependent colors[] array from `graph' to the x11 specific struct 2010-11-04 19:32:53 +00:00
rlar 6b5debfc1e use `NUMELEMS' and add some `(int)' casts 2010-11-02 17:23:46 +00:00
rlar b4ffca60c4 (int) casts for some `strlen()' expressions 2010-11-02 17:17:43 +00:00
rlar 01566f2b49 add casts to make `int' versus `size_t' conversions explicit 2010-11-02 17:07:57 +00:00
rlar 7b3960506f wrap tmalloc MALLOC etc, into two macros TMALLOC and TREALLOC 2010-10-28 19:32:34 +00:00
rlar 15d12df25b tmalloc usage unification, parenthesize some terms 2010-10-24 13:27:18 +00:00