From 98a5c1a5cf20e57d6fe7d8e5f7ac17ca80a72d09 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 5 Jul 2019 14:45:36 -0300 Subject: [PATCH] Fixing warnings. --- src/dialogs/print/print.c | 8 ++++---- src/dialogs/transfer.c | 4 ++-- src/terminal/accessible.c | 16 ++++++++-------- src/terminal/draw.c | 7 ++++--- src/terminal/mouse.c | 4 ++-- src/testprogram/testprogram.c | 4 ++++ 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/dialogs/print/print.c b/src/dialogs/print/print.c index 7988d68..b21bfbe 100644 --- a/src/dialogs/print/print.c +++ b/src/dialogs/print/print.c @@ -306,8 +306,8 @@ V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_PRINT case LIB3270_PRINT_SELECTED: { - int row, col; - int baddr = 0; + unsigned int row, col; + unsigned int baddr = 0; GdkRectangle rect; memset(&rect,0,sizeof(rect)); @@ -340,12 +340,12 @@ V3270PrintOperation * v3270_print_operation_new(GtkWidget *widget, LIB3270_PRINT operation->contents.text = g_new0(column *, operation->contents.height+1); - for(row = rect.y; row < rect.width; row++) + for(row = rect.y; ((int) row) < rect.width; row++) { int c = 0; operation->contents.text[r++] = text = g_new0(column, operation->contents.width); - for(col = rect.x; col < rect.height; col++) + for(col = rect.x; ((int) col) < rect.height; col++) { lib3270_get_element(operation->session,lib3270_translate_to_address(operation->session,row,col),&text[c].c,&text[c].attr); if(!(text[c].attr & LIB3270_ATTR_SELECTED)) diff --git a/src/dialogs/transfer.c b/src/dialogs/transfer.c index 78f045f..8f4876b 100644 --- a/src/dialogs/transfer.c +++ b/src/dialogs/transfer.c @@ -42,13 +42,13 @@ /*--[ Implement ]------------------------------------------------------------------------------------*/ -static void header_on_state_changed(GtkWidget *worker, guint state, const gchar *msg, GtkDialog *dialog) +static void header_on_state_changed(GtkWidget G_GNUC_UNUSED(*worker), guint G_GNUC_UNUSED(state), const gchar *msg, GtkDialog *dialog) { debug("%s(%s)",__FUNCTION__,msg); gtk_header_bar_set_subtitle(GTK_HEADER_BAR(gtk_dialog_get_header_bar(dialog)),msg); } -static void transfer_success(GtkWidget *worker, const gchar *msg, const gchar *description, GtkDialog *dialog) +static void transfer_success(GtkWidget G_GNUC_UNUSED(*worker), const gchar *msg, const gchar *description, GtkDialog *dialog) { debug("%s(\"%s\",\"%s\")",__FUNCTION__,msg,description); gtk_dialog_response(dialog,GTK_RESPONSE_OK); diff --git a/src/terminal/accessible.c b/src/terminal/accessible.c index a35262d..d29cd22 100644 --- a/src/terminal/accessible.c +++ b/src/terminal/accessible.c @@ -310,9 +310,9 @@ static void v3270_accessible_get_character_extents( AtkText *text, gint *height, AtkCoordType coords ) { - v3270 * widget = (v3270 *) gtk_accessible_get_widget(GTK_ACCESSIBLE (text)); - int rows, cols; - GdkWindow * window; + v3270 * widget = (v3270 *) gtk_accessible_get_widget(GTK_ACCESSIBLE (text)); + unsigned int rows, cols; + GdkWindow * window; if (widget == NULL) return; @@ -344,10 +344,10 @@ static void v3270_accessible_get_character_extents( AtkText *text, static gchar * v3270_accessible_get_text_at_offset(AtkText *atk_text, gint offset, AtkTextBoundary boundary_type, G_GNUC_UNUSED gint *start_offset, G_GNUC_UNUSED gint *end_offset) { - GtkWidget * widget = gtk_accessible_get_widget(GTK_ACCESSIBLE (atk_text)); - H3270 * host; - char * text = NULL; - int rows,cols,pos; + GtkWidget * widget = gtk_accessible_get_widget(GTK_ACCESSIBLE (atk_text)); + H3270 * host; + char * text = NULL; + unsigned int rows,cols,pos; if(!widget) return NULL; @@ -385,7 +385,7 @@ static gchar * v3270_accessible_get_text_at_offset(AtkText *atk_text, gint offse case ATK_TEXT_BOUNDARY_LINE_START: // Boundary is the initial character of the content or a character immediately following a newline, // linefeed, or return character. pos = (offset/cols)*cols; - if(pos == offset) + if( ((int) pos) == offset) offset++; text = lib3270_get_string_at_address(host,pos,(offset-pos),'\n'); break; diff --git a/src/terminal/draw.c b/src/terminal/draw.c index 5249ed5..c7c6c15 100644 --- a/src/terminal/draw.c +++ b/src/terminal/draw.c @@ -375,7 +375,8 @@ LIB3270_EXPORT void v3270_reload(GtkWidget *widget) gint height = gtk_widget_get_allocated_height(widget); GdkRectangle rect; - int addr, cursor, r, rows, cols; + int addr, cursor; + unsigned int rows, cols, r; cairo_t * cr; @@ -411,7 +412,7 @@ LIB3270_EXPORT void v3270_reload(GtkWidget *widget) for(r = 0; r < rows; r++) { - int c; + unsigned int c; rect.x = terminal->font.left; @@ -447,7 +448,7 @@ void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned sho v3270 * terminal = GTK_V3270(lib3270_get_user_data(session)); cairo_t * cr; GdkRectangle rect; - int rows,cols; + unsigned int rows,cols; if(!(gtk_widget_get_realized(GTK_WIDGET(terminal)) && terminal->drawing)) return; diff --git a/src/terminal/mouse.c b/src/terminal/mouse.c index eb663b8..b0c712a 100644 --- a/src/terminal/mouse.c +++ b/src/terminal/mouse.c @@ -48,7 +48,7 @@ gint v3270_get_offset_at_point(v3270 *widget, gint x, gint y) { GdkPoint point; - int r,c; + unsigned int r,c; g_return_val_if_fail(widget->font.width > 0,-1); @@ -59,7 +59,7 @@ gint v3270_get_offset_at_point(v3270 *widget, gint x, gint y) lib3270_get_screen_size(widget->host,&r,&c); - if(point.x >= 0 && point.y >= 0 && point.x < c && point.y < r) + if(point.x >= 0 && point.y >= 0 && point.x < ((int) c) && point.y < ((int) r)) return (point.y * c) + point.x; } diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 2e81456..ac643fc 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -86,6 +86,7 @@ static gboolean popup_menu(GtkWidget *widget, G_GNUC_UNUSED gboolean selected, g } */ + /* static gboolean field_clicked(GtkWidget *widget, gboolean connected, V3270_OIA_FIELD field, GdkEventButton *event, GtkWidget *window) { trace("%s: %s field=%d event=%p window=%p",__FUNCTION__,connected ? "Connected" : "Disconnected", field, event, window); @@ -103,7 +104,9 @@ static gboolean popup_menu(GtkWidget *widget, G_GNUC_UNUSED gboolean selected, g return FALSE; } + */ + /* static void trace_window_destroy(G_GNUC_UNUSED GtkWidget *widget, H3270 *hSession) { lib3270_set_toggle(hSession,LIB3270_TOGGLE_DS_TRACE,0); lib3270_set_toggle(hSession,LIB3270_TOGGLE_SCREEN_TRACE,0); @@ -111,6 +114,7 @@ static void trace_window_destroy(G_GNUC_UNUSED GtkWidget *widget, H3270 *hSessio lib3270_set_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE,0); lib3270_set_toggle(hSession,LIB3270_TOGGLE_SSL_TRACE,0); } +*/ /* -- libgit2 0.21.2