Fix clang 9 missing-field-initializer warnings
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 5 May 2020 01:47:39 +0000 (13:47 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 8 May 2020 09:31:31 +0000 (09:31 +0000)
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
53 files changed:
auth/credentials/pycredentials.c
buildtools/wafsamba/samba_autoconf.py
examples/libsmbclient/testbrowse.c
lib/crypto/py_crypto.c
lib/ldb-samba/pyldb.c
lib/ldb-samba/samba_extensions.c
lib/ldb/pyldb.c
lib/ldb/tools/cmdline.c
lib/talloc/pytalloc.c
lib/talloc/test_pytalloc.c
lib/tdb/pytdb.c
lib/tevent/pytevent.c
libcli/nbt/pynbt.c
libcli/security/pysecurity.c
libgpo/pygpo.c
librpc/tools/ndrdump.c
pidl/lib/Parse/Pidl/Samba4/Python.pm
python/pyglue.c
source3/libsmb/pylibsmb.c
source3/param/pyparam.c
source3/passdb/py_passdb.c
source3/rpc_client/py_mdscli.c
source3/rpcclient/cmd_spotlight.c
source3/smbd/posix_acls.c
source3/smbd/pysmbd.c
source3/torture/cmd_vfs.c
source3/utils/smbcontrol.c
source4/auth/gensec/pygensec.c
source4/auth/pyauth.c
source4/client/cifsdd.c
source4/dns_server/dlz_bind9.c
source4/dns_server/pydns.c
source4/dsdb/pydsdb.c
source4/dsdb/samdb/ldb_modules/count_attrs.c
source4/lib/policy/pypolicy.c
source4/lib/registry/pyregistry.c
source4/lib/registry/tools/regdiff.c
source4/lib/registry/tools/regpatch.c
source4/lib/registry/tools/regshell.c
source4/lib/registry/tools/regtree.c
source4/librpc/ndr/py_security.c
source4/librpc/ndr/py_xattr.c
source4/ntvfs/posix/python/pyposix_eadb.c
source4/ntvfs/posix/python/pyxattr_native.c
source4/ntvfs/posix/python/pyxattr_tdb.c
source4/param/pyparam.c
source4/torture/gentest.c
source4/torture/ldb/ldb.c
source4/torture/locktest.c
source4/torture/masktest.c
source4/torture/smbtorture.c
source4/torture/vfs/fruit.c
source4/utils/oLschema2ldif/main.c

index fad07b84ba7eae0e95f2dff125763ffb8230b050..a5d0f9e051cc4ffd81c2d12ecf52684d3a6dd0f1 100644 (file)
@@ -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 = {
index 5534c2f6a9fef5be65139f9b0e95a15cba5291f8..1533ff0c46d7b7f19cad1cdeb109efd26d1c3d7e 100644 (file)
@@ -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)
index 0629653ef8b0e5013fe3f9eab80174c3441039b1..1609e2f4f9153e37996d0a0c8181c498b63fd389 100644 (file)
@@ -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);
index c85cd2c13d24e03b666b9c79c446bb121a89e369..32b946eee8f7bd24a17660a7c50e36060d8d0dbe 100644 (file)
@@ -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 = {
index 48adc74b16aa4bb0006f0c66260b83dd865bc3c9..bea489489efe9ad89f7cbc81e2176117f8cf8226 100644 (file)
@@ -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 = {
index 45b01e1b447acb3d4bb1e76f0bf3469bc3fffdd5..65a4079ec97e1030baaaa2a9105c5dce398c3509 100644 (file)
@@ -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}
 };
 
 /*
index eb879b98984dbe349ba1e974beeba5a095cb4887..813cdb0870eb0f62057e1091c4a33d2e0e1d5016 100644 (file)
@@ -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."
index d53161574fdb4bda2f8a5b346befbd6ae5e90a9f..e5bb499c97e138f6873e5e57c744afaaac6aed94 100644 (file)
@@ -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)
index 12c7325fcac340f590bb30a1165fdc6a7f7b1590..cc5a6a812eac26c3b052959261fb2b635dbe64d5 100644 (file)
@@ -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}
 };
 
 /**
index 6797b98c6b90732f6b1680f140e37ae7f2ddbf49..3b0484b2274f06432694b03f9189dcecb30ced4d 100644 (file)
@@ -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;
index 69da98c34d45aa7bdbc39130b27a73d4bbd5f330..2ea2042c1e5d13bdcd4aaffbaf6d8d06a7cef6ab 100644 (file)
@@ -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)
index dde6bd010c73fc36d00ef19459ede30348b1b085..93375f718682e15d3ce02b03b0862bcba6b979c0 100644 (file)
@@ -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.")
index d8a781b529096429c027dcdab26a344c9084c3f3..0908a6bce3c60220aece09fbb1512b35fe0fb19a 100644 (file)
@@ -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 = {
index 9f4aa147c6a20f2c8ac912e66f81365ebac99a35..807304852426938c8c9e1acd572adb160744195c 100644 (file)
@@ -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 = {
index 97bbb3ec528c850d3e37cae7923e396c12fde86f..29c8b11886e5cac59ced5e15f452698643abff70 100644 (file)
@@ -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 = {
index 914c67e98e2124ebe3237c41ac635ede47e1ad8b..2872a85b62130579829040e6f9b98a43ed7cb0b7 100644 (file)
@@ -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;
index e72d32db3919829173c082a453e9c117c58caca8..344f48987d1a8d69d5d2ac3fd0c1fc76589f8c60 100644 (file)
@@ -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("");
index ef1419fbd883f416d3293b6d0bc87bea359ec938..aff9365d11b2c05d7dba5f24dd0ba783efe4bb0c 100644 (file)
@@ -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 = {
index e61ca5c1993d0924bbd2f4e0897ed7bbfc2fc567..bfa6f1bec24777a0cf0fa9953011ffb8867365a4 100644 (file)
@@ -1654,7 +1654,7 @@ static PyTypeObject py_cli_state_type = {
 };
 
 static PyMethodDef py_libsmb_methods[] = {
-       { NULL },
+       {0},
 };
 
 void initlibsmb_samba_internal(void);
index 6f709afe96ec4650e9d90b27a14d2860daf221f3..749cfe308f4d845da7ea7ee9a2531010d22b746e 100644 (file)
@@ -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 = {
index 6b7d2a0a7b8eeb755fff0e313022fc36c576cb27..70238e43d4176145eaeb9aba16c16e99ed9368e6 100644 (file)
@@ -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 = {
index 05dd0390cbd94444dfa70d8ef66ddf542155afb5..290be3f86d9c5c7c12bab54e42e23cf14a5c265a 100644 (file)
@@ -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 = {
index 5bc5eb1088891dbe3f114e35f87d3370bab30c2d..661ada7efb82ba4de05d8da037c7d2f525de4cb2 100644 (file)
@@ -456,5 +456,5 @@ struct cmd_set spotlight_commands[] = {
                .description = "Fetch attributes for a CNID",
                .usage = "",
        },
-       { NULL }
+       {0}
 };
index bdae3bc636e79a2762d93de4894f94d0865430e0..df2b3b57f2ae06b2ab67e1027746d100290e6434 100644 (file)
@@ -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);
index d5a1bd99bffa6b08b8d059e7f163e0c7cc894e69..9f5663e2e43e1ff9e0373a5d58626488346628ab 100644 (file)
@@ -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);
index 5037d5f116d914f9ab8770072637eb99438b5d19..3c16b73310a71e66178ea66dd3d296decec9f60c 100644 (file)
@@ -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}
 };
index d779f0d14ea7b5e2bd62da382bbe4a0ca3b1bbb8..6836b3ad7dbed15e9d092822b44c9582e68c1cca 100644 (file)
@@ -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 */
index a73ca9302dde4800053c4d71222c7e7eba020d2e..75ce478d4c9d8ffb23d3f5183029b8da923e43d2 100644 (file)
@@ -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 = {
index 4203692025bde26dd994c026bc9c53a5fba932e7..ed88a1751fec5a1f3757cdbdf3685f7b90b0128b 100644 (file)
@@ -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 = {
index dadff84bda53df3af74676ab50a5cb7ba72b5be2..adc123b5e9c3f56a46f1dfc9901c7a3e85f6cc46 100644 (file)
@@ -622,7 +622,7 @@ int main(int argc, const char ** argv)
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
                POPT_COMMON_VERSION
-               { NULL }
+               {0}
        };
 
        /* Block sizes. */
index f2c93c21af58a655b4fca45b65222db5cf061ab0..4fafea17751b76b1a189912e1c8723f22d7c3e80 100644 (file)
@@ -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,
index 9d4c1dd1727d32979d704c7027af1829af6ed073..1e6a1cb6105a36fe0b95bb63881eccd4822e5eb2 100644 (file)
@@ -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 = {
index fd25347c22930cdf7f6f2bde0b83c3cb00c2d0a8..79015545109f1dce6468c2cf10f1e1377bb1e1f5 100644 (file)
@@ -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 = {
index eb762cc25aa62d9008dfaec198be9c73cc4368ea..aa9e2807e050c16c99a490e3742b17276bf58cde 100644 (file)
@@ -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;
index ca25d190134e8e917b150332e562590e5b89ce7d..f40d811a50fa264abccbfe99b303cc1e0843add8 100644 (file)
@@ -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 = {
index b08cf4f09e77436537154fa9d9efdcd463697d50..f4201c3ca9e2fef62a178f957f40986d93ac34a4 100644 (file)
@@ -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 = {
index da813336b85e8a2d1bf66fdb04a84998934085d7..b5cf4dd2566753c75db73c23f7ff4066c66a8025 100644 (file)
@@ -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;
index 50195fe084c30b03a89727377254aca6f5e85bf5..4db7a5090e0f375c75702aee69c361aa21203f8f 100644 (file)
@@ -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);
index 48251c33ea4a038f22b80749067c8b3c9c3bd8c9..eebec4353cb5dd469adad4f046d512d1a0adeefd 100644 (file)
@@ -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);
index d4319f5f6bbc839797e370e0749d034462aa162f..f147e2707f7e4812f45bef9847b2cfb78ad13a9f 100644 (file)
@@ -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);
index 19bfdd56559bb835b5fa5c9c5feba2f1d448a9d3..96f499614cef4408cb040d765a1f85393299c06f 100644 (file)
@@ -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)
index 4052399becea0113201ae1d188859393f4a56baf..221b9771e0d391340d105ce91ee252a4e6fabb36 100644 (file)
@@ -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)
index ef4db0e867a20f60aefb5c867311d6ed7d2b5b90..c64a388bfc72e54b7bc218212f29ef4f183db638 100644 (file)
@@ -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 = {
index 7d5bee0c37cb5e7539b70f172bbac372377fd2cc..3be896911f21ea1f22a03530686a307da23cbd69 100644 (file)
@@ -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 = {
index 397cae77bc98093a463ac1a10b93122c40191d24..b457c86e066e45a88b3f83766be84d7ad43e3bce 100644 (file)
@@ -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 = {
index 63da7d64242f577311be3d152fabc8c4e5f2bd9a..5e5e1d370cd7d7cec123223f6a41533367892792 100644 (file)
@@ -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 = {
index f6cf4aa28b7b3932f8a648ead1ae5de6f16cd648..54dfcc265768ee9e6e11cf3fb602633e58539715 100644 (file)
@@ -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;
 
index 1fd5697a27afb40c64972059caaf99d22c20d31f..bd0ae3a382a00c35c3a09ddc272f1813151857fa 100644 (file)
@@ -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);
 
index 546231fabec5da069791a77f502cbb7c9e5966a8..97e0b6c0abde86c24d06a92290a723fc829b897d 100644 (file)
@@ -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;
index 5b9d1b2901f1d38528eeb812011c16b45d45a5d2..35ec2e9d040eee934e2e73a1c906a7e92276fd7f 100644 (file)
@@ -317,7 +317,7 @@ int main(int argc, const char *argv[])
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
                POPT_COMMON_VERSION
-               { NULL }
+               {0}
        };
 
        setlinebuf(stdout);
index 90b2b04cd88b6a8790b3881c43c061e204793117..1dbbe6c8301ddadb328b73d341add48cacc1bff8 100644 (file)
@@ -426,7 +426,7 @@ int main(int argc, const char *argv[])
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
                POPT_COMMON_VERSION
-               { NULL }
+               {0}
        };
 
        setlinebuf(stdout);
index 01d2890e17d5169c2167933de2fc77969bffe6b8..a094ce0ab6515eba6fda46d5810626f793d5b30b 100644 (file)
@@ -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);
index 601b8a8f1f22dbd3c6831df3627d56c485210a0e..a3445f8ffe67925cce04b0f80e18178b74553bd8 100644 (file)
@@ -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}
 };