From: Matthew Fernandez Date: Wed, 7 Sep 2022 04:08:34 +0000 (-0700) Subject: smyrna: use a 'size_t' for 'ViewInfo.mouse_action_count' X-Git-Tag: 6.0.1~4^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8ebfc3b1df532ffde2874bc43c6801de67f9dd3;p=graphviz smyrna: use a 'size_t' for 'ViewInfo.mouse_action_count' Squashes two -Wsign-conversion warnings. --- diff --git a/cmd/smyrna/hotkeymap.c b/cmd/smyrna/hotkeymap.c index 09e048815..3952c48e6 100644 --- a/cmd/smyrna/hotkeymap.c +++ b/cmd/smyrna/hotkeymap.c @@ -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) diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 9f2c1d7e3..02181381f 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -16,6 +16,7 @@ #endif #endif +#include #include #include #include @@ -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;