]> granicus.if.org Git - graphviz/commitdiff
smyrna: use a 'size_t' for 'ViewInfo.mouse_action_count'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Sep 2022 04:08:34 +0000 (21:08 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 00:11:28 +0000 (17:11 -0700)
Squashes two -Wsign-conversion warnings.

cmd/smyrna/hotkeymap.c
cmd/smyrna/smyrnadefs.h

index 09e048815a665a57312d1027c57413bb49ce0124..3952c48e6f96f4c1396bd3b0bbab5e405bf37d82 100644 (file)
@@ -164,7 +164,6 @@ void load_mouse_actions(ViewInfo * v)
 
 int get_mode(ViewInfo * v)
 {
-    int ind = 0;
     glMouseButtonType curMouseType = v->mouse.t;
     int curDragging = ((v->mouse.dragX != 0) || (v->mouse.dragY != 0));
     smyrna_view_mode view_mode;
@@ -175,7 +174,7 @@ int get_mode(ViewInfo * v)
        view_mode = smyrna_fisheye;
 
 
-    for (; ind < v->mouse_action_count; ind++) {
+    for (size_t ind = 0; ind < v->mouse_action_count; ind++) {
 
        if ((v->mouse_actions[ind].hotkey == v->keymap.keyVal)
            && (v->mouse_actions[ind].type == curMouseType)
index 9f2c1d7e316bb1a33ff7aa13ed1da6d09b358016..02181381fe95122aa115dc8cf93be0ab33653367 100644 (file)
@@ -16,6 +16,7 @@
 #endif
 #endif
 
+#include <stddef.h>
 #include <xdot/xdot.h>
 #include <gtk/gtk.h>
 #include <glcomp/opengl.h>
@@ -436,7 +437,7 @@ typedef struct
        ArcBall_t *arcball;
        keymap_t keymap;
        mouse_action_t* mouse_actions;  /*customizable moouse interraction list*/
-       int mouse_action_count;
+       size_t mouse_action_count;
        refresh_filter refresh;
        int edgerendertype;
        float nodeScale;