diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index fad07b84ba7..a5d0f9e051c 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -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 = { diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 5534c2f6a9f..1533ff0c46d 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -793,7 +793,6 @@ int main(void) { 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) diff --git a/examples/libsmbclient/testbrowse.c b/examples/libsmbclient/testbrowse.c index 0629653ef8b..1609e2f4f91 100644 --- a/examples/libsmbclient/testbrowse.c +++ b/examples/libsmbclient/testbrowse.c @@ -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); diff --git a/lib/crypto/py_crypto.c b/lib/crypto/py_crypto.c index c85cd2c13d2..32b946eee8f 100644 --- a/lib/crypto/py_crypto.c +++ b/lib/crypto/py_crypto.c @@ -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 = { diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c index 48adc74b16a..bea489489ef 100644 --- a/lib/ldb-samba/pyldb.c +++ b/lib/ldb-samba/pyldb.c @@ -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 = { diff --git a/lib/ldb-samba/samba_extensions.c b/lib/ldb-samba/samba_extensions.c index 45b01e1b447..65a4079ec97 100644 --- a/lib/ldb-samba/samba_extensions.c +++ b/lib/ldb-samba/samba_extensions.c @@ -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; } @@ -51,7 +51,7 @@ static struct poptOption cmdline_extensions[] = { POPT_COMMON_CREDENTIALS POPT_COMMON_CONNECTION POPT_COMMON_VERSION - { NULL } + {0} }; /* diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index eb879b98984..813cdb0870e 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -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; @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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." diff --git a/lib/ldb/tools/cmdline.c b/lib/ldb/tools/cmdline.c index d53161574fd..e5bb499c97e 100644 --- a/lib/ldb/tools/cmdline.c +++ b/lib/ldb/tools/cmdline.c @@ -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) diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index 12c7325fcac..cc5a6a812ea 100644 --- a/lib/talloc/pytalloc.c +++ b/lib/talloc/pytalloc.c @@ -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} }; /** diff --git a/lib/talloc/test_pytalloc.c b/lib/talloc/test_pytalloc.c index 6797b98c6b9..3b0484b2274 100644 --- a/lib/talloc/test_pytalloc.c +++ b/lib/talloc/test_pytalloc.c @@ -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; diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c index 69da98c34d4..2ea2042c1e5 100644 --- a/lib/tdb/pytdb.c +++ b/lib/tdb/pytdb.c @@ -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) diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index dde6bd010c7..93375f71868 100644 --- a/lib/tevent/pytevent.c +++ b/lib/tevent/pytevent.c @@ -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) @@ -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 = { @@ -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, @@ -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) @@ -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) @@ -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) @@ -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) @@ -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.") diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c index d8a781b5290..0908a6bce3c 100644 --- a/libcli/nbt/pynbt.c +++ b/libcli/nbt/pynbt.c @@ -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 = { diff --git a/libcli/security/pysecurity.c b/libcli/security/pysecurity.c index 9f4aa147c6a..80730485242 100644 --- a/libcli/security/pysecurity.c +++ b/libcli/security/pysecurity.c @@ -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 = { diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index 97bbb3ec528..29c8b11886e 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -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, @@ -120,7 +120,7 @@ static PyMethodDef GPO_methods[] = { py_gpo_get_unix_path), METH_VARARGS | METH_KEYWORDS, NULL }, - {NULL} + {0} }; static PyTypeObject GPOType = { @@ -493,7 +493,7 @@ static PyMethodDef ADS_methods[] = { METH_VARARGS | METH_KEYWORDS, NULL }, #endif - { NULL } + {0} }; static PyTypeObject ads_ADSType = { @@ -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 = { diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c index 914c67e98e2..2872a85b621 100644 --- a/librpc/tools/ndrdump.c +++ b/librpc/tools/ndrdump.c @@ -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; diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index e72d32db391..344f48987d1 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -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(""); diff --git a/python/pyglue.c b/python/pyglue.c index ef1419fbd88..aff9365d11b 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -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 = { diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index e61ca5c1993..bfa6f1bec24 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1654,7 +1654,7 @@ static PyTypeObject py_cli_state_type = { }; static PyMethodDef py_libsmb_methods[] = { - { NULL }, + {0}, }; void initlibsmb_samba_internal(void); diff --git a/source3/param/pyparam.c b/source3/param/pyparam.c index 6f709afe96e..749cfe308f4 100644 --- a/source3/param/pyparam.c +++ b/source3/param/pyparam.c @@ -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 = { diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 6b7d2a0a7b8..70238e43d41 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -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}, }; @@ -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 = { diff --git a/source3/rpc_client/py_mdscli.c b/source3/rpc_client/py_mdscli.c index 05dd0390cbd..290be3f86d9 100644 --- a/source3/rpc_client/py_mdscli.c +++ b/source3/rpc_client/py_mdscli.c @@ -243,7 +243,7 @@ static PyMethodDef search_methods[] = { .ml_flags = METH_VARARGS|METH_KEYWORDS, .ml_doc = "", }, - { NULL }, + {0}, }; static PyObject *search_new(PyTypeObject *type, @@ -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, @@ -521,7 +521,7 @@ static PyTypeObject conn_type = { }; static PyMethodDef mdscli_methods[] = { - { NULL }, + {0}, }; static struct PyModuleDef moduledef = { diff --git a/source3/rpcclient/cmd_spotlight.c b/source3/rpcclient/cmd_spotlight.c index 5bc5eb10888..661ada7efb8 100644 --- a/source3/rpcclient/cmd_spotlight.c +++ b/source3/rpcclient/cmd_spotlight.c @@ -456,5 +456,5 @@ struct cmd_set spotlight_commands[] = { .description = "Fetch attributes for a CNID", .usage = "", }, - { NULL } + {0} }; diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index bdae3bc636e..df2b3b57f2a 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -4640,7 +4640,7 @@ int posix_sys_acl_blob_get_file(vfs_handle_struct *handle, TALLOC_CTX *frame = talloc_stackframe(); /* Initialise this to zero, in a portable way */ struct smb_acl_wrapper acl_wrapper = { - NULL + 0 }; struct smb_filename *smb_fname = cp_smb_filename_nostream(frame, smb_fname_in); diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index d5a1bd99bff..9f5663e2e43 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -1164,7 +1164,7 @@ static PyMethodDef py_smbd_methods[] = { PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_create_file), METH_VARARGS|METH_KEYWORDS, NULL }, - { NULL } + {0} }; void initsmbd(void); diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 5037d5f116d..3c16b73310a 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -2058,5 +2058,5 @@ struct cmd_set vfs_commands[] = { { "test_chain", cmd_test_chain, "test chain code", "test_chain" }, { "translate_name", cmd_translate_name, "VFS translate_name()", "translate_name unix_filename" }, - { NULL } + {0} }; diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index d779f0d14ea..6836b3ad7db 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -1689,7 +1689,7 @@ struct poptOption help_options[] = { NULL, NULL }, { "help", '?', 0, NULL, '?', "Show this help message", NULL }, { "usage", '\0', 0, NULL, 'u', "Display brief usage message", NULL }, - { NULL } + {0} } ; /* Main program */ diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index a73ca9302dd..75ce478d4c9 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -693,7 +693,7 @@ static PyMethodDef py_gensec_security_methods[] = { "S.sign_packet(data, whole_pdu) -> sig\nSign a DCERPC packet." }, { "check_packet", (PyCFunction)py_gensec_check_packet, METH_VARARGS, "S.check_packet(data, whole_pdu, sig)\nCheck a DCERPC packet." }, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c index 4203692025b..ed88a1751fe 100644 --- a/source4/auth/pyauth.c +++ b/source4/auth/pyauth.c @@ -434,7 +434,7 @@ static PyMethodDef py_auth_methods[] = { PY_DISCARD_FUNC_SIG(PyCFunction,py_copy_session_info), METH_VARARGS|METH_KEYWORDS, NULL }, - { NULL }, + {0}, }; static struct PyModuleDef moduledef = { diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index dadff84bda5..adc123b5e9c 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -622,7 +622,7 @@ int main(int argc, const char ** argv) POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; /* Block sizes. */ diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c index f2c93c21af5..4fafea17751 100644 --- a/source4/dns_server/dlz_bind9.c +++ b/source4/dns_server/dlz_bind9.c @@ -544,7 +544,7 @@ static isc_result_t parse_options(struct dlz_bind9_data *state, struct poptOption long_options[] = { { "url", 'H', POPT_ARG_STRING, &options->url, 0, "database URL", "URL" }, { "debug", 'd', POPT_ARG_STRING, &options->debug, 0, "debug level", "DEBUG" }, - { NULL } + {0} }; pc = poptGetContext("dlz_bind9", argc, argv, long_options, diff --git a/source4/dns_server/pydns.c b/source4/dns_server/pydns.c index 9d4c1dd1727..1e6a1cb6105 100644 --- a/source4/dns_server/pydns.c +++ b/source4/dns_server/pydns.c @@ -336,7 +336,7 @@ static PyMethodDef py_dsdb_dns_methods[] = { METH_VARARGS, "Replace the DNS database entries for a LDB DN"}, { "extract", (PyCFunction)py_dsdb_dns_extract, METH_VARARGS, "Return the DNS database entry as a python structure from an Ldb.MessageElement of type dnsRecord"}, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index fd25347c229..79015545109 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -1479,7 +1479,7 @@ static PyMethodDef py_dsdb_methods[] = { "_dsdb_allocate_rid(samdb)" " -> RID" }, { "_dsdb_load_udv_v2", (PyCFunction)py_dsdb_load_udv_v2, METH_VARARGS, NULL }, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/dsdb/samdb/ldb_modules/count_attrs.c b/source4/dsdb/samdb/ldb_modules/count_attrs.c index eb762cc25aa..aa9e2807e05 100644 --- a/source4/dsdb/samdb/ldb_modules/count_attrs.c +++ b/source4/dsdb/samdb/ldb_modules/count_attrs.c @@ -150,7 +150,7 @@ static int increment_req_vs_found(struct tdb_context *tdb, .dptr = (unsigned char *)k, .dsize = sizeof(k) }; - TDB_DATA data = {NULL}; + TDB_DATA data = {0}; ssize_t n_req = ac->n_attrs; if (ac->is_null) { n_req = NULL_REQ_PSEUDO_N; diff --git a/source4/lib/policy/pypolicy.c b/source4/lib/policy/pypolicy.c index ca25d190134..f40d811a50f 100644 --- a/source4/lib/policy/pypolicy.c +++ b/source4/lib/policy/pypolicy.c @@ -143,7 +143,7 @@ static PyMethodDef py_policy_methods[] = { "get_gplink_options(options) -> list" }, { "ads_to_dir_access_mask", (PyCFunction)py_ads_to_dir_access_mask, METH_VARARGS, "ads_to_dir_access_mask(access_mask) -> dir_mask" }, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index b08cf4f09e7..f4201c3ca9e 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -153,7 +153,7 @@ static PyMethodDef registry_methods[] = { "Apply the diff from the specified file" }, { "mount_hive", py_mount_hive, METH_VARARGS, "S.mount_hive(key, key_id, elements=None) -> None\n" "Mount the specified key at the specified path." }, - { NULL } + {0} }; PyTypeObject PyRegistry = { @@ -240,7 +240,7 @@ static PyMethodDef hive_key_methods[] = { "Delete a value" }, { "set_value", py_hive_key_set_value, METH_VARARGS, "S.set_value(name, type, data) -> None\n" "Set a value" }, - { NULL } + {0} }; static PyObject *hive_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { @@ -443,7 +443,7 @@ static PyMethodDef py_registry_methods[] = { METH_VARARGS|METH_KEYWORDS, "open_hive(location, session_info=None, credentials=None, loadparm_context=None) -> key" }, { "str_regtype", py_str_regtype, METH_VARARGS, "str_regtype(int) -> str" }, { "get_predef_name", py_get_predef_name, METH_VARARGS, "get_predef_name(hkey) -> str" }, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index da813336b85..b5cf4dd2566 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -82,7 +82,7 @@ int main(int argc, const char **argv) POPT_COMMON_SAMBA POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; TALLOC_CTX *ctx; void *callback_data; diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 50195fe084c..4db7a5090e0 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -41,7 +41,7 @@ int main(int argc, const char **argv) {"file", 'F', POPT_ARG_STRING, &file, 0, "file path", NULL }, POPT_COMMON_SAMBA POPT_COMMON_CREDENTIALS - { NULL } + {0} }; pc = poptGetContext(argv[0], argc, argv, long_options,0); diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 48251c33ea4..eebec4353cb 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -380,7 +380,7 @@ static struct { {"help", "?", "Help", cmd_help }, {"exit", "quit", "Exit", cmd_exit }, {"predef", "predefined", "Go to predefined key", cmd_predef }, - {NULL } + {0} }; static WERROR cmd_help(struct regshell_context *ctx, @@ -570,7 +570,7 @@ int main(int argc, const char **argv) POPT_COMMON_SAMBA POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; pc = poptGetContext(argv[0], argc, argv, long_options,0); diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index d4319f5f6bb..f147e2707f7 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -120,7 +120,7 @@ int main(int argc, const char **argv) POPT_COMMON_SAMBA POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; pc = poptGetContext(argv[0], argc, argv, long_options,0); diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c index 19bfdd56559..96f499614ce 100644 --- a/source4/librpc/ndr/py_security.c +++ b/source4/librpc/ndr/py_security.c @@ -150,7 +150,7 @@ static PyMethodDef py_dom_sid_extra_methods[] = { { "split", (PyCFunction)py_dom_sid_split, METH_NOARGS, "S.split() -> (domain_sid, rid)\n" "Split a domain sid" }, - { NULL } + {0} }; @@ -306,7 +306,7 @@ static PyMethodDef py_descriptor_extra_methods[] = { NULL }, { "as_sddl", (PyCFunction)py_descriptor_as_sddl, METH_VARARGS, NULL }, - { NULL } + {0} }; static void py_descriptor_patch(PyTypeObject *type) @@ -422,7 +422,7 @@ static PyMethodDef py_token_extra_methods[] = { NULL }, { "set_privilege", (PyCFunction)py_token_set_privilege, METH_VARARGS, NULL }, - { NULL } + {0} }; #define PY_TOKEN_PATCH py_token_patch @@ -479,7 +479,7 @@ static PyMethodDef py_mod_security_extra_methods[] = { { "random_sid", (PyCFunction)py_random_sid, METH_NOARGS, NULL }, { "privilege_id", (PyCFunction)py_privilege_id, METH_VARARGS, NULL }, { "privilege_name", (PyCFunction)py_privilege_name, METH_VARARGS, NULL }, - { NULL } + {0} }; static void py_mod_security_patch(PyObject *m) diff --git a/source4/librpc/ndr/py_xattr.c b/source4/librpc/ndr/py_xattr.c index 4052399bece..221b9771e0d 100644 --- a/source4/librpc/ndr/py_xattr.c +++ b/source4/librpc/ndr/py_xattr.c @@ -87,7 +87,7 @@ static PyObject *py_ntacl_print(PyObject *self, PyObject *args) static PyMethodDef py_ntacl_extra_methods[] = { { "dump", (PyCFunction)py_ntacl_print, METH_NOARGS, NULL }, - { NULL } + {0} }; static void py_xattr_NTACL_patch(PyTypeObject *type) diff --git a/source4/ntvfs/posix/python/pyposix_eadb.c b/source4/ntvfs/posix/python/pyposix_eadb.c index ef4db0e867a..c64a388bfc7 100644 --- a/source4/ntvfs/posix/python/pyposix_eadb.c +++ b/source4/ntvfs/posix/python/pyposix_eadb.c @@ -116,7 +116,7 @@ static PyMethodDef py_posix_eadb_methods[] = { "Set the given attribute to the given value on the given file." }, { "is_xattr_supported", (PyCFunction)py_is_xattr_supported, METH_NOARGS, "Return true if xattr are supported on this system\n"}, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/ntvfs/posix/python/pyxattr_native.c b/source4/ntvfs/posix/python/pyxattr_native.c index 7d5bee0c37c..3be896911f2 100644 --- a/source4/ntvfs/posix/python/pyxattr_native.c +++ b/source4/ntvfs/posix/python/pyxattr_native.c @@ -105,7 +105,7 @@ static PyMethodDef py_xattr_methods[] = { "Set the given attribute to the given value on the given file." }, { "is_xattr_supported", (PyCFunction)py_is_xattr_supported, METH_NOARGS, "Return true if xattr are supported on this system\n"}, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c b/source4/ntvfs/posix/python/pyxattr_tdb.c index 397cae77bc9..b457c86e066 100644 --- a/source4/ntvfs/posix/python/pyxattr_tdb.c +++ b/source4/ntvfs/posix/python/pyxattr_tdb.c @@ -152,7 +152,7 @@ static PyMethodDef py_xattr_methods[] = { "Set the given attribute to the given value on the given file." }, { "is_xattr_supported", (PyCFunction)py_is_xattr_supported, METH_NOARGS, "Return true if xattr are supported on this system\n"}, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 63da7d64242..5e5e1d370cd 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -446,7 +446,7 @@ static PyMethodDef py_lp_ctx_methods[] = { { "state_path", py_state_path, METH_VARARGS, "S.state_path(name) -> string\n" "Returns a path in the Samba state directory." }, - { NULL } + {0} }; static PyObject *py_lp_ctx_default_service(PyObject *self, void *closure) @@ -605,7 +605,7 @@ static PyObject *py_lp_service_dump(PyObject *self, PyObject *args) static PyMethodDef py_lp_service_methods[] = { { "dump", (PyCFunction)py_lp_service_dump, METH_VARARGS, "S.dump(default_service, show_defaults=False, file_name='', mode='w')" }, - { NULL } + {0} }; PyTypeObject PyLoadparmService = { @@ -650,7 +650,7 @@ static PyMethodDef pyparam_methods[] = { "Returns the compiled in BINDIR." }, { "sbin_dir", (PyCFunction)py_sbin_dir, METH_NOARGS, "Returns the compiled in SBINDIR." }, - { NULL } + {0} }; static struct PyModuleDef moduledef = { diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index f6cf4aa28b7..54dfcc26576 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -3318,7 +3318,7 @@ int main(int argc, const char *argv[]) POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; TALLOC_CTX *mem_ctx = NULL; diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c index 1fd5697a27a..bd0ae3a382a 100644 --- a/source4/torture/ldb/ldb.c +++ b/source4/torture/ldb/ldb.c @@ -1331,9 +1331,6 @@ static bool torture_ldb_unpack_data_corrupt(struct torture_context *torture) int i, j, current, expect_rcode, ret; const char *comment; - const char *comment_fmt = "Expected unpack rcode for index %d " - "(corrupt bytes index %d) " - "to be %d but got %d"; /* * List of corruptible byte ranges. First 12 bytes are corruptible, @@ -1358,9 +1355,15 @@ static bool torture_ldb_unpack_data_corrupt(struct torture_context *torture) ret = ldb_unpack_data(ldb, &bin_copy, msg); - comment = talloc_asprintf(bin_copy.data, comment_fmt, - current, i, - expect_rcode, ret); + comment = talloc_asprintf( + bin_copy.data, + "Expected unpack rcode for index %d " + "(corrupt bytes index %d) " + "to be %d but got %d", + current, + i, + expect_rcode, + ret); torture_assert_int_equal(torture, ret, expect_rcode, comment); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index 546231fabec..97e0b6c0abd 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -578,7 +578,7 @@ int main(int argc, const char *argv[]) POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; TALLOC_CTX *mem_ctx = NULL; int ret = -1; diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index 5b9d1b2901f..35ec2e9d040 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -317,7 +317,7 @@ int main(int argc, const char *argv[]) POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; setlinebuf(stdout); diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 90b2b04cd88..1dbbe6c8301 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -426,7 +426,7 @@ int main(int argc, const char *argv[]) POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS POPT_COMMON_VERSION - { NULL } + {0} }; setlinebuf(stdout); diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index 01d2890e17d..a094ce0ab65 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -6898,7 +6898,7 @@ static bool test_empty_stream(struct torture_context *tctx, tcase_afpresource_rw, tcase_foo_ro, tcase_foo_rw, - {NULL} + {0} }; ret = torture_smb2_connection(tctx, &tree2); diff --git a/source4/utils/oLschema2ldif/main.c b/source4/utils/oLschema2ldif/main.c index 601b8a8f1f2..a3445f8ffe6 100644 --- a/source4/utils/oLschema2ldif/main.c +++ b/source4/utils/oLschema2ldif/main.c @@ -49,7 +49,7 @@ static struct poptOption popt_options[] = { { "output", 'O', POPT_ARG_STRING, &options.output, 0, "outputfile otherwise STDOUT", "outputfile"}, POPT_COMMON_VERSION - { NULL } + {0} };