aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwelinder@darter.rentec.com <welinder@darter.rentec.com>2004-09-13 16:19:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:12 -0700
commit6a9a969e71981ba02e805c552f6b540c6cd0eb8e (patch)
tree2423834b744691c12d95883071af2cdf8453cb45
parentFix up format string buglet found by the compiler. (diff)
downloadsparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.tar.gz
sparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.tar.bz2
sparse-6a9a969e71981ba02e805c552f6b540c6cd0eb8e.zip
Janitorial trivialities.
-rw-r--r--check.c2
-rw-r--r--compile-i386.c10
-rw-r--r--linearize.c2
-rw-r--r--pre-process.c2
-rw-r--r--show-parse.c2
-rw-r--r--test-lexing.c2
6 files changed, 10 insertions, 10 deletions
diff --git a/check.c b/check.c
index 53db70b..5c1a55b 100644
--- a/check.c
+++ b/check.c
@@ -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) {