aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-29 15:18:59 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:09 -0700
commit2d0659ec1e30a223aaafdf04864356260f8fa17e (patch)
tree40427326e72593d82a17727d6797de0f210553c4 /compile-i386.c
parentWarn about plain integer conversion to NULL pointer. (diff)
downloadsparse-2d0659ec1e30a223aaafdf04864356260f8fa17e.tar.gz
sparse-2d0659ec1e30a223aaafdf04864356260f8fa17e.tar.bz2
sparse-2d0659ec1e30a223aaafdf04864356260f8fa17e.zip
Fix integer/pointer errors in sparse.
Shown by running sparse on itself.
Diffstat (limited to 'compile-i386.c')
-rw-r--r--compile-i386.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/compile-i386.c b/compile-i386.c
index f8e2e61..70253b7 100644
--- a/compile-i386.c
+++ b/compile-i386.c
@@ -1759,7 +1759,7 @@ static void emit_loop(struct statement *stmt)
static struct storage *x86_statement(struct statement *stmt)
{
if (!stmt)
- return 0;
+ return NULL;
switch (stmt->type) {
case STMT_RETURN:
return emit_return_stmt(stmt);
@@ -2090,14 +2090,14 @@ static void x86_initializer_expr(struct expression *expr, struct symbol *ctype)
static struct storage *x86_expression(struct expression *expr)
{
if (!expr)
- return 0;
+ return NULL;
if (!expr->ctype) {
struct position *pos = &expr->pos;
printf("\tno type at %s:%d:%d\n",
input_streams[pos->stream].name,
pos->line, pos->pos);
- return 0;
+ return NULL;
}
switch (expr->type) {
@@ -2122,7 +2122,7 @@ static struct storage *x86_expression(struct expression *expr)
case EXPR_DEREF:
case EXPR_SIZEOF:
warn(expr->pos, "invalid expression after evaluation");
- return 0;
+ return NULL;
case EXPR_CAST:
return emit_cast_expr(expr);
case EXPR_VALUE:
@@ -2145,16 +2145,16 @@ static struct storage *x86_expression(struct expression *expr)
// valid as sub-expressions of initializers.
case EXPR_POS:
warn(expr->pos, "unable to show plain initializer position expression");
- return 0;
+ return NULL;
case EXPR_IDENTIFIER:
warn(expr->pos, "unable to show identifier expression");
- return 0;
+ return NULL;
case EXPR_INDEX:
warn(expr->pos, "unable to show index expression");
- return 0;
+ return NULL;
case EXPR_TYPE:
warn(expr->pos, "unable to show type expression");
- return 0;
+ return NULL;
}
- return 0;
+ return NULL;
}