diff options
author | Neil Conway <neilc@samurai.com> | 2004-01-07 18:56:30 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2004-01-07 18:56:30 +0000 |
commit | 192ad63bd765d448e91389c6ff1d75f8b18bb268 (patch) | |
tree | 85873642a16b5ac877dc443a681fe9249c210693 /src/backend/commands/sequence.c | |
parent | afca5d50dc296580925b560fff0eb75bb48f0cbe (diff) | |
download | postgresql-192ad63bd765d448e91389c6ff1d75f8b18bb268.tar.gz postgresql-192ad63bd765d448e91389c6ff1d75f8b18bb268.zip |
More janitorial work: remove the explicit casting of NULL literals to a
pointer type when it is not necessary to do so.
For future reference, casting NULL to a pointer type is only necessary
when (a) invoking a function AND either (b) the function has no prototype
OR (c) the function is a varargs function.
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 54acb5b89cd..3fcc76a72bc 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.106 2003/12/14 00:34:47 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.107 2004/01/07 18:56:25 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -946,7 +946,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit) } /* INCREMENT BY */ - if (increment_by != (DefElem *) NULL) + if (increment_by != NULL) { new->increment_by = defGetInt64(increment_by); if (new->increment_by == 0) @@ -958,7 +958,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit) new->increment_by = 1; /* CYCLE */ - if (is_cycled != (DefElem *) NULL) + if (is_cycled != NULL) { new->is_cycled = intVal(is_cycled->arg); Assert(new->is_cycled == false || new->is_cycled == true); @@ -967,11 +967,11 @@ init_params(List *options, Form_pg_sequence new, bool isInit) new->is_cycled = false; /* MAXVALUE (null arg means NO MAXVALUE) */ - if (max_value != (DefElem *) NULL && max_value->arg) + if (max_value != NULL && max_value->arg) { new->max_value = defGetInt64(max_value); } - else if (isInit || max_value != (DefElem *) NULL) + else if (isInit || max_value != NULL) { if (new->increment_by > 0) new->max_value = SEQ_MAXVALUE; /* ascending seq */ @@ -980,11 +980,11 @@ init_params(List *options, Form_pg_sequence new, bool isInit) } /* MINVALUE (null arg means NO MINVALUE) */ - if (min_value != (DefElem *) NULL && min_value->arg) + if (min_value != NULL && min_value->arg) { new->min_value = defGetInt64(min_value); } - else if (isInit || min_value != (DefElem *) NULL) + else if (isInit || min_value != NULL) { if (new->increment_by > 0) new->min_value = 1; /* ascending seq */ @@ -1007,7 +1007,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit) } /* START WITH */ - if (last_value != (DefElem *) NULL) + if (last_value != NULL) new->last_value = defGetInt64(last_value); else if (isInit) { @@ -1044,7 +1044,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit) } /* CACHE */ - if (cache_value != (DefElem *) NULL) + if (cache_value != NULL) { new->cache_value = defGetInt64(cache_value); if (new->cache_value <= 0) |