From 8e3674dcc12654e48e9c85e5aff2d56642512321 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 25 Oct 2010 13:07:50 +0100 Subject: [PATCH] Avoid variable length arrays in clutter-backend-x11 There was an array whose length was define by a static const int variable. GCC seems to consider this a variable-length array so it will cause warnings now that -Wvla is enabled. We might as well make this constant a #define instead to avoid the warning. --- clutter/x11/clutter-backend-x11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 084839674..2654c0fd5 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -84,7 +84,7 @@ static const gchar *atom_names[] = { "UTF8_STRING", }; -static const guint n_atom_names = G_N_ELEMENTS (atom_names); +#define N_ATOM_NAMES G_N_ELEMENTS (atom_names) /* singleton object */ static ClutterBackendX11 *backend_singleton = NULL; @@ -289,7 +289,7 @@ clutter_backend_x11_post_parse (ClutterBackend *backend, if (backend_x11->xdpy) { ClutterSettings *settings; - Atom atoms[n_atom_names]; + Atom atoms[N_ATOM_NAMES]; double dpi; CLUTTER_NOTE (BACKEND, "Getting the X screen"); @@ -343,7 +343,7 @@ clutter_backend_x11_post_parse (ClutterBackend *backend, XSynchronize (backend_x11->xdpy, True); XInternAtoms (backend_x11->xdpy, - (char **) atom_names, n_atom_names, + (char **) atom_names, N_ATOM_NAMES, False, atoms); backend_x11->atom_NET_WM_PID = atoms[0];