libscroll warnings on compilation

Issue #17 new
Joseba Echevarria García repo owner created an issue

compiling the code as it is now results in a warning on libscroll:

libscroll.c
../../../modules/libscroll/libscroll.c:135:52: warning: incompatible pointer types passing
      'int (int, REGION *, int *, int *)' to parameter of type 'OBJ_INFO *' (aka 'int (*)(void *, REGION *,
      int *, int *)') [-Wincompatible-pointer-types]
        scrolls_objects[n] = (int)gr_new_object(0, info_scroll, scroll_draw, n);
                                                   ^~~~~~~~~~~
/Users/joseba/cvs/pixtudio/projects/QTCreator/../../modules/librender/g_object.h:69:43: note: passing argument
      to parameter 'info' here
extern int gr_new_object(int z, OBJ_INFO *info, OBJ_DRAW *draw, void *what);
                                          ^
../../../modules/libscroll/libscroll.c:135:65: warning: incompatible pointer types passing
      'void (int, REGION *)' to parameter of type 'OBJ_DRAW *' (aka 'void (*)(void *, REGION *)')
      [-Wincompatible-pointer-types]
        scrolls_objects[n] = (int)gr_new_object(0, info_scroll, scroll_draw, n);
                                                                ^~~~~~~~~~~
/Users/joseba/cvs/pixtudio/projects/QTCreator/../../modules/librender/g_object.h:69:59: note: passing argument
      to parameter 'draw' here
extern int gr_new_object(int z, OBJ_INFO *info, OBJ_DRAW *draw, void *what);
                                                          ^
../../../modules/libscroll/libscroll.c:135:78: warning: incompatible integer to pointer conversion passing
      'int' to parameter of type 'void *' [-Wint-conversion]
        scrolls_objects[n] = (int)gr_new_object(0, info_scroll, scroll_draw, n);
                                                                             ^
/Users/joseba/cvs/pixtudio/projects/QTCreator/../../modules/librender/g_object.h:69:71: note: passing argument
      to parameter 'what' here
extern int gr_new_object(int z, OBJ_INFO *info, OBJ_DRAW *draw, void *what);
                                                                      ^
3 warnings generated

The code should be changed so that the calls to gr_new_object don't result in a warning.

Comments (0)

  1. Log in to comment