History

Fix compiler warnings utf8 code

herman ten brugge committed 5 years ago

Commit 38eaf9b1 parent b40a88e1 file · +3 −3Browse files

Unified · Split

tccpp.c+3−3
@@ -360,7 +360,7 @@ void cstr_u8cat(CString *cstr, int ch) · 359 unmodified lines
360360 {
361361 unsigned char buf[4];
362362 int size;
363− int add = (int)((unsigned char*)unicode_to_utf8(&buf[0],(uint32_t)ch) - &buf[0]);
363+ int add = (int)((unsigned char*)unicode_to_utf8((char *)&buf[0],(uint32_t)ch) - &buf[0]);
364364 unsigned char *p,*b=buf;
365365 size = cstr->size + add;
366366 if (size > cstr->size_allocated)
@@ -2125,13 +2125,13 @@ static void parse_escape_string(CString *outstr, const uint8_t *buf, int is_long · 1758 unmodified lines
21252125 }
21262126 c = n;
21272127 goto add_char_nonext;
2128− case 'x': { unsigned ucn_chars_nr = -1u; goto parse_hex_or_ucn;
2128+ case 'x': { unsigned int i; unsigned ucn_chars_nr = -1u; goto parse_hex_or_ucn;
21292129 case 'u': ucn_chars_nr = 4; goto parse_hex_or_ucn;
21302130 case 'U': ucn_chars_nr = 8; goto parse_hex_or_ucn;
21312131 parse_hex_or_ucn:;
21322132 p++;
21332133 n = 0;
2134− for(unsigned i=1;i<=ucn_chars_nr;i++) {
2134+ for(i=1;i<=ucn_chars_nr;i++) {
21352135 c = *p;
21362136 if (c >= 'a' && c <= 'f')
21372137 c = c - 'a' + 10;

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