diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2020-04-01 20:52:25 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2020-04-01 20:59:19 -0400 |
commit | ed8bb9667ac1e0f0863a03a44962be9654c4d04e (patch) | |
tree | b15ca88ee2a1ca3cd5685e561c8d529f548306af /src/xftextent.c | |
parent | a266847d3c17dcdfcac719a1aa970ad54f4b545a (diff) | |
download | xorg-lib-libXft-ed8bb9667ac1e0f0863a03a44962be9654c4d04e.tar.gz |
fix most type-conversion warnings from gcc-normal, without object-file changes
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftextent.c')
-rw-r--r-- | src/xftextent.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/xftextent.c b/src/xftextent.c index 1e418f2..1f84757 100644 --- a/src/xftextent.c +++ b/src/xftextent.c @@ -100,12 +100,12 @@ XftGlyphExtents (Display *dpy, y += xftg->metrics.yOff; } } - extents->x = -overall_left; - extents->y = -overall_top; - extents->width = overall_right - overall_left; - extents->height = overall_bottom - overall_top; - extents->xOff = x; - extents->yOff = y; + extents->x = (short)(-overall_left); + extents->y = (short)(-overall_top); + extents->width = (unsigned short)(overall_right - overall_left); + extents->height = (unsigned short)(overall_bottom - overall_top); + extents->xOff = (short)x; + extents->yOff = (short)y; } if (glyphs_loaded) _XftFontManageMemory (dpy, pub); @@ -127,7 +127,7 @@ XftTextExtents8 (Display *dpy, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -155,7 +155,7 @@ XftTextExtents16 (Display *dpy, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -183,7 +183,7 @@ XftTextExtents32 (Display *dpy, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) { memset (extents, '\0', sizeof (XGlyphInfo)); @@ -217,7 +217,7 @@ XftTextExtentsUtf8 (Display *dpy, { if (i == size) { - glyphs_new = malloc (size * 2 * sizeof (FT_UInt)); + glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -225,7 +225,7 @@ XftTextExtentsUtf8 (Display *dpy, memset (extents, '\0', sizeof (XGlyphInfo)); return; } - memcpy (glyphs_new, glyphs, size * sizeof (FT_UInt)); + memcpy (glyphs_new, glyphs, (size_t)size * sizeof (FT_UInt)); size *= 2; if (glyphs != glyphs_local) free (glyphs); @@ -261,7 +261,7 @@ XftTextExtentsUtf16 (Display *dpy, { if (i == size) { - glyphs_new = malloc (size * 2 * sizeof (FT_UInt)); + glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -269,7 +269,7 @@ XftTextExtentsUtf16 (Display *dpy, memset (extents, '\0', sizeof (XGlyphInfo)); return; } - memcpy (glyphs_new, glyphs, size * sizeof (FT_UInt)); + memcpy (glyphs_new, glyphs, (size_t)size * sizeof (FT_UInt)); size *= 2; if (glyphs != glyphs_local) free (glyphs); |