diff --git a/ChangeLog b/ChangeLog index dd0d2fc8a..3fc17062f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-02-13 Holger Vogt + * icm/dllmain.c, evtload.c, ngspice.h, terminal.c, evaluate.c, twomesh.c, + tclspice.c, conf.h, conf.c: patches by R. Larice 100213 + 2010-02-11 Holger Vogt * terminal.h, cpextern.h: use format (__printf__, 1, 2) * pzan.c, nipzmeth.c, cktpzstr.c, macros.h: remove conflicting macro definition diff --git a/src/ciderlib/twod/twomesh.c b/src/ciderlib/twod/twomesh.c index ef63076c2..4448b8409 100644 --- a/src/ciderlib/twod/twomesh.c +++ b/src/ciderlib/twod/twomesh.c @@ -101,34 +101,34 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain, interiorNode = TRUE; if (xIndex > 1) { pNode1 = nodeArray[xIndex - 1][yIndex]; - if (pNode1->nodeType != NULL + if (pNode1->nodeType != 0 && pNode1->nodeType != CONTACT) { interiorNode = FALSE; } } if (interiorNode && xIndex < numXNodes) { pNode1 = nodeArray[xIndex + 1][yIndex]; - if (pNode1->nodeType != NULL + if (pNode1->nodeType != 0 && pNode1->nodeType != CONTACT) { interiorNode = FALSE; } } if (interiorNode && yIndex > 1) { pNode1 = nodeArray[xIndex][yIndex - 1]; - if (pNode1->nodeType != NULL + if (pNode1->nodeType != 0 && pNode1->nodeType != CONTACT) { interiorNode = FALSE; } } if (interiorNode && yIndex < numYNodes) { pNode1 = nodeArray[xIndex][yIndex + 1]; - if (pNode1->nodeType != NULL + if (pNode1->nodeType != 0 && pNode1->nodeType != CONTACT) { interiorNode = FALSE; } } if (interiorNode) { - pNode->nodeType = NULL; + pNode->nodeType = 0; } } } @@ -139,7 +139,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain, for (yIndex = 1; yIndex <= numYNodes; yIndex++) { for (xIndex = 1; xIndex <= numXNodes; xIndex++) { pNode = nodeArray[xIndex][yIndex]; - if (pNode->nodeType == NULL) { + if (pNode->nodeType == 0) { /* This node doesn't belong to a domain so delete it. */ nodeArray[xIndex][yIndex] = NIL(TWOnode); FREE(pNode); diff --git a/src/conf.c b/src/conf.c index 571ad7a32..4906aaf63 100644 --- a/src/conf.c +++ b/src/conf.c @@ -11,12 +11,12 @@ #define BUG_ADDRESS "ngspice-bugs@lists.sourceforge.net" #endif -char Spice_Version[] = PACKAGE_VERSION; -char Spice_Notice[] = "Please submit bug-reports to: " BUG_ADDRESS; +char *Spice_Version = PACKAGE_VERSION; +char *Spice_Notice = "Please submit bug-reports to: " BUG_ADDRESS; #ifndef _MSC_VER -char Spice_Build_Date[] = NGSPICEBUILDDATE; +char *Spice_Build_Date = NGSPICEBUILDDATE; #else -char Spice_Build_Date[] = __DATE__" "__TIME__; +char *Spice_Build_Date = __DATE__" "__TIME__; #endif char *Spice_Exec_Dir = NGSPICEBINDIR; diff --git a/src/conf.h b/src/conf.h index 31619949f..4e6f59489 100644 --- a/src/conf.h +++ b/src/conf.h @@ -1,9 +1,9 @@ #ifndef __CONF_H #define __CONF_H -extern char Spice_Version[]; -extern char Spice_Notice[]; -extern char Spice_Build_Date[]; +extern char *Spice_Version; +extern char *Spice_Notice; +extern char *Spice_Build_Date; extern char *Spice_Exec_Dir; extern char *Spice_Lib_Dir; extern char *Def_Editor; diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index f0cc20255..689e797b0 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -7,10 +7,11 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group * Convert a parse tree to a list of data vectors. */ +#include + #include #include -#include #include #include diff --git a/src/frontend/terminal.c b/src/frontend/terminal.c index f8bb3aa33..c29c62d21 100644 --- a/src/frontend/terminal.c +++ b/src/frontend/terminal.c @@ -41,7 +41,6 @@ $Id$ #include #endif -#include "ngspice.h" #include #include "variable.h" diff --git a/src/include/ngspice.h b/src/include/ngspice.h index 5096fe44e..5af600dae 100644 --- a/src/include/ngspice.h +++ b/src/include/ngspice.h @@ -13,7 +13,9 @@ * This file will eventually replace spice.h and lots of other * files in src/include */ -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif #include "config.h" #include diff --git a/src/tclspice.c b/src/tclspice.c index a92501e1d..4b6de16ee 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -86,8 +86,6 @@ typedef pthread_t threadId_t; #include /* usleep */ #endif /* __MINGW32__ */ -#define _GNU_SOURCE - #include #include #include diff --git a/src/xspice/evt/evtload.c b/src/xspice/evt/evtload.c index 606ec4cf2..c16799ab4 100755 --- a/src/xspice/evt/evtload.c +++ b/src/xspice/evt/evtload.c @@ -325,7 +325,6 @@ static void EVTcreate_state( CKTcircuit *ckt, /* The circuit structure */ int inst_index) /* The instance to create state for */ { - int i; int total_size; Evt_State_Data_t *state_data; @@ -333,10 +332,6 @@ static void EVTcreate_state( Evt_State_t *new_state; Evt_State_t *prev_state; - char *from; - char *to; - - /* Get variables for fast access */ state_data = ckt->evt->data.state; @@ -369,10 +364,7 @@ static void EVTcreate_state( state_data->tail[inst_index] = &(prev_state->next); /* Copy the old state to the new state and set the step */ - from = prev_state->block; - to = new_state->block; - for(i = 0; i < total_size; i++) - to[i] = from[i]; + memcpy(new_state->block, prev_state->block, total_size); new_state->step = g_mif_info.circuit.evt_step; /* Mark that the state data on the instance has been modified */ diff --git a/src/xspice/icm/dlmain.c b/src/xspice/icm/dlmain.c index 5e7ac9136..7455abdcd 100644 --- a/src/xspice/icm/dlmain.c +++ b/src/xspice/icm/dlmain.c @@ -369,14 +369,14 @@ void free_pj(void *ptr) { (coreitf->dllitf_free_pj)(ptr); } -char * tmalloc(int s) { +void * tmalloc(size_t s) { return (coreitf->dllitf_tmalloc)(s); } -char * trealloc(char *ptr, int s) { +void * trealloc(void *ptr, size_t s) { return (coreitf->dllitf_trealloc)(ptr,s); } -void txfree(char *ptr) { +void txfree(void *ptr) { (coreitf->dllitf_txfree)(ptr); }