]> granicus.if.org Git - graphviz/commitdiff
smyrna: use a more appropriate type for 'ComboValuesCount'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 3 Nov 2022 02:20:41 +0000 (19:20 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 4 Nov 2022 01:14:25 +0000 (18:14 -0700)
Squashes two compiler warnings:

  gui/gui.c:94:96: warning: conversion to ‘size_t’ {aka ‘long unsigned
    int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
     94 |   attr[attrcount].ComboValuesCount - 1,
        |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
  gui/gui.c:95:78: warning: conversion to ‘size_t’ {aka ‘long unsigned
    int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
     95 |   attr[attrcount].ComboValuesCount,
        |   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

cmd/smyrna/smyrnadefs.h

index 2b0935d0f4ce2a4d3b1cbc04b9af27528efe9c8d..9327f98ddfa9c06f10fa28330fdca4779f02c272 100644 (file)
@@ -25,6 +25,7 @@
 #include <glcomp/glcompset.h>
 #include "hier.h"
 #include <glcomp/glutils.h>
+#include <stddef.h>
 
 #ifdef _WIN32                  //this is needed on _WIN32 to get libglade see the callback
 #define _BB  __declspec(dllexport)
@@ -281,7 +282,7 @@ typedef struct
        char *Default;
        char Engine[GVK_FDP + 1];
        char **ComboValues;
-       int ComboValuesCount;
+       size_t ComboValuesCount;
        GtkWidget *attrWidget;
 
     } attribute;