Commit 378b5cd7e1f22024d85d5e70954ecf6e86091702
1 parent
5e6ca200
Exists in
master
and in
1 other branch
Fixing warnings and window build.
Showing
12 changed files
with
43 additions
and
31 deletions
Show diff stats
src/trace/trace.c
... | ... | @@ -394,7 +394,7 @@ static void destroy(GtkWidget *widget) |
394 | 394 | return g_object_new(V3270_TYPE_TRACE, NULL); |
395 | 395 | } |
396 | 396 | |
397 | - GtkWidget * v3270_new_trace_window(GtkWidget *widget) | |
397 | + LIB3270_EXPORT GtkWidget * v3270_new_trace_window(GtkWidget *widget) | |
398 | 398 | { |
399 | 399 | return v3270_trace_new_from_session(v3270_get_session(widget)); |
400 | 400 | } |
... | ... | @@ -450,7 +450,7 @@ static void destroy(GtkWidget *widget) |
450 | 450 | gchar * msg; |
451 | 451 | }; |
452 | 452 | |
453 | - static void bg_trace_vprintf(struct bg_print_data *data) | |
453 | + static gboolean bg_trace_vprintf(struct bg_print_data *data) | |
454 | 454 | { |
455 | 455 | |
456 | 456 | GtkTextIter itr; |
... | ... | @@ -475,6 +475,9 @@ static void destroy(GtkWidget *widget) |
475 | 475 | //gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(hwnd->scroll), vadj); |
476 | 476 | |
477 | 477 | g_free(data->msg); |
478 | + | |
479 | + return FALSE; | |
480 | + | |
478 | 481 | } |
479 | 482 | |
480 | 483 | void v3270_trace_vprintf(GtkWidget *widget, const char *fmt, va_list args) | ... | ... |
src/v3270/callbacks.c
... | ... | @@ -28,6 +28,11 @@ |
28 | 28 | */ |
29 | 29 | |
30 | 30 | #include <config.h> |
31 | + | |
32 | + #ifdef _WIN32 | |
33 | + #include <winsock2.h> | |
34 | + #endif // _WIN32 | |
35 | + | |
31 | 36 | #include "private.h" |
32 | 37 | |
33 | 38 | #include <gtk/gtk.h> |
... | ... | @@ -132,7 +137,7 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value |
132 | 137 | |
133 | 138 | } |
134 | 139 | |
135 | -static void bg_update_message(H3270 *session) | |
140 | +static gboolean bg_update_message(H3270 *session) | |
136 | 141 | { |
137 | 142 | void *widget = lib3270_get_user_data(session); |
138 | 143 | trace("-----A %s %p",__FUNCTION__, lib3270_get_user_data(session)); |
... | ... | @@ -145,6 +150,8 @@ static void bg_update_message(H3270 *session) |
145 | 150 | ); |
146 | 151 | |
147 | 152 | trace("-----B %s %p",__FUNCTION__, lib3270_get_user_data(session)); |
153 | + | |
154 | + return FALSE; | |
148 | 155 | } |
149 | 156 | |
150 | 157 | static void update_message(H3270 *session, G_GNUC_UNUSED LIB3270_MESSAGE id) |
... | ... | @@ -163,7 +170,7 @@ struct select_cursor_data |
163 | 170 | LIB3270_POINTER id; |
164 | 171 | }; |
165 | 172 | |
166 | -static void bg_select_cursor(struct select_cursor_data *data) | |
173 | +static gboolean bg_select_cursor(struct select_cursor_data *data) | |
167 | 174 | { |
168 | 175 | GtkWidget *widget = GTK_WIDGET(lib3270_get_user_data(data->hSession)); |
169 | 176 | |
... | ... | @@ -176,6 +183,8 @@ static void bg_select_cursor(struct select_cursor_data *data) |
176 | 183 | GTK_V3270(widget)->pointer_id = data->id; |
177 | 184 | v3270_update_mouse_pointer(widget); |
178 | 185 | } |
186 | + | |
187 | + return FALSE; | |
179 | 188 | } |
180 | 189 | |
181 | 190 | static void select_cursor(H3270 *session, LIB3270_POINTER id) | ... | ... |
src/v3270/linux/iosource.c
... | ... | @@ -91,25 +91,11 @@ GSource * IO_source_new(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*call |
91 | 91 | return (GSource *) src; |
92 | 92 | } |
93 | 93 | |
94 | -G_GNUC_INTERNAL void IO_source_set_state(GSource *source, gboolean enable) | |
94 | +void IO_source_set_state(GSource *source, gboolean enable) | |
95 | 95 | { |
96 | 96 | ((IO_Source *)source)->enabled = enable; |
97 | - | |
98 | - /* | |
99 | - if(enable) | |
100 | - { | |
101 | - trace("Polling %d was enabled",((IO_Source *)source)->poll.fd); | |
102 | - g_source_add_poll((GSource *) source,&((IO_Source *)source)->poll); | |
103 | - } | |
104 | - else | |
105 | - { | |
106 | - trace("Polling of %d was disabled",((IO_Source *)source)->poll.fd); | |
107 | - g_source_remove_poll((GSource *) source,&((IO_Source *)source)->poll); | |
108 | - } | |
109 | - */ | |
110 | 97 | } |
111 | 98 | |
112 | - | |
113 | 99 | gboolean IO_prepare(G_GNUC_UNUSED GSource *source, G_GNUC_UNUSED gint *timeout) |
114 | 100 | { |
115 | 101 | /* | ... | ... |
src/v3270/oia.c
... | ... | @@ -940,12 +940,16 @@ void v3270_oia_update_text_field(v3270 *terminal, gboolean flag, V3270_OIA_FIELD |
940 | 940 | v3270_queue_draw_area(GTK_WIDGET(terminal),r->x,r->y,r->width,r->height); |
941 | 941 | } |
942 | 942 | |
943 | +#ifdef KEY_FLAG_ALT | |
943 | 944 | void v3270_draw_alt_status(v3270 *terminal) |
944 | 945 | { |
945 | -#ifdef KEY_FLAG_ALT | |
946 | 946 | v3270_oia_update_text_field(terminal,terminal->keyflags & KEY_FLAG_ALT,V3270_OIA_ALT,'A'); |
947 | -#endif // KEY_FLAG_ALT | |
948 | 947 | } |
948 | +#else | |
949 | +void v3270_draw_alt_status(v3270 G_GNUC_UNUSED(*terminal)) | |
950 | +{ | |
951 | +} | |
952 | +#endif // KEY_FLAG_ALT | |
949 | 953 | |
950 | 954 | void v3270_draw_ins_status(v3270 *terminal) |
951 | 955 | { | ... | ... |
src/v3270/private.h
... | ... | @@ -229,6 +229,8 @@ G_BEGIN_DECLS |
229 | 229 | G_GNUC_INTERNAL void v3270_oia_update_text_field(v3270 *terminal, gboolean flag, V3270_OIA_FIELD id, const gchar chr); |
230 | 230 | G_GNUC_INTERNAL cairo_t * v3270_oia_set_update_region(v3270 * terminal, GdkRectangle **r, V3270_OIA_FIELD id); |
231 | 231 | |
232 | + G_GNUC_INTERNAL void v3270_install_callbacks(v3270 *widget); | |
233 | + | |
232 | 234 | G_GNUC_INTERNAL struct _v3270_properties |
233 | 235 | { |
234 | 236 | size_t count; // Number of properties. | ... | ... |
src/v3270/widget.c
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | |
34 | 34 | #include <lib3270.h> |
35 | 35 | #include <lib3270/log.h> |
36 | + #include <lib3270/actions.h> | |
36 | 37 | |
37 | 38 | #if GTK_CHECK_VERSION(3,0,0) |
38 | 39 | #include <gdk/gdkkeysyms-compat.h> |
... | ... | @@ -509,7 +510,7 @@ static void v3270_class_init(v3270Class *klass) |
509 | 510 | |
510 | 511 | static gboolean activity_tick(v3270 *widget) |
511 | 512 | { |
512 | - if(widget->activity.disconnect && lib3270_is_connected(widget->host) && ((time(0) - widget->activity.timestamp)/60) >= widget->activity.disconnect) | |
513 | + if(widget->activity.disconnect && lib3270_is_connected(widget->host) && ((guint) ((time(0) - widget->activity.timestamp)/60)) >= widget->activity.disconnect) | |
513 | 514 | lib3270_disconnect(widget->host); |
514 | 515 | return TRUE; |
515 | 516 | } | ... | ... |
src/v3270/windows/iosource.c
... | ... | @@ -86,6 +86,11 @@ GSource * IO_source_new(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*call |
86 | 86 | return (GSource *) src; |
87 | 87 | } |
88 | 88 | |
89 | +void IO_source_set_state(GSource *source, gboolean enable) | |
90 | +{ | |
91 | + ((IO_Source *)source)->enabled = enable; | |
92 | +} | |
93 | + | |
89 | 94 | static gboolean IO_prepare(G_GNUC_UNUSED GSource *source, G_GNUC_UNUSED gint *timeout) |
90 | 95 | { |
91 | 96 | /* | ... | ... |
src/v3270ft/filelist.c
... | ... | @@ -101,8 +101,8 @@ void v3270ft_append_file(GtkWidget *widget, const gchar *filename, gboolean text |
101 | 101 | struct v3270ft_entry * entry = v3270ft_create_entry(); |
102 | 102 | gchar * base = g_path_get_basename(filename); |
103 | 103 | |
104 | - strncpy(entry->local,filename,FILENAME_MAX); | |
105 | - strncpy(entry->remote,base,FILENAME_MAX); | |
104 | + strncpy(entry->local,filename,ENTRY_FILENAME_LENGTH); | |
105 | + strncpy(entry->remote,base,ENTRY_FILENAME_LENGTH); | |
106 | 106 | |
107 | 107 | g_free(base); |
108 | 108 | ... | ... |
src/v3270ft/load.c
... | ... | @@ -86,11 +86,11 @@ static void entry_start(G_GNUC_UNUSED GMarkupParseContext *context, const gchar |
86 | 86 | |
87 | 87 | if(!g_ascii_strcasecmp(type,"local")) { |
88 | 88 | |
89 | - strncpy(info->local,path,sizeof(info->local)); | |
89 | + strncpy(info->local,path,sizeof(info->local)-1); | |
90 | 90 | |
91 | 91 | } else if(!g_ascii_strcasecmp(type,"remote")) { |
92 | 92 | |
93 | - strncpy(info->remote,path,sizeof(info->remote)); | |
93 | + strncpy(info->remote,path,sizeof(info->remote)-1); | |
94 | 94 | |
95 | 95 | } |
96 | 96 | ... | ... |
src/v3270ft/private.h
... | ... | @@ -98,11 +98,12 @@ |
98 | 98 | extern const struct v3270ft_type ft_type[]; |
99 | 99 | extern const struct v3270ft_value ft_value[]; |
100 | 100 | |
101 | + #define ENTRY_FILENAME_LENGTH FILENAME_MAX | |
101 | 102 | struct v3270ft_entry { |
102 | 103 | gint type; ///< Transfer type. |
103 | 104 | gboolean valid; ///< Is dialog content valid? |
104 | - gchar local[FILENAME_MAX]; ///< Local file name. | |
105 | - gchar remote[FILENAME_MAX]; ///< Remote file name. | |
105 | + gchar local[ENTRY_FILENAME_LENGTH+1]; ///< Local file name. | |
106 | + gchar remote[ENTRY_FILENAME_LENGTH+1]; ///< Remote file name. | |
106 | 107 | LIB3270_FT_OPTION options; ///< File Transfer options. |
107 | 108 | guint value[LIB3270_FT_VALUE_COUNT]; ///< File transfer values. |
108 | 109 | }; | ... | ... |
src/v3270ft/select.c
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | |
38 | 38 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
39 | 39 | |
40 | +/* | |
40 | 41 | #if defined(_WIN32) |
41 | 42 | |
42 | 43 | struct file { |
... | ... | @@ -69,8 +70,8 @@ static gpointer select_file(struct file *fl) { |
69 | 70 | |
70 | 71 | return 0; |
71 | 72 | } |
72 | - | |
73 | 73 | #endif // _WIN32 |
74 | +*/ | |
74 | 75 | |
75 | 76 | gchar * v3270ft_select_file(v3270ft *dialog, const gchar *title, const gchar *button, GtkFileChooserAction action, G_GNUC_UNUSED const gchar *filename, G_GNUC_UNUSED const gchar *filter, ...) { |
76 | 77 | |
... | ... | @@ -189,7 +190,7 @@ gchar * v3270ft_select_file(v3270ft *dialog, const gchar *title, const gchar *bu |
189 | 190 | gtk_widget_destroy(chooser); |
190 | 191 | |
191 | 192 | |
192 | -#endif // defined | |
193 | +#endif // WIN32 | |
193 | 194 | |
194 | 195 | return rc; |
195 | 196 | ... | ... |
src/v3270ft/v3270ft.c
... | ... | @@ -290,7 +290,7 @@ static gboolean spin_format(GtkSpinButton *spin, G_GNUC_UNUSED gpointer data) { |
290 | 290 | } |
291 | 291 | |
292 | 292 | #ifdef WIN32 |
293 | -static void select_local_file(GtkButton *button, v3270ft *dialog) { | |
293 | +static void select_local_file(GtkButton G_GNUC_UNUSED(*button), v3270ft *dialog) { | |
294 | 294 | #else |
295 | 295 | static void icon_press(G_GNUC_UNUSED GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_pos, G_GNUC_UNUSED GdkEvent *event, v3270ft *dialog) { |
296 | 296 | #endif // WIN32 | ... | ... |