From 381d4ec43d9198e8bdcca1f535bb7cf3df07d4e3 Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Sat, 25 Apr 2020 19:50:49 +0200 Subject: [PATCH] #includes modified --- src/include/ngspice/cidersupt.h | 23 +++++++++++++---------- src/include/ngspice/cmproto.h | 9 +++++++++ src/include/ngspice/complex.h | 18 +++++++++--------- src/include/ngspice/cpdefs.h | 2 +- src/include/ngspice/cpstd.h | 1 - src/include/ngspice/devdefs.h | 8 ++++---- src/include/ngspice/ftedev.h | 7 +++++-- src/include/ngspice/mifproto.h | 4 ++++ src/xspice/icm/xtraevt/real/udnfunc.c | 3 +-- 9 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/include/ngspice/cidersupt.h b/src/include/ngspice/cidersupt.h index 2101f3549..c7f79b101 100644 --- a/src/include/ngspice/cidersupt.h +++ b/src/include/ngspice/cidersupt.h @@ -7,9 +7,12 @@ #ifndef ngspice_CIDERSUPT_H #define ngspice_CIDERSUPT_H -#include "ngspice/numglobs.h" -#include "ngspice/material.h" +#include + +#include "ngspice/bool.h" #include "ngspice/gendev.h" +#include "ngspice/material.h" +#include "ngspice/numglobs.h" #include "ngspice/profile.h" /* externals for database.c */ @@ -60,21 +63,21 @@ extern void printMaterialInfo(MaterialInfo * ); /* externals for mobil.c */ extern void MOBdefaults(MaterialInfo *, int, int, int, int ); -extern void MOBtempDep (MaterialInfo *, double ); -extern void MOBconcDep (MaterialInfo *, double, double *, double *); -extern void MOBfieldDep (MaterialInfo *, int, double, double *, double * ); +extern void MOBtempDep(MaterialInfo *, double ); +extern void MOBconcDep(MaterialInfo *, double, double *, double *); +extern void MOBfieldDep(MaterialInfo *, int, double, double *, double * ); /* externals for recomb.c */ -extern void recomb (double, double, double, double, double, double, +extern void recomb(double, double, double, double, double, double, double, double *, double *, double * ); /* externals for suprem.c */ -extern void readAsciiData( char *, int, DOPtable ** ); -extern void readSupremData( char *, int, int, DOPtable ** ); +extern int readAsciiData(const char *, int, DOPtable **); +extern int readSupremData(const char *, int, int, DOPtable ** ); /* externals for suprmitf.c */ -extern void SUPbinRead( char *, float *, float *, int *, int * ); -extern void SUPascRead( char *, float *, float *, int *, int * ); +extern int SUPbinRead(const char *, float *, float *, int *, int *); +extern int SUPascRead(const char *, float *, float *, int *, int *); diff --git a/src/include/ngspice/cmproto.h b/src/include/ngspice/cmproto.h index d29d91c0d..4b37c8924 100644 --- a/src/include/ngspice/cmproto.h +++ b/src/include/ngspice/cmproto.h @@ -116,4 +116,13 @@ void free_pj(const void *ptr); FILE *fopen_with_path(const char *path, const char *mode); +#ifdef __GNUC__ +int cm_message_printf(const char *fmt, ...) + __attribute__ ((format (__printf__, 1, 2))); +#else +int cm_message_printf(const char *fmt, ...); #endif + +#define CM_IGNORE(x) (void) (x) + +#endif /* include guard */ diff --git a/src/include/ngspice/complex.h b/src/include/ngspice/complex.h index 2963b0ce2..f13c83f1e 100644 --- a/src/include/ngspice/complex.h +++ b/src/include/ngspice/complex.h @@ -69,17 +69,17 @@ typedef struct { #endif /* Some defines used mainly in cmath.c. */ -#define cph(c) (atan2(imagpart(c), (realpart(c)))) -#define cmag(c) (hypot(realpart(c), imagpart(c))) +#define cph(c) (atan2(imagpart(c), (realpart(c)))) +#define cmag(c) (hypot(realpart(c), imagpart(c))) #define radtodeg(c) (cx_degrees ? ((c) * (180 / M_PI)) : (c)) #define degtorad(c) (cx_degrees ? ((c) * (M_PI / 180)) : (c)) -#define rcheck(cond, name) if (!(cond)) { \ - fprintf(cp_err, "Error: argument out of range for %s\n", name); \ - return (NULL); } -#define rcheckn(cond, name, clean) if (!(cond)) { \ - fprintf(cp_err, "Error: argument out of range for %s\n", name); \ - tfree(clean); \ - return (NULL); } +#define rcheck(cond, name)\ + if (!(cond)) {\ + (void) fprintf(cp_err, "Error: argument out of range for %s\n",\ + name);\ + xrc = -1;\ + goto EXITPOINT;\ + } #define cdiv(r1, i1, r2, i2, r3, i3) \ { \ diff --git a/src/include/ngspice/cpdefs.h b/src/include/ngspice/cpdefs.h index a29190288..9ee8f75fa 100644 --- a/src/include/ngspice/cpdefs.h +++ b/src/include/ngspice/cpdefs.h @@ -41,7 +41,7 @@ struct comm { int co_maxargs; /* The fn that prompts the user. */ - void (*co_argfn) (const wordlist *wl, const struct comm *command); + void (*co_argfn)(const wordlist *wl, const struct comm *command); /* When these are printed, printf(string, av[0]) .. */ char *co_help; diff --git a/src/include/ngspice/cpstd.h b/src/include/ngspice/cpstd.h index aab9409f9..b5e973000 100644 --- a/src/include/ngspice/cpstd.h +++ b/src/include/ngspice/cpstd.h @@ -26,7 +26,6 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group /* Externs defined in std.c */ -extern char *tildexpand(const char *string); extern void printnum(char *buf, double num); int printnum_ds(DSTRING *p_ds, double num); extern int cp_numdgt; diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index 49704ab07..ead0d29dd 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -55,15 +55,15 @@ typedef struct SPICEdev { /* routine to input a paramater to a model */ int (*DEVload)(GENmodel*,CKTcircuit*); /* routine to load the device into the matrix */ - int (*DEVsetup)(SMPmatrix*,GENmodel*,CKTcircuit*,int*); + int (*DEVsetup)(SMPmatrix *, GENmodel *, CKTcircuit *, int *); /* setup routine to preprocess devices once before soloution begins */ int (*DEVunsetup)(GENmodel*,CKTcircuit*); /* clean up before running again */ - int (*DEVpzSetup)(SMPmatrix*,GENmodel*,CKTcircuit*,int*); + int (*DEVpzSetup)(SMPmatrix *, GENmodel *, CKTcircuit *, int *); /* setup routine to process devices specially for pz analysis */ - int (*DEVtemperature)(GENmodel*,CKTcircuit*); + int (*DEVtemperature)(GENmodel*,CKTcircuit*); /* subroutine to do temperature dependent setup processing */ - int (*DEVtrunc)(GENmodel*,CKTcircuit*,double*); + int (*DEVtrunc)(GENmodel*,CKTcircuit*,double*); /* subroutine to perform truncation error calc. */ int (*DEVfindBranch)(CKTcircuit*,GENmodel*,IFuid); /* subroutine to search for device branch eq.s */ diff --git a/src/include/ngspice/ftedev.h b/src/include/ngspice/ftedev.h index 530f497ac..1dbba6194 100644 --- a/src/include/ngspice/ftedev.h +++ b/src/include/ngspice/ftedev.h @@ -10,6 +10,9 @@ Author: 1987 Jeffrey M. Hsu #ifndef ngspice_FTEDEV_H #define ngspice_FTEDEV_H +#include "ngspice/bool.h" +#include "ngspice/typedefs.h" + struct graph; struct request; struct response; @@ -20,11 +23,11 @@ typedef int disp_fn_Close_t (void); typedef int disp_fn_Clear_t (void); typedef int disp_fn_DrawLine_t (int x1, int y1, int x2, int y2, bool isgrid); typedef int disp_fn_Arc_t (int x0, int y0, int radius, double theta, double delta_theta); -typedef int disp_fn_Text_t (char *text, int x, int y, int angle); +typedef int disp_fn_Text_t (const char *text, int x, int y, int angle); typedef int disp_fn_DefineColor_t (int colorid, double red, double green, double blue); typedef int disp_fn_DefineLinestyle_t (int linestyleid, int mask); typedef int disp_fn_SetLinestyle_t (int linestyleid); -typedef int disp_fn_SetColor_t (int colorid, GRAPH *graf); +typedef int disp_fn_SetColor_t (int colorid); typedef int disp_fn_Update_t (void); typedef int disp_fn_Track_t (void); typedef int disp_fn_MakeMenu_t (void); diff --git a/src/include/ngspice/mifproto.h b/src/include/ngspice/mifproto.h index 192044193..722e4b633 100644 --- a/src/include/ngspice/mifproto.h +++ b/src/include/ngspice/mifproto.h @@ -155,4 +155,8 @@ extern Mif_Cntl_Src_Type_t MIFget_cntl_src_type( extern char *MIFcopy(char *); +#ifndef CM_IGNORE +#define CM_IGNORE(x) (void) (x) #endif + +#endif /* include guard */ diff --git a/src/xspice/icm/xtraevt/real/udnfunc.c b/src/xspice/icm/xtraevt/real/udnfunc.c index df8d040a1..b9f5f2250 100644 --- a/src/xspice/icm/xtraevt/real/udnfunc.c +++ b/src/xspice/icm/xtraevt/real/udnfunc.c @@ -43,10 +43,9 @@ NON-STANDARD FEATURES #include "ngspice/cm.h" #include "ngspice/evtudn.h" +#include "ngspice/memory.h" -void *tmalloc(size_t); -#define TMALLOC(t,n) (t*) tmalloc(sizeof(t) * (size_t)(n)) /* macro to ignore unused variables and parameters */ #define NG_IGNORE(x) (void)x