From 51b692c3f9e303498d859294e660b46556fb8060 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 23 Feb 2021 19:32:19 -0800 Subject: [PATCH] remove use of int as size_t in dot_polygon This removes four -Wconversion warnings. --- cmd/gvmap/make_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/gvmap/make_map.c b/cmd/gvmap/make_map.c index b189b157a..6bf1fcbd3 100644 --- a/cmd/gvmap/make_map.c +++ b/cmd/gvmap/make_map.c @@ -643,7 +643,7 @@ static void dot_polygon(char **sbuff, int *len, int *len_max, int np, float *xp, int ret = 0; char buf[10000]; char swidth[10000]; - int len_swidth; + size_t len_swidth; if (np > 0){ /* figure out the size needed */ @@ -654,7 +654,7 @@ static void dot_polygon(char **sbuff, int *len, int *len_max, int np, float *xp, if (line_width > 0){ sprintf(swidth,"%f",line_width); len_swidth = strlen(swidth); - sprintf(swidth,"S %d -setlinewidth(%f)",len_swidth+14, line_width); + sprintf(swidth,"S %zu -setlinewidth(%f)",len_swidth+14, line_width); ret += snprintf(buf, sizeof(buf), " c %zu -%s %s L %d ", strlen(cstring), cstring, swidth, np); } else { ret += snprintf(buf, sizeof(buf), " c %zu -%s L %d ", strlen(cstring), cstring, np); @@ -676,7 +676,7 @@ static void dot_polygon(char **sbuff, int *len, int *len_max, int np, float *xp, if (line_width > 0){ sprintf(swidth,"%f",line_width); len_swidth = strlen(swidth); - sprintf(swidth,"S %d -setlinewidth(%f)",len_swidth+14, line_width); + sprintf(swidth,"S %zu -setlinewidth(%f)",len_swidth+14, line_width); ret = sprintf(&((*sbuff)[*len]), " c %zu -%s %s L %d ", strlen(cstring), cstring, swidth, np); } else { ret = sprintf(&((*sbuff)[*len]), " c %zu -%s L %d ", strlen(cstring), cstring, np); -- 2.40.0