diff options
| author | Vlad Vissoultchev <wqweto@gmail.com> | 2016-04-13 14:32:51 +0300 |
|---|---|---|
| committer | Vlad Vissoultchev <wqweto@gmail.com> | 2016-04-13 14:33:21 +0300 |
| commit | 34feee0ed6879a9c28e8f82fde932eb6b20d79d5 (patch) | |
| tree | c8b17f67befaace812f15d4d15640168a4f12e00 | |
| parent | cb5f6b063b2b75e29f91fc1a523372bf48ae8bff (diff) | |
| download | tinycc-34feee0ed6879a9c28e8f82fde932eb6b20d79d5.tar.gz tinycc-34feee0ed6879a9c28e8f82fde932eb6b20d79d5.tar.bz2 | |
Move utility functions `trimfront/back` to tccpp.c
These are used in `libtcc.c` now and cannot remain in `tccpe.c`
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | tcc.h | 2 | ||||
| -rw-r--r-- | tccpe.c | 16 | ||||
| -rw-r--r-- | tccpp.c | 15 |
4 files changed, 18 insertions, 19 deletions
@@ -69,6 +69,4 @@ tiny_libmaker *~ \#* .#* -win32/include/* -win32/lib/* -win32/vs2015/* +win32/* @@ -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 ------------ */ @@ -1564,22 +1564,6 @@ quit: } /* ------------------------------------------------------------- */ -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) { int state = 0, ret = -1, dllindex = 0, ord; @@ -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; +} |
