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/xftdraw.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/xftdraw.c')
-rw-r--r-- | src/xftdraw.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/xftdraw.c b/src/xftdraw.c index dfa97fb..1fe6d4d 100644 --- a/src/xftdraw.c +++ b/src/xftdraw.c @@ -114,7 +114,7 @@ XftDrawBitsPerPixel (XftDraw *draw) { if (formats[i].depth == depth) { - draw->bits_per_pixel = formats[i].bits_per_pixel; + draw->bits_per_pixel = (unsigned)formats[i].bits_per_pixel; break; } } @@ -190,7 +190,7 @@ XftDrawCreateAlpha (Display *dpy, draw->dpy = dpy; draw->drawable = (Drawable) pixmap; draw->screen = _XftDrawScreen (dpy, pixmap, NULL); - draw->depth = depth; + draw->depth = (unsigned)depth; draw->bits_per_pixel = 0; /* don't find out until we need it */ draw->visual = NULL; draw->colormap = 0; @@ -216,9 +216,9 @@ _XftDrawFormat (XftDraw *draw) XRenderPictFormat pf; pf.type = PictTypeDirect; - pf.depth = XftDrawDepth (draw); + pf.depth = (int)XftDrawDepth (draw); pf.direct.alpha = 0; - pf.direct.alphaMask = (1 << pf.depth) - 1; + pf.direct.alphaMask = (short)((1 << pf.depth) - 1); return XRenderFindFormat (draw->dpy, (PictFormatType| PictFormatDepth| @@ -359,7 +359,7 @@ XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color) XRenderPictureAttributes pa; pix = XCreatePixmap (dpy, RootWindow (dpy, draw->screen), 1, 1, - info->solidFormat->depth); + (unsigned)info->solidFormat->depth); pa.repeat = True; info->colors[i].pict = XRenderCreatePicture (draw->dpy, pix, @@ -525,7 +525,7 @@ XftDrawString8 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) return; } @@ -552,7 +552,7 @@ XftDrawString16 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) return; } @@ -580,7 +580,7 @@ XftDrawString32 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (FT_UInt)); + glyphs = malloc ((size_t)len * sizeof (FT_UInt)); if (!glyphs) return; } @@ -614,14 +614,14 @@ XftDrawStringUtf8 (XftDraw *draw, { 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) free (glyphs); 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); @@ -659,14 +659,14 @@ XftDrawStringUtf16 (XftDraw *draw, { 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) free (glyphs); 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); @@ -759,7 +759,7 @@ XftDrawCharSpec (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (XftGlyphSpec)); + glyphs = malloc ((size_t)len * sizeof (XftGlyphSpec)); if (!glyphs) return; } @@ -788,7 +788,7 @@ XftDrawCharFontSpec (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc (len * sizeof (XftGlyphFontSpec)); + glyphs = malloc ((size_t)len * sizeof (XftGlyphFontSpec)); if (!glyphs) return; } @@ -929,7 +929,7 @@ XftDrawSetClipRectangles (XftDraw *draw, draw->clip.rect->n == n && (n == 0 || (draw->clip.rect->xOrigin == xOrigin && draw->clip.rect->yOrigin == yOrigin)) && - !memcmp (XftClipRects (draw->clip.rect), rects, n * sizeof (XRectangle))) + !memcmp (XftClipRects (draw->clip.rect), rects, (size_t)n * sizeof (XRectangle))) { return True; } @@ -937,14 +937,14 @@ XftDrawSetClipRectangles (XftDraw *draw, /* * Duplicate the region so future changes can be short circuited */ - new = malloc (sizeof (XftClipRect) + n * sizeof (XRectangle)); + new = malloc (sizeof (XftClipRect) + (size_t)n * sizeof (XRectangle)); if (!new) return False; new->n = n; new->xOrigin = xOrigin; new->yOrigin = yOrigin; - memcpy (XftClipRects (new), rects, n * sizeof (XRectangle)); + memcpy (XftClipRects (new), rects, (size_t)n * sizeof (XRectangle)); /* * Destroy existing clip |