From: Matthew Fernandez Date: Thu, 14 Jul 2022 00:14:14 +0000 (-0700) Subject: squash Clang -Wmissing-field-initializers warnings X-Git-Tag: 5.0.1~38^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbdc6db3faf20a9eb2f2d5fac465e3f71c54af73;p=graphviz squash Clang -Wmissing-field-initializers warnings Clang seems to consider `{NULL}` different from `{0}`, with the latter being an intent of zero initialization and the former a possible accidental omission of other fields. --- diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index b0e7e8332..5108924b9 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -266,9 +266,9 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, const char *str) const strview_t reqtyp = strview(str, ':'); - strview_t reqdep = {NULL}; + strview_t reqdep = {0}; - strview_t reqpkg = {NULL}; + strview_t reqpkg = {0}; if (reqtyp.data[reqtyp.size] == ':') { reqdep = strview(reqtyp.data + reqtyp.size + strlen(":"), ':'); @@ -281,7 +281,7 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, const char *str) for (pnext = gvc->apis[api]; pnext; pnext = pnext->next) { const strview_t typ = strview(pnext->typestr, ':'); - strview_t dep = {NULL}; + strview_t dep = {0}; if (typ.data[typ.size] == ':') { dep = strview(typ.data + typ.size + strlen(":"), '\0'); } @@ -372,7 +372,7 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str) } if (new) { /* if the type was not found, or if str without ':', then just list available types */ - strview_t type_last = {NULL}; + strview_t type_last = {0}; for (pnext = plugin; pnext; pnext = pnext->next) { /* list only one instance of type */ const strview_t type = strview(pnext->typestr, ':'); @@ -424,7 +424,7 @@ char **gvPluginList(GVC_t * gvc, const char *kind, int *sz, const char *str) /* point to the beginning of the linked list of plugins for this api */ plugin = gvc->apis[api]; - strview_t typestr_last = {NULL}; + strview_t typestr_last = {0}; for (pnext = plugin; pnext; pnext = pnext->next) { /* list only one instance of type */ strview_t q = strview(pnext->typestr, ':'); diff --git a/lib/label/xlabels.c b/lib/label/xlabels.c index 9bb10b0a8..c062f30fc 100644 --- a/lib/label/xlabels.c +++ b/lib/label/xlabels.c @@ -404,7 +404,7 @@ static BestPos_t xladjust(XLabels_t * xlp, object_t * objp) xlabel_t *lp = objp->lbl; double xincr = ((2 * lp->sz.x) + objp->sz.x) / XLXDENOM; double yincr = ((2 * lp->sz.y) + objp->sz.y) / XLYDENOM; - object_t *intrsx[XLNBR] = {NULL}; + object_t *intrsx[XLNBR] = {0}; BestPos_t bp, nbp; assert(objp->lbl);