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
69*~69*~
70\#*70\#*
71.#*71.#*
72win32/include/*72win32/*
73win32/lib/*
74win32/vs2015/*
tcc.h+2−0
@@ -1263,6 +1263,8 @@ ST_FUNC void preprocess_delete(void); · 1262 unmodified lines
1263ST_FUNC int tcc_preprocess(TCCState *s1);1263ST_FUNC int tcc_preprocess(TCCState *s1);
1264ST_FUNC void skip(int c);1264ST_FUNC void skip(int c);
1265ST_FUNC NORETURN void expect(const char *msg);1265ST_FUNC NORETURN void expect(const char *msg);
1266ST_FUNC char *trimfront(char *p);
1267ST_FUNC char *trimback(char *a, char *e);
1266 1268
1267/* ------------ tccgen.c ------------ */1269/* ------------ tccgen.c ------------ */
1268 1270
tccpe.c+0−16
@@ -1563,22 +1563,6 @@ quit: · 1562 unmodified lines
1563 return ret;1563 return ret;
1564}1564}
1565 1565
1566/* ------------------------------------------------------------- */
1567static char *trimfront(char *p)
1568{
1569 while (*p && (unsigned char)*p <= ' ')
1570 ++p;
1571 return p;
1572}
1573
1574static 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
1582/* ------------------------------------------------------------- */1566/* ------------------------------------------------------------- */
1583static int pe_load_def(TCCState *s1, int fd)1567static int pe_load_def(TCCState *s1, int fd)
1584{1568{
tccpp.c+15−0
@@ -3490,3 +3490,18 @@ ST_FUNC int tcc_preprocess(TCCState *s1) · 3489 unmodified lines
3490 3490
3491 return 0;3491 return 0;
3492}3492}
3493
3494ST_FUNC char *trimfront(char *p)
3495{
3496 while (*p && (unsigned char)*p <= ' ')
3497 ++p;
3498 return p;
3499}
3500
3501ST_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