aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2004-10-28 21:14:30 +0000
committerbellard <bellard>2004-10-28 21:14:30 +0000
commit736b5657661072acf97e1df85432184048ad2063 (patch)
tree440e4ebbb0620081cf72a89279111d55baa4dd1e
parentc2ec76a41f4dfa5ef0fef7f49617350c115fb45e (diff)
downloadtinycc-736b5657661072acf97e1df85432184048ad2063.tar.gz
tinycc-736b5657661072acf97e1df85432184048ad2063.tar.bz2
fixed const and volatile function parameters typing - fixed string parsing when skipping code
-rw-r--r--tcc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tcc.c b/tcc.c
index 0263ff0..b702ed5 100644
--- a/tcc.c
+++ b/tcc.c
@@ -2061,7 +2061,8 @@ static uint8_t *parse_pp_string(uint8_t *p,
} else if (c == '\r') {
PEEKC_EOB(c, p);
if (c != '\n') {
- cstr_ccat(str, '\r');
+ if (str)
+ cstr_ccat(str, '\r');
} else {
file->line_num++;
goto add_char;
@@ -6621,6 +6622,9 @@ the_end:
function pointer) */
static inline void convert_parameter_type(CType *pt)
{
+ /* remove const and volatile qualifiers (XXX: const could be used
+ to indicate a const function parameter */
+ pt->t &= ~(VT_CONSTANT | VT_VOLATILE);
/* array must be transformed to pointer according to ANSI C */
pt->t &= ~VT_ARRAY;
if ((pt->t & VT_BTYPE) == VT_FUNC) {