aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtcc.c2
-rw-r--r--tcc.h8
-rw-r--r--tccasm.c5
-rw-r--r--tccrun.c2
-rw-r--r--x86_64-gen.c4
5 files changed, 12 insertions, 9 deletions
diff --git a/libtcc.c b/libtcc.c
index eb12a5f..2a43a3a 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -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
diff --git a/tcc.h b/tcc.h
index 1be6be7..394b6ab 100644
--- a/tcc.h
+++ b/tcc.h
@@ -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
};
diff --git a/tccasm.c b/tccasm.c
index 3cbae19..044db83 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -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;
diff --git a/tccrun.c b/tccrun.c
index f348e48..2519105 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -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
}
diff --git a/x86_64-gen.c b/x86_64-gen.c
index d8dfaab..4ac1e93 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -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
{