remove #define for EOS use '\0' instead

This commit is contained in:
rlar 2010-10-09 11:42:10 +00:00
parent cf3514b9ae
commit 5bc8777a9b
5 changed files with 19 additions and 14 deletions

View File

@ -1,3 +1,10 @@
2010-10-09 Robert Larice
* src/frontend/measure.c ,
* src/frontend/numparam/mystring.c ,
* src/include/dstring.h ,
* src/misc/dstring.c :
remove #define for EOS use '\0' instead
2010-10-09 Robert Larice
* src/frontend/terminal.c ,
* src/include/complex.h ,

View File

@ -21,8 +21,6 @@
#include "error.h" /* controlled_exit() */
#define EOS '\0'
static wordlist *measure_parse_line( char *line ) ;
static bool measure_valid[20000];/* TRUE: if measurement no. [xxx] has been done successfully
@ -264,7 +262,7 @@ do_measure(
/* New way of processing measure statements using common code
in fcn get_measure2() (com_measure2.c)*/
out_line[0] = EOS ;
out_line[0] = '\0' ;
measure_word_list = measure_parse_line( meas_card->li_line) ;
if( measure_word_list ){
fail = get_measure2(measure_word_list,&result,out_line,chk_only) ;

View File

@ -22,8 +22,6 @@
#include "../error.h" /* controlled_exit() */
#define EOS '\0'
/***** primitive input-output ***/
int
@ -347,7 +345,7 @@ pscopy (SPICE_DSTRINGPTR dstr_p, char *t, int start, int leng)
s_p = spice_dstring_value(dstr_p) ;
for (i = 0; i < leng; i++)
s_p[i] = t[start + i];
s_p[leng] = EOS ;
s_p[leng] = '\0' ;
} else {
s_p = spice_dstring_reinit(dstr_p) ;
}
@ -373,7 +371,7 @@ pscopy_up (SPICE_DSTRINGPTR dstr_p, char *t, int start, int leng)
s_p = spice_dstring_value(dstr_p) ;
for (i = 0; i < leng; i++)
s_p[i] = upcase ( t[start + i] ) ;
s_p[leng] = EOS ;
s_p[leng] = '\0' ;
} else {
s_p = spice_dstring_reinit(dstr_p) ;
}

View File

@ -3,7 +3,6 @@
#ifndef DSTRING_H
#define DSTRING_H
#define EOS '\0'
/* -----------------------------------------------------------------
* This structure is modified from Tcl. We do this to avoid a
* conflict and later add a conditional compile to just use the Tcl

View File

@ -4,7 +4,10 @@ DESCRIPTION:This file contains the routines for manipulating dynamic strings.
CONTENTS:
DATE: Wed Mar 24 18:38:28 CDT 2010
REVISIONS: $Log$
REVISIONS: Revision 1.2 2010-07-01 19:52:26 rlar
REVISIONS: Revision 1.3 2010-10-09 11:42:10 rlar
REVISIONS: remove #define for EOS use '\0' instead
REVISIONS:
REVISIONS: Revision 1.2 2010/07/01 19:52:26 rlar
REVISIONS: cast the return values of malloc() function calls
REVISIONS:
REVISIONS: Revision 1.1 2010/03/25 22:44:38 dwarning
@ -43,7 +46,7 @@ void spice_dstring_init(SPICE_DSTRINGPTR dsPtr)
dsPtr->string = dsPtr->staticSpace ;
dsPtr->length = 0 ;
dsPtr->spaceAvl = SPICE_DSTRING_STATIC_SIZE ;
dsPtr->staticSpace[0] = EOS;
dsPtr->staticSpace[0] = '\0';
} /* end spice_dstring_init() */
/*
@ -103,7 +106,7 @@ char *spice_dstring_append(SPICE_DSTRINGPTR dsPtr,char *string,int length)
string < end; string++, dst++) {
*dst = *string ;
}
*dst = EOS ;
*dst = '\0' ;
dsPtr->length += length ;
return(dsPtr->string) ;
@ -119,7 +122,7 @@ char *spice_dstring_append_char( SPICE_DSTRINGPTR dstr_p, char c)
char *val_p ; /* return value */
tmp_str[0] = c ;
tmp_str[1] = EOS ;
tmp_str[1] = '\0' ;
val_p = spice_dstring_append( dstr_p, tmp_str, -1 ) ;
return(val_p) ;
} /* end spice_dstring_append_char() */
@ -319,7 +322,7 @@ char *spice_dstring_setlength(SPICE_DSTRINGPTR dsPtr,int length)
char *str_p ; /* newly create string */
str_p = _spice_dstring_setlength( dsPtr,length) ;
str_p[length] = EOS ;
str_p[length] = '\0' ;
return( str_p ) ;
} /* end spice_dstring_setlength() */
@ -350,6 +353,6 @@ void spice_dstring_free(SPICE_DSTRINGPTR dsPtr)
dsPtr->string = dsPtr->staticSpace ;
dsPtr->length = 0 ;
dsPtr->spaceAvl = SPICE_DSTRING_STATIC_SIZE;
dsPtr->staticSpace[0] = EOS ;
dsPtr->staticSpace[0] = '\0' ;
} /* end spice_dstring_free() */