From d50ffdd987d69365334876658ff9a396962690e1 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 6 Aug 2012 19:50:23 +0200 Subject: [PATCH] swallow warnings --- src/frontend/spiceif.c | 12 ++++++------ src/main.c | 4 ++-- src/misc/string.c | 8 ++++++-- src/spicelib/devices/asrc/asrcdest.c | 1 + 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index f8cd4ad90..f87c93c1d 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -1491,8 +1491,8 @@ do {\ if(__i) {\ if(name)\ tfree(name);\ - name = (type *)tmalloc(__i);\ - fread(name,1,__i,file);\ + name = (type *)tmalloc((size_t) __i);\ + fread(name,1,(size_t) __i,file);\ } else {\ fprintf(cp_err, "size for vector " #name " is 0\n");\ }\ @@ -1642,9 +1642,9 @@ void com_savesnap(wordlist *wl) do {\ int __i;\ if(name) {\ - __i = (num) * sizeof(type); fwrite(&__i,sizeof(int),1,file);\ + __i = (num) * (int)sizeof(type); fwrite(&__i,sizeof(int),1,file);\ if((num))\ - fwrite(name,sizeof(type),(num),file);\ + fwrite(name,sizeof(type),(size_t)(num),file);\ } else {\ __i = 0;\ fprintf(cp_err,#name " is NULL, zero written\n");\ @@ -1704,7 +1704,7 @@ void com_savesnap(wordlist *wl) /* now save the TSK struct, ft_curckt->ci_curTask*/ _foo(task,TSKtask,1); - _foo(task->TSKname,char,(strlen(task->TSKname)+1)); + _foo(task->TSKname,char,((int)strlen(task->TSKname)+1)); /* now save the JOB struct task->jobs */ /* lol, only allow one job, tough! */ @@ -1712,7 +1712,7 @@ void com_savesnap(wordlist *wl) _foo(task->jobs,TRANan,1); - _foo(task->jobs->JOBname,char,(strlen(task->jobs->JOBname)+1)); + _foo(task->jobs->JOBname,char,((int)strlen(task->jobs->JOBname)+1)); /* Finally the stats */ diff --git a/src/main.c b/src/main.c index fe6650090..eb5b5c292 100644 --- a/src/main.c +++ b/src/main.c @@ -353,8 +353,8 @@ if_getstat(CKTcircuit *ckt, char *name) return (NULL); } -void com_loadsnap(wordlist *wl) { return; } -void com_savesnap(wordlist *wl) { return; } +void com_loadsnap(wordlist *wl) { NG_IGNORE(wl); } +void com_savesnap(wordlist *wl) { NG_IGNORE(wl); } void SMPprint( SMPmatrix *n1 , char *n2) { diff --git a/src/misc/string.c b/src/misc/string.c index cef2acc75..56412e24a 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -387,8 +387,12 @@ gettok_char(char **s, char p, bool inc_p, bool nested) char q; int count = 0; /* find opening bracket */ - if (( p == '}' ) || ( p == ']' )) q = p - 2; - else q = p - 1; + if ( p == '}' ) + q = '{'; + else if(p == ']' ) + q = '['; + else + q = '('; /* add string in front of q, excluding q */ while ((c = **s) != '\0' && ( **s != q )) { spice_dstring_append_char( &buf, *(*s)++ ) ; diff --git a/src/spicelib/devices/asrc/asrcdest.c b/src/spicelib/devices/asrc/asrcdest.c index 26f08ffad..c90ca427b 100644 --- a/src/spicelib/devices/asrc/asrcdest.c +++ b/src/spicelib/devices/asrc/asrcdest.c @@ -6,6 +6,7 @@ Author: 1987 Kanwar Jit Singh #include "ngspice/ngspice.h" #include "asrcdefs.h" #include "ngspice/suffix.h" +#include "ngspice/inpdefs.h" void ASRCdestroy(GENmodel **model)