diff options
author | welinder@darter.rentec.com <welinder@darter.rentec.com> | 2004-09-13 16:19:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:03:12 -0700 |
commit | 6a9a969e71981ba02e805c552f6b540c6cd0eb8e (patch) | |
tree | 2423834b744691c12d95883071af2cdf8453cb45 | |
parent | Fix up format string buglet found by the compiler. (diff) | |
download | sparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.tar.gz sparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.tar.bz2 sparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.zip |
Janitorial trivialities.
-rw-r--r-- | check.c | 2 | ||||
-rw-r--r-- | compile-i386.c | 10 | ||||
-rw-r--r-- | linearize.c | 2 | ||||
-rw-r--r-- | pre-process.c | 2 | ||||
-rw-r--r-- | show-parse.c | 2 | ||||
-rw-r--r-- | test-lexing.c | 2 |
6 files changed, 10 insertions, 10 deletions
@@ -98,7 +98,7 @@ int main(int argc, char **argv) while (!eof_token(token)) { int prec = 1; struct token *next = token->next; - char * separator = ""; + const char *separator = ""; if (next->pos.whitespace) separator = " "; if (next->pos.newline) { diff --git a/compile-i386.c b/compile-i386.c index 0d946a5..832317f 100644 --- a/compile-i386.c +++ b/compile-i386.c @@ -286,10 +286,10 @@ struct regclass { const unsigned char regs[30]; }; -struct regclass regclass_8 = { "8-bit", { AL, DL, CL, BL, AH, DH, CH, BH }}; -struct regclass regclass_16 = { "16-bit", { AX, DX, CX, BX, SI, DI, BP }}; -struct regclass regclass_32 = { "32-bit", { EAX, EDX, ECX, EBX, ESI, EDI, EBP }}; -struct regclass regclass_64 = { "64-bit", { EAX_EDX, ECX_EBX, ESI_EDI }}; +static struct regclass regclass_8 = { "8-bit", { AL, DL, CL, BL, AH, DH, CH, BH }}; +static struct regclass regclass_16 = { "16-bit", { AX, DX, CX, BX, SI, DI, BP }}; +static struct regclass regclass_32 = { "32-bit", { EAX, EDX, ECX, EBX, ESI, EDI, EBP }}; +static struct regclass regclass_64 = { "64-bit", { EAX_EDX, ECX_EBX, ESI_EDI }}; struct regclass regclass_32_8 = { "32-bit bytes", { EAX, EDX, ECX, EBX }}; @@ -1126,7 +1126,7 @@ static const char *opbits(const char *insn, unsigned int bits) case 16: c = 'w'; break; case 32: c = 'l'; break; case 64: c = 'q'; break; - default: assert(0); break; + default: abort(); break; } sprintf(opbits_str, "%s%c", insn, c); diff --git a/linearize.c b/linearize.c index e82be03..4db5b84 100644 --- a/linearize.c +++ b/linearize.c @@ -143,7 +143,7 @@ static void show_instruction(struct instruction *insn) case OP_PHI: { struct phi *phi; - char *s = " "; + const char *s = " "; printf("\t%%r%d <- phi", insn->target->nr); FOR_EACH_PTR(insn->phi_list, phi) { printf("%s(%%r%d, .L%p)", s, phi->pseudo->nr, phi->source); diff --git a/pre-process.c b/pre-process.c index bb6dc6f..2481ffc 100644 --- a/pre-process.c +++ b/pre-process.c @@ -95,7 +95,7 @@ static void replace_with_integer(struct token *token, unsigned int val) static void replace_with_defined(struct token *token) { - char *string[] = { "0", "1" }; + static char *string[] = { "0", "1" }; int defined = 0; if (token_type(token) != TOKEN_IDENT) warning(token->pos, "operator \"defined\" requires an identifier"); diff --git a/show-parse.c b/show-parse.c index bca9e47..3856289 100644 --- a/show-parse.c +++ b/show-parse.c @@ -159,7 +159,7 @@ static void do_show_type(struct symbol *sym, struct type_name *name) const char *mod; static struct ctype_name { struct symbol *sym; - char *name; + const char *name; } typenames[] = { { & char_ctype, "char" }, { &schar_ctype, "signed char" }, diff --git a/test-lexing.c b/test-lexing.c index ce24970..9cb00f9 100644 --- a/test-lexing.c +++ b/test-lexing.c @@ -38,7 +38,7 @@ int main(int argc, char **argv) while (!eof_token(token)) { int prec = 1; struct token *next = token->next; - char * separator = ""; + const char *separator = ""; if (next->pos.whitespace) separator = " "; if (next->pos.newline) { |