Browse Source

Code clean up (removed some warning)

pre-master-46
pnenzi 25 years ago
parent
commit
6f55975cc0
  1. 2
      src/frontend/com_dump.c
  2. 1
      src/frontend/com_ghelp.c
  3. 10
      src/frontend/control.c
  4. 2
      src/frontend/define.c
  5. 1
      src/frontend/terminal.c
  6. 8
      src/frontend/variable.c
  7. 2
      src/include/cpextern.h
  8. 10
      src/misc/ivars.c

2
src/frontend/com_dump.c

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

1
src/frontend/com_ghelp.c

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

10
src/frontend/control.c

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

2
src/frontend/define.c

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

1
src/frontend/terminal.c

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

8
src/frontend/variable.c

@ -15,6 +15,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include <cpdefs.h> #include <cpdefs.h>
#include <memory.h> #include <memory.h>
#include <inpdefs.h> #include <inpdefs.h>
#include <fteext.h>
#include "circuits.h" #include "circuits.h"
#include "com_history.h" #include "com_history.h"
@ -390,9 +391,12 @@ cp_remvar(char *varname)
cp_nonomatch = FALSE; cp_nonomatch = FALSE;
else if (eq(varname, "noclobber")) else if (eq(varname, "noclobber"))
cp_noclobber = FALSE; 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*/ /* 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")) else if (eq(varname, "cpdebug"))
cp_debug = FALSE; cp_debug = FALSE;
else if (eq(varname, "ignoreeof")) else if (eq(varname, "ignoreeof"))

2
src/include/cpextern.h

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

10
src/misc/ivars.c

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

Loading…
Cancel
Save