Skip to content

Fix GTK 3.x compiler warnings#59

Open
tanuki-no wants to merge 1 commit intodeiv:masterfrom
tanuki-no:gtk3
Open

Fix GTK 3.x compiler warnings#59
tanuki-no wants to merge 1 commit intodeiv:masterfrom
tanuki-no:gtk3

Conversation

@tanuki-no
Copy link

This patch replces outdated API functions with newer ones:

display.c: In function ‘update_window’:
display.c:153:9: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations]
153 | cairo_t *cr = gdk_cairo_create(drawable);
| ^~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:33,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from display.c:23:
/usr/include/gtk-3.0/gdk/gdkcairo.h:35:12: note: declared here
35 | cairo_t * gdk_cairo_create (GdkWindow *window);
| ^~~~~~~~~~~~~~~~
display.c: In function ‘button_release_event’:
display.c:323:9: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations]
323 | cairo_t *cr = gdk_cairo_create(drawable);
| ^~~~~~~
/usr/include/gtk-3.0/gdk/gdkcairo.h:35:12: note: declared here
35 | cairo_t * gdk_cairo_create (GdkWindow window);
| ^~~~~~~~~~~~~~~~
display.c:330:9: warning: ‘gdk_flush’ is deprecated: Use 'gdk_display_flush' instead [-Wdeprecated-declarations]
330 | gdk_flush(); /
force X to actually draw the damn thing. */
| ^~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:
/usr/include/gtk-3.0/gdk/gdkmain.h:124:6: note: declared here
124 | void gdk_flush (void);
| ^~~~~~~~~
display.c: In function ‘display_send_img’:
display.c:64:5: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
64 | write(imgpipe_writefd, name, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c: In function ‘do_image_display’:
display.c:73:5: warning: ignoring return value of ‘pipe’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
73 | pipe(pfd);
| ^~~~~~~~~
display.c: In function ‘pipe_event’:
display.c:420:29: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
420 | write(1, "\a", 1);
| ^~~~~~~~~~~~~~~~~
rm -f libdisplay.a

Signed-off-by: Vladislav Mikhailikov vmikhailikov@gmail.com

This patch replces outdated API functions with newer ones:

display.c: In function ‘update_window’:
display.c:153:9: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations]
  153 |         cairo_t *cr = gdk_cairo_create(drawable);
      |         ^~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:33,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from display.c:23:
/usr/include/gtk-3.0/gdk/gdkcairo.h:35:12: note: declared here
   35 | cairo_t  * gdk_cairo_create             (GdkWindow          *window);
      |            ^~~~~~~~~~~~~~~~
display.c: In function ‘button_release_event’:
display.c:323:9: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations]
  323 |         cairo_t *cr = gdk_cairo_create(drawable);
      |         ^~~~~~~
/usr/include/gtk-3.0/gdk/gdkcairo.h:35:12: note: declared here
   35 | cairo_t  * gdk_cairo_create             (GdkWindow          *window);
      |            ^~~~~~~~~~~~~~~~
display.c:330:9: warning: ‘gdk_flush’ is deprecated: Use 'gdk_display_flush' instead [-Wdeprecated-declarations]
  330 |         gdk_flush();    /* force X to actually draw the damn thing. */
      |         ^~~~~~~~~
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:
/usr/include/gtk-3.0/gdk/gdkmain.h:124:6: note: declared here
  124 | void gdk_flush (void);
      |      ^~~~~~~~~
display.c: In function ‘display_send_img’:
display.c:64:5: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   64 |     write(imgpipe_writefd, name, len);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c: In function ‘do_image_display’:
display.c:73:5: warning: ignoring return value of ‘pipe’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   73 |     pipe(pfd);
      |     ^~~~~~~~~
display.c: In function ‘pipe_event’:
display.c:420:29: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  420 |                             write(1, "\a", 1);
      |                             ^~~~~~~~~~~~~~~~~
rm -f libdisplay.a

Signed-off-by: Vladislav Mikhailikov <vmikhailikov@gmail.com>
@tanuki-no
Copy link
Author

Adding PR to fix the reported issue: #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant