]> granicus.if.org Git - graphviz/commitdiff
core plugin: squash -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 8 Nov 2022 02:27:36 +0000 (18:27 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 11 Nov 2022 01:09:34 +0000 (17:09 -0800)
Squashes the compiler warning:

  gvloadimage_core.c: In function ‘core_loadimage_vml’:
  gvloadimage_core.c:251:18: warning: conversion to ‘unsigned int’ from ‘int’
    may change the sign of the result [-Wsign-conversion]
    251 |     graphHeight =(int)(job->bb.UR.y - job->bb.LL.y);
        |                  ^

plugin/core/gvloadimage_core.c

index 149698668a7859ba6d9e6ad899b6b6102cc85fb4..6d652de829370d3c56a643adafcd9fd2729dfdb2 100644 (file)
@@ -247,8 +247,7 @@ static void core_loadimage_vml(GVJ_t * job, usershape_t *us, boxf b, bool filled
 {
     (void)filled;
 
-    unsigned int  graphHeight;
-    graphHeight =(int)(job->bb.UR.y - job->bb.LL.y);
+    int  graphHeight = (int)(job->bb.UR.y - job->bb.LL.y);
     gvprintf (job, "<v:image src=\"%s\" style=\" position:absolute; width:%.2f; height:%.2f; left:%.2f ; top:%.2f\"",
            us->name,  b.UR.x - b.LL.x, b.UR.y - b.LL.y, b.LL.x, graphHeight-b.UR.y);
     gvputs(job, " />\n");