Trivial changes to avoid some compiler warnings.

This commit is contained in:
Edmund Grimley Evans 2015-11-19 18:26:47 +00:00
parent 553242c18a
commit ba99a70cd8
5 changed files with 12 additions and 9 deletions

View File

@ -1974,7 +1974,7 @@ enum {
TCC_OPTION_E,
TCC_OPTION_MD,
TCC_OPTION_MF,
TCC_OPTION_x,
TCC_OPTION_x
};
#define TCC_OPTION_HAS_ARG 0x0001

8
tcc.h
View File

@ -34,7 +34,7 @@
#include <fcntl.h>
#include <setjmp.h>
#include <time.h>
#include <sys/stat.h> // stat()
#include <sys/stat.h> /* stat() */
#ifdef CONFIG_TCCASSERT
#include <assert.h>
@ -704,7 +704,7 @@ struct TCCState {
enum {
LINE_MACRO_OUTPUT_FORMAT_GCC,
LINE_MACRO_OUTPUT_FORMAT_NONE,
LINE_MACRO_OUTPUT_FORMAT_STD,
LINE_MACRO_OUTPUT_FORMAT_STD
} Pflag; /* -P switch */
int dflag; /* -dX value */
@ -1033,8 +1033,8 @@ struct TCCState {
#endif /* defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 */
enum tcc_token {
TOK_LAST = TOK_IDENT - 1,
#define DEF(id, str) id,
TOK_LAST = TOK_IDENT - 1
#define DEF(id, str) ,id
#include "tcctok.h"
#undef DEF
};

View File

@ -550,7 +550,10 @@ static void asm_parse_directive(TCCState *s1)
n = asm_int_expr(s1);
next();
}
sprintf(sname, (n?".%s%d":".%s"), get_tok_str(tok1, NULL), n);
if (n)
sprintf(sname, ".%s%d", get_tok_str(tok1, NULL), n);
else
sprintf(sname, ".%s", get_tok_str(tok1, NULL));
use_section(s1, sname);
}
break;

View File

@ -235,7 +235,7 @@ static void set_pages_executable(void *ptr, unsigned long length)
end = (addr_t)ptr + length;
end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1);
mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC);
__clear_cache(ptr, ptr + length);
__clear_cache(ptr, (char *)ptr + length);
#endif
}

View File

@ -77,7 +77,7 @@ enum {
TREG_ST0 = 24,
TREG_MEM = 0x20,
TREG_MEM = 0x20
};
#define REX_BASE(reg) (((reg) >> 3) & 1)
@ -1703,7 +1703,7 @@ int gtst(int inv, int t)
to our target if the result was unordered and test wasn't NE,
otherwise if unordered we don't want to jump. */
vtop->c.i &= ~0x100;
if (!inv == (vtop->c.i != TOK_NE))
if (inv == (vtop->c.i == TOK_NE))
o(0x067a); /* jp +6 */
else
{