]> granicus.if.org Git - graphviz/commitdiff
squash a -Wsign-conversion warning in core_loadimage_ps
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 May 2021 00:40:50 +0000 (17:40 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 27 May 2021 15:02:39 +0000 (08:02 -0700)
The st_size field is always positive, but is apparently an off_t which then
triggers -Wsign-conversion warnings when being converted to a size_t.

plugin/core/gvloadimage_core.c

index d12179cd03dac7149e3cf5e76094114943674ab4..32845f7b1e75786e192df0ebcf82db8129c38fcb 100644 (file)
@@ -179,7 +179,7 @@ static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean fill
             case FT_PS:
             case FT_EPS:
                fstat(fd, &statbuf);
-               us->datasize = statbuf.st_size;
+               us->datasize = (size_t)statbuf.st_size;
 #ifdef HAVE_SYS_MMAN_H
                us->data = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
                if (us->data == MAP_FAILED)