summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-07-27 14:59:50 +0100
committerRichard Hughes <richard@hughsie.com>2016-07-27 14:59:50 +0100
commit2b0f49c86f98f9ea0400d74528bfac542b25043f (patch)
tree547c3a57cc66f0965a929bd1e17c7e56189b1488
parent4fc7521dc871da9929ae85ff93129428e3388ea0 (diff)
downloadcolord-2b0f49c86f98f9ea0400d74528bfac542b25043f.tar.gz
Fix compile with -Wformat-signedness
-rw-r--r--client/Makefile.am10
-rw-r--r--client/cd-fix-profile.c4
-rw-r--r--client/cd-iccdump.c2
-rw-r--r--client/cd-util.c22
-rw-r--r--configure.ac76
-rw-r--r--contrib/colord-sane/Makefile.am2
-rw-r--r--contrib/session-helper/Makefile.am4
-rw-r--r--contrib/session-helper/cd-example.c4
-rw-r--r--contrib/session-helper/cd-main.c14
-rw-r--r--contrib/session-helper/cd-state.c20
-rw-r--r--examples/Makefile.am4
-rw-r--r--lib/colord/Makefile.am8
-rw-r--r--lib/colord/cd-device.c2
-rw-r--r--lib/colord/cd-icc.c17
-rw-r--r--lib/colord/cd-it8-utils.c2
-rw-r--r--lib/colord/cd-it8.c12
-rw-r--r--lib/colord/cd-test-daemon.c8
-rw-r--r--lib/colord/cd-test-private.c26
-rw-r--r--lib/colorhug/Makefile.am4
-rw-r--r--lib/colorhug/ch-device-queue.c8
-rw-r--r--lib/colorhug/ch-device.c26
-rw-r--r--lib/colorhug/ch-self-test.c4
-rw-r--r--lib/compat/Makefile.am2
-rw-r--r--lib/dtp94/Makefile.am2
-rw-r--r--lib/huey/Makefile.am2
-rw-r--r--lib/huey/huey-ctx.c4
-rw-r--r--lib/huey/huey-device.c2
-rw-r--r--lib/munki/Makefile.am2
-rw-r--r--lib/ospark/Makefile.am4
-rw-r--r--lib/ospark/osp-device.c31
-rw-r--r--m4/gnome-compiler-flags.m4184
-rw-r--r--src/Makefile.am4
-rw-r--r--src/cd-device.c6
-rw-r--r--src/cd-main.c12
-rw-r--r--src/cd-profile.c2
-rw-r--r--src/cd-sensor.c6
-rw-r--r--src/plugins/Makefile.am8
-rw-r--r--src/sensors/Makefile.am18
-rw-r--r--src/sensors/cd-parse-beagle.c2
-rw-r--r--src/sensors/cd-sensor-argyll.c2
-rw-r--r--src/sensors/cd-sensor-spark.c4
-rw-r--r--src/sensors/cd-spawn.c4
42 files changed, 375 insertions, 205 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index f6a62a5..1a41057 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -41,7 +41,7 @@ colormgr_LDFLAGS = \
$(PIE_LDFLAGS)
colormgr_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_fix_profile_SOURCES = \
cd-fix-profile.c
@@ -53,7 +53,7 @@ cd_fix_profile_LDADD = \
-lm
cd_fix_profile_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_fix_profile_LDFLAGS = \
$(PIE_LDFLAGS)
@@ -71,7 +71,7 @@ cd_iccdump_LDFLAGS = \
$(PIE_LDFLAGS)
cd_iccdump_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_it8_SOURCES = \
cd-it8.c
@@ -86,7 +86,7 @@ cd_it8_LDFLAGS = \
$(PIE_LDFLAGS)
cd_it8_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_create_profile_SOURCES = \
cd-create-profile.c
@@ -101,7 +101,7 @@ cd_create_profile_LDFLAGS = \
$(PIE_LDFLAGS)
cd_create_profile_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
MAINTAINERCLEANFILES = *.a
diff --git a/client/cd-fix-profile.c b/client/cd-fix-profile.c
index dc1450c..f4ec7f9 100644
--- a/client/cd-fix-profile.c
+++ b/client/cd-fix-profile.c
@@ -594,7 +594,7 @@ cd_util_extract_vcgt (CdUtilPrivate *priv, gchar **values, GError **error)
g_print ("idx,red,green,blue\n");
for (i = 0; i < size; i++) {
in = (gdouble) i / (gdouble) (size - 1);
- g_print ("%i,", i);
+ g_print ("%u,", i);
g_print ("%f,", cmsEvalToneCurveFloat(vcgt[0], in));
g_print ("%f,", cmsEvalToneCurveFloat(vcgt[1], in));
g_print ("%f\n", cmsEvalToneCurveFloat(vcgt[2], in));
@@ -622,7 +622,7 @@ cd_util_lcms_error_cb (cmsContext ContextID,
cmsUInt32Number errorcode,
const char *text)
{
- g_warning ("LCMS error %i: %s", errorcode, text);
+ g_warning ("LCMS error %" G_GUINT32_FORMAT ": %s", errorcode, text);
}
/**
diff --git a/client/cd-iccdump.c b/client/cd-iccdump.c
index 789245f..8482861 100644
--- a/client/cd-iccdump.c
+++ b/client/cd-iccdump.c
@@ -39,7 +39,7 @@ cd_fix_profile_error_cb (cmsContext ContextID,
cmsUInt32Number errorcode,
const char *text)
{
- g_warning ("LCMS error %i: %s", errorcode, text);
+ g_warning ("LCMS error %" G_GUINT32_FORMAT ": %s", errorcode, text);
/* copy this sytemwide */
lcms_error_code = errorcode;
diff --git a/client/cd-util.c b/client/cd-util.c
index e3068e9..82a669a 100644
--- a/client/cd-util.c
+++ b/client/cd-util.c
@@ -371,7 +371,7 @@ cd_util_show_device (CdUtilPrivate *priv, CdDevice *device)
for (i = 0; i < profiles->len; i++) {
profile_tmp = g_ptr_array_index (profiles, i);
/* TRANSLATORS: the profile for the device */
- str_tmp = g_strdup_printf ("%s %i", _("Profile"), i+1);
+ str_tmp = g_strdup_printf ("%s %u", _("Profile"), i+1);
ret = cd_profile_connect_sync (profile_tmp, NULL, &error);
if (!ret) {
cd_util_print_field (str_tmp,
@@ -847,19 +847,19 @@ cd_util_dump (CdUtilPrivate *priv, gchar **values, GError **error)
ret = FALSE;
goto out;
}
- g_string_append_printf (str, "no-profile\t%i\n", profiles->len);
+ g_string_append_printf (str, "no-profile\t%u\n", profiles->len);
for (i = 0; i < profiles->len; i++) {
profile = g_ptr_array_index (profiles, i);
ret = cd_profile_connect_sync (profile, NULL, &error_local);
if (!ret) {
- g_string_append_printf (str, "profile-%02i\t%s\tERROR: %s\n",
- i,
+ g_string_append_printf (str, "profile-%02u\t%s\tERROR: %s\n",
+ (guint) i,
cd_profile_get_object_path (profile),
error_local->message);
g_clear_error (&error_local);
}
- g_string_append_printf (str, "profile-%02i\t%s\t%s\n",
- i,
+ g_string_append_printf (str, "profile-%02u\t%s\t%s\n",
+ (guint) i,
cd_profile_get_id (profile),
cd_profile_get_filename (profile));
}
@@ -870,13 +870,13 @@ cd_util_dump (CdUtilPrivate *priv, gchar **values, GError **error)
ret = FALSE;
goto out;
}
- g_string_append_printf (str, "no-devices\t%i\n", devices->len);
+ g_string_append_printf (str, "no-devices\t%u\n", devices->len);
for (i = 0; i < devices->len; i++) {
device = g_ptr_array_index (devices, i);
ret = cd_device_connect_sync (device, NULL, &error_local);
if (!ret) {
- g_string_append_printf (str, "device-%02i\t%s\tERROR: %s\n",
- i,
+ g_string_append_printf (str, "device-%02u\t%s\tERROR: %s\n",
+ (guint) i,
cd_device_get_object_path (device),
error_local->message);
g_clear_error (&error_local);
@@ -887,8 +887,8 @@ cd_util_dump (CdUtilPrivate *priv, gchar **values, GError **error)
if (!ret)
goto out;
}
- g_string_append_printf (str, "device-%02i\t%s\t%s\n",
- i,
+ g_string_append_printf (str, "device-%02u\t%s\t%s\n",
+ (guint) i,
profile != NULL ?
cd_profile_get_id (profile) :
" ",
diff --git a/configure.ac b/configure.ac
index 47071da..027c921 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,59 +56,29 @@ AM_PROG_CC_C_O
IT_PROG_INTLTOOL([0.35.0])
AC_PATH_PROG(XSLTPROC, xsltproc)
-dnl ---------------------------------------------------------------------------
-dnl - Use strict options (default enabled for devs, disabled in releases)
-dnl ---------------------------------------------------------------------------
-if test -d ".git"; then
- default_strict=yes
-else
- default_strict=no
-fi
-
-AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict],
- [Enable strict compilation options]),
- enable_strict=$enableval,
- enable_strict=$default_strict)
-if test x$enable_strict != xno; then
- CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES"
- CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED"
- CPPFLAGS="$CPPFLAGS -DGSEAL_ENABLE"
-fi
-
-dnl ---------------------------------------------------------------------------
-dnl - Extra verbose warning switches
-dnl ---------------------------------------------------------------------------
-
-if test "$GCC" = "yes"; then
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
-else
- WARNINGFLAGS_C=""
-fi
-AC_SUBST(WARNINGFLAGS_C)
+GNOME_COMPILE_WARNINGS([maximum],[
+ -Wmissing-declarations
+ -Wcast-align
+ -Wwrite-strings
+ -Wreturn-type
+ -Wformat-nonliteral
+ -Wmissing-format-attribute
+ -Wclobbered
+ -Wempty-body
+ -Wignored-qualifiers
+ -Wsign-compare
+ -Wtype-limits
+ -Wuninitialized
+ -Waggregate-return
+ -Wdeclaration-after-statement
+ -Wshadow
+ -Wno-strict-aliasing
+ -Winline
+ -Wmissing-parameter-type
+ -Woverride-init
+ -Wno-discarded-qualifiers
+ -Wformat-signedness
+])
dnl ---------------------------------------------------------------------------
dnl - gettext stuff
diff --git a/contrib/colord-sane/Makefile.am b/contrib/colord-sane/Makefile.am
index 4fd9465..1397b8b 100644
--- a/contrib/colord-sane/Makefile.am
+++ b/contrib/colord-sane/Makefile.am
@@ -39,7 +39,7 @@ colord_sane_LDFLAGS = \
$(PIE_LDFLAGS)
colord_sane_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
DISTCLEANFILES = \
$(dist_profile_DATA)
diff --git a/contrib/session-helper/Makefile.am b/contrib/session-helper/Makefile.am
index 9f45753..8388425 100644
--- a/contrib/session-helper/Makefile.am
+++ b/contrib/session-helper/Makefile.am
@@ -53,7 +53,7 @@ colord_session_LDFLAGS = \
$(PIE_LDFLAGS)
colord_session_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
dbusservicemaindir = $(datadir)/dbus-1/services
dbusservicemain_in_files = org.freedesktop.ColorHelper.service.in
@@ -80,7 +80,7 @@ colord_session_example_LDADD = \
$(GNOME_DESKTOP_LIBS) \
$(LCMS_LIBS) -lm
colord_session_example_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
test: colord-session-example
./colord-session-example \
diff --git a/contrib/session-helper/cd-example.c b/contrib/session-helper/cd-example.c
index ba43512..2585988 100644
--- a/contrib/session-helper/cd-example.c
+++ b/contrib/session-helper/cd-example.c
@@ -271,7 +271,7 @@ cd_example_signal_cb (GDBusProxy *proxy,
g_debug ("calibration succeeded with profile %s created at %s",
profile_id, profile_path);
} else {
- g_warning ("calibration failed with code %i: %s",
+ g_warning ("calibration failed with code %u: %s",
code, str);
}
g_main_loop_quit (priv->loop);
@@ -299,7 +299,7 @@ cd_example_signal_cb (GDBusProxy *proxy,
&code,
&message,
&image);
- g_print ("Interaction required type %i: %s\n",
+ g_print ("Interaction required type %u: %s\n",
code, message);
cd_example_interaction_required (priv,
code,
diff --git a/contrib/session-helper/cd-main.c b/contrib/session-helper/cd-main.c
index 8477edd..c5cd59b 100644
--- a/contrib/session-helper/cd-main.c
+++ b/contrib/session-helper/cd-main.c
@@ -254,7 +254,7 @@ cd_main_emit_interaction_required (CdMainPrivate *priv,
message = "";
break;
}
- g_debug ("CdMain: Emitting InteractionRequired(%i,%s,%s)",
+ g_debug ("CdMain: Emitting InteractionRequired(%u,%s,%s)",
code, message, image);
g_dbus_connection_emit_signal (priv->connection,
NULL,
@@ -280,7 +280,7 @@ cd_main_emit_update_gamma (CdMainPrivate *priv,
CdColorRGB *color;
/* emit signal */
- g_debug ("CdMain: Emitting UpdateGamma(%i elements)",
+ g_debug ("CdMain: Emitting UpdateGamma(%u elements)",
array->len);
/* build the dict */
@@ -1667,7 +1667,7 @@ cd_main_daemon_method_call (GDBusConnection *connection,
cd_profile_quality_to_string (priv->quality));
} else if (g_strcmp0 (prop_key, "Whitepoint") == 0) {
priv->target_whitepoint = g_variant_get_uint32 (prop_value);
- g_debug ("Whitepoint: %iK",
+ g_debug ("Whitepoint: %uK",
priv->target_whitepoint);
} else if (g_strcmp0 (prop_key, "Title") == 0) {
priv->title = g_variant_dup_string (prop_value, NULL);
@@ -1678,7 +1678,7 @@ cd_main_daemon_method_call (GDBusConnection *connection,
cd_sensor_cap_to_string (priv->device_kind));
} else if (g_strcmp0 (prop_key, "Brightness") == 0) {
priv->screen_brightness = g_variant_get_uint32 (prop_value);
- g_debug ("Device brightness: %i", priv->screen_brightness);
+ g_debug ("Device brightness: %u", priv->screen_brightness);
} else if (g_strcmp0 (prop_key, "Gamma") == 0) {
priv->target_gamma = g_variant_get_double (prop_value);
g_debug ("Gamma: %.2f", priv->target_gamma);
@@ -1706,7 +1706,7 @@ cd_main_daemon_method_call (GDBusConnection *connection,
g_dbus_method_invocation_return_error (invocation,
CD_SESSION_ERROR,
CD_SESSION_ERROR_INVALID_VALUE,
- "invalid quality value %i",
+ "invalid quality value %u",
priv->quality);
return;
}
@@ -1728,7 +1728,7 @@ cd_main_daemon_method_call (GDBusConnection *connection,
g_dbus_method_invocation_return_error (invocation,
CD_SESSION_ERROR,
CD_SESSION_ERROR_INVALID_VALUE,
- "invalid target whitepoint value %i",
+ "invalid target whitepoint value %u",
priv->target_whitepoint);
return;
}
@@ -1970,7 +1970,7 @@ cd_main_percentage_changed_cb (CdState *state,
guint value,
CdMainPrivate *priv)
{
- g_debug ("CdMain: Emitting PropertiesChanged(Progress) %i", value);
+ g_debug ("CdMain: Emitting PropertiesChanged(Progress) %u", value);
cd_main_emit_property_changed (priv,
"Progress",
g_variant_new_uint32 (value));
diff --git a/contrib/session-helper/cd-state.c b/contrib/session-helper/cd-state.c
index 11987a2..a3b32e8 100644
--- a/contrib/session-helper/cd-state.c
+++ b/contrib/session-helper/cd-state.c
@@ -113,7 +113,7 @@ cd_state_print_parent_chain (CdState *state, guint level)
{
if (state->priv->parent != NULL)
cd_state_print_parent_chain (state->priv->parent, level + 1);
- g_print ("%i) %s (%i/%i)\n",
+ g_print ("%u) %s (%u/%u)\n",
level, state->priv->id, state->priv->current, state->priv->steps);
}
@@ -130,7 +130,7 @@ cd_state_set_percentage (CdState *state, guint percentage)
/* is it invalid */
if (percentage > 100) {
cd_state_print_parent_chain (state, 0);
- g_warning ("percentage %i%% is invalid on %p!",
+ g_warning ("percentage %u%% is invalid on %p!",
percentage, state);
return FALSE;
}
@@ -139,7 +139,7 @@ cd_state_set_percentage (CdState *state, guint percentage)
if (percentage < state->priv->last_percentage) {
if (state->priv->enable_profile) {
cd_state_print_parent_chain (state, 0);
- g_critical ("percentage should not go down from %i to %i on %p!",
+ g_critical ("percentage should not go down from %u to %u on %p!",
state->priv->last_percentage, percentage, state);
}
return FALSE;
@@ -207,7 +207,7 @@ cd_state_child_percentage_changed_cb (CdState *child, guint percentage, CdState
/* already at >= 100% */
if (state->priv->current >= state->priv->steps) {
- g_warning ("already at %i/%i steps on %p", state->priv->current, state->priv->steps, state);
+ g_warning ("already at %u/%u steps on %p", state->priv->current, state->priv->steps, state);
return;
}
@@ -230,7 +230,7 @@ cd_state_child_percentage_changed_cb (CdState *child, guint percentage, CdState
/* get the range between the parent step and the next parent step */
range = cd_state_discrete_to_percent (state->priv->current+1, state->priv->steps) - offset;
if (range < 0.01) {
- g_warning ("range=%f (from %i to %i), should be impossible", range, state->priv->current+1, state->priv->steps);
+ g_warning ("range=%f (from %u to %u), should be impossible", range, state->priv->current+1, state->priv->steps);
return;
}
@@ -368,7 +368,7 @@ cd_state_set_number_steps_real (CdState *state, guint steps, const gchar *strloc
/* did we call done on a state that did not have a size set? */
if (state->priv->steps != 0) {
- g_warning ("steps already set to %i, can't set %i! [%s]",
+ g_warning ("steps already set to %u, can't set %u! [%s]",
state->priv->steps, steps, strloc);
cd_state_print_parent_chain (state, 0);
return FALSE;
@@ -425,7 +425,7 @@ cd_state_set_steps_real (CdState *state, GError **error, const gchar *strloc, gi
g_set_error (error,
CD_STATE_ERROR,
CD_STATE_ERROR_INVALID,
- "percentage not 100: %i",
+ "percentage not 100: %u",
total);
return FALSE;
}
@@ -435,7 +435,7 @@ cd_state_set_steps_real (CdState *state, GError **error, const gchar *strloc, gi
g_set_error (error,
CD_STATE_ERROR,
CD_STATE_ERROR_INVALID,
- "failed to set number steps: %i",
+ "failed to set number steps: %u",
i+1);
return FALSE;
}
@@ -479,7 +479,7 @@ cd_state_show_profile (CdState *state)
/* what we set */
result = g_string_new ("steps were set as [ ");
for (i = 0; i < state->priv->steps; i++) {
- g_string_append_printf (result, "%i, ",
+ g_string_append_printf (result, "%u, ",
state->priv->step_data[i] - uncumalitive);
uncumalitive = state->priv->step_data[i];
}
@@ -535,7 +535,7 @@ cd_state_done_real (CdState *state, GError **error, const gchar *strloc)
if (state->priv->child != NULL) {
CdStatePrivate *child_priv = state->priv->child->priv;
if (child_priv->current != child_priv->steps) {
- g_print ("child is at %i/%i steps and parent done [%s]\n",
+ g_print ("child is at %u/%u steps and parent done [%s]\n",
child_priv->current, child_priv->steps, strloc);
cd_state_print_parent_chain (state->priv->child, 0);
/* do not abort, as we want to clean this up */
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 6a4c8a6..4df697b 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -15,7 +15,7 @@ cd_dbus_create_device_LDADD = \
$(DBUS_LIBS)
cd_dbus_create_device_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_dbus_use_qualifier_SOURCES = \
cd-dbus-use-qualifier.c
@@ -24,7 +24,7 @@ cd_dbus_use_qualifier_LDADD = \
$(DBUS_LIBS)
cd_dbus_use_qualifier_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
endif
-include $(top_srcdir)/git.mk
diff --git a/lib/colord/Makefile.am b/lib/colord/Makefile.am
index 6c5c2d8..b2bbf3e 100644
--- a/lib/colord/Makefile.am
+++ b/lib/colord/Makefile.am
@@ -92,7 +92,7 @@ libcolordprivate_la_LDFLAGS = \
-export-symbols-regex '^cd_.*'
libcolordprivate_la_CFLAGS = \
$(PIE_CFLAGS) \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
libcolord_la_SOURCES = \
cd-client.c \
@@ -115,7 +115,7 @@ libcolord_la_LDFLAGS = \
-export-symbols-regex '^cd_.*'
libcolord_la_CFLAGS = \
$(PIE_CFLAGS) \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = colord.pc
@@ -142,7 +142,7 @@ cd_test_daemon_LDADD = \
$(GLIB_UNIX_LIBS) \
$(lib_LTLIBRARIES)
-cd_test_daemon_CFLAGS = $(WARNINGFLAGS_C)
+cd_test_daemon_CFLAGS = $(WARN_CFLAGS)
cd_test_private_SOURCES = \
cd-test-shared.h \
@@ -156,7 +156,7 @@ cd_test_private_LDADD = \
$(LCMS_LIBS) \
$(lib_LTLIBRARIES)
-cd_test_private_CFLAGS = $(WARNINGFLAGS_C)
+cd_test_private_CFLAGS = $(WARN_CFLAGS)
if BUILDOPT_INSTALL_TESTS
insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)
diff --git a/lib/colord/cd-device.c b/lib/colord/cd-device.c
index 3882d5e..28bbdeb 100644
--- a/lib/colord/cd-device.c
+++ b/lib/colord/cd-device.c
@@ -1815,7 +1815,7 @@ cd_device_to_string (CdDevice *device)
/* get a human readable time */
t = (time_t) priv->created;
time_tm = localtime (&t);
- strftime (time_buf, sizeof time_buf, "%c", time_tm);
+ strftime (time_buf, sizeof time_buf, "%F %T", time_tm);
string = g_string_new ("");
g_string_append_printf (string, " object-path: %s\n",
diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c
index 1264885..d5f4e65 100644
--- a/lib/colord/cd-icc.c
+++ b/lib/colord/cd-icc.c
@@ -260,7 +260,7 @@ cd_icc_to_string (CdIcc *icc)
/* print size */
tmp = cd_icc_get_size (icc);
if (tmp > 0)
- g_string_append_printf (str, " Size\t\t= %i bytes\n", tmp);
+ g_string_append_printf (str, " Size\t\t= %" G_GUINT32_FORMAT " bytes\n", tmp);
/* version */
g_string_append_printf (str, " Version\t= %.1f\n",
@@ -360,8 +360,9 @@ cd_icc_to_string (CdIcc *icc)
cd_icc_uint32_to_str (GUINT32_FROM_BE (sig), tag_str);
/* print header */
- g_string_append_printf (str, "tag %02i:\n", i);
- g_string_append_printf (str, " sig\t'%s' [0x%x]\n", tag_str, sig);
+ g_string_append_printf (str, "tag %02u:\n", (guint) i);
+ g_string_append_printf (str, " sig\t'%s' [0x%x]\n",
+ tag_str, (guint) sig);
/* is this linked to another data area? */
sig_link = cmsTagLinkedTo (priv->lcms_profile, sig);
@@ -440,7 +441,7 @@ cd_icc_to_string (CdIcc *icc)
error->message);
continue;
}
- g_string_append_printf (str, " %s_%s:\t%s [%i bytes]\n",
+ g_string_append_printf (str, " %s_%s:\t%s [%" G_GUINT32_FORMAT " bytes]\n",
language_code[0] != '\0' ? language_code : "**",
country_code[0] != '\0' ? country_code : "**",
text_buffer,
@@ -573,7 +574,7 @@ cd_icc_to_string (CdIcc *icc)
break;
}
g_string_append_printf (str, " channels\t = %i\n", 3);
- g_string_append_printf (str, " entries\t = %i\n",
+ g_string_append_printf (str, " entries\t = %" G_GUINT32_FORMAT "\n",
cmsGetToneCurveEstimatedTableEntries (vcgt[0]));
break;
}
@@ -614,7 +615,7 @@ cd_icc_to_string (CdIcc *icc)
(cmsUInt16Number *)&pcs,
NULL);
if (!ret) {
- g_string_append_printf (str, " Info:\t\tFailed to get NC #%i", j);
+ g_string_append_printf (str, " Info:\t\tFailed to get NC #%" G_GUINT32_FORMAT, j);
continue;
}
if (prefix[0] != '\0')
@@ -636,8 +637,8 @@ cd_icc_to_string (CdIcc *icc)
/* get color */
cmsLabEncoded2Float ((cmsCIELab *) &lab, pcs);
- g_string_append_printf (str, " %03i:\t %s\tL:%.2f a:%.3f b:%.3f\n",
- j,
+ g_string_append_printf (str, " %03u:\t %s\tL:%.2f a:%.3f b:%.3f\n",
+ (guint) j,
string->str,
lab.L, lab.a, lab.b);
}
diff --git a/lib/colord/cd-it8-utils.c b/lib/colord/cd-it8-utils.c
index 98d234a..751dd96 100644
--- a/lib/colord/cd-it8-utils.c
+++ b/lib/colord/cd-it8-utils.c
@@ -227,7 +227,7 @@ cd_it8_utils_calculate_ccmx (CdIt8 *it8_reference,
for (i = 0; i < 9; i++) {
if (fpclassify (data[i]) != FP_NORMAL) {
g_set_error (error, 1, 0,
- "Matrix value %i non-normal: %f", i, data[i]);
+ "Matrix value %u non-normal: %f", i, data[i]);
return FALSE;
}
}
diff --git a/lib/colord/cd-it8.c b/lib/colord/cd-it8.c
index b25fd6d..8deced0 100644
--- a/lib/colord/cd-it8.c
+++ b/lib/colord/cd-it8.c
@@ -652,7 +652,7 @@ cd_it8_load_ccss_spect (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
g_set_error (error,
CD_IT8_ERROR,
CD_IT8_ERROR_INVALID_FORMAT,
- "Invalid CCSS spectral size: %i", spectral_bands);
+ "Invalid CCSS spectral size: %u", spectral_bands);
return FALSE;
}
@@ -679,7 +679,7 @@ cd_it8_load_ccss_spect (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
g_set_error (error,
CD_IT8_ERROR,
CD_IT8_ERROR_INVALID_FORMAT,
- "Invalid CCSS: bands = %i, fields = %i",
+ "Invalid CCSS: bands = %u, fields = %u",
spectral_bands, number_of_fields);
return FALSE;
}
@@ -701,7 +701,7 @@ cd_it8_load_ccss_spect (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
cmsIT8GetDataRowCol(it8_lcms, j, 0));
} else {
g_autofree gchar *label = NULL;
- label = g_strdup_printf ("%i", j + 1);
+ label = g_strdup_printf ("%u", j + 1);
cd_spectrum_set_id (spectrum, label);
}
for (i = has_index; i < number_of_fields; i++) {
@@ -762,7 +762,7 @@ cd_it8_load_cmf (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
g_set_error (error,
CD_IT8_ERROR,
CD_IT8_ERROR_INVALID_FORMAT,
- "Invalid CCSS spectral size: %i", spectral_bands);
+ "Invalid CCSS spectral size: %u", spectral_bands);
return FALSE;
}
@@ -784,7 +784,7 @@ cd_it8_load_cmf (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
g_set_error (error,
CD_IT8_ERROR,
CD_IT8_ERROR_INVALID_FORMAT,
- "Invalid CMF: bands != fields (%i, %i)",
+ "Invalid CMF: bands != fields (%u, %u)",
spectral_bands, number_of_fields);
return FALSE;
}
@@ -795,7 +795,7 @@ cd_it8_load_cmf (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
g_set_error (error,
CD_IT8_ERROR,
CD_IT8_ERROR_INVALID_FORMAT,
- "Invalid CMF: sets != 3 (%i)",
+ "Invalid CMF: sets != 3 (%u)",
number_of_sets);
return FALSE;
}
diff --git a/lib/colord/cd-test-daemon.c b/lib/colord/cd-test-daemon.c
index 2b18c9c..586f5d0 100644
--- a/lib/colord/cd-test-daemon.c
+++ b/lib/colord/cd-test-daemon.c
@@ -1206,9 +1206,9 @@ colord_device_mapping_func (void)
}
key = g_random_int_range (0x00, 0xffff);
- g_debug ("using random key %04x", key);
- profile_id1 = g_strdup_printf ("profile-mapping-%04x_1", key);
- profile_id2 = g_strdup_printf ("profile-mapping-%04x_2", key);
+ g_debug ("using random key %04x", (guint) key);
+ profile_id1 = g_strdup_printf ("profile-mapping-%04x_1", (guint) key);
+ profile_id2 = g_strdup_printf ("profile-mapping-%04x_2", (guint) key);
client = cd_client_new ();
@@ -1662,7 +1662,7 @@ colord_device_async_func (void)
}
user_details = getpwuid(getuid());
- device_path = g_strdup_printf("/org/freedesktop/ColorManager/devices/%s_%s_%d",
+ device_path = g_strdup_printf("/org/freedesktop/ColorManager/devices/%s_%s_%u",
device_name,
user_details->pw_name,
user_details->pw_uid);
diff --git a/lib/colord/cd-test-private.c b/lib/colord/cd-test-private.c
index 6bdbe01..b9f10eb 100644
--- a/lib/colord/cd-test-private.c
+++ b/lib/colord/cd-test-private.c
@@ -825,7 +825,7 @@ colord_enum_func (void)
for (i = CD_SENSOR_KIND_UNKNOWN + 1; i < CD_SENSOR_KIND_LAST; i++) {
tmp = cd_sensor_kind_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_sensor_kind_from_string (tmp);
if (enum_tmp == CD_SENSOR_KIND_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -836,7 +836,7 @@ colord_enum_func (void)
for (i = CD_DEVICE_KIND_UNKNOWN + 1; i < CD_DEVICE_KIND_LAST; i++) {
tmp = cd_device_kind_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_device_kind_from_string (tmp);
if (enum_tmp == CD_DEVICE_KIND_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -847,7 +847,7 @@ colord_enum_func (void)
for (i = CD_PROFILE_KIND_UNKNOWN + 1; i < CD_PROFILE_KIND_LAST; i++) {
tmp = cd_profile_kind_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_profile_kind_from_string (tmp);
if (enum_tmp == CD_PROFILE_KIND_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -858,7 +858,7 @@ colord_enum_func (void)
for (i = CD_RENDERING_INTENT_UNKNOWN + 1; i < CD_RENDERING_INTENT_LAST; i++) {
tmp = cd_rendering_intent_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_rendering_intent_from_string (tmp);
if (enum_tmp == CD_RENDERING_INTENT_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -869,7 +869,7 @@ colord_enum_func (void)
for (i = CD_COLORSPACE_UNKNOWN + 1; i < CD_COLORSPACE_LAST; i++) {
tmp = cd_colorspace_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_colorspace_from_string (tmp);
if (enum_tmp == CD_COLORSPACE_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -880,7 +880,7 @@ colord_enum_func (void)
for (i = CD_DEVICE_RELATION_UNKNOWN + 1; i < CD_DEVICE_RELATION_LAST; i++) {
tmp = cd_device_relation_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_device_relation_from_string (tmp);
if (enum_tmp == CD_DEVICE_RELATION_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -891,7 +891,7 @@ colord_enum_func (void)
for (i = CD_OBJECT_SCOPE_UNKNOWN + 1; i < CD_OBJECT_SCOPE_LAST; i++) {
tmp = cd_object_scope_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_object_scope_from_string (tmp);
if (enum_tmp == CD_OBJECT_SCOPE_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -902,7 +902,7 @@ colord_enum_func (void)
for (i = CD_SENSOR_STATE_UNKNOWN + 1; i < CD_SENSOR_STATE_LAST; i++) {
tmp = cd_sensor_state_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_sensor_state_from_string (tmp);
if (enum_tmp == CD_SENSOR_STATE_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -913,7 +913,7 @@ colord_enum_func (void)
for (i = CD_SENSOR_CAP_UNKNOWN + 1; i < CD_SENSOR_CAP_LAST; i++) {
tmp = cd_sensor_cap_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_sensor_cap_from_string (tmp);
if (enum_tmp == CD_SENSOR_CAP_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -924,7 +924,7 @@ colord_enum_func (void)
for (i = CD_STANDARD_SPACE_UNKNOWN + 1; i < CD_STANDARD_SPACE_LAST; i++) {
tmp = cd_standard_space_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_standard_space_from_string (tmp);
if (enum_tmp == CD_STANDARD_SPACE_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -935,7 +935,7 @@ colord_enum_func (void)
for (i = CD_PROFILE_WARNING_UNKNOWN + 1; i < CD_PROFILE_WARNING_LAST; i++) {
tmp = cd_standard_space_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_standard_space_from_string (tmp);
if (enum_tmp == CD_PROFILE_WARNING_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -946,7 +946,7 @@ colord_enum_func (void)
for (i = CD_PROFILE_QUALITY_UNKNOWN + 1; i < CD_PROFILE_QUALITY_LAST; i++) {
tmp = cd_profile_quality_to_string (i);
if (g_strcmp0 (tmp, "unknown") == 0)
- g_warning ("no enum for %i", i);
+ g_warning ("no enum for %u", i);
enum_tmp = cd_profile_quality_from_string (tmp);
if (enum_tmp == CD_PROFILE_QUALITY_UNKNOWN)
g_warning ("no enum for %s", tmp);
@@ -1890,7 +1890,7 @@ colord_transform_func (void)
g_assert_cmpint (memcmp (img_data_out,
img_data_check,
height * width * 3), ==, 0);
- g_print ("%i threads = %.2fms\n", i,
+ g_print ("%u threads = %.2fms\n", i,
g_timer_elapsed (timer, NULL) * 1000 / repeats);
}
g_timer_destroy (timer);
diff --git a/lib/colorhug/Makefile.am b/lib/colorhug/Makefile.am
index 55993a8..71fb66f 100644
--- a/lib/colorhug/Makefile.am
+++ b/lib/colorhug/Makefile.am
@@ -76,7 +76,7 @@ libcolorhug_la_LDFLAGS = \
-export-symbols-regex '^ch_.*'
libcolorhug_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
TESTS_ENVIRONMENT = \
libtool --mode=execute valgrind \
@@ -98,7 +98,7 @@ ch_self_test_LDADD = \
$(lib_LTLIBRARIES) \
$(GUSB_LIBS)
-ch_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) $(WARNINGFLAGS_C)
+ch_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) $(WARN_CFLAGS)
TESTS = ch-self-test
diff --git a/lib/colorhug/ch-device-queue.c b/lib/colorhug/ch-device-queue.c
index a166cea..1fd9185 100644
--- a/lib/colorhug/ch-device-queue.c
+++ b/lib/colorhug/ch-device-queue.c
@@ -271,7 +271,7 @@ out:
CH_DEVICE_QUEUE_DATA_STATE_PENDING);
pending_commands += ch_device_queue_count_in_state (device_queue,
CH_DEVICE_QUEUE_DATA_STATE_WAITING_FOR_HW);
- g_debug ("Pending commands: %i", pending_commands);
+ g_debug ("Pending commands: %u", pending_commands);
if (pending_commands == 0) {
/* should we return the process with an error, or just
@@ -290,7 +290,7 @@ out:
g_task_return_new_error (task,
CH_DEVICE_ERROR,
last_error_code,
- "There were %i failures: %s",
+ "There were %u failures: %s",
tdata->failures->len - 1,
error_msg);
} else {
@@ -1168,7 +1168,7 @@ ch_device_queue_set_calibration_ccmx (ChDeviceQueue *device_queue,
if (calibration_tmp[i] < -100.0f ||
calibration_tmp[i] > 100.0f) {
g_set_error (error, 1, 0,
- "Matrix value %i out of range %f",
+ "Matrix value %u out of range %f",
i, calibration_tmp[i]);
return FALSE;
}
@@ -2610,7 +2610,7 @@ ch_device_queue_buffer_verify_flash_cb (guint8 *output_buffer,
}
g_set_error (error, 1, 0,
"Failed to verify at @0x%04x",
- helper->address + i);
+ (guint) (helper->address + i));
return FALSE;
}
return TRUE;
diff --git a/lib/colorhug/ch-device.c b/lib/colorhug/ch-device.c
index 513848c..3033573 100644
--- a/lib/colorhug/ch-device.c
+++ b/lib/colorhug/ch-device.c
@@ -1159,7 +1159,8 @@ ch_device_get_serial_number (GUsbDevice *device, guint32 *value,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (value != NULL)
@@ -1282,7 +1283,8 @@ ch_device_get_leds (GUsbDevice *device, ChStatusLed *value,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (value != NULL)
@@ -1418,7 +1420,8 @@ ch_device_get_pcb_errata (GUsbDevice *device, ChPcbErrata *value,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (value != NULL)
@@ -1610,7 +1613,8 @@ ch_device_get_ccd_calibration (GUsbDevice *device,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (start_nm != NULL) {
@@ -1737,7 +1741,8 @@ ch_device_get_integral_time (GUsbDevice *device, guint16 *value,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (value != NULL)
@@ -1813,7 +1818,8 @@ ch_device_get_temperature (GUsbDevice *device, gdouble *value,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (value != NULL)
@@ -1881,7 +1887,8 @@ ch_device_get_error (GUsbDevice *device, ChError *status, ChCmd *cmd,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return FALSE;
}
if (status != NULL)
@@ -2104,7 +2111,8 @@ ch_device_take_reading_xyz (GUsbDevice *device, guint16 calibration_idx,
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Invalid size, got %li", actual_length);
+ "Invalid size, got %" G_GSIZE_FORMAT,
+ actual_length);
return NULL;
}
@@ -2187,7 +2195,7 @@ ch_device_get_spectrum (GUsbDevice *device, GCancellable *cancellable, GError **
g_set_error (error,
G_USB_DEVICE_ERROR,
G_USB_DEVICE_ERROR_IO,
- "Failed to get spectrum data, got %li",
+ "Failed to get spectrum data, got %" G_GSIZE_FORMAT,
actual_length);
return NULL;
}
diff --git a/lib/colorhug/ch-self-test.c b/lib/colorhug/ch-self-test.c
index 9c93431..67a3f5b 100644
--- a/lib/colorhug/ch-self-test.c
+++ b/lib/colorhug/ch-self-test.c
@@ -76,7 +76,7 @@ ch_test_device_queue_progress_changed_cb (ChDeviceQueue *device_queue,
gpointer user_data)
{
progress_changed_cnt++;
- g_debug ("queue complete %i%%",
+ g_debug ("queue complete %u%%",
percentage);
}
@@ -1084,7 +1084,7 @@ ch_test_reading_xyz_func (void)
/* set post scale much higher */
for (post_scale = 1; post_scale < 2000; post_scale *= 2) {
- g_debug ("Setting post-scale %i", post_scale);
+ g_debug ("Setting post-scale %" G_GUINT16_FORMAT, post_scale);
ch_device_queue_set_post_scale (device_queue,
device,
post_scale);
diff --git a/lib/compat/Makefile.am b/lib/compat/Makefile.am
index 10dd61f..a007bd2 100644
--- a/lib/compat/Makefile.am
+++ b/lib/compat/Makefile.am
@@ -33,7 +33,7 @@ libcolordcompat_la_LDFLAGS = \
-export-symbols-regex '^cd_.*'
libcolordcompat_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
clean-local:
rm -f *~
diff --git a/lib/dtp94/Makefile.am b/lib/dtp94/Makefile.am
index 76ad8ef..1c0f4e6 100644
--- a/lib/dtp94/Makefile.am
+++ b/lib/dtp94/Makefile.am
@@ -35,7 +35,7 @@ libdtp94_private_la_LDFLAGS = \
-export-symbols-regex '^dtp94_.*'
libdtp94_private_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
CLEANFILES = $(BUILT_SOURCES)
diff --git a/lib/huey/Makefile.am b/lib/huey/Makefile.am
index 822430d..a8b2aec 100644
--- a/lib/huey/Makefile.am
+++ b/lib/huey/Makefile.am
@@ -37,7 +37,7 @@ libhuey_private_la_LDFLAGS = \
-export-symbols-regex '^huey_.*'
libhuey_private_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
CLEANFILES = $(BUILT_SOURCES)
diff --git a/lib/huey/huey-ctx.c b/lib/huey/huey-ctx.c
index a96eadc..42ba900 100644
--- a/lib/huey/huey-ctx.c
+++ b/lib/huey/huey-ctx.c
@@ -373,7 +373,7 @@ huey_ctx_take_sample (HueyCtx *ctx, CdSensorCap cap, GError **error)
error);
if (!ret)
return NULL;
- g_debug ("initial values: red=%i, green=%i, blue=%i",
+ g_debug ("initial values: red=%u, green=%u, blue=%u",
color_native.R, color_native.G, color_native.B);
/* try to fill the 16 bit register for accuracy */
@@ -396,7 +396,7 @@ huey_ctx_take_sample (HueyCtx *ctx, CdSensorCap cap, GError **error)
error);
if (!ret)
return NULL;
- g_debug ("raw values: red=%i, green=%i, blue=%i",
+ g_debug ("raw values: red=%u, green=%u, blue=%u",
color_native.R, color_native.G, color_native.B);
/* get DeviceRGB values */
diff --git a/lib/huey/huey-device.c b/lib/huey/huey-device.c
index 23c2c20..a070158 100644
--- a/lib/huey/huey-device.c
+++ b/lib/huey/huey-device.c
@@ -215,7 +215,7 @@ huey_device_get_serial_number (GUsbDevice *device, GError **error)
error);
if (!ret)
return NULL;
- return g_strdup_printf ("%i", tmp);
+ return g_strdup_printf ("%" G_GUINT32_FORMAT, tmp);
}
/**
diff --git a/lib/munki/Makefile.am b/lib/munki/Makefile.am
index 5f000f6..235cb0c 100644
--- a/lib/munki/Makefile.am
+++ b/lib/munki/Makefile.am
@@ -33,7 +33,7 @@ libmunki_private_la_LDFLAGS = \
-export-symbols-regex '^munki_.*'
libmunki_private_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
CLEANFILES = $(BUILT_SOURCES)
diff --git a/lib/ospark/Makefile.am b/lib/ospark/Makefile.am
index 0daf16d..3cf58d5 100644
--- a/lib/ospark/Makefile.am
+++ b/lib/ospark/Makefile.am
@@ -35,7 +35,7 @@ libospark_private_la_LDFLAGS = \
-export-symbols-regex '^osp_.*'
libospark_private_la_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
TESTS_ENVIRONMENT = \
libtool --mode=execute valgrind \
@@ -57,7 +57,7 @@ osp_self_test_LDADD = \
$(privlib_LTLIBRARIES) \
$(GUSB_LIBS)
-osp_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) $(WARNINGFLAGS_C)
+osp_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) $(WARN_CFLAGS)
TESTS = osp-self-test
diff --git a/lib/ospark/osp-device.c b/lib/ospark/osp-device.c
index e9a5d5a..834cef8 100644
--- a/lib/ospark/osp-device.c
+++ b/lib/ospark/osp-device.c
@@ -325,12 +325,13 @@ osp_device_get_fw_version (GUsbDevice *device, GError **error)
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected %i bytes, got %li", 2, data_len);
+ "Expected %i bytes, got %" G_GSIZE_FORMAT,
+ 2, data_len);
return NULL;
}
/* format value */
- return g_strdup_printf ("%i.%i", data[1], data[0]);
+ return g_strdup_printf ("%u.%u", data[1], data[0]);
}
/**
@@ -361,7 +362,8 @@ osp_device_get_wavelength_cal_for_idx (GUsbDevice *device,
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected %i bytes, got %li", 4, data_len);
+ "Expected %i bytes, got %" G_GSIZE_FORMAT,
+ 4, data_len);
return FALSE;
}
@@ -440,7 +442,8 @@ osp_device_get_wavelength_cal (GUsbDevice *device, guint *length, GError **error
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected 1 bytes, got %li", data_len);
+ "Expected 1 bytes, got %" G_GSIZE_FORMAT,
+ data_len);
return NULL;
}
@@ -449,7 +452,7 @@ osp_device_get_wavelength_cal (GUsbDevice *device, guint *length, GError **error
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected 4 coefs, got %i", data[0]);
+ "Expected 4 coefs, got %u", data[0]);
return NULL;
}
@@ -501,7 +504,8 @@ osp_device_get_nonlinearity_cal_for_idx (GUsbDevice *device,
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected %i bytes, got %li", 4, data_len);
+ "Expected %i bytes, got %" G_GSIZE_FORMAT,
+ 4, data_len);
return FALSE;
}
@@ -548,7 +552,8 @@ osp_device_get_nonlinearity_cal (GUsbDevice *device, guint *length, GError **err
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected 1 bytes, got %li", data_len);
+ "Expected 1 bytes, got %" G_GSIZE_FORMAT,
+ data_len);
return NULL;
}
@@ -614,7 +619,8 @@ osp_device_get_irradiance_cal (GUsbDevice *device, guint *length, GError **error
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected %i bytes, got %li", 4096 * 4, data_len);
+ "Expected %i bytes, got %" G_GSIZE_FORMAT,
+ 4096 * 4, data_len);
return NULL;
}
@@ -664,7 +670,8 @@ osp_device_take_spectrum_internal (GUsbDevice *device,
g_set_error (error,
OSP_DEVICE_ERROR,
OSP_DEVICE_ERROR_INTERNAL,
- "Expected %i bytes, got %li", 2048, data_len);
+ "Expected %i bytes, got %" G_GSIZE_FORMAT,
+ 2048, data_len);
return NULL;
}
@@ -831,9 +838,9 @@ osp_device_take_spectrum (GUsbDevice *device, GError **error)
/* limit this to something sane */
if (sample_duration / G_USEC_PER_SEC > sample_duration_max_secs) {
- g_debug ("limiting duration from %lus to %is",
- sample_duration / G_USEC_PER_SEC,
- sample_duration_max_secs);
+ g_debug ("limiting duration from %us to %us",
+ (guint) (sample_duration / G_USEC_PER_SEC),
+ (guint) (sample_duration_max_secs));
sample_duration = sample_duration_max_secs * G_USEC_PER_SEC;
relax_requirements = TRUE;
}
diff --git a/m4/gnome-compiler-flags.m4 b/m4/gnome-compiler-flags.m4
new file mode 100644
index 0000000..49ebb95
--- /dev/null
+++ b/m4/gnome-compiler-flags.m4
@@ -0,0 +1,184 @@
+# gnome-compiler-flags.m4
+#
+# serial 4
+#
+
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings and substitute the result into
+dnl WARN_CFLAGS
+dnl For now, only works on GCC
+dnl Pass the default value of the --enable-compile-warnings configure option as
+dnl the first argument to the macro, defaulting to 'yes'.
+dnl Additional warning/error flags can be passed as an optional second argument.
+dnl
+dnl For example: GNOME_COMPILE_WARNINGS([maximum],[-Werror=some-flag -Wfoobar])
+AU_DEFUN([GNOME_COMPILE_WARNINGS],[
+ dnl ******************************
+ dnl More compiler warnings
+ dnl ******************************
+
+ AC_ARG_ENABLE(compile-warnings,
+ AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+ [Turn on compiler warnings]),,
+ [enable_compile_warnings="m4_default([$1],[yes])"])
+
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+
+ warning_flags=
+ realsave_CFLAGS="$CFLAGS"
+
+ dnl These are warning flags that aren't marked as fatal. Can be
+ dnl overridden on a per-project basis with -Wno-foo.
+ base_warn_flags=" \
+ -Wall \
+ -Wstrict-prototypes \
+ -Wnested-externs \
+ "
+
+ dnl These compiler flags typically indicate very broken or suspicious
+ dnl code. Some of them such as implicit-function-declaration are
+ dnl just not default because gcc compiles a lot of legacy code.
+ dnl We choose to make this set into explicit errors.
+ base_error_flags=" \
+ -Werror=missing-prototypes \
+ -Werror=implicit-function-declaration \
+ -Werror=pointer-arith \
+ -Werror=init-self \
+ -Werror=format-security \
+ -Werror=format=2 \
+ -Werror=missing-include-dirs \
+ -Werror=return-type \
+ "
+
+ dnl Additional warning or error flags provided by the module author to
+ dnl allow stricter standards to be imposed on a per-module basis.
+ dnl The author can pass -W or -Werror flags here as they see fit.
+ additional_flags="m4_default([$2],[])"
+
+ case "$enable_compile_warnings" in
+ no)
+ warning_flags="-w"
+ ;;
+ minimum)
+ warning_flags="-Wall"
+ ;;
+ yes|maximum|error)
+ warning_flags="$base_warn_flags $base_error_flags $additional_flags"
+ ;;
+ *)
+ AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
+ ;;
+ esac
+
+ if test "$enable_compile_warnings" = "error" ; then
+ warning_flags="$warning_flags -Werror"
+ fi
+
+ dnl Check whether GCC supports the warning options
+ for option in $warning_flags; do
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([whether gcc understands $option])
+ AC_TRY_COMPILE([], [],
+ has_option=yes,
+ has_option=no,)
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT([$has_option])
+ if test $has_option = yes; then
+ tested_warning_flags="$tested_warning_flags $option"
+ fi
+ unset has_option
+ unset save_CFLAGS
+ done
+ unset option
+ CFLAGS="$realsave_CFLAGS"
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ AC_MSG_RESULT($tested_warning_flags)
+
+ AC_ARG_ENABLE(iso-c,
+ AS_HELP_STRING([--enable-iso-c],
+ [Try to warn if code is not ISO C ]),,
+ [enable_iso_c=no])
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+ complCFLAGS=
+ if test "x$enable_iso_c" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -ansi" ;;
+ esac
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCFLAGS)
+
+ WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
+ AC_SUBST(WARN_CFLAGS)
+],
+[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
+eliminate use of --enable-iso-c.
+See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
+
+dnl For C++, do basically the same thing.
+
+AU_DEFUN([GNOME_CXX_WARNINGS],[
+ AC_ARG_ENABLE(cxx-warnings,
+ AS_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
+ [Turn on compiler warnings.]),,
+ [enable_cxx_warnings="m4_default([$1],[minimum])"])
+
+ AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+ warnCXXFLAGS=
+ if test "x$GXX" != xyes; then
+ enable_cxx_warnings=no
+ fi
+ if test "x$enable_cxx_warnings" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+ esac
+
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_cxx_warnings" = "xyes"; then
+ warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCXXFLAGS)
+
+ AC_ARG_ENABLE(iso-cxx,
+ AS_HELP_STRING([--enable-iso-cxx],
+ [Try to warn if code is not ISO C++ ]),,
+ [enable_iso_cxx=no])
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+ complCXXFLAGS=
+ if test "x$enable_iso_cxx" != "xno"; then
+ if test "x$GXX" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+ esac
+
+ case " $CXXFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCXXFLAGS)
+
+ WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+ AC_SUBST(WARN_CXXFLAGS)
+],
+[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and
+eliminate use of --enable-iso-cxx.
+See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]])
diff --git a/src/Makefile.am b/src/Makefile.am
index 335f5ad..aa05d49 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -114,7 +114,7 @@ colord_LDFLAGS = \
$(RELRO_LDFLAGS)
colord_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
TESTS_ENVIRONMENT = \
libtool --mode=execute valgrind \
@@ -157,7 +157,7 @@ cd_self_test_LDADD = \
$(GLIB_LIBS) \
$(GLIB_UNIX_LIBS)
-cd_self_test_CFLAGS = $(WARNINGFLAGS_C)
+cd_self_test_CFLAGS = $(WARN_CFLAGS)
install-data-hook:
if test -w $(DESTDIR)$(prefix)/; then \
diff --git a/src/cd-device.c b/src/cd-device.c
index 484b6ce..1629e61 100644
--- a/src/cd-device.c
+++ b/src/cd-device.c
@@ -312,7 +312,7 @@ cd_device_set_object_path (CdDevice *device)
g_strcmp0 (pw->pw_name, DAEMON_USER) == 0) {
path_tmp = g_strdup (priv->id);
} else {
- path_tmp = g_strdup_printf ("%s_%s_%d",
+ path_tmp = g_strdup_printf ("%s_%s_%u",
priv->id,
pw->pw_name,
priv->owner);
@@ -1645,7 +1645,7 @@ cd_device_register_object (CdDevice *device,
error_local->message);
return FALSE;
}
- g_debug ("CdDevice: Register interface %i on %s",
+ g_debug ("CdDevice: Register interface %u on %s",
priv->registration_id,
priv->object_path);
return TRUE;
@@ -1813,7 +1813,7 @@ cd_device_finalize (GObject *object)
if (priv->watcher_id > 0)
g_bus_unwatch_name (priv->watcher_id);
if (priv->registration_id > 0) {
- g_debug ("CdDevice: Unregister interface %i on %s",
+ g_debug ("CdDevice: Unregister interface %u on %s",
priv->registration_id,
priv->object_path);
g_dbus_connection_unregister_object (priv->connection,
diff --git a/src/cd-main.c b/src/cd-main.c
index 045a6c0..ee475f8 100644
--- a/src/cd-main.c
+++ b/src/cd-main.c
@@ -249,11 +249,11 @@ cd_main_create_profile (CdMainPrivate *priv,
"persistent profiles are no yet supported");
return NULL;
default:
- g_warning ("CdMain: Unsupported scope kind: %i", scope);
+ g_warning ("CdMain: Unsupported scope kind: %u", scope);
g_set_error (error,
CD_CLIENT_ERROR,
CD_CLIENT_ERROR_NOT_SUPPORTED,
- "Unsupported scope kind: %i", scope);
+ "Unsupported scope kind: %u", scope);
return NULL;
}
@@ -434,7 +434,7 @@ cd_main_device_auto_add_from_db (CdMainPrivate *priv, CdDevice *device)
object_id_tmp,
cd_device_get_owner (device));
if (profile_tmp == NULL) {
- g_debug ("CdMain: profile %s with owner %i is not (yet) available",
+ g_debug ("CdMain: profile %s with owner %u is not (yet) available",
object_id_tmp, cd_device_get_owner (device));
continue;
}
@@ -533,7 +533,7 @@ cd_main_get_seat_for_process (guint pid)
/* get session the process belongs to */
rc = sd_pid_get_session (pid, &sd_session);
if (rc != 0) {
- g_warning ("failed to get session [pid %i]: %s",
+ g_warning ("failed to get session [pid %u]: %s",
pid, strerror (-rc));
goto out;
}
@@ -541,7 +541,7 @@ cd_main_get_seat_for_process (guint pid)
/* get the seat the session is on */
rc = sd_session_get_seat (sd_session, &sd_seat);
if (rc != 0) {
- g_warning ("failed to get seat for session %s [pid %i]: %s",
+ g_warning ("failed to get seat for session %s [pid %u]: %s",
sd_session, pid, strerror (-rc));
goto out;
}
@@ -878,7 +878,7 @@ cd_main_get_cmdline_for_pid (guint pid)
g_autofree gchar *proc_path = NULL;
/* just read the link */
- proc_path = g_strdup_printf ("/proc/%i/cmdline", pid);
+ proc_path = g_strdup_printf ("/proc/%u/cmdline", pid);
ret = g_file_get_contents (proc_path, &cmdline, &len, &error);
if (!ret) {
g_warning ("CdMain: failed to read %s: %s",
diff --git a/src/cd-profile.c b/src/cd-profile.c
index 420ef6a..dfe0669 100644
--- a/src/cd-profile.c
+++ b/src/cd-profile.c
@@ -221,7 +221,7 @@ cd_profile_set_object_path (CdProfile *profile)
g_strcmp0 (pw->pw_name, DAEMON_USER) == 0) {
path_tmp = g_strdup (priv->id);
} else {
- path_tmp = g_strdup_printf ("%s_%s_%d",
+ path_tmp = g_strdup_printf ("%s_%s_%u",
priv->id,
pw->pw_name,
priv->owner);
diff --git a/src/cd-sensor.c b/src/cd-sensor.c
index d3aa099..5b82f0a 100644
--- a/src/cd-sensor.c
+++ b/src/cd-sensor.c
@@ -1288,7 +1288,7 @@ cd_sensor_register_object (CdSensor *sensor,
error_local->message);
return FALSE;
}
- g_debug ("CdSensor: Register interface %i on %s",
+ g_debug ("CdSensor: Register interface %u on %s",
priv->registration_id,
priv->object_path);
return TRUE;
@@ -1523,7 +1523,7 @@ cd_sensor_set_index (CdSensor *sensor,
{
CdSensorPrivate *priv = GET_PRIVATE (sensor);
g_autofree gchar *id = NULL;
- id = g_strdup_printf ("%s-%02i",
+ id = g_strdup_printf ("%s-%02u",
cd_sensor_kind_to_string (priv->kind),
idx);
cd_sensor_set_id (sensor, id);
@@ -1762,7 +1762,7 @@ cd_sensor_finalize (GObject *object)
CdSensorPrivate *priv = GET_PRIVATE (sensor);
if (priv->registration_id > 0) {
- g_debug ("CdSensor: Unregister interface %i on %s",
+ g_debug ("CdSensor: Unregister interface %u on %s",
priv->registration_id,
priv->object_path);
g_dbus_connection_unregister_object (priv->connection,
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index f2559b4..bf1117c 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -25,7 +25,7 @@ noinst_LTLIBRARIES = \
libcd_plugin_example_la_SOURCES = cd-plugin-example.c
libcd_plugin_example_la_LIBADD = $(CD_PLUGIN_LIBS)
libcd_plugin_example_la_LDFLAGS = -module -avoid-version
-libcd_plugin_example_la_CFLAGS = $(CD_PLUGIN_CFLAGS) $(WARNINGFLAGS_C)
+libcd_plugin_example_la_CFLAGS = $(CD_PLUGIN_CFLAGS) $(WARN_CFLAGS)
if HAVE_UDEV
@@ -36,12 +36,12 @@ plugin_LTLIBRARIES = \
libcd_plugin_camera_la_SOURCES = cd-plugin-camera.c
libcd_plugin_camera_la_LIBADD = $(GUDEV_LIBS)
libcd_plugin_camera_la_LDFLAGS = -module -avoid-version
-libcd_plugin_camera_la_CFLAGS = $(GUDEV_CFLAGS) $(WARNINGFLAGS_C)
+libcd_plugin_camera_la_CFLAGS = $(GUDEV_CFLAGS) $(WARN_CFLAGS)
libcd_plugin_scanner_la_SOURCES = cd-plugin-scanner.c
libcd_plugin_scanner_la_LIBADD = $(GUDEV_LIBS)
libcd_plugin_scanner_la_LDFLAGS = -module -avoid-version
-libcd_plugin_scanner_la_CFLAGS = $(GUDEV_CFLAGS) $(WARNINGFLAGS_C)
+libcd_plugin_scanner_la_CFLAGS = $(GUDEV_CFLAGS) $(WARN_CFLAGS)
if HAVE_SANE
@@ -51,7 +51,7 @@ plugin_LTLIBRARIES += \
libcd_plugin_sane_la_SOURCES = cd-plugin-sane.c
libcd_plugin_sane_la_LIBADD = $(GUDEV_LIBS)
libcd_plugin_sane_la_LDFLAGS = -module -avoid-version
-libcd_plugin_sane_la_CFLAGS = $(GUDEV_CFLAGS) $(WARNINGFLAGS_C)
+libcd_plugin_sane_la_CFLAGS = $(GUDEV_CFLAGS) $(WARN_CFLAGS)
endif # HAVE_SANE
endif # HAVE_UDEV
diff --git a/src/sensors/Makefile.am b/src/sensors/Makefile.am
index 2a2cfa5..ae7e30e 100644
--- a/src/sensors/Makefile.am
+++ b/src/sensors/Makefile.am
@@ -42,7 +42,7 @@ cd_parse_beagle_LDADD = \
$(top_builddir)/lib/munki/libmunki-private.la
cd_parse_beagle_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
cd_sensor_dump_SOURCES = \
../cd-common.c \
@@ -63,7 +63,7 @@ cd_sensor_dump_LDADD = \
-lm
cd_sensor_dump_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
CLEANFILES = $(noinst_PROGRAMS)
@@ -77,7 +77,7 @@ plugin_LTLIBRARIES = \
libcolord_sensor_dummy_la_SOURCES = cd-sensor-dummy.c
libcolord_sensor_dummy_la_LIBADD = $(GLIB_LIBS)
libcolord_sensor_dummy_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_dummy_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_dummy_la_CFLAGS = $(WARN_CFLAGS)
if HAVE_GUSB
plugin_LTLIBRARIES += \
@@ -93,7 +93,7 @@ libcolord_sensor_spark_la_LIBADD = \
$(GUSB_LIBS) \
$(top_builddir)/lib/ospark/libospark-private.la
libcolord_sensor_spark_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_spark_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_spark_la_CFLAGS = $(WARN_CFLAGS)
libcolord_sensor_huey_la_SOURCES = \
cd-sensor-huey.c
@@ -102,7 +102,7 @@ libcolord_sensor_huey_la_LIBADD = \
$(GUSB_LIBS) \
$(top_builddir)/lib/huey/libhuey-private.la
libcolord_sensor_huey_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_huey_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_huey_la_CFLAGS = $(WARN_CFLAGS)
libcolord_sensor_dtp94_la_SOURCES = \
cd-sensor-dtp94.c
@@ -111,7 +111,7 @@ libcolord_sensor_dtp94_la_LIBADD = \
$(GUSB_LIBS) \
$(top_builddir)/lib/dtp94/libdtp94-private.la
libcolord_sensor_dtp94_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_dtp94_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_dtp94_la_CFLAGS = $(WARN_CFLAGS)
libcolord_sensor_colorhug_la_SOURCES = \
cd-sensor-colorhug.c
@@ -120,7 +120,7 @@ libcolord_sensor_colorhug_la_LIBADD = \
$(GUSB_LIBS) \
$(top_builddir)/lib/colorhug/libcolorhug.la
libcolord_sensor_colorhug_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_colorhug_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_colorhug_la_CFLAGS = $(WARN_CFLAGS)
endif
if HAVE_ARGYLLCMS_SENSOR
@@ -132,14 +132,14 @@ libcolord_sensor_argyll_la_SOURCES = \
cd-sensor-argyll.c
libcolord_sensor_argyll_la_LIBADD = $(GLIB_LIBS) $(GUSB_LIBS)
libcolord_sensor_argyll_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_argyll_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_argyll_la_CFLAGS = $(WARN_CFLAGS)
endif
if FALSE
libcolord_sensor_munki_la_SOURCES = cd-sensor-munki.c
libcolord_sensor_munki_la_LIBADD = $(GLIB_LIBS)
libcolord_sensor_munki_la_LDFLAGS = -module -avoid-version
-libcolord_sensor_munki_la_CFLAGS = $(WARNINGFLAGS_C)
+libcolord_sensor_munki_la_CFLAGS = $(WARN_CFLAGS)
endif
-include $(top_srcdir)/git.mk
diff --git a/src/sensors/cd-parse-beagle.c b/src/sensors/cd-parse-beagle.c
index e2c6ae2..de83dcc 100644
--- a/src/sensors/cd-parse-beagle.c
+++ b/src/sensors/cd-parse-beagle.c
@@ -311,7 +311,7 @@ main (gint argc, gchar *argv[])
split[i][0] == '\0')
continue;
- g_print ("@@%i:%s\n", i, split[i]);
+ g_print ("@@%u:%s\n", i, split[i]);
/* populate a CdParseEntry */
sections = g_strsplit (split[i], ",", -1);
diff --git a/src/sensors/cd-sensor-argyll.c b/src/sensors/cd-sensor-argyll.c
index 3151186..af84461 100644
--- a/src/sensors/cd-sensor-argyll.c
+++ b/src/sensors/cd-sensor-argyll.c
@@ -256,7 +256,7 @@ cd_sensor_get_sample_async (CdSensor *sensor,
argv = g_ptr_array_new_with_free_func (g_free);
g_ptr_array_add (argv, g_strdup ("/usr/bin/spotread"));
g_ptr_array_add (argv, g_strdup ("-d"));
- g_ptr_array_add (argv, g_strdup_printf ("-c%i", priv->communication_port));
+ g_ptr_array_add (argv, g_strdup_printf ("-c%u", priv->communication_port));
g_ptr_array_add (argv, g_strdup ("-N")); //no autocal
g_ptr_array_add (argv, g_strdup (cd_sensor_get_y_arg_for_cap (cap)));
g_ptr_array_add (argv, NULL);
diff --git a/src/sensors/cd-sensor-spark.c b/src/sensors/cd-sensor-spark.c
index 3170117..25897ba 100644
--- a/src/sensors/cd-sensor-spark.c
+++ b/src/sensors/cd-sensor-spark.c
@@ -529,7 +529,7 @@ cd_sensor_spark_lock_thread_cb (GTask *task,
return;
}
priv->dark_cal = cd_spectrum_dup (cd_it8_get_spectrum_by_id (it8, "1"));
- g_debug ("loaded dark calibration with %i elements",
+ g_debug ("loaded dark calibration with %u elements",
cd_spectrum_get_size (priv->dark_cal));
/* print something for debugging */
@@ -557,7 +557,7 @@ cd_sensor_spark_lock_thread_cb (GTask *task,
return;
}
priv->irradiance_cal = cd_spectrum_dup (cd_it8_get_spectrum_by_id (it8, "1"));
- g_debug ("loaded irradiance calibration with %i elements",
+ g_debug ("loaded irradiance calibration with %u elements",
cd_spectrum_get_size (priv->irradiance_cal));
/* print something for debugging */
diff --git a/src/sensors/cd-spawn.c b/src/sensors/cd-spawn.c
index 0e9c47e..21b1e9d 100644
--- a/src/sensors/cd-spawn.c
+++ b/src/sensors/cd-spawn.c
@@ -415,11 +415,11 @@ cd_spawn_argv (CdSpawn *spawn, gchar **argv, gchar **envp, GError **error)
len = g_strv_length (argv);
for (i = 0; i < len; i++)
- g_debug ("argv[%i] '%s'", i, argv[i]);
+ g_debug ("argv[%u] '%s'", i, argv[i]);
if (envp != NULL) {
len = g_strv_length (envp);
for (i = 0; i < len; i++)
- g_debug ("envp[%i] '%s'", i, envp[i]);
+ g_debug ("envp[%u] '%s'", i, envp[i]);
}
/* create spawned object for tracking */