Skip to content

Commit

Permalink
Fix clang 9 missing-field-initializer warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Lockyer <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
GaryWL authored and cryptomilk committed May 8, 2020
1 parent c2b0071 commit 13a2f70
Show file tree
Hide file tree
Showing 53 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion auth/credentials/pycredentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ static PyObject *py_ccache_name(PyObject *self, PyObject *unused)
static PyMethodDef py_ccache_container_methods[] = {
{ "get_name", py_ccache_name, METH_NOARGS,
"S.get_name() -> name\nObtain KRB5 credentials cache name." },
{ NULL }
{0}
};

PyTypeObject PyCredentialCacheContainer = {
Expand Down
1 change: 0 additions & 1 deletion buildtools/wafsamba/samba_autoconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ def SAMBA_CONFIG_H(conf, path=None):
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=cast-align', testflags=True)
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=format-nonliteral', testflags=True)
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=for-loop-analysis', testflags=True)
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=missing-field-initializers', testflags=True)

if Options.options.fatal_errors:
conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
Expand Down
4 changes: 1 addition & 3 deletions examples/libsmbclient/testbrowse.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ int main(int argc, const char *argv[])
"contextauth", 'C', POPT_ARG_NONE, &context_auth,
0, "Use new authentication function with context", "integer"
},
{
NULL
}
{0}
};

setbuf(stdout, NULL);
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/py_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static const char py_crypto_arcfour_crypt_blob_doc[] = "arcfour_crypt_blob(data,

static PyMethodDef py_crypto_methods[] = {
{ "arcfour_crypt_blob", (PyCFunction)py_crypto_arcfour_crypt_blob, METH_VARARGS, py_crypto_arcfour_crypt_blob_doc },
{ NULL },
{0},
};

static struct PyModuleDef moduledef = {
Expand Down
2 changes: 1 addition & 1 deletion lib/ldb-samba/pyldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static PyMethodDef py_samba_ldb_methods[] = {
{ "samba_schema_attribute_add",
(PyCFunction)py_ldb_samba_schema_attribute_add,
METH_VARARGS, NULL },
{ NULL },
{0},
};

static struct PyModuleDef moduledef = {
Expand Down
4 changes: 2 additions & 2 deletions lib/ldb-samba/samba_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
static unsigned calculate_popt_array_length(struct poptOption *opts)
{
unsigned i;
struct poptOption zero_opt = { NULL };
struct poptOption zero_opt = { 0 };
for (i=0; memcmp(&zero_opt, &opts[i], sizeof(zero_opt)) != 0; i++) ;
return i;
}
Expand All @@ -51,7 +51,7 @@ static struct poptOption cmdline_extensions[] = {
POPT_COMMON_CREDENTIALS
POPT_COMMON_CONNECTION
POPT_COMMON_VERSION
{ NULL }
{0}
};

/*
Expand Down
16 changes: 8 additions & 8 deletions lib/ldb/pyldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static PyObject *py_ldb_dn_set_component(PyLdbDnObject *self, PyObject *args)
{
unsigned int num = 0;
char *name = NULL, *value = NULL;
struct ldb_val val = { NULL, };
struct ldb_val val = { 0 };
int err;
Py_ssize_t size = 0;

Expand Down Expand Up @@ -847,7 +847,7 @@ static PyMethodDef py_ldb_dn_methods[] = {
{ "get_rdn_value", (PyCFunction)py_ldb_dn_get_rdn_value, METH_NOARGS,
"S.get_rdn_value() -> string\n"
"get the RDN attribute value as a binary string" },
{ NULL }
{0}
};

static Py_ssize_t py_ldb_dn_len(PyLdbDnObject *self)
Expand Down Expand Up @@ -2398,7 +2398,7 @@ static PyMethodDef py_ldb_methods[] = {
{ "_register_test_extensions", (PyCFunction)py_ldb_register_test_extensions, METH_NOARGS,
"S._register_test_extensions() -> None\n"
"Register internal extensions used in testing" },
{ NULL },
{0},
};

static PyObject *PyLdbModule_FromModule(struct ldb_module *mod)
Expand Down Expand Up @@ -2725,7 +2725,7 @@ static PyMethodDef py_ldb_search_iterator_methods[] = {
"S.result() -> ldb.Result (without msgs and referrals)\n" },
{ "abandon", (PyCFunction)py_ldb_search_iterator_abandon, METH_NOARGS,
"S.abandon()\n" },
{ NULL }
{0}
};

static PyObject *py_ldb_search_iterator_repr(PyLdbSearchIteratorObject *self)
Expand Down Expand Up @@ -2920,7 +2920,7 @@ static PyMethodDef py_ldb_module_methods[] = {
{ "start_transaction", (PyCFunction)py_ldb_module_start_transaction, METH_NOARGS, NULL },
{ "end_transaction", (PyCFunction)py_ldb_module_end_transaction, METH_NOARGS, NULL },
{ "del_transaction", (PyCFunction)py_ldb_module_del_transaction, METH_NOARGS, NULL },
{ NULL },
{0},
};

static void py_ldb_module_dealloc(PyLdbModuleObject *self)
Expand Down Expand Up @@ -3098,7 +3098,7 @@ static PyMethodDef py_ldb_msg_element_methods[] = {
{ "get", (PyCFunction)py_ldb_msg_element_get, METH_VARARGS, NULL },
{ "set_flags", (PyCFunction)py_ldb_msg_element_set_flags, METH_VARARGS, NULL },
{ "flags", (PyCFunction)py_ldb_msg_element_flags, METH_NOARGS, NULL },
{ NULL },
{0},
};

static Py_ssize_t py_ldb_msg_element_len(PyLdbMessageElementObject *self)
Expand Down Expand Up @@ -3603,7 +3603,7 @@ static PyMethodDef py_ldb_msg_methods[] = {
{ "add", (PyCFunction)py_ldb_msg_add, METH_VARARGS,
"S.add(element)\n\n"
"Add an element to this message." },
{ NULL },
{0},
};

static PyObject *py_ldb_msg_iter(PyLdbMessageObject *self)
Expand Down Expand Up @@ -4280,7 +4280,7 @@ static PyMethodDef py_ldb_global_methods[] = {
{ "binary_decode", py_binary_decode, METH_VARARGS,
"S.binary_decode(string) -> string\n\n"
"Perform a RFC2254 binary decode on a string" },
{ NULL }
{0}
};

#define MODULE_DOC "An interface to LDB, a LDAP-like API that can either to talk an embedded database (TDB-based) or a standards-compliant LDAP server."
Expand Down
2 changes: 1 addition & 1 deletion lib/ldb/tools/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static struct poptOption builtin_popt_options[] = {
{ "relax", 0, POPT_ARG_NONE, NULL, CMDLINE_RELAX, "pass relax control", NULL },
{ "cross-ncs", 0, POPT_ARG_NONE, NULL, 'N', "search across NC boundaries", NULL },
{ "extended-dn", 0, POPT_ARG_NONE, NULL, 'E', "show extended DNs", NULL },
{ NULL }
{0}
};

void ldb_cmdline_help(struct ldb_context *ldb, const char *cmdname, FILE *f)
Expand Down
2 changes: 1 addition & 1 deletion lib/talloc/pytalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static PyMethodDef talloc_methods[] = {
"enable tracking of the NULL object"},
{ "total_blocks", (PyCFunction)pytalloc_total_blocks, METH_VARARGS,
"return talloc block count"},
{ NULL }
{0}
};

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/talloc/test_pytalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static PyMethodDef test_talloc_methods[] = {
"call pytalloc_reference_ex"},
{ "base_reference", (PyCFunction)testpytalloc_base_reference, METH_VARARGS,
"call pytalloc_reference_ex"},
{ NULL }
{0}
};

static PyTypeObject DObject_Type;
Expand Down
2 changes: 1 addition & 1 deletion lib/tdb/pytdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static PyMethodDef tdb_object_methods[] = {
"S.enable_seqnum() -> None" },
{ "increment_seqnum_nonblock", (PyCFunction)obj_increment_seqnum_nonblock, METH_NOARGS,
"S.increment_seqnum_nonblock() -> None" },
{ NULL }
{0}
};

static PyObject *obj_get_hash_size(PyTdbObject *self, void *closure)
Expand Down
16 changes: 8 additions & 8 deletions lib/tevent/pytevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static PyMethodDef py_tevent_queue_methods[] = {
"S.start()" },
{ "add", (PyCFunction)py_tevent_queue_add, METH_VARARGS,
"S.add(ctx, req, trigger, baton)" },
{ NULL },
{0},
};

static PyObject *py_tevent_context_wakeup_send(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -394,7 +394,7 @@ struct PyGetSetDef py_tevent_timer_getset[] = {
.get = (getter)py_tevent_timer_get_active,
.doc = discard_const_p(char, "true if the timer is scheduled to run"),
},
{NULL},
{0},
};

static PyTypeObject TeventTimer_Type = {
Expand Down Expand Up @@ -576,7 +576,7 @@ static PyMethodDef py_tevent_context_methods[] = {
METH_VARARGS, "S.add_timer(offset_seconds, handler) -> timer" },
{ "add_fd", (PyCFunction)py_tevent_context_add_fd,
METH_VARARGS, "S.add_fd(fd, flags, handler) -> fd" },
{ NULL },
{0},
};

static PyObject *py_tevent_req_wakeup_recv(PyObject *self,
Expand Down Expand Up @@ -620,7 +620,7 @@ static PyGetSetDef py_tevent_req_getsetters[] = {
.get = (getter)py_tevent_req_is_in_progress,
.doc = discard_const_p(char, "Whether the request is in progress"),
},
{ NULL }
{0}
};

static PyObject *py_tevent_req_post(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -688,7 +688,7 @@ static PyMethodDef py_tevent_req_methods[] = {
METH_VARARGS, "set_endtime(ctx, endtime)" },
{ "cancel", (PyCFunction)py_tevent_req_cancel,
METH_NOARGS, "cancel()" },
{ NULL }
{0}
};

static void py_tevent_req_dealloc(TeventReq_Object *self)
Expand Down Expand Up @@ -718,7 +718,7 @@ static PyGetSetDef py_tevent_queue_getsetters[] = {
.get = (getter)py_tevent_queue_get_length,
.doc = discard_const_p(char, "The number of elements in the queue."),
},
{ NULL },
{0},
};

static void py_tevent_queue_dealloc(TeventQueue_Object *self)
Expand Down Expand Up @@ -750,7 +750,7 @@ static PyGetSetDef py_tevent_context_getsetters[] = {
py_tevent_context_signal_support),
.doc = discard_const_p(char, "if this platform and tevent context support signal handling"),
},
{ NULL }
{0}
};

static void py_tevent_context_dealloc(TeventContext_Object *self)
Expand Down Expand Up @@ -861,7 +861,7 @@ static PyMethodDef tevent_methods[] = {
METH_VARARGS, "set_default_backend(backend)" },
{ "backend_list", (PyCFunction)py_backend_list,
METH_NOARGS, "backend_list() -> list" },
{ NULL },
{0},
};

#define MODULE_DOC PyDoc_STR("Python wrapping of talloc-maintained objects.")
Expand Down
2 changes: 1 addition & 1 deletion libcli/nbt/pynbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static PyMethodDef py_nbt_methods[] = {
"S.name_status(name, dest, timeout=0, retries=0) -> (reply_from, name, status)\n"
"Find the status of a name" },

{ NULL }
{0}
};

PyTypeObject nbt_node_Type = {
Expand Down
2 changes: 1 addition & 1 deletion libcli/security/pysecurity.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static PyMethodDef py_security_methods[] = {
py_se_access_check),
METH_VARARGS|METH_KEYWORDS,
"access_check(security_descriptor, token, access_desired) -> access_granted. Raises NT_STATUS on error, including on access check failure, returns access granted bitmask"},
{ NULL },
{0},
};

static struct PyModuleDef moduledef = {
Expand Down
8 changes: 4 additions & 4 deletions libgpo/pygpo.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static PyGetSetDef GPO_setters[] = {
NULL, NULL, NULL},
{discard_const_p(char, "machine_extensions"),
(getter)GPO_get_machine_extensions, NULL, NULL, NULL},
{NULL}
{0}
};

static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args,
Expand Down Expand Up @@ -120,7 +120,7 @@ static PyMethodDef GPO_methods[] = {
py_gpo_get_unix_path),
METH_VARARGS | METH_KEYWORDS,
NULL },
{NULL}
{0}
};

static PyTypeObject GPOType = {
Expand Down Expand Up @@ -493,7 +493,7 @@ static PyMethodDef ADS_methods[] = {
METH_VARARGS | METH_KEYWORDS,
NULL },
#endif
{ NULL }
{0}
};

static PyTypeObject ads_ADSType = {
Expand All @@ -510,7 +510,7 @@ static PyMethodDef py_gpo_methods[] = {
{"gpo_get_sysvol_gpt_version",
(PyCFunction)py_gpo_get_sysvol_gpt_version,
METH_VARARGS, NULL},
{NULL}
{0}
};

static struct PyModuleDef moduledef = {
Expand Down
2 changes: 1 addition & 1 deletion librpc/tools/ndrdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
"Try to print structures that fail to parse (used to develop parsers, segfaults are likely).", NULL },
POPT_COMMON_SAMBA
POPT_COMMON_VERSION
{ NULL }
{0}
};
uint32_t highest_ofs;
struct dcerpc_sec_verification_trailer *sec_vt = NULL;
Expand Down
2 changes: 1 addition & 1 deletion pidl/lib/Parse/Pidl/Samba4/Python.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ sub Interface($$$)
my ($infn, $outfn, $callfn, $prettyname, $docstring, $opnum) = @$d;
$self->pidl("{ \"$prettyname\", $docstring, (py_dcerpc_call_fn)$callfn, (py_data_pack_fn)$infn, (py_data_unpack_fn)$outfn, $opnum, &ndr_table_$interface->{NAME} },");
}
$self->pidl("{ NULL }");
$self->pidl("{0}");
$self->deindent;
$self->pidl("};");
$self->pidl("");
Expand Down
2 changes: 1 addition & 1 deletion python/pyglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static PyMethodDef py_misc_methods[] = {
METH_VARARGS,
"generate_random_bytes(len) -> bytes\n"
"Generate random bytes with specified length." },
{ NULL }
{0}
};

static struct PyModuleDef moduledef = {
Expand Down
2 changes: 1 addition & 1 deletion source3/libsmb/pylibsmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ static PyTypeObject py_cli_state_type = {
};

static PyMethodDef py_libsmb_methods[] = {
{ NULL },
{0},
};

void initlibsmb_samba_internal(void);
Expand Down
2 changes: 1 addition & 1 deletion source3/param/pyparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static PyObject *py_get_context(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyMethodDef pyparam_methods[] = {
{ "get_context", (PyCFunction)py_get_context, METH_NOARGS,
"Returns LoadParm context." },
{ NULL }
{0}
};

static struct PyModuleDef moduledef = {
Expand Down
4 changes: 2 additions & 2 deletions source3/passdb/py_passdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3753,7 +3753,7 @@ static PyMethodDef py_pdb_methods[] = {
{ "delete_secret", py_pdb_delete_secret, METH_VARARGS,
"delete_secret(secret_name) -> None\n\n \
Delete secret information for secret_name." },
{ NULL },
{0},
};


Expand Down Expand Up @@ -3969,7 +3969,7 @@ static PyMethodDef py_passdb_methods[] = {
{ "reload_static_pdb", py_reload_static_pdb, METH_NOARGS,
"reload_static_pdb() -> None\n\n \
Re-initialise the static pdb used internally. Needed if 'passdb backend' is changed." },
{ NULL },
{0},
};

static struct PyModuleDef moduledef = {
Expand Down
6 changes: 3 additions & 3 deletions source3/rpc_client/py_mdscli.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static PyMethodDef search_methods[] = {
.ml_flags = METH_VARARGS|METH_KEYWORDS,
.ml_doc = "",
},
{ NULL },
{0},
};

static PyObject *search_new(PyTypeObject *type,
Expand Down Expand Up @@ -448,7 +448,7 @@ static PyMethodDef conn_methods[] = {
.ml_flags = METH_VARARGS|METH_KEYWORDS,
.ml_doc = "mdscli.conn.disconnect(...) -> disconnect",
},
{ NULL },
{0},
};

static PyObject *conn_new(PyTypeObject *type,
Expand Down Expand Up @@ -521,7 +521,7 @@ static PyTypeObject conn_type = {
};

static PyMethodDef mdscli_methods[] = {
{ NULL },
{0},
};

static struct PyModuleDef moduledef = {
Expand Down
2 changes: 1 addition & 1 deletion source3/rpcclient/cmd_spotlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,5 +456,5 @@ struct cmd_set spotlight_commands[] = {
.description = "Fetch attributes for a CNID",
.usage = "",
},
{ NULL }
{0}
};
Loading

0 comments on commit 13a2f70

Please sign in to comment.