History

Move utility functions `trimfront/back` to tccpp.c

These are used in `libtcc.c` now and cannot remain in `tccpe.c`

Vlad Vissoultchev committed 10 years ago

Commit 34feee01 parent cb5f6b04 files · +18 −19Browse files

Unified · Split

4 files
  1. .gitignore +1 −3
  2. tcc.h +2 −0
  3. tccpe.c +0 −16
  4. tccpp.c +15 −0
.gitignore+1−3
@@ -69,6 +69,4 @@ tiny_libmaker · 68 unmodified lines
6969 *~
7070 \#*
7171 .#*
72−win32/include/*
73−win32/lib/*
74−win32/vs2015/*
72+win32/*
tcc.h+2−0
@@ -1263,6 +1263,8 @@ ST_FUNC void preprocess_delete(void); · 1262 unmodified lines
12631263 ST_FUNC int tcc_preprocess(TCCState *s1);
12641264 ST_FUNC void skip(int c);
12651265 ST_FUNC NORETURN void expect(const char *msg);
1266+ST_FUNC char *trimfront(char *p);
1267+ST_FUNC char *trimback(char *a, char *e);
12661268
12671269 /* ------------ tccgen.c ------------ */
12681270
tccpe.c+0−16
@@ -1563,22 +1563,6 @@ quit: · 1562 unmodified lines
15631563 return ret;
15641564 }
15651565
1566−/* ------------------------------------------------------------- */
1567−static char *trimfront(char *p)
1568−{
1569− while (*p && (unsigned char)*p <= ' ')
1570− ++p;
1571− return p;
1572−}
1573−
1574−static char *trimback(char *a, char *e)
1575−{
1576− while (e > a && (unsigned char)e[-1] <= ' ')
1577− --e;
1578− *e = 0;;
1579− return a;
1580−}
1581−
15821566 /* ------------------------------------------------------------- */
15831567 static int pe_load_def(TCCState *s1, int fd)
15841568 {
tccpp.c+15−0
@@ -3490,3 +3490,18 @@ ST_FUNC int tcc_preprocess(TCCState *s1) · 3489 unmodified lines
34903490
34913491 return 0;
34923492 }
3493+
3494+ST_FUNC char *trimfront(char *p)
3495+{
3496+ while (*p && (unsigned char)*p <= ' ')
3497+ ++p;
3498+ return p;
3499+}
3500+
3501+ST_FUNC char *trimback(char *a, char *e)
3502+{
3503+ while (e > a && (unsigned char)e[-1] <= ' ')
3504+ --e;
3505+ *e = 0;;
3506+ return a;
3507+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t