summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-15 11:04:52 +0100
committerraveit65 <[email protected]>2021-12-20 17:54:37 +0100
commitf3be406bb0f3be4f253b287c2f1f7d6283e1d05f (patch)
tree847722d1efdf1768266214e0ea675b7bf0c069e7
parent462949a3bc6b54675e9dec59745504c949856524 (diff)
downloadmate-panel-f3be406bb0f3be4f253b287c2f1f7d6283e1d05f.tar.bz2
mate-panel-f3be406bb0f3be4f253b287c2f1f7d6283e1d05f.tar.xz
Fix some -Wsign-compare warnings
-rw-r--r--applets/clock/calendar-window.c10
-rw-r--r--applets/wncklet/window-list.c4
-rw-r--r--libmate-panel-applet/mate-panel-applet.c2
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applet-container.c2
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c2
-rw-r--r--mate-panel/panel-action-protocol.c13
-rw-r--r--mate-panel/panel-addto.c21
-rw-r--r--mate-panel/panel-applet-frame.c6
-rw-r--r--mate-panel/panel-applet-frame.h4
-rw-r--r--mate-panel/panel-bindings.c4
-rw-r--r--mate-panel/panel-ditem-editor.c4
-rw-r--r--mate-panel/panel-menu-button.c6
-rw-r--r--mate-panel/panel-properties-dialog.c2
-rw-r--r--mate-panel/panel-run-dialog.c6
-rw-r--r--mate-panel/panel-stock-icons.c12
-rw-r--r--mate-panel/panel-test-applets.c2
-rw-r--r--mate-panel/panel-toplevel.c16
-rw-r--r--mate-panel/panel-toplevel.h2
18 files changed, 64 insertions, 54 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c
index 11003d28..56c48955 100644
--- a/applets/clock/calendar-window.c
+++ b/applets/clock/calendar-window.c
@@ -93,10 +93,10 @@ static void calendar_mark_today(GtkCalendar *calendar)
gtk_calendar_get_date(calendar, &year, &month, &day);
time(&now);
localtime_r (&now, &tm1);
- if ((tm1.tm_mon == month) && (tm1.tm_year + 1900 == year)) {
- gtk_calendar_mark_day (GTK_CALENDAR (calendar), tm1.tm_mday);
+ if ((tm1.tm_mon == (int) month) && (tm1.tm_year + 1900 == (int) year)) {
+ gtk_calendar_mark_day (GTK_CALENDAR (calendar), (guint) tm1.tm_mday);
} else {
- gtk_calendar_unmark_day (GTK_CALENDAR (calendar), tm1.tm_mday);
+ gtk_calendar_unmark_day (GTK_CALENDAR (calendar), (guint) tm1.tm_mday);
}
}
@@ -131,8 +131,8 @@ calendar_window_create_calendar (CalendarWindow *calwin)
localtime_r (calwin->priv->current_time, &tm1);
gtk_calendar_select_month (GTK_CALENDAR (calendar),
- tm1.tm_mon, tm1.tm_year + 1900);
- gtk_calendar_select_day (GTK_CALENDAR (calendar), tm1.tm_mday);
+ (guint) tm1.tm_mon, (guint) (tm1.tm_year + 1900));
+ gtk_calendar_select_day (GTK_CALENDAR (calendar), (guint) tm1.tm_mday);
calendar_mark_today (GTK_CALENDAR(calendar));
g_signal_connect(calendar, "month-changed",
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index 758933b3..db8a8202 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -865,7 +865,7 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
/* disable the item of system monitor, if not exists.
* example, mate-system-monitor, o gnome-system-monitor */
char* programpath;
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS(system_monitors); i += 1)
{
@@ -910,7 +910,7 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
static void call_system_monitor(GtkAction* action, TasklistData* tasklist)
{
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS(system_monitors); i += 1)
{
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 8d1018d6..cd015eb1 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1790,7 +1790,7 @@ mate_panel_applet_setup (MatePanelApplet *applet)
MatePanelAppletPrivate *priv;
GValue value = {0, };
GArray *params;
- gint i;
+ guint i;
gboolean ret;
priv = mate_panel_applet_get_instance_private (applet);
diff --git a/mate-panel/libmate-panel-applet-private/panel-applet-container.c b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
index c31c058d..bd2269e9 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applet-container.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
@@ -238,7 +238,7 @@ mate_panel_applet_container_class_init (MatePanelAppletContainerClass *klass)
static const AppletPropertyInfo *
mate_panel_applet_container_child_property_get_info (const gchar *property_name)
{
- gint i;
+ gsize i;
g_assert (property_name != NULL);
diff --git a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
index ca1f08ad..115919b0 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
@@ -162,7 +162,7 @@ mate_panel_applets_manager_get_applet_factory_info_from_file (const gchar *filen
const char *lib_prefix;
gchar **groups;
gsize n_groups;
- gint i;
+ gsize i;
GError *error = NULL;
applet_file = g_key_file_new ();
diff --git a/mate-panel/panel-action-protocol.c b/mate-panel/panel-action-protocol.c
index 86311072..f261d860 100644
--- a/mate-panel/panel-action-protocol.c
+++ b/mate-panel/panel-action-protocol.c
@@ -145,15 +145,18 @@ panel_action_protocol_filter (GdkXEvent *gdk_xevent,
if (window != gdk_screen_get_root_window (screen))
return GDK_FILTER_CONTINUE;
- if (xevent->xclient.data.l [0] == atom_mate_panel_action_main_menu)
+ if (xevent->xclient.data.l [0] < 0)
+ return GDK_FILTER_CONTINUE;
+
+ if (xevent->xclient.data.l [0] == (long) atom_mate_panel_action_main_menu)
panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1], event);
- else if (xevent->xclient.data.l [0] == atom_mate_panel_action_run_dialog)
+ else if (xevent->xclient.data.l [0] == (long) atom_mate_panel_action_run_dialog)
panel_action_protocol_run_dialog (screen, xevent->xclient.data.l [1]);
- else if (xevent->xclient.data.l [0] == atom_gnome_panel_action_main_menu)
+ else if (xevent->xclient.data.l [0] == (long) atom_gnome_panel_action_main_menu)
panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1], event);
- else if (xevent->xclient.data.l [0] == atom_gnome_panel_action_run_dialog)
+ else if (xevent->xclient.data.l [0] == (long) atom_gnome_panel_action_run_dialog)
panel_action_protocol_run_dialog (screen, xevent->xclient.data.l [1]);
- else if (xevent->xclient.data.l [0] == atom_mate_panel_action_kill_dialog)
+ else if (xevent->xclient.data.l [0] == (long) atom_mate_panel_action_kill_dialog)
panel_action_protocol_kill_dialog (screen, xevent->xclient.data.l [1]);
else
return GDK_FILTER_CONTINUE;
diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c
index f7f6a43c..bcd676ee 100644
--- a/mate-panel/panel-addto.c
+++ b/mate-panel/panel-addto.c
@@ -229,8 +229,9 @@ panel_addto_applet_info_sort_func (PanelAddtoItemInfo *a,
static GSList *
panel_addto_prepend_internal_applets (GSList *list)
{
- static gboolean translated = FALSE;
- int i;
+ static gboolean translated = FALSE;
+ gsize i;
+ PanelActionButtonType p;
for (i = 0; i < G_N_ELEMENTS (internal_addto_items); i++) {
if (!translated) {
@@ -243,19 +244,19 @@ panel_addto_prepend_internal_applets (GSList *list)
translated = TRUE;
- for (i = PANEL_ACTION_LOCK; i < PANEL_ACTION_LAST; i++) {
+ for (p = PANEL_ACTION_LOCK; p < PANEL_ACTION_LAST; p++) {
PanelAddtoItemInfo *info;
- if (panel_action_get_is_disabled (i))
+ if (panel_action_get_is_disabled (p))
continue;
info = g_new0 (PanelAddtoItemInfo, 1);
info->type = PANEL_ADDTO_ACTION;
- info->action_type = i;
- info->name = g_strdup (panel_action_get_text (i));
- info->description = g_strdup (panel_action_get_tooltip (i));
- info->icon = g_strdup (panel_action_get_icon_name (i));
- info->iid = g_strdup (panel_action_get_drag_id (i));
+ info->action_type = p;
+ info->name = g_strdup (panel_action_get_text (p));
+ info->description = g_strdup (panel_action_get_tooltip (p));
+ info->icon = g_strdup (panel_action_get_icon_name (p));
+ info->iid = g_strdup (panel_action_get_drag_id (p));
info->enabled = TRUE;
info->static_data = FALSE;
@@ -484,7 +485,7 @@ panel_addto_append_special_applets (PanelAddtoDialog *dialog,
GtkListStore *model)
{
static gboolean translated = FALSE;
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS (special_addto_items); i++) {
if (!translated) {
diff --git a/mate-panel/panel-applet-frame.c b/mate-panel/panel-applet-frame.c
index 80d9b311..2c1bb43c 100644
--- a/mate-panel/panel-applet-frame.c
+++ b/mate-panel/panel-applet-frame.c
@@ -627,12 +627,12 @@ _mate_panel_applet_frame_update_flags (MatePanelAppletFrame *frame,
void
_mate_panel_applet_frame_update_size_hints (MatePanelAppletFrame *frame,
- gint *size_hints,
- guint n_elements)
+ gint *size_hints,
+ gsize n_elements)
{
if (frame->priv->has_handle) {
gint extra_size = HANDLE_SIZE + 1;
- gint i;
+ gsize i;
for (i = 0; i < n_elements; i++)
size_hints[i] += extra_size;
diff --git a/mate-panel/panel-applet-frame.h b/mate-panel/panel-applet-frame.h
index 618d0e3d..0c0fbd09 100644
--- a/mate-panel/panel-applet-frame.h
+++ b/mate-panel/panel-applet-frame.h
@@ -126,8 +126,8 @@ void _mate_panel_applet_frame_update_flags (MatePanelAppletFrame *fram
gboolean has_handle);
void _mate_panel_applet_frame_update_size_hints (MatePanelAppletFrame *frame,
- gint *size_hints,
- guint n_elements);
+ gint *size_hints,
+ gsize n_elements);
char *_mate_panel_applet_frame_get_background_string (MatePanelAppletFrame *frame,
PanelWidget *panel,
diff --git a/mate-panel/panel-bindings.c b/mate-panel/panel-bindings.c
index 39310c5e..4680cb3d 100644
--- a/mate-panel/panel-bindings.c
+++ b/mate-panel/panel-bindings.c
@@ -191,7 +191,7 @@ panel_bindings_mouse_modifier_changed (GSettings *settings,
static void
panel_bindings_initialise (void)
{
- int i;
+ gsize i;
char *str;
if (initialised)
@@ -229,7 +229,7 @@ panel_bindings_initialise (void)
void
panel_bindings_set_entries (GtkBindingSet *binding_set)
{
- int i;
+ gsize i;
if (!initialised)
panel_bindings_initialise ();
diff --git a/mate-panel/panel-ditem-editor.c b/mate-panel/panel-ditem-editor.c
index fa4357e4..f6f0c53a 100644
--- a/mate-panel/panel-ditem-editor.c
+++ b/mate-panel/panel-ditem-editor.c
@@ -1308,7 +1308,7 @@ response_cb (GtkDialog *dialog,
static void
panel_ditem_editor_revert (PanelDItemEditor *dialog)
{
- int i;
+ gsize i;
char *string;
gboolean boolean;
GKeyFile *key_file;
@@ -1384,7 +1384,7 @@ panel_ditem_editor_revert (PanelDItemEditor *dialog)
static void
panel_ditem_editor_set_revert (PanelDItemEditor *dialog)
{
- int i;
+ gsize i;
char *string;
gboolean boolean;
GKeyFile *key_file;
diff --git a/mate-panel/panel-menu-button.c b/mate-panel/panel-menu-button.c
index fda621c0..b2550ee0 100644
--- a/mate-panel/panel-menu-button.c
+++ b/mate-panel/panel-menu-button.c
@@ -108,7 +108,7 @@ static const char *
panel_menu_path_root_to_filename (MenuPathRoot path_root)
{
const char *retval;
- int i;
+ gsize i;
retval = NULL;
@@ -126,7 +126,7 @@ static const char *
panel_menu_filename_to_scheme (const char *filename)
{
const char *retval;
- int i;
+ gsize i;
gchar *basename;
retval = NULL;
@@ -162,7 +162,7 @@ static MenuPathRoot
panel_menu_scheme_to_path_root (const char *scheme)
{
MenuPathRoot retval;
- int i;
+ gsize i;
retval = LAST_MENU;
diff --git a/mate-panel/panel-properties-dialog.c b/mate-panel/panel-properties-dialog.c
index 6c6e3cc2..b37cc778 100644
--- a/mate-panel/panel-properties-dialog.c
+++ b/mate-panel/panel-properties-dialog.c
@@ -171,7 +171,7 @@ panel_properties_dialog_setup_orientation_combo (PanelPropertiesDialog *dialog,
GtkListStore *model;
GtkTreeIter iter;
GtkCellRenderer *renderer;
- int i;
+ gsize i;
dialog->orientation_combo = PANEL_GTK_BUILDER_GET (gui, "orientation_combo");
g_return_if_fail (dialog->orientation_combo != NULL);
diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c
index 24738d3c..a033fe1f 100644
--- a/mate-panel/panel-run-dialog.c
+++ b/mate-panel/panel-run-dialog.c
@@ -1545,7 +1545,7 @@ entry_event (GtkEditable *entry,
if (dialog->completion_started &&
pos != tmp &&
pos != 1 &&
- tmp == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
+ ((size_t) tmp) == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
gtk_editable_select_region (entry, 0, 0);
gtk_editable_set_position (entry, -1);
@@ -1558,12 +1558,12 @@ entry_event (GtkEditable *entry,
if (dialog->completion_started &&
pos != tmp &&
pos != 0 &&
- tmp == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
+ ((size_t) tmp) == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
temp = gtk_editable_get_chars (entry, 0, pos);
prefix = g_strconcat (temp, event->string, NULL);
g_free (temp);
} else if (pos == tmp &&
- tmp == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
+ ((size_t) tmp) == strlen (gtk_entry_get_text (GTK_ENTRY (entry)))) {
prefix = g_strconcat (gtk_entry_get_text (GTK_ENTRY (entry)),
event->string, NULL);
} else {
diff --git a/mate-panel/panel-stock-icons.c b/mate-panel/panel-stock-icons.c
index 02a930f4..8e124709 100644
--- a/mate-panel/panel-stock-icons.c
+++ b/mate-panel/panel-stock-icons.c
@@ -67,7 +67,7 @@ static void
panel_init_stock_icons (GtkIconFactory *factory)
{
GtkIconSource *source;
- int i;
+ gsize i;
source = gtk_icon_source_new ();
@@ -104,11 +104,13 @@ static void
panel_init_stock_items (GtkIconFactory *factory)
{
GtkStockItem *items;
- int i;
+ gsize n_items;
+ gsize i;
- items = g_new (GtkStockItem, G_N_ELEMENTS (stock_items));
+ n_items = G_N_ELEMENTS (stock_items);
+ items = g_new (GtkStockItem, n_items);
- for (i = 0; i < G_N_ELEMENTS (stock_items); i++) {
+ for (i = 0; i < n_items; i++) {
GtkIconSet *icon_set;
items [i].stock_id = g_strdup (stock_items [i].stock_id);
@@ -122,7 +124,7 @@ panel_init_stock_items (GtkIconFactory *factory)
gtk_icon_factory_add (factory, stock_items [i].stock_id, icon_set);
}
- gtk_stock_add_static (items, G_N_ELEMENTS (stock_items));
+ gtk_stock_add_static (items, n_items);
}
void
diff --git a/mate-panel/panel-test-applets.c b/mate-panel/panel-test-applets.c
index 8809f855..f14c3888 100644
--- a/mate-panel/panel-test-applets.c
+++ b/mate-panel/panel-test-applets.c
@@ -178,7 +178,7 @@ static void
load_applet_from_command_line (void)
{
guint size = 24, orient = PANEL_ORIENTATION_TOP;
- gint i;
+ gsize i;
g_assert (cli_iid != NULL);
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c
index 5a3dc181..591fb324 100644
--- a/mate-panel/panel-toplevel.c
+++ b/mate-panel/panel-toplevel.c
@@ -1144,7 +1144,7 @@ static void panel_toplevel_hide_button_clicked(PanelToplevel* toplevel, GtkButto
arrow_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "arrow-type"));
if (toplevel->priv->state == PANEL_STATE_NORMAL) {
- GtkDirectionType direction = -1;
+ GtkDirectionType direction;
switch (arrow_type) {
case GTK_ARROW_UP:
@@ -1164,7 +1164,7 @@ static void panel_toplevel_hide_button_clicked(PanelToplevel* toplevel, GtkButto
break;
}
- panel_toplevel_hide (toplevel, FALSE, direction);
+ panel_toplevel_hide (toplevel, FALSE, (gint) direction);
} else
panel_toplevel_unhide (toplevel);
}
@@ -3679,7 +3679,7 @@ panel_toplevel_start_animation (PanelToplevel *toplevel)
void
panel_toplevel_hide (PanelToplevel *toplevel,
gboolean auto_hide,
- GtkDirectionType direction)
+ gint direction)
{
g_return_if_fail (PANEL_IS_TOPLEVEL (toplevel));
@@ -3694,14 +3694,18 @@ panel_toplevel_hide (PanelToplevel *toplevel,
if (auto_hide)
toplevel->priv->state = PANEL_STATE_AUTO_HIDDEN;
else {
+ GtkDirectionType hide_direction;
+
if (direction == -1) {
if (toplevel->priv->orientation & PANEL_VERTICAL_MASK)
- direction = GTK_DIR_UP;
+ hide_direction = GTK_DIR_UP;
else
- direction = GTK_DIR_LEFT;
+ hide_direction = GTK_DIR_LEFT;
+ } else {
+ hide_direction = (GtkDirectionType) direction;
}
- switch (direction) {
+ switch (hide_direction) {
case GTK_DIR_UP:
g_return_if_fail (toplevel->priv->orientation & PANEL_VERTICAL_MASK);
toplevel->priv->state = PANEL_STATE_HIDDEN_UP;
diff --git a/mate-panel/panel-toplevel.h b/mate-panel/panel-toplevel.h
index 907e47a2..fd5897f1 100644
--- a/mate-panel/panel-toplevel.h
+++ b/mate-panel/panel-toplevel.h
@@ -138,7 +138,7 @@ PanelState panel_toplevel_get_state (PanelToplevel
void panel_toplevel_hide (PanelToplevel *toplevel,
gboolean auto_hide,
- GtkDirectionType direction);
+ gint direction);
void panel_toplevel_unhide (PanelToplevel *toplevel);
void panel_toplevel_queue_auto_hide (PanelToplevel *toplevel);
void panel_toplevel_queue_auto_unhide (PanelToplevel *toplevel);