diff --git a/display/d.graph/do_graph.c b/display/d.graph/do_graph.c index 5b1e13deac0..def7b9b4477 100644 --- a/display/d.graph/do_graph.c +++ b/display/d.graph/do_graph.c @@ -50,7 +50,7 @@ int set_graph_stuff(void) int set_text_size(void) { if (hsize >= 0. && vsize >= 0. && hsize <= 100. && vsize <= 100.) { - D_text_size(hsize * xincr, vsize * yincr); + D_text_size((double)hsize * xincr, (double)vsize * yincr); G_debug(3, "text size initialized to [%.1f,%.1f]", hsize * xincr, vsize * yincr); } @@ -201,7 +201,7 @@ int do_size(const char *str) if (xper < 0. || yper < 0. || xper > 100. || yper > 100.) return (-1); - D_text_size(xper * xincr, yper * yincr); + D_text_size((double)xper * xincr, (double)yper * yincr); G_debug(3, "text size set to [%.1f,%.1f]", xper * xincr, yper * yincr); return (0); diff --git a/display/d.legend/draw.c b/display/d.legend/draw.c index d3353589d4d..47d7df32501 100644 --- a/display/d.legend/draw.c +++ b/display/d.legend/draw.c @@ -1098,7 +1098,7 @@ void draw(const char *map_name, int maptype, int color, int thin, int lines, 0.81)); /* ?? txsiz*.81=actual text width. */ if (ScaleFactor < 1.0) { txsiz = txsiz * ScaleFactor; - dots_per_line = (int)floor(dots_per_line * ScaleFactor); + dots_per_line = (int)floor((double)dots_per_line * ScaleFactor); } } diff --git a/imagery/i.segment/flag.c b/imagery/i.segment/flag.c index b638ec9b68e..3cfed9ec2ff 100644 --- a/imagery/i.segment/flag.c +++ b/imagery/i.segment/flag.c @@ -20,7 +20,7 @@ FLAG *flag_create(int nrows, int ncols) if (!new_flag->array) G_fatal_error(_("Out of memory!")); - temp = (unsigned char *)G_malloc(nrows * new_flag->leng * + temp = (unsigned char *)G_malloc((size_t)nrows * new_flag->leng * sizeof(unsigned char)); if (!temp) diff --git a/raster3d/r3.in.v5d/main.c b/raster3d/r3.in.v5d/main.c index 72c8a4a3214..f750892ff7e 100644 --- a/raster3d/r3.in.v5d/main.c +++ b/raster3d/r3.in.v5d/main.c @@ -117,11 +117,11 @@ void convert(char *openFile, RASTER3D_Region *region, int convertNull, res_r = v5d.ProjArgs[2]; res_c = v5d.ProjArgs[3]; res_l = v5d.VertArgs[1]; - region->south = region->north - region->rows * res_r; + region->south = region->north - (double)region->rows * res_r; region->west = v5d.ProjArgs[1]; - region->east = region->west + region->cols * res_c; + region->east = region->west + (double)region->cols * res_c; region->bottom = v5d.VertArgs[0]; - region->top = region->bottom + region->depths * res_l; + region->top = region->bottom + (double)region->depths * res_l; data1 = (float *)G_malloc(nrncnl * sizeof(float)); if (!data1) diff --git a/raster3d/r3.out.v5d/main.c b/raster3d/r3.out.v5d/main.c index a6be34e2469..23d01b8fe7f 100644 --- a/raster3d/r3.out.v5d/main.c +++ b/raster3d/r3.out.v5d/main.c @@ -195,7 +195,7 @@ void convert(char *fileout, int rows, int cols, int depths, int trueCoords) /****************/ - g = (float *)G_malloc(rows * cols * Nl[0] * sizeof(float)); + g = (float *)G_malloc((size_t)rows * cols * Nl[0] * sizeof(float)); d1p = &d1; f1p = (float *)&d1; cnt = 0; diff --git a/vector/v.vol.rst/user3.c b/vector/v.vol.rst/user3.c index bc7fd69511f..76c802b5322 100644 --- a/vector/v.vol.rst/user3.c +++ b/vector/v.vol.rst/user3.c @@ -253,7 +253,7 @@ int COGRR1(double x_or, double y_or, double z_or, int n_rows, int n_cols, c normalization c */ - offset1 = nsizr * nsizc; + offset1 = (off_t)nsizr * nsizc; stepix = ew_res / dnorm; stepiy = ns_res / dnorm; diff --git a/visualization/ximgview/color.c b/visualization/ximgview/color.c index f24c59367f6..2a7b91cfc95 100644 --- a/visualization/ximgview/color.c +++ b/visualization/ximgview/color.c @@ -142,8 +142,8 @@ static int try_get_colors(Colormap cmap, int nr, int ng, int nb) int n_pixels; int r, g, b; - xpixels = (unsigned long *)G_realloc(xpixels, - nr * ng * nb * sizeof(unsigned long)); + xpixels = (unsigned long *)G_realloc(xpixels, (size_t)nr * ng * nb * + sizeof(unsigned long)); n_pixels = 0; xcolor.flags = DoRed | DoGreen | DoBlue;