(int) cast the return value of some strlen() invocations

This commit is contained in:
rlar 2010-11-06 16:54:11 +00:00
parent 927470e12f
commit 5f4b0aa798
7 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2010-11-06 Robert Larice
* src/frontend/plotting/agraf.c ,
* src/frontend/plotting/graf.c ,
* src/frontend/plotting/grid.c ,
* src/misc/dstring.c ,
* src/spicelib/parser/inp2r.c ,
* src/spicelib/parser/inpgmod.c :
(int) cast the return value of some strlen() invocations
2010-11-06 Robert Larice
* src/frontend/subckt.c ,
* src/spicelib/parser/inppas2.c :

View File

@ -50,7 +50,7 @@ ft_agraf(double *xlims, double *ylims, struct dvec *xscale, struct plot *plot, s
* We assumed it was 2. If it's more, shift starting position over.
*/
sprintf(buf, "%1.1e", 0.0); /* expect 0.0e+00 */
shift = strlen(buf) - 7;
shift = (int) strlen(buf) - 7;
margin += shift;
/* Make sure the margin is correct */

View File

@ -868,7 +868,7 @@ getitright(char *buf, double num)
if (p) {
return p - 4;
} else {
k = strlen(buf);
k = (int) strlen(buf);
if (k > 8)
return buf + 4;
else /* k >= 4 */

View File

@ -1166,7 +1166,7 @@ drawsmithgrid(GRAPH *graph)
ir[k] = pixperunit * (1 + cos(dphi[k])) / sin(dphi[k]);
rr[k] = pixperunit * 0.5 * (((1 - rnorm[k]) / (1 + rnorm[k])) + 1);
(void) sprintf(plab, "%g", rnorm[k]);
plen = strlen(plab);
plen = (int) strlen(plab);
/* See if the label will fit on the upper xaxis */
/* wait for some k, so we don't get fooled */

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.4 2010-10-28 19:32:34 rlar
REVISIONS: Revision 1.5 2010-11-06 16:54:11 rlar
REVISIONS: (int) cast the return value of some strlen() invocations
REVISIONS:
REVISIONS: Revision 1.4 2010/10/28 19:32:34 rlar
REVISIONS: wrap tmalloc MALLOC etc, into two macros TMALLOC and TREALLOC
REVISIONS:
REVISIONS: Revision 1.3 2010/10/09 11:42:10 rlar
@ -82,7 +85,7 @@ char *spice_dstring_append(SPICE_DSTRINGPTR dsPtr,char *string,int length)
char *end ; /* end of string */
if( length < 0){
length = strlen(string) ;
length = (int) strlen(string) ;
}
newSize = length + dsPtr->length ;
@ -242,7 +245,7 @@ char *spice_dstring_print( SPICE_DSTRINGPTR dsPtr,char *format, ... )
va_start( args, format ) ;
if( format ){
vsprintf( buffer + orig_length, format, args ) ;
dsPtr->length = strlen( buffer ) ;
dsPtr->length = (int) strlen(buffer) ;
} else {
buffer = NULL ;
}

View File

@ -124,7 +124,7 @@ void INP2R(CKTcircuit *ckt, INPtables * tab, card * current)
so now we splice in a "tc2=" at the location remembered above. */
/* first alocate memory for the new longer line */
i = strlen(current->line); /* length of existing line */
i = (int) strlen(current->line); /* length of existing line */
line = TMALLOC(char, i + 4 + 1); /* alocate enough for "tc2=" & terminating NULL */
if(line == NULL) {
/* failed to allocate memory so we recover rather crudely

View File

@ -468,7 +468,7 @@ INPfindCard( char *name, IFcardInfo *table[], int numCards )
int best;
int length;
length = strlen(name);
length = (int) strlen(name);
/* compare all the names in the card table to this name */
best = E_MISSING;
@ -496,7 +496,7 @@ INPfindParm( char *name, IFparm *table, int numParms )
int id, bestId;
int length;
length = strlen(name);
length = (int) strlen(name);
/* compare all the names in the parameter table to this name */
best = E_MISSING;