build: Don't turn off critical warnings

-Wint-conversion is important because it checks casts from ints to
pointers.

-Wdiscarded-qualifiers is important to catch cases where we don't
strings when we should.
This commit is contained in:
Benjamin Otte 2017-10-06 16:01:19 +02:00
parent defcf17d3d
commit c1e9869329
10 changed files with 29 additions and 31 deletions

View File

@ -901,10 +901,10 @@ map_named_shm (char *name, gsize size)
#endif #endif
} }
static char * static const char *
parse_line (char *line, char *key) parse_line (const char *line, const char *key)
{ {
char *p; const char *p;
if (!g_str_has_prefix (line, key)) if (!g_str_has_prefix (line, key))
return NULL; return NULL;
@ -970,15 +970,15 @@ static void
start_input (HttpRequest *request) start_input (HttpRequest *request)
{ {
char **lines; char **lines;
char *p; const char *p;
int i; int i;
char *res; char *res;
char *origin, *host; const char *origin, *host;
BroadwayInput *input; BroadwayInput *input;
const void *data_buffer; const void *data_buffer;
gsize data_buffer_size; gsize data_buffer_size;
GInputStream *in; GInputStream *in;
char *key; const char *key;
GSocket *socket; GSocket *socket;
int flag = 1; int flag = 1;

View File

@ -421,7 +421,7 @@ main (int argc, char *argv[])
int http_port = 0; int http_port = 0;
char *ssl_cert = NULL; char *ssl_cert = NULL;
char *ssl_key = NULL; char *ssl_key = NULL;
char *display; const char *display;
int port = 0; int port = 0;
const GOptionEntry entries[] = { const GOptionEntry entries[] = {
{ "port", 'p', 0, G_OPTION_ARG_INT, &http_port, "Httpd port", "PORT" }, { "port", 'p', 0, G_OPTION_ARG_INT, &http_port, "Httpd port", "PORT" },

View File

@ -35,7 +35,7 @@ translate_buttons (char *layout, int *len_p)
while ((button = strsep (&strp, ","))) while ((button = strsep (&strp, ",")))
{ {
char *gtkbutton; const char *gtkbutton;
if (strcmp (button, "menu") == 0) if (strcmp (button, "menu") == 0)
gtkbutton = "icon"; gtkbutton = "icon";

View File

@ -81,9 +81,9 @@ parse_boolean (char *v)
} }
static gboolean static gboolean
get_boolean_default (Display *dpy, get_boolean_default (Display *dpy,
gchar *option, const gchar *option,
gboolean *value) gboolean *value)
{ {
gchar *v; gchar *v;
gint i; gint i;
@ -103,9 +103,9 @@ get_boolean_default (Display *dpy,
} }
static gboolean static gboolean
get_double_default (Display *dpy, get_double_default (Display *dpy,
gchar *option, const gchar *option,
gdouble *value) gdouble *value)
{ {
gchar *v, *e; gchar *v, *e;
@ -126,9 +126,9 @@ get_double_default (Display *dpy,
} }
static gboolean static gboolean
get_integer_default (Display *dpy, get_integer_default (Display *dpy,
gchar *option, const gchar *option,
gint *value) gint *value)
{ {
gchar *v, *e; gchar *v, *e;

View File

@ -458,7 +458,7 @@ read_settings (GdkX11Screen *x11_screen,
g_value_init (copy, G_VALUE_TYPE (setting)); g_value_init (copy, G_VALUE_TYPE (setting));
g_value_copy (setting, copy); g_value_copy (setting, copy);
g_hash_table_insert (x11_screen->xsettings, g_hash_table_insert (x11_screen->xsettings,
"gtk-xft-dpi", copy); (gpointer) "gtk-xft-dpi", copy);
} }
} }

View File

@ -662,13 +662,13 @@ gsk_vulkan_render_pass_add (GskVulkanRenderPass *self,
} }
static GskVulkanImage * static GskVulkanImage *
gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self, gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
GskVulkanRender *render, GskVulkanRender *render,
GskVulkanUploader *uploader, GskVulkanUploader *uploader,
GskRenderNode *node, GskRenderNode *node,
graphene_rect_t *bounds, const graphene_rect_t *bounds,
GskVulkanClip *current_clip, GskVulkanClip *current_clip,
graphene_rect_t *tex_rect) graphene_rect_t *tex_rect)
{ {
GskVulkanImage *result; GskVulkanImage *result;
cairo_surface_t *surface; cairo_surface_t *surface;
@ -889,7 +889,7 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
{ {
GskVulkanOp *op; GskVulkanOp *op;
guint i; guint i;
const GskVulkanClip *clip = NULL; GskVulkanClip *clip = NULL;
for (i = 0; i < self->render_ops->len; i++) for (i = 0; i < self->render_ops->len; i++)
{ {

View File

@ -136,7 +136,7 @@ atk_key_event_from_gdk_event_key (GdkEventKey *key,
if (string && string[0] && if (string && string[0] &&
(state & GDK_CONTROL_MASK || (state & GDK_CONTROL_MASK ||
g_unichar_isgraph (g_utf8_get_char (string)))) g_unichar_isgraph (g_utf8_get_char (string))))
event->string = string; event->string = (char *) string;
else else
event->string = gdk_keyval_name (keyval); event->string = gdk_keyval_name (keyval);

View File

@ -2270,7 +2270,7 @@ gtk_icon_view_button_press (GtkGestureMultiPress *gesture,
} }
static gboolean static gboolean
button_event_modifies_selection (GdkEventButton *event) button_event_modifies_selection (const GdkEventButton *event)
{ {
guint state; guint state;

View File

@ -208,7 +208,7 @@ get_color_surface (const GdkRGBA *color)
} }
static cairo_surface_t * static cairo_surface_t *
get_linear_gradient_surface (gsize n_stops, GskColorStop *stops) get_linear_gradient_surface (gsize n_stops, const GskColorStop *stops)
{ {
cairo_surface_t *surface; cairo_surface_t *surface;
cairo_t *cr; cairo_t *cr;

View File

@ -249,8 +249,6 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Wlogical-op', '-Wlogical-op',
'-Wno-uninitialized', '-Wno-uninitialized',
'-Wno-shadow', '-Wno-shadow',
'-Wno-int-conversion',
'-Wno-discarded-qualifiers',
'-Werror=redundant-decls', '-Werror=redundant-decls',
'-Werror=implicit', '-Werror=implicit',
'-Werror=nonnull', '-Werror=nonnull',