mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
Move utility functions trimfront/back
to tccpp.c
These are used in `libtcc.c` now and cannot remain in `tccpe.c`
This commit is contained in:
parent
cb5f6b063b
commit
34feee0ed6
4
.gitignore
vendored
4
.gitignore
vendored
@ -69,6 +69,4 @@ tiny_libmaker
|
||||
*~
|
||||
\#*
|
||||
.#*
|
||||
win32/include/*
|
||||
win32/lib/*
|
||||
win32/vs2015/*
|
||||
win32/*
|
||||
|
2
tcc.h
2
tcc.h
@ -1263,6 +1263,8 @@ ST_FUNC void preprocess_delete(void);
|
||||
ST_FUNC int tcc_preprocess(TCCState *s1);
|
||||
ST_FUNC void skip(int c);
|
||||
ST_FUNC NORETURN void expect(const char *msg);
|
||||
ST_FUNC char *trimfront(char *p);
|
||||
ST_FUNC char *trimback(char *a, char *e);
|
||||
|
||||
/* ------------ tccgen.c ------------ */
|
||||
|
||||
|
16
tccpe.c
16
tccpe.c
@ -1563,22 +1563,6 @@ quit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
static char *trimfront(char *p)
|
||||
{
|
||||
while (*p && (unsigned char)*p <= ' ')
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
|
||||
static char *trimback(char *a, char *e)
|
||||
{
|
||||
while (e > a && (unsigned char)e[-1] <= ' ')
|
||||
--e;
|
||||
*e = 0;;
|
||||
return a;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
static int pe_load_def(TCCState *s1, int fd)
|
||||
{
|
||||
|
15
tccpp.c
15
tccpp.c
@ -3490,3 +3490,18 @@ ST_FUNC int tcc_preprocess(TCCState *s1)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ST_FUNC char *trimfront(char *p)
|
||||
{
|
||||
while (*p && (unsigned char)*p <= ' ')
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
|
||||
ST_FUNC char *trimback(char *a, char *e)
|
||||
{
|
||||
while (e > a && (unsigned char)e[-1] <= ' ')
|
||||
--e;
|
||||
*e = 0;;
|
||||
return a;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user