History

Trivial changes to avoid some compiler warnings.

Edmund Grimley Evans committed 10 years ago

Commit ba99a701 parent 553242c5 files · +12 −9Browse files

Unified · Split

5 files
  1. libtcc.c +1 −1
  2. tcc.h +4 −4
  3. tccasm.c +4 −1
  4. tccrun.c +1 −1
  5. x86_64-gen.c +2 −2
libtcc.c+1−1
@@ -1974,7 +1974,7 @@ enum { · 1973 unmodified lines
19741974 TCC_OPTION_E,
19751975 TCC_OPTION_MD,
19761976 TCC_OPTION_MF,
1977− TCC_OPTION_x,
1977+ TCC_OPTION_x
19781978 };
19791979
19801980 #define TCC_OPTION_HAS_ARG 0x0001
tcc.h+4−4
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include <fcntl.h>
3535 #include <setjmp.h>
3636 #include <time.h>
37−#include <sys/stat.h> // stat()
37+#include <sys/stat.h> /* stat() */
3838
3939 #ifdef CONFIG_TCCASSERT
4040 #include <assert.h>
@@ -704,7 +704,7 @@ struct TCCState { · 663 unmodified lines
704704 enum {
705705 LINE_MACRO_OUTPUT_FORMAT_GCC,
706706 LINE_MACRO_OUTPUT_FORMAT_NONE,
707− LINE_MACRO_OUTPUT_FORMAT_STD,
707+ LINE_MACRO_OUTPUT_FORMAT_STD
708708 } Pflag; /* -P switch */
709709 int dflag; /* -dX value */
710710
@@ -1033,8 +1033,8 @@ struct TCCState { · 322 unmodified lines
10331033 #endif /* defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 */
10341034
10351035 enum tcc_token {
1036− TOK_LAST = TOK_IDENT - 1,
1037−#define DEF(id, str) id,
1036+ TOK_LAST = TOK_IDENT - 1
1037+#define DEF(id, str) ,id
10381038 #include "tcctok.h"
10391039 #undef DEF
10401040 };
tccasm.c+4−1
@@ -550,7 +550,10 @@ static void asm_parse_directive(TCCState *s1) · 549 unmodified lines
550550 n = asm_int_expr(s1);
551551 next();
552552 }
553− sprintf(sname, (n?".%s%d":".%s"), get_tok_str(tok1, NULL), n);
553+ if (n)
554+ sprintf(sname, ".%s%d", get_tok_str(tok1, NULL), n);
555+ else
556+ sprintf(sname, ".%s", get_tok_str(tok1, NULL));
554557 use_section(s1, sname);
555558 }
556559 break;
tccrun.c+1−1
@@ -235,7 +235,7 @@ static void set_pages_executable(void *ptr, unsigned long length) · 234 unmodified lines
235235 end = (addr_t)ptr + length;
236236 end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1);
237237 mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC);
238− __clear_cache(ptr, ptr + length);
238+ __clear_cache(ptr, (char *)ptr + length);
239239 #endif
240240 }
241241
x86_64-gen.c+2−2
@@ -77,7 +77,7 @@ enum { · 76 unmodified lines
7777
7878 TREG_ST0 = 24,
7979
80− TREG_MEM = 0x20,
80+ TREG_MEM = 0x20
8181 };
8282
8383 #define REX_BASE(reg) (((reg) >> 3) & 1)
@@ -1703,7 +1703,7 @@ int gtst(int inv, int t) · 1619 unmodified lines
17031703 to our target if the result was unordered and test wasn't NE,
17041704 otherwise if unordered we don't want to jump. */
17051705 vtop->c.i &= ~0x100;
1706− if (!inv == (vtop->c.i != TOK_NE))
1706+ if (inv == (vtop->c.i == TOK_NE))
17071707 o(0x067a); /* jp +6 */
17081708 else
17091709 {

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