Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/libXft/dist/src merge libXfont2 2.0.5 and lib...



details:   https://anonhg.NetBSD.org/xsrc/rev/d9dcfc75b458
branches:  trunk
changeset: 10781:d9dcfc75b458
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Aug 23 21:05:09 2021 +0000

description:
merge libXfont2 2.0.5 and libXft 2.3.4.

diffstat:

 external/mit/libXft/dist/src/xftdpy.c    |  14 ++--
 external/mit/libXft/dist/src/xftglyphs.c |  94 ++++++++++++++++----------------
 2 files changed, 54 insertions(+), 54 deletions(-)

diffs (truncated from 308 to 300 lines):

diff -r 6ef7a3616f79 -r d9dcfc75b458 external/mit/libXft/dist/src/xftdpy.c
--- a/external/mit/libXft/dist/src/xftdpy.c     Mon Aug 23 21:04:26 2021 +0000
+++ b/external/mit/libXft/dist/src/xftdpy.c     Mon Aug 23 21:05:09 2021 +0000
@@ -165,7 +165,7 @@
     _XftDisplayInfo = info;
 
     info->glyph_memory = 0;
-    info->max_glyph_memory = XftDefaultGetInteger (dpy,
+    info->max_glyph_memory = (unsigned long)XftDefaultGetInteger (dpy,
                                                   XFT_MAX_GLYPH_MEMORY, 0,
                                                   XFT_DPY_MAX_GLYPH_MEMORY);
     if (XftDebug () & XFT_DBG_CACHE)
@@ -233,7 +233,7 @@
     }
     while (info->glyph_memory > info->max_glyph_memory)
     {
-       glyph_memory = rand () % info->glyph_memory;
+       glyph_memory = (unsigned long)rand () % info->glyph_memory;
        public = info->fonts;
        while (public)
        {
@@ -274,9 +274,9 @@
     info->defaults = defaults;
     if (!info->max_glyph_memory)
        info->max_glyph_memory = XFT_DPY_MAX_GLYPH_MEMORY;
-    info->max_glyph_memory = XftDefaultGetInteger (dpy,
+    info->max_glyph_memory = (unsigned long)XftDefaultGetInteger (dpy,
                                                   XFT_MAX_GLYPH_MEMORY, 0,
-                                                  info->max_glyph_memory);
+                                                  (int)info->max_glyph_memory);
     if (!info->max_unref_fonts)
        info->max_unref_fonts = XFT_DPY_MAX_UNREF_FONTS;
     info->max_unref_fonts = XftDefaultGetInteger (dpy,
@@ -292,7 +292,7 @@
 
     c0 = *v;
     if (isupper ((int)c0))
-       c0 = tolower (c0);
+       c0 = (char)tolower (c0);
     if (c0 == 't' || c0 == 'y' || c0 == '1')
        return 1;
     if (c0 == 'f' || c0 == 'n' || c0 == '0')
@@ -301,7 +301,7 @@
     {
        c1 = v[1];
        if (isupper ((int)c1))
-           c1 = tolower (c1);
+           c1 = (char)tolower (c1);
        if (c1 == 'n')
            return 1;
        if (c1 == 'f')
@@ -349,7 +349,7 @@
     {
        if (FcNameConstant ((FcChar8 *) v, &i))
            return FcPatternAddInteger (pat, option, i);
-       i = strtol (v, &e, 0);
+       i = (int)strtol (v, &e, 0);
        if (e != v)
            return FcPatternAddInteger (pat, option, i);
     }
diff -r 6ef7a3616f79 -r d9dcfc75b458 external/mit/libXft/dist/src/xftglyphs.c
--- a/external/mit/libXft/dist/src/xftglyphs.c  Mon Aug 23 21:04:26 2021 +0000
+++ b/external/mit/libXft/dist/src/xftglyphs.c  Mon Aug 23 21:05:09 2021 +0000
@@ -86,11 +86,11 @@
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
        return -1;
 
-    // compute the size of the final bitmap
+    /* compute the size of the final bitmap */
     ftbit = &slot->bitmap;
 
-    width = ftbit->width;
-    height = ftbit->rows;
+    width = (int)ftbit->width;
+    height = (int)ftbit->rows;
     pitch = (width+3) & ~3;
 
     switch ( ftbit->pixel_mode )
@@ -134,8 +134,8 @@
        return -1;
     }
 
-    target->width = width;
-    target->rows = height;
+    target->width = (unsigned)width;
+    target->rows = (unsigned)height;
     target->pitch = pitch;
     target->buffer = NULL;
 
@@ -168,8 +168,8 @@
        unsigned char*  srcLine = ftbit->buffer;
         unsigned char* dstLine = target->buffer;
         int            src_pitch = ftbit->pitch;
-        int            width = target->width;
-        int            height = target->rows;
+        int            width = (int)target->width;
+        int            height = (int)target->rows;
         int            pitch = target->pitch;
         int            subpixel;
         int            h;
@@ -178,7 +178,7 @@
                     mode == FT_RENDER_MODE_LCD_V );
 
        if ( src_pitch < 0 )
-           srcLine -= src_pitch*(ftbit->rows-1);
+           srcLine -= ((unsigned)src_pitch * (ftbit->rows-1));
 
        switch ( ftbit->pixel_mode )
        {
@@ -214,7 +214,7 @@
                int bytes = (width+7) >> 3;
 
                for ( h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch )
-                   memcpy( dstLine, srcLine, bytes );
+                   memcpy( dstLine, srcLine, (size_t)bytes );
            }
            break;
 
@@ -240,7 +240,7 @@
            else  /* copy gray into gray */
            {
                for ( h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch )
-                   memcpy( dstLine, srcLine, width );
+                   memcpy( dstLine, srcLine, (size_t)width );
            }
            break;
 
@@ -456,28 +456,28 @@
                        printf("Trans %d %d: %d %d\n", (int) xc, (int) yc,
                               (int) vector.x, (int) vector.y);
                    if(xc == 0 && yc == 0) {
-                       left = right = vector.x;
-                       top = bottom = vector.y;
+                       left = right = (int)vector.x;
+                       top = bottom = (int)vector.y;
                    } else {
-                       if(left > vector.x) left = vector.x;
-                       if(right < vector.x) right = vector.x;
-                       if(bottom > vector.y) bottom = vector.y;
-                       if(top < vector.y) top = vector.y;
+                       if(left   > vector.x) left   = (int)vector.x;
+                       if(right  < vector.x) right  = (int)vector.x;
+                       if(bottom > vector.y) bottom = (int)vector.y;
+                       if(top    < vector.y) top    = (int)vector.y;
                    }
 
                }
            }
-           left = FLOOR(left);
-           right = CEIL(right);
-           bottom = FLOOR(bottom);
-           top = CEIL(top);
+           left   = (int)FLOOR(left);
+           right  = (int)CEIL(right);
+           bottom = (int)FLOOR(bottom);
+           top    = CEIL(top);
 
        } else {
-           left  = FLOOR( glyphslot->metrics.horiBearingX );
-           right = CEIL( glyphslot->metrics.horiBearingX + glyphslot->metrics.width );
+           left   = (int)FLOOR( glyphslot->metrics.horiBearingX );
+           right  = (int)CEIL( glyphslot->metrics.horiBearingX + glyphslot->metrics.width );
 
-           top    = CEIL( glyphslot->metrics.horiBearingY );
-           bottom = FLOOR( glyphslot->metrics.horiBearingY - glyphslot->metrics.height );
+           top    = (int)CEIL( glyphslot->metrics.horiBearingY );
+           bottom = (int)FLOOR( glyphslot->metrics.horiBearingY - glyphslot->metrics.height );
        }
 
        width = TRUNC(right - left);
@@ -543,34 +543,34 @@
                    vector.y = 0;
                }
                FT_Vector_Transform (&vector, &font->info.matrix);
-               xftg->metrics.xOff = vector.x >> 6;
-               xftg->metrics.yOff = -(vector.y >> 6);
+               xftg->metrics.xOff = (short)(vector.x >> 6);
+               xftg->metrics.yOff = (short)(-(vector.y >> 6));
            }
            else
            {
                if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT)
                {
                    xftg->metrics.xOff = 0;
-                   xftg->metrics.yOff = -font->public.max_advance_width;
+                   xftg->metrics.yOff = (short)(-font->public.max_advance_width);
                }
                else
                {
-                   xftg->metrics.xOff = font->public.max_advance_width;
+                   xftg->metrics.xOff = (short)(font->public.max_advance_width);
                    xftg->metrics.yOff = 0;
                }
            }
        }
        else
        {
-           xftg->metrics.xOff = TRUNC(ROUND(glyphslot->advance.x));
-           xftg->metrics.yOff = -TRUNC(ROUND(glyphslot->advance.y));
+           xftg->metrics.xOff = (short)(TRUNC(ROUND(glyphslot->advance.x)));
+           xftg->metrics.yOff = (short)(-TRUNC(ROUND(glyphslot->advance.y)));
        }
 
-       // compute the size of the final bitmap
+       /* compute the size of the final bitmap */
        ftbit = &glyphslot->bitmap;
 
-       width = ftbit->width;
-       height = ftbit->rows;
+       width = (int)ftbit->width;
+       height = (int)ftbit->rows;
 
        if (XftDebug() & XFT_DBG_GLYPH)
        {
@@ -617,10 +617,10 @@
        if ( size < 0 )
            continue;
 
-       xftg->metrics.width  = local.width;
-       xftg->metrics.height = local.rows;
-       xftg->metrics.x      = - glyphslot->bitmap_left;
-       xftg->metrics.y      =   glyphslot->bitmap_top;
+       xftg->metrics.width  = (unsigned short)local.width;
+       xftg->metrics.height = (unsigned short)local.rows;
+       xftg->metrics.x      = (short)(- glyphslot->bitmap_left);
+       xftg->metrics.y      = (short)(  glyphslot->bitmap_top);
 
        /*
         * If the glyph is relatively large (> 1% of server memory),
@@ -636,12 +636,12 @@
        {
            if (bufBitmap != bufLocal)
                free (bufBitmap);
-           bufBitmap = (unsigned char *) malloc (size);
+           bufBitmap = (unsigned char *) malloc ((size_t)size);
            if (!bufBitmap)
                continue;
            bufSize = size;
        }
-       memset (bufBitmap, 0, size);
+       memset (bufBitmap, 0, (size_t)size);
 
        local.buffer = bufBitmap;
 
@@ -662,7 +662,7 @@
         */
        glyph = (Glyph) glyphindex;
 
-       xftg->glyph_memory = size + sizeof (XftGlyph);
+       xftg->glyph_memory = (size_t)size + sizeof (XftGlyph);
        if (font->format)
        {
            if (!font->glyphset)
@@ -681,7 +681,7 @@
                        c = ((c << 1) & 0xaa) | ((c >> 1) & 0x55);
                        c = ((c << 2) & 0xcc) | ((c >> 2) & 0x33);
                        c = ((c << 4) & 0xf0) | ((c >> 4) & 0x0f);
-                       *line++ = c;
+                       *line++ = (unsigned char)c;
                    }
                }
            }
@@ -699,9 +699,9 @@
        {
            if (size)
            {
-               xftg->bitmap = malloc (size);
+               xftg->bitmap = malloc ((size_t)size);
                if (xftg->bitmap)
-                   memcpy (xftg->bitmap, bufBitmap, size);
+                   memcpy (xftg->bitmap, bufBitmap, (size_t)size);
            }
            else
                xftg->bitmap = NULL;
@@ -836,7 +836,7 @@
     if (!font->hash_value)
        return 0;
 
-    ent = ucs4 % font->hash_value;
+    ent = ucs4 % (FcChar32)font->hash_value;
     offset = 0;
     while (font->hash_table[ent].ucs4 != ucs4)
     {
@@ -854,13 +854,13 @@
        }
        if (!offset)
        {
-           offset = ucs4 % font->rehash_value;
+           offset = ucs4 % (FcChar32)font->rehash_value;
            if (!offset)
                offset = 1;
        }
        ent = ent + offset;
        if (ent >= font->hash_value)
-           ent -= font->hash_value;
+           ent -= (FcChar32)font->hash_value;
     }
     return font->hash_table[ent].glyph;
 }
@@ -880,7 +880,7 @@



Home | Main Index | Thread Index | Old Index