Skip to content

Commit 4b1740d

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix deprecated use of 0/NULL in velox/tpch/gen/dbgen/bm_utils.cpp + 1 (#12612)
Summary: Pull Request resolved: #12612 `nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed. This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`. Reviewed By: dtolnay Differential Revision: D70939272 fbshipit-source-id: 063f2275ba217ec2dc7438ef80f603a86ea4c5ba
1 parent c81bb1b commit 4b1740d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

velox/tpch/gen/dbgen/bm_utils.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void permute_dist(distribution* d, seed_t* seed);
116116
const char* tpch_env_config(const char* var, const char* dflt) {
117117
static char* evar;
118118

119-
if ((evar = getenv(var)) != NULL)
119+
if ((evar = getenv(var)) != nullptr)
120120
return (evar);
121121
else
122122
return (dflt);
@@ -252,17 +252,17 @@ void read_dist(const char* path, const char* name, distribution* target) {
252252
long weight, count = 0, name_set = 0;
253253

254254
while (read_line_into_buffer(line, sizeof(line), &src)) {
255-
if ((c = strchr(line, '\n')) != NULL)
255+
if ((c = strchr(line, '\n')) != nullptr)
256256
*c = '\0';
257-
if ((c = strchr(line, '#')) != NULL)
257+
if ((c = strchr(line, '#')) != nullptr)
258258
*c = '\0';
259259
if (*line == '\0')
260260
continue;
261261

262262
if (!name_set) {
263263
if (dsscasecmp(strtok(line, "\n\t "), "BEGIN"))
264264
continue;
265-
if (dsscasecmp(strtok(NULL, "\n\t "), name))
265+
if (dsscasecmp(strtok(nullptr, "\n\t "), name))
266266
continue;
267267
name_set = 1;
268268
continue;

0 commit comments

Comments
 (0)