summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-04 13:49:42 -0700
committerBen Pfaff <blp@nicira.com>2011-05-16 13:40:47 -0700
commite3c17733704fd54fa937ed5e1e8c4b51e00961f1 (patch)
tree78dd7e21f574d1a4614df73fd79e0b239e93201c /ovsdb
parent1102893de4f14a2d184afc640c9a1edf778c6a93 (diff)
downloadopenvswitch-e3c17733704fd54fa937ed5e1e8c4b51e00961f1.tar.gz
Consistently write null pointer constants as NULL instead of 0.
Found with sparse.
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/log.c6
-rw-r--r--ovsdb/ovsdb-client.c10
-rw-r--r--ovsdb/ovsdb-server.c22
-rw-r--r--ovsdb/ovsdb-tool.c10
-rw-r--r--ovsdb/ovsdb.c2
-rw-r--r--ovsdb/table.c2
6 files changed, 26 insertions, 26 deletions
diff --git a/ovsdb/log.c b/ovsdb/log.c
index 67043078f..f0926c0e6 100644
--- a/ovsdb/log.c
+++ b/ovsdb/log.c
@@ -289,7 +289,7 @@ ovsdb_log_read(struct ovsdb_log *file, struct json **jsonp)
file->prev_offset = file->offset;
file->offset = data_offset + data_length;
*jsonp = json;
- return 0;
+ return NULL;
error:
file->read_error = ovsdb_error_clone(error);
@@ -372,7 +372,7 @@ ovsdb_log_write(struct ovsdb_log *file, struct json *json)
file->offset += strlen(header) + length;
free(json_string);
- return 0;
+ return NULL;
error:
file->write_error = ovsdb_error_clone(error);
@@ -386,7 +386,7 @@ ovsdb_log_commit(struct ovsdb_log *file)
if (fsync(fileno(file->stream))) {
return ovsdb_io_error(errno, "%s: fsync failed", file->name);
}
- return 0;
+ return NULL;
}
/* Returns the current offset into the file backing 'log', in bytes. This
diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index e8afdd6b3..800d3e172 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -74,16 +74,16 @@ parse_options(int argc, char *argv[])
TABLE_OPTION_ENUMS
};
static struct option long_options[] = {
- {"verbose", optional_argument, 0, 'v'},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
+ {"verbose", optional_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'V'},
DAEMON_LONG_OPTIONS,
#ifdef HAVE_OPENSSL
- {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT},
+ {"bootstrap-ca-cert", required_argument, NULL, OPT_BOOTSTRAP_CA_CERT},
STREAM_SSL_LONG_OPTIONS,
#endif
TABLE_LONG_OPTIONS,
- {0, 0, 0, 0},
+ {NULL, 0, NULL, 0},
};
char *short_options = long_options_to_short_options(long_options);
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 14f0fbfb7..5477e8680 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -344,7 +344,7 @@ read_string_column(const struct ovsdb_row *row, const char *column_name,
const union ovsdb_atom *atom;
atom = read_column(row, column_name, OVSDB_TYPE_STRING);
- *stringp = atom ? atom->string : 0;
+ *stringp = atom ? atom->string : NULL;
return atom != NULL;
}
@@ -659,19 +659,19 @@ parse_options(int argc, char *argv[], char **file_namep,
DAEMON_OPTION_ENUMS
};
static struct option long_options[] = {
- {"remote", required_argument, 0, OPT_REMOTE},
- {"unixctl", required_argument, 0, OPT_UNIXCTL},
- {"run", required_argument, 0, OPT_RUN},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
+ {"remote", required_argument, NULL, OPT_REMOTE},
+ {"unixctl", required_argument, NULL, OPT_UNIXCTL},
+ {"run", required_argument, NULL, OPT_RUN},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'V'},
DAEMON_LONG_OPTIONS,
VLOG_LONG_OPTIONS,
LEAK_CHECKER_LONG_OPTIONS,
- {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT},
- {"private-key", required_argument, 0, 'p'},
- {"certificate", required_argument, 0, 'c'},
- {"ca-cert", required_argument, 0, 'C'},
- {0, 0, 0, 0},
+ {"bootstrap-ca-cert", required_argument, NULL, OPT_BOOTSTRAP_CA_CERT},
+ {"private-key", required_argument, NULL, 'p'},
+ {"certificate", required_argument, NULL, 'c'},
+ {"ca-cert", required_argument, NULL, 'C'},
+ {NULL, 0, NULL, 0},
};
char *short_options = long_options_to_short_options(long_options);
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index 275490990..07d27293c 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -60,11 +60,11 @@ static void
parse_options(int argc, char *argv[])
{
static struct option long_options[] = {
- {"more", no_argument, 0, 'm'},
- {"verbose", optional_argument, 0, 'v'},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
- {0, 0, 0, 0},
+ {"more", no_argument, NULL, 'm'},
+ {"verbose", optional_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'V'},
+ {NULL, 0, NULL, 0},
};
char *short_options = long_options_to_short_options(long_options);
diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c
index abe88e9f9..fb020c9f2 100644
--- a/ovsdb/ovsdb.c
+++ b/ovsdb/ovsdb.c
@@ -253,7 +253,7 @@ ovsdb_schema_from_json(struct json *json, struct ovsdb_schema **schemap)
}
*schemap = schema;
- return 0;
+ return NULL;
}
struct json *
diff --git a/ovsdb/table.c b/ovsdb/table.c
index 2f693501b..2ea73bf8a 100644
--- a/ovsdb/table.c
+++ b/ovsdb/table.c
@@ -157,7 +157,7 @@ ovsdb_table_schema_from_json(const struct json *json, const char *name,
add_column(ts, column);
}
*tsp = ts;
- return 0;
+ return NULL;
}
/* Returns table schema 'ts' serialized into JSON.