const'ify some 'skip'ing functions
This commit is contained in:
parent
45ad60b738
commit
7a42510cc0
|
|
@ -241,7 +241,7 @@ extern double x_atanh(double);
|
|||
extern char *gettok_noparens(char **s);
|
||||
extern char *gettok_node(char **s);
|
||||
extern char *gettok_iv(char **s);
|
||||
extern char *nexttok(char *s);
|
||||
extern char *nexttok(const char *s);
|
||||
extern int get_l_paren(char **s);
|
||||
extern int get_r_paren(char **s);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef ngspice_STRINGSKIP_H
|
||||
#define ngspice_STRINGSKIP_H
|
||||
|
||||
static inline char *skip_non_ws(char *s) { while (*s && !isspace_c(*s)) s++; return s; }
|
||||
static inline char *skip_ws(char *s) { while ( isspace_c(*s)) s++; return s; }
|
||||
static inline char *skip_non_ws(const char *s) { while (*s && !isspace_c(*s)) s++; return (char *) s; }
|
||||
static inline char *skip_ws(const char *s) { while ( isspace_c(*s)) s++; return (char *) s; }
|
||||
|
||||
static inline char *depreciated_skip_back_non_ws(char *s) { while (s[-1] && !isspace_c(s[-1])) s--; return s; }
|
||||
static inline char *depreciated_skip_back_ws(char *s) { while (isspace_c(s[-1])) s--; return s; }
|
||||
|
||||
static inline char *skip_back_non_ws(char *s, char *start) { while (s > start && !isspace_c(s[-1])) s--; return s; }
|
||||
static inline char *skip_back_ws(char *s, char *start) { while (s > start && isspace_c(s[-1])) s--; return s; }
|
||||
static inline char *skip_back_non_ws(const char *s, const char *start) { while (s > start && !isspace_c(s[-1])) s--; return (char *) s; }
|
||||
static inline char *skip_back_ws(const char *s, const char *start) { while (s > start && isspace_c(s[-1])) s--; return (char *) s; }
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ gettok(char **s)
|
|||
* you have parens or commas anywhere in the nodelist.
|
||||
*-------------------------------------------------------------------------*/
|
||||
char *
|
||||
nexttok(char *s)
|
||||
nexttok(const char *s)
|
||||
{
|
||||
int paren = 0;
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ nexttok(char *s)
|
|||
while (isspace_c(*s) || *s == ',')
|
||||
s++;
|
||||
|
||||
return s;
|
||||
return (char *) s;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue