const'ify some 'skip'ing functions

This commit is contained in:
rlar 2016-11-01 11:30:08 +01:00
parent 45ad60b738
commit 7a42510cc0
3 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;
}