diff options
| author | Tom Lane | 2010-10-29 19:51:52 +0000 |
|---|---|---|
| committer | Tom Lane | 2010-10-29 19:51:52 +0000 |
| commit | bfd3f37be309c3647844aed937e6a66aad5fd3cb (patch) | |
| tree | 5bc39a02df05c848eb88e300a25ef83af4cd43b6 /src/backend/utils | |
| parent | 48a1fb23900d73e7d9cb2dc0408c745cd03597a7 (diff) | |
Fix comparisons of pointers with zero to compare with NULL instead.
Per C standard, these are semantically the same thing; but saying NULL
when you mean NULL is good for readability.
Marti Raudsepp, per results of INRIA's Coccinelle.
Diffstat (limited to 'src/backend/utils')
| -rw-r--r-- | src/backend/utils/adt/tsrank.c | 2 | ||||
| -rw-r--r-- | src/backend/utils/fmgr/dfmgr.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index d61bcdd426..b0417de126 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -395,7 +395,7 @@ getWeights(ArrayType *win) int i; float4 *arrdata; - if (win == 0) + if (win == NULL) return weights; if (ARR_NDIM(win) != 1) diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 566ac46bd7..d08fdddde2 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -616,7 +616,7 @@ find_in_dynamic_libpath(const char *basename) (errcode(ERRCODE_INVALID_NAME), errmsg("zero-length component in parameter \"dynamic_library_path\""))); - if (piece == 0) + if (piece == NULL) len = strlen(p); else len = piece - p; |
