Code clean up (removed some warning)

This commit is contained in:
pnenzi 2001-02-09 13:27:21 +00:00
parent d735c9a871
commit 6f55975cc0
8 changed files with 25 additions and 11 deletions

View File

@ -3,10 +3,10 @@
#include <bool.h>
#include <wordlist.h>
#include <inpdefs.h>
#include "circuits.h"
#include "com_dump.h"
#include "streams.h"
#include "fteext.h"
void

View File

@ -8,6 +8,7 @@
#include "com_help.h"
#include "variable.h"
#include "streams.h"
#include "cpextern.h"
void
com_ghelp(wordlist *wl)

View File

@ -11,6 +11,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "control.h"
#include "com_cdump.h"
#include "variable.h"
#include "fteext.h"
/* Return values from doblock(). I am assuming that nobody will use
* these characters in a string. */
@ -184,7 +186,7 @@ docommand(wordlist *wlist)
nargs++;
if (command->co_stringargs) {
lcom = wl_flatten(wlist->wl_next);
(*command->co_func) (lcom);
(*command->co_func) ((void *)(lcom));
} else {
if (nargs < command->co_minargs) {
if (command->co_argfn) {
@ -242,7 +244,7 @@ doblock(struct control *bl, int *num)
switch (bl->co_type) {
case CO_WHILE:
while (bl->co_cond && cp_isTRUE(bl->co_cond)) {
while (bl->co_cond && cp_istrue(bl->co_cond)) {
for (ch = bl->co_children; ch; ch = cn) {
cn = ch->co_next;
i = doblock(ch, &nn);
@ -310,7 +312,7 @@ doblock(struct control *bl, int *num)
return (i);
}
}
} while (bl->co_cond && cp_isTRUE(bl->co_cond));
} while (bl->co_cond && cp_istrue(bl->co_cond));
break;
case CO_REPEAT:
@ -353,7 +355,7 @@ doblock(struct control *bl, int *num)
break;
case CO_IF:
if (bl->co_cond && cp_isTRUE(bl->co_cond)) {
if (bl->co_cond && cp_istrue(bl->co_cond)) {
for (ch = bl->co_children; ch; ch = cn) {
cn = ch->co_next;
i = doblock(ch, &nn);

View File

@ -266,7 +266,7 @@ ft_substdef(char *name, struct pnode *args)
struct udfunc *udf;
struct pnode *tp;
char *s;
int arity = 0, rarity;
int arity = 0, rarity = 0;
bool found = FALSE;
if (args)

View File

@ -9,6 +9,7 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* can be written for every possible machine...
*/
#include <config.h>
#include <term.h>
#ifdef HAVE_SGTTY_H
#include <sgtty.h>

View File

@ -15,6 +15,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include <cpdefs.h>
#include <memory.h>
#include <inpdefs.h>
#include <fteext.h>
#include "circuits.h"
#include "com_history.h"
@ -390,9 +391,12 @@ cp_remvar(char *varname)
cp_nonomatch = FALSE;
else if (eq(varname, "noclobber"))
cp_noclobber = FALSE;
else if (eq(varname, "prompt"))
else if (eq(varname, "prompt")){
/* cp_promptstring = ""; Memory leak here the last allocated reference wil be lost*/
if(cp_promptstring)strcpy(cp_promptstring,"");/*DG avoid memory leak*/
if(cp_promptstring) {
strcpy(cp_promptstring,"");/*DG avoid memory leak*/
}
}
else if (eq(varname, "cpdebug"))
cp_debug = FALSE;
else if (eq(varname, "ignoreeof"))

View File

@ -171,7 +171,7 @@ extern bool cp_getvar(char *name, int type, void *retval);
/* cpinterface.c etc -- stuff CP needs from FTE */
extern bool cp_istrue();
extern bool cp_istrue(wordlist *wl);
extern bool cp_oddcomm();
extern void cp_doquit();
extern void cp_periodic();

View File

@ -4,6 +4,7 @@ Copyright 1991 Regents of the University of California. All rights reserved.
#include "ngspice.h"
#include "ivars.h"
#include <stdlib.h>
#include <stdio.h>
char *Spice_Path;
@ -37,7 +38,9 @@ mkvar(char **p, char *path_prefix, char *var_dir, char *env_var)
void
ivars(void)
{
char *temp;
env_overr(&Spice_Exec_Dir, "SPICE_EXEC_DIR");
env_overr(&Spice_Lib_Dir, "SPICE_LIB_DIR");
@ -50,7 +53,10 @@ ivars(void)
env_overr(&Spice_Host, "SPICE_HOST");
env_overr(&Bug_Addr, "SPICE_BUGADDR");
env_overr(&Def_Editor, "SPICE_EDITOR");
env_overr(&AsciiRawFile, "SPICE_ASCIIRAWFILE");
env_overr(&temp, "SPICE_ASCIIRAWFILE");
AsciiRawFile = atoi(temp);
}
void