summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2022-07-04 08:12:05 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2022-07-04 08:12:05 +0000
commitb6a2437579ba19ab6e2d3d9b815e4cafadd7b05e (patch)
tree386c7d1af4e26452495eac4b2a52cb1293d1380e /lib
parente24a82532822f3ba768040970102f96251283b59 (diff)
Update libXft to version 2.3.4
Bug fixes and prepare for future fontconfig update.
Diffstat (limited to 'lib')
-rw-r--r--lib/libXft/ChangeLog73
-rw-r--r--lib/libXft/Makefile.in1
-rw-r--r--lib/libXft/NEWS9
-rw-r--r--lib/libXft/aclocal.m416
-rw-r--r--lib/libXft/compile17
-rw-r--r--lib/libXft/configure58
-rw-r--r--lib/libXft/configure.ac2
-rw-r--r--lib/libXft/man/Makefile.in1
-rw-r--r--lib/libXft/man/Xft.man4
-rw-r--r--lib/libXft/src/Makefile.in1
-rw-r--r--lib/libXft/src/xftcolor.c6
-rw-r--r--lib/libXft/src/xftcore.c74
-rw-r--r--lib/libXft/src/xftdpy.c12
-rw-r--r--lib/libXft/src/xftdraw.c34
-rw-r--r--lib/libXft/src/xftextent.c26
-rw-r--r--lib/libXft/src/xftfreetype.c57
-rw-r--r--lib/libXft/src/xftglyphs.c92
-rw-r--r--lib/libXft/src/xftinit.c1
-rw-r--r--lib/libXft/src/xftint.h2
-rw-r--r--lib/libXft/src/xftname.c22
-rw-r--r--lib/libXft/src/xftrender.c58
21 files changed, 319 insertions, 247 deletions
diff --git a/lib/libXft/ChangeLog b/lib/libXft/ChangeLog
index 6d211a888..b1581e479 100644
--- a/lib/libXft/ChangeLog
+++ b/lib/libXft/ChangeLog
@@ -1,3 +1,70 @@
+commit 98b121f22c3477b508dd17aa5db99f2ebf36ade4
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Aug 1 17:49:42 2021 -0700
+
+ libXft 2.3.4
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit dcd637d0f162e177a73a121feeb9d9e4fd69d4bb
+Author: Samanta Navarro <ferivoz@riseup.net>
+Date: Sat Oct 3 11:51:35 2020 +0000
+
+ Fix typo in manual
+
+commit 6e7da3c7c40deed551d14b6bab6f3d1ac256509f
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Apr 3 17:53:33 2020 -0700
+
+ Remove call to FcNameRegisterObjectTypes
+
+ This fontconfig function has been deprecated and no longer does
+ anything.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 26a3a497409279d74827f374e65ae4b8d3c1f1f7
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Apr 3 17:43:04 2020 -0700
+
+ Skip 'render' pattern elements with invalid type
+
+ Fontconfig no longer supports the FcNameRegisterObjectTypes API, which
+ means that any Xft custom fields cannot be specified in a fontconfig
+ name as those will always be set to FcTypeUnknown in the pattern.
+
+ The only one of those we care about is XFT_RENDER, which was used to
+ disable the Render extension, something most apps probably don't need
+ to support in names anyways. Allow the call requesting this value to
+ return FcResultTypeMismatch and pretend that XFT_RENDER is missing
+ from the pattern.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 972fa05c3df73fd3c99c409c0ac2225a58f76d09
+Author: Thomas E. Dickey <dickey@invisible-island.net>
+Date: Wed Apr 1 20:57:52 2020 -0400
+
+ build-fix for c89
+
+ Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
+
+commit 86c2355b116fd9febe2ac7f577e7c12e069d3986
+Author: Thomas E. Dickey <dickey@invisible-island.net>
+Date: Wed Apr 1 20:53:30 2020 -0400
+
+ minor typography fix
+
+ Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
+
+commit ed8bb9667ac1e0f0863a03a44962be9654c4d04e
+Author: Thomas E. Dickey <dickey@invisible-island.net>
+Date: Wed Apr 1 20:52:25 2020 -0400
+
+ fix most type-conversion warnings from gcc-normal, without object-file changes
+
+ Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
+
commit a266847d3c17dcdfcac719a1aa970ad54f4b545a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Mar 16 11:03:38 2019 -0700
@@ -821,7 +888,7 @@ Date: Fri Jul 29 21:22:51 2005 +0000
- Update modular Xorg version
commit 0dd89a9e7ba09ed0c3f90a415b506a4ed89b91bb
-Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Jul 27 21:48:38 2005 +0000
Build system for Xft
@@ -860,14 +927,14 @@ Date: Tue May 17 08:10:10 2005 +0000
which however is not visible outside the DDX) (Bugzilla #3268).
commit 0161d08ecd543c80e5625bf63d0091dbccd95f4e
-Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri Aug 13 19:03:15 2004 +0000
Fri Aug 13 21:01:34 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix the build
commit 0641e99b21eead5aaee0c1136dd2d640028f6783
-Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri Aug 13 18:24:06 2004 +0000
Fri Aug 13 19:53:10 2004 Soeren Sandmann <sandmann@redhat.com>
diff --git a/lib/libXft/Makefile.in b/lib/libXft/Makefile.in
index 79ca323d2..ae090fe49 100644
--- a/lib/libXft/Makefile.in
+++ b/lib/libXft/Makefile.in
@@ -330,6 +330,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/lib/libXft/NEWS b/lib/libXft/NEWS
index 75e212461..54ef96bd8 100644
--- a/lib/libXft/NEWS
+++ b/lib/libXft/NEWS
@@ -1,12 +1,17 @@
Xft
X FreeType library
- Version 2.3.3
- 2019-03-16
+ Version 2.3.4
+ 2021-08-01
Xft version 2.1 was the first stand alone release of Xft, a library that
connects X applications with the FreeType font rasterization library. Xft
uses fontconfig to locate fonts so it has no configuration files.
+Version 2.3.4
+
+Handle deprecation of FcNameRegisterObjectTypes API by fontconfig.
+Minor cleanups for compiler warnings and man pages.
+
Version 2.3.3
Use XRenderCreateSolidFill when available (Render version 0.10 or later)
diff --git a/lib/libXft/aclocal.m4 b/lib/libXft/aclocal.m4
index e7052124f..ff9ff5994 100644
--- a/lib/libXft/aclocal.m4
+++ b/lib/libXft/aclocal.m4
@@ -8606,9 +8606,9 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29.1)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
@@ -8649,7 +8649,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29.1])
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@@ -8750,7 +8750,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -8760,11 +8760,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -8781,7 +8781,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
diff --git a/lib/libXft/compile b/lib/libXft/compile
index a85b723c7..df363c8fb 100644
--- a/lib/libXft/compile
+++ b/lib/libXft/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/lib/libXft/configure b/lib/libXft/configure
index 549e8d9cb..bf0a7069d 100644
--- a/lib/libXft/configure
+++ b/lib/libXft/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libXft 2.3.3.
+# Generated by GNU Autoconf 2.69 for libXft 2.3.4.
#
# Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXft/issues>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libXft'
PACKAGE_TARNAME='libXft'
-PACKAGE_VERSION='2.3.3'
-PACKAGE_STRING='libXft 2.3.3'
+PACKAGE_VERSION='2.3.4'
+PACKAGE_STRING='libXft 2.3.4'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/lib/libXft/issues'
PACKAGE_URL=''
@@ -762,6 +762,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -853,6 +854,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1105,6 +1107,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1242,7 +1253,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1355,7 +1366,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libXft 2.3.3 to adapt to many kinds of systems.
+\`configure' configures libXft 2.3.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1395,6 +1406,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1425,7 +1437,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libXft 2.3.3:";;
+ short | recursive ) echo "Configuration of libXft 2.3.4:";;
esac
cat <<\_ACEOF
@@ -1556,7 +1568,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libXft configure 2.3.3
+libXft configure 2.3.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1880,7 +1892,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libXft $as_me 2.3.3, which was
+It was created by libXft $as_me 2.3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2709,7 +2721,7 @@ fi
# Define the identity of the package.
PACKAGE='libXft'
- VERSION='2.3.3'
+ VERSION='2.3.4'
cat >>confdefs.h <<_ACEOF
@@ -17601,8 +17613,8 @@ XFT_LT_VERSION=`echo $PACKAGE_VERSION | tr '.' ':'`
#
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5
-$as_echo_n "checking for XRENDER... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xrender >= 0.8.2 x11" >&5
+$as_echo_n "checking for xrender >= 0.8.2 x11... " >&6; }
if test -n "$XRENDER_CFLAGS"; then
pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS"
@@ -17642,7 +17654,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -17669,7 +17681,7 @@ Alternatively, you may set the environment variables XRENDER_CFLAGS
and XRENDER_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -17694,8 +17706,8 @@ fi
# Check freetype configuration
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5
-$as_echo_n "checking for FREETYPE... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2 >= 2.1.6" >&5
+$as_echo_n "checking for freetype2 >= 2.1.6... " >&6; }
if test -n "$FREETYPE_CFLAGS"; then
pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS"
@@ -17735,7 +17747,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -17762,7 +17774,7 @@ Alternatively, you may set the environment variables FREETYPE_CFLAGS
and FREETYPE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -17787,8 +17799,8 @@ fi
# Check fontconfig configuration
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FONTCONFIG" >&5
-$as_echo_n "checking for FONTCONFIG... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig >= 2.5.92" >&5
+$as_echo_n "checking for fontconfig >= 2.5.92... " >&6; }
if test -n "$FONTCONFIG_CFLAGS"; then
pkg_cv_FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS"
@@ -17828,7 +17840,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -17855,7 +17867,7 @@ Alternatively, you may set the environment variables FONTCONFIG_CFLAGS
and FONTCONFIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -18424,7 +18436,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libXft $as_me 2.3.3, which was
+This file was extended by libXft $as_me 2.3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18490,7 +18502,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libXft config.status 2.3.3
+libXft config.status 2.3.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/lib/libXft/configure.ac b/lib/libXft/configure.ac
index a05c9a268..8bfe3d7c7 100644
--- a/lib/libXft/configure.ac
+++ b/lib/libXft/configure.ac
@@ -27,7 +27,7 @@ AC_PREREQ([2.60])
# version. This version number will be substituted into Xft.h
# Please bump the minor library number at each release as well.
#
-AC_INIT([libXft], [2.3.3],
+AC_INIT([libXft], [2.3.4],
[https://gitlab.freedesktop.org/xorg/lib/libXft/issues], [libXft])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
diff --git a/lib/libXft/man/Makefile.in b/lib/libXft/man/Makefile.in
index 313e4f087..262e36006 100644
--- a/lib/libXft/man/Makefile.in
+++ b/lib/libXft/man/Makefile.in
@@ -246,6 +246,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/lib/libXft/man/Xft.man b/lib/libXft/man/Xft.man
index 62439281c..205d2c388 100644
--- a/lib/libXft/man/Xft.man
+++ b/lib/libXft/man/Xft.man
@@ -288,7 +288,7 @@ The X
.BR Drawable ,
.BR Colormap ,
and
-.BR Visual
+.B Visual
of an
.B XftDraw
can be queried with
@@ -698,7 +698,7 @@ returns the X drawable associated with the Xft draw object
\fBXftDrawColormap (XftDraw *\fIdraw\fB);\fR
.fi
.B XftDrawColormap
-returns the colormap associatied with the Xft draw object
+returns the colormap associated with the Xft draw object
.IR draw .
.PP
.nf
diff --git a/lib/libXft/src/Makefile.in b/lib/libXft/src/Makefile.in
index 8b2f542e8..84423c178 100644
--- a/lib/libXft/src/Makefile.in
+++ b/lib/libXft/src/Makefile.in
@@ -287,6 +287,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/lib/libXft/src/xftcolor.c b/lib/libXft/src/xftcolor.c
index a323822bd..739dc2d35 100644
--- a/lib/libXft/src/xftcolor.c
+++ b/lib/libXft/src/xftcolor.c
@@ -90,9 +90,9 @@ XftColorAllocValue (Display *dpy,
green_len = masklen (visual->green_mask);
blue_shift = maskbase (visual->blue_mask);
blue_len = masklen (visual->blue_mask);
- result->pixel = (((color->red >> (16 - red_len)) << red_shift) |
- ((color->green >> (16 - green_len)) << green_shift) |
- ((color->blue >> (16 - blue_len)) << blue_shift));
+ result->pixel = (unsigned long)(((color->red >> (16 - red_len)) << red_shift) |
+ ((color->green >> (16 - green_len)) << green_shift) |
+ ((color->blue >> (16 - blue_len)) << blue_shift));
}
else
{
diff --git a/lib/libXft/src/xftcore.c b/lib/libXft/src/xftcore.c
index 85b58c3f3..6cfa3bc76 100644
--- a/lib/libXft/src/xftcore.c
+++ b/lib/libXft/src/xftcore.c
@@ -86,7 +86,7 @@ _XftSharpGlyphMono (XftDraw *draw,
}
} while (bits & bitsMask);
XFillRectangle (draw->dpy, draw->drawable,
- draw->core.gc, xspan, y, lenspan, 1);
+ draw->core.gc, xspan, y, (unsigned)lenspan, 1);
xspan += lenspan;
w -= lenspan;
}
@@ -151,7 +151,7 @@ _XftSharpGlyphGray (XftDraw *draw,
bits = *src++;
} while (bits >= 0x80);
XFillRectangle (draw->dpy, draw->drawable,
- draw->core.gc, xspan, y, lenspan, 1);
+ draw->core.gc, xspan, y, (unsigned)lenspan, 1);
xspan += lenspan;
w -= lenspan;
}
@@ -207,7 +207,7 @@ _XftSharpGlyphRgba (XftDraw *draw,
bits = *src++;
} while (bits >= 0x80000000);
XFillRectangle (draw->dpy, draw->drawable,
- draw->core.gc, xspan, y, lenspan, 1);
+ draw->core.gc, xspan, y, (unsigned)lenspan, 1);
xspan += lenspan;
w -= lenspan;
}
@@ -284,7 +284,7 @@ _XftGetField (unsigned long l_pixel, int shift, int len)
{
CARD32 pixel = (CARD32) l_pixel;
- pixel = pixel & (((1 << (len)) - 1) << shift);
+ pixel = pixel & (CARD32)(((1 << (len)) - 1) << shift);
pixel = pixel << (32 - (shift + len)) >> 24;
while (len < 8)
{
@@ -301,7 +301,7 @@ _XftPutField (CARD32 pixel, int shift, int len)
shift = shift - (8 - len);
if (len <= 8)
- l_pixel &= (((1 << len) - 1) << (8 - len));
+ l_pixel = l_pixel & (unsigned long)(((1 << len) - 1) << (8 - len));
if (shift < 0)
l_pixel >>= -shift;
else
@@ -373,24 +373,24 @@ _XftSmoothGlyphMono (XImage *image,
* Other formats are handled by the general case
*/
-#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 5) & 0x07e0) | \
- (((s) >> 8) & 0xf800))
+#define cvt8888to0565(s) (CARD16)((((s) >> 3) & 0x001f) | \
+ (((s) >> 5) & 0x07e0) | \
+ (((s) >> 8) & 0xf800))
#define cvt0565to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
-#define cvt8888to0555(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 6) & 0x03e0) | \
- (((s) >> 7) & 0x7c00))
+#define cvt8888to0555(s) (CARD16)((((s) >> 3) & 0x001f) | \
+ (((s) >> 6) & 0x03e0) | \
+ (((s) >> 7) & 0x7c00))
#define cvt0555to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
((((s) << 6) & 0xf800) | (((s) >> 0) & 0x300)) | \
((((s) << 9) & 0xf80000) | (((s) << 4) & 0x70000)))
-#define XftIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
+#define XftIntMult(a,b,t,cast) ( ((t) = (cast)((a) * (b) + 0x80)), ( ( ( (t)>>8 ) + (t) )>>8 ) )
#define XftIntDiv(a,b) (((CARD16) (a) * 255) / (b))
#define XftGet8(v,i) ((CARD16) (CARD8) ((v) >> i))
@@ -403,18 +403,18 @@ _XftSmoothGlyphMono (XImage *image,
* this difference will have two versions using the same convention.
*/
-#define XftOverU(x,y,i,a,t) ((t) = XftIntMult(XftGet8(y,i),(a),(t)) + XftGet8(x,i),\
- (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
+#define XftOverU(x,y,i,a,t) ((t) = (CARD16) XftIntMult(XftGet8(y,i),(a),(t),CARD16) + XftGet8(x,i),\
+ (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
-#define XftOverC(x,y,i,a,t) ((t) = XftIntMult(XftGet8(y,i),XftGet8(a,i),(t)) + XftGet8(x,i),\
+#define XftOverC(x,y,i,a,t) ((t) = (CARD16) XftIntMult(XftGet8(y,i),XftGet8(a,i),(t),CARD16) + XftGet8(x,i),\
(CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
-#define XftInU(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),(a),(t)) << (i))
+#define XftInU(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),(a),(t),CARD16) << (i))
-#define XftInC(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),XftGet8(a,i),(t)) << (i))
+#define XftInC(x,i,a,t) ((CARD32) XftIntMult(XftGet8(x,i),XftGet8(a,i),(t),CARD32) << (i))
-#define XftGen(x,y,i,ax,ay,t,u,v) ((t) = (XftIntMult(XftGet8(y,i),ay,(u)) + \
- XftIntMult(XftGet8(x,i),ax,(v))),\
+#define XftGen(x,y,i,ax,ay,t,u,v) ((t) = (XftIntMult(XftGet8(y,i),ay,(u),CARD32) + \
+ XftIntMult(XftGet8(x,i),ax,(v),CARD32)),\
(CARD32) ((CARD8) ((t) | \
(0 - ((t) >> 8)))) << (i))
@@ -425,7 +425,7 @@ _XftSmoothGlyphMono (XImage *image,
static CARD32
fbOver24 (CARD32 x, CARD32 y)
{
- CARD16 a = ~x >> 24;
+ CARD16 a = (CARD16)(~x >> 24);
CARD16 t;
CARD32 m,n,o;
@@ -691,7 +691,7 @@ _XftSmoothGlyphGray (XImage *image,
srca = color->color.alpha >> 8;
src = (srca << 24 |
- (color->color.red & 0xff00) << 8 |
+ (CARD32)((color->color.red & 0xff00) << 8) |
(color->color.green & 0xff00) |
(color->color.blue) >> 8);
x -= xftg->metrics.x;
@@ -769,7 +769,7 @@ _XftSmoothGlyphRgba (XImage *image,
srca = color->color.alpha >> 8;
src = (srca << 24 |
- (color->color.red & 0xff00) << 8 |
+ (CARD32)((color->color.red & 0xff00) << 8) |
(color->color.green & 0xff00) |
(color->color.blue) >> 8);
x -= xftg->metrics.x;
@@ -818,9 +818,9 @@ _XftSmoothGlyphRgba (XImage *image,
CARD16 __a = XftGet8(msk,i); \
CARD32 __t, __ta; \
CARD32 __i; \
- __t = XftIntMult (XftGet8(src,i), __a,__i); \
- __ta = (CARD8) ~XftIntMult (srca, __a,__i); \
- __t = __t + XftIntMult(XftGet8(dst,i),__ta,__i); \
+ __t = XftIntMult (XftGet8(src,i), __a,__i,CARD32); \
+ __ta = (CARD8) ~XftIntMult (srca, __a,__i,CARD32); \
+ __t = __t + XftIntMult(XftGet8(dst,i),__ta,__i,CARD32); \
__t = (CARD32) (CARD8) (__t | (-(__t >> 8))); \
result = __t << (i); \
}
@@ -1144,7 +1144,7 @@ XftGlyphSpecCore (XftDraw *draw,
prev_error = XSetErrorHandler (XftGetImageErrorHandler);
image = XGetImage (dpy, draw->drawable,
x1, y1,
- width, height, AllPlanes,
+ (unsigned)width, (unsigned)height, AllPlanes,
ZPixmap);
XSetErrorHandler (prev_error);
if (!image)
@@ -1162,13 +1162,13 @@ XftGlyphSpecCore (XftDraw *draw,
XGCValues gcv;
pix = XCreatePixmap (dpy, draw->drawable,
- width, height, depth);
+ (unsigned)width, (unsigned)height, depth);
gcv.graphics_exposures = False;
gc = XCreateGC (dpy, pix, GCGraphicsExposures, &gcv);
XCopyArea (dpy, draw->drawable, pix, gc, x1, y1,
- width, height, 0, 0);
+ (unsigned)width, (unsigned)height, 0, 0);
XFreeGC (dpy, gc);
- image = XGetImage (dpy, pix, 0, 0, width, height, AllPlanes,
+ image = XGetImage (dpy, pix, 0, 0, (unsigned)width, (unsigned)height, AllPlanes,
ZPixmap);
XFreePixmap (dpy, pix);
}
@@ -1193,7 +1193,7 @@ XftGlyphSpecCore (XftDraw *draw,
if (image->byte_order != XftNativeByteOrder ())
XftSwapImage (image);
XPutImage (dpy, draw->drawable, draw->core.gc, image, 0, 0, x1, y1,
- width, height);
+ (unsigned)width, (unsigned)height);
XDestroyImage (image);
}
else
@@ -1257,8 +1257,8 @@ XftGlyphFontSpecCore (XftDraw *draw,
if (g_x1 < 0)
{
/* do nothing if the given glyphs are out of range */
- short t = glyphs[i-1].font->max_advance_width
- + glyphs[i-1].x;
+ short t = (short)(glyphs[i-1].font->max_advance_width
+ + glyphs[i-1].x);
if (t < 0 && glyphs[i-1].x > 0)
goto bail1;
}
@@ -1305,7 +1305,7 @@ XftGlyphFontSpecCore (XftDraw *draw,
prev_error = XSetErrorHandler (XftGetImageErrorHandler);
image = XGetImage (dpy, draw->drawable,
x1, y1,
- width, height, AllPlanes,
+ (unsigned)width, (unsigned)height, AllPlanes,
ZPixmap);
XSetErrorHandler (prev_error);
if (!image)
@@ -1323,13 +1323,13 @@ XftGlyphFontSpecCore (XftDraw *draw,
XGCValues gcv;
pix = XCreatePixmap (dpy, draw->drawable,
- width, height, depth);
+ (unsigned)width, (unsigned)height, depth);
gcv.graphics_exposures = False;
gc = XCreateGC (dpy, pix, GCGraphicsExposures, &gcv);
XCopyArea (dpy, draw->drawable, pix, gc, x1, y1,
- width, height, 0, 0);
+ (unsigned)width, (unsigned)height, 0, 0);
XFreeGC (dpy, gc);
- image = XGetImage (dpy, pix, 0, 0, width, height, AllPlanes,
+ image = XGetImage (dpy, pix, 0, 0, (unsigned)width, (unsigned)height, AllPlanes,
ZPixmap);
XFreePixmap (dpy, pix);
}
@@ -1358,7 +1358,7 @@ XftGlyphFontSpecCore (XftDraw *draw,
if (image->byte_order != XftNativeByteOrder ())
XftSwapImage (image);
XPutImage (dpy, draw->drawable, draw->core.gc, image, 0, 0, x1, y1,
- width, height);
+ (unsigned)width, (unsigned)height);
XDestroyImage (image);
}
else
diff --git a/lib/libXft/src/xftdpy.c b/lib/libXft/src/xftdpy.c
index d2a45452a..923fa6b66 100644
--- a/lib/libXft/src/xftdpy.c
+++ b/lib/libXft/src/xftdpy.c
@@ -165,7 +165,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
_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)
@@ -274,9 +274,9 @@ XftDefaultSet (Display *dpy, FcPattern *defaults)
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 @@ XftDefaultParseBool (const char *v)
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 @@ XftDefaultParseBool (const char *v)
{
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 @@ _XftDefaultInitInteger (Display *dpy, FcPattern *pat, const char *option)
{
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 --git a/lib/libXft/src/xftdraw.c b/lib/libXft/src/xftdraw.c
index 07eb7f243..c79f213c9 100644
--- a/lib/libXft/src/xftdraw.c
+++ b/lib/libXft/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
diff --git a/lib/libXft/src/xftextent.c b/lib/libXft/src/xftextent.c
index 1e418f28a..1f84757ac 100644
--- a/lib/libXft/src/xftextent.c
+++ b/lib/libXft/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);
diff --git a/lib/libXft/src/xftfreetype.c b/lib/libXft/src/xftfreetype.c
index 6ed17cec1..1246605a4 100644
--- a/lib/libXft/src/xftfreetype.c
+++ b/lib/libXft/src/xftfreetype.c
@@ -58,7 +58,7 @@ _XftGetFile (const FcChar8 *file, int id)
if (!f)
return NULL;
- XftMemAlloc (XFT_MEM_FILE, sizeof (XftFtFile) + strlen ((char *) file) + 1);
+ XftMemAlloc (XFT_MEM_FILE, (int)(sizeof (XftFtFile) + strlen ((char *) file) + 1));
if (XftDebug () & XFT_DBG_REF)
printf ("FontFile %s/%d matches new\n",
file, id);
@@ -276,7 +276,7 @@ _XftReleaseFile (XftFtFile *f)
FT_Done_Face (f->face);
}
XftMemFree (XFT_MEM_FILE,
- sizeof (XftFtFile) + (f->file ? strlen (f->file) + 1 : 0));
+ (sizeof (XftFtFile) + (f->file ? strlen (f->file) + 1 : 0)));
free (f);
}
@@ -481,10 +481,10 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
fi->matrix.xy = fi->matrix.yx = 0;
break;
case FcResultMatch:
- fi->matrix.xx = 0x10000L * font_matrix->xx;
- fi->matrix.yy = 0x10000L * font_matrix->yy;
- fi->matrix.xy = 0x10000L * font_matrix->xy;
- fi->matrix.yx = 0x10000L * font_matrix->yx;
+ fi->matrix.xx = (FT_Fixed)(0x10000L * font_matrix->xx);
+ fi->matrix.yy = (FT_Fixed)(0x10000L * font_matrix->yy);
+ fi->matrix.xy = (FT_Fixed)(0x10000L * font_matrix->xy);
+ fi->matrix.yx = (FT_Fixed)(0x10000L * font_matrix->yx);
break;
default:
goto bail1;
@@ -499,6 +499,15 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
if (info->hasRender)
{
switch (FcPatternGetBool (pattern, XFT_RENDER, 0, &fi->render)) {
+ case FcResultTypeMismatch:
+ /*
+ * Fontconfig no longer supports xft's custom values in
+ * text patterns, so any name specifying render:true or
+ * render:false will have an invalid type in the resulting
+ * pattern. Just ignore that case so that the app doesn't
+ * just fail
+ */
+ /* fall through ... */
case FcResultNoMatch:
fi->render = info->hasRender;
break;
@@ -869,11 +878,11 @@ XftFontOpenInfo (Display *dpy,
* Sometimes the glyphs are numbered 1..n, other times 0..n-1,
* accept either numbering scheme by making room in the table
*/
- num_glyphs = face->num_glyphs + 1;
+ num_glyphs = (int)face->num_glyphs + 1;
alloc_size = (sizeof (XftFontInt) +
- num_glyphs * sizeof (XftGlyph *) +
+ (size_t)num_glyphs * sizeof (XftGlyph *) +
hash_value * sizeof (XftUcsHash));
- font = malloc (alloc_size);
+ font = malloc ((size_t)alloc_size);
if (!font)
goto bail2;
@@ -890,12 +899,12 @@ XftFontOpenInfo (Display *dpy,
vector.x = 0;
vector.y = face->size->metrics.descender;
FT_Vector_Transform (&vector, &fi->matrix);
- descent = -(vector.y >> 6);
+ descent = (int)(-(vector.y >> 6));
vector.x = 0;
vector.y = face->size->metrics.ascender;
FT_Vector_Transform (&vector, &fi->matrix);
- ascent = vector.y >> 6;
+ ascent = (int)(vector.y >> 6);
if (fi->minspace)
height = ascent + descent;
@@ -904,17 +913,17 @@ XftFontOpenInfo (Display *dpy,
vector.x = 0;
vector.y = face->size->metrics.height;
FT_Vector_Transform (&vector, &fi->matrix);
- height = vector.y >> 6;
+ height = (int)(vector.y >> 6);
}
}
else
{
- descent = -(face->size->metrics.descender >> 6);
- ascent = face->size->metrics.ascender >> 6;
+ descent = -(int)(face->size->metrics.descender >> 6);
+ ascent = (int)(face->size->metrics.ascender >> 6);
if (fi->minspace)
height = ascent + descent;
else
- height = face->size->metrics.height >> 6;
+ height = (int)(face->size->metrics.height >> 6);
}
font->public.ascent = ascent;
font->public.descent = descent;
@@ -930,10 +939,10 @@ XftFontOpenInfo (Display *dpy,
vector.x = face->size->metrics.max_advance;
vector.y = 0;
FT_Vector_Transform (&vector, &fi->matrix);
- font->public.max_advance_width = vector.x >> 6;
+ font->public.max_advance_width = (int)(vector.x >> 6);
}
else
- font->public.max_advance_width = face->size->metrics.max_advance >> 6;
+ font->public.max_advance_width = (int)(face->size->metrics.max_advance >> 6);
}
font->public.charset = charset;
font->public.pattern = pattern;
@@ -968,7 +977,7 @@ XftFontOpenInfo (Display *dpy,
* Per glyph information
*/
font->glyphs = (XftGlyph **) (font + 1);
- memset (font->glyphs, '\0', num_glyphs * sizeof (XftGlyph *));
+ memset (font->glyphs, '\0', (size_t)num_glyphs * sizeof (XftGlyph *));
font->num_glyphs = num_glyphs;
/*
* Unicode hash table information
@@ -979,8 +988,8 @@ XftFontOpenInfo (Display *dpy,
font->hash_table[i].ucs4 = ((FcChar32) ~0);
font->hash_table[i].glyph = 0;
}
- font->hash_value = hash_value;
- font->rehash_value = rehash_value;
+ font->hash_value = (int)hash_value;
+ font->rehash_value = (int)rehash_value;
/*
* X specific fields
*/
@@ -991,7 +1000,7 @@ XftFontOpenInfo (Display *dpy,
* Glyph memory management fields
*/
font->glyph_memory = 0;
- font->max_glyph_memory = max_glyph_memory;
+ font->max_glyph_memory = (unsigned long)max_glyph_memory;
font->use_free_glyphs = info->use_free_glyphs;
_XftUnlockFile (fi->file);
@@ -1061,9 +1070,9 @@ XftFontDestroy (Display *dpy, XftFont *public)
FcCharSetDestroy (font->public.charset);
/* Finally, free the font structure */
- XftMemFree (XFT_MEM_FONT, sizeof (XftFontInt) +
- font->num_glyphs * sizeof (XftGlyph *) +
- font->hash_value * sizeof (XftUcsHash));
+ XftMemFree (XFT_MEM_FONT, (sizeof (XftFontInt) +
+ (size_t)font->num_glyphs * sizeof (XftGlyph *) +
+ (size_t)font->hash_value * sizeof (XftUcsHash)));
free (font);
}
diff --git a/lib/libXft/src/xftglyphs.c b/lib/libXft/src/xftglyphs.c
index f75a636d2..c3ee98a59 100644
--- a/lib/libXft/src/xftglyphs.c
+++ b/lib/libXft/src/xftglyphs.c
@@ -86,11 +86,11 @@ _compute_xrender_bitmap_size( FT_Bitmap* target,
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 @@ _compute_xrender_bitmap_size( FT_Bitmap* target,
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 @@ _fill_xrender_bitmap( FT_Bitmap* target,
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 @@ _fill_xrender_bitmap( FT_Bitmap* target,
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 @@ _fill_xrender_bitmap( FT_Bitmap* target,
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 @@ _fill_xrender_bitmap( FT_Bitmap* target,
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 @@ XftFontLoadGlyphs (Display *dpy,
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 @@ XftFontLoadGlyphs (Display *dpy,
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 @@ XftFontLoadGlyphs (Display *dpy,
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 @@ XftFontLoadGlyphs (Display *dpy,
{
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 @@ XftFontLoadGlyphs (Display *dpy,
*/
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 @@ XftFontLoadGlyphs (Display *dpy,
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 @@ XftFontLoadGlyphs (Display *dpy,
{
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 @@ XftCharIndex (Display *dpy,
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 @@ XftCharIndex (Display *dpy,
}
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;
}
diff --git a/lib/libXft/src/xftinit.c b/lib/libXft/src/xftinit.c
index ff2372297..78eb3ed9d 100644
--- a/lib/libXft/src/xftinit.c
+++ b/lib/libXft/src/xftinit.c
@@ -32,7 +32,6 @@ XftInit (_Xconst char *config)
_XftConfigInitialized = True;
if (!FcInit ())
return False;
- _XftNameInit ();
return True;
}
diff --git a/lib/libXft/src/xftint.h b/lib/libXft/src/xftint.h
index c06ac3cba..ced9a029b 100644
--- a/lib/libXft/src/xftint.h
+++ b/lib/libXft/src/xftint.h
@@ -428,8 +428,6 @@ XftListFontsPatternObjects (Display *dpy,
FcObjectSet *os);
/* xftname.c */
-void
-_XftNameInit (void);
/* xftrender.c */
diff --git a/lib/libXft/src/xftname.c b/lib/libXft/src/xftname.c
index 30dd6e06c..e1201999b 100644
--- a/lib/libXft/src/xftname.c
+++ b/lib/libXft/src/xftname.c
@@ -22,30 +22,9 @@
#include "xftint.h"
-static const FcObjectType _XftObjectTypes[] = {
- { XFT_CORE, FcTypeBool, },
- { XFT_XLFD, FcTypeString, },
- { XFT_RENDER, FcTypeBool, },
- { XFT_MAX_GLYPH_MEMORY, FcTypeInteger, },
-};
-
-#define NUM_OBJECT_TYPES (sizeof _XftObjectTypes / sizeof _XftObjectTypes[0])
-
-static FcBool _XftNameInitialized;
-
-_X_HIDDEN void
-_XftNameInit (void)
-{
- if (_XftNameInitialized)
- return;
- _XftNameInitialized = FcTrue;
- FcNameRegisterObjectTypes (_XftObjectTypes, NUM_OBJECT_TYPES);
-}
-
_X_EXPORT FcPattern
*XftNameParse (const char *name)
{
- _XftNameInit ();
return FcNameParse ((FcChar8 *) name);
}
@@ -54,7 +33,6 @@ XftNameUnparse (FcPattern *pat, char *dest, int len)
{
FcChar8 *name;
- _XftNameInit ();
name = FcNameUnparse (pat);
if (!name)
return FcFalse;
diff --git a/lib/libXft/src/xftrender.c b/lib/libXft/src/xftrender.c
index b280c0313..a352737bc 100644
--- a/lib/libXft/src/xftrender.c
+++ b/lib/libXft/src/xftrender.c
@@ -96,7 +96,7 @@ XftGlyphRender (Display *dpy,
chars = char_local;
if (nglyphs * size > sizeof (char_local))
{
- chars = malloc (nglyphs * size);
+ chars = malloc ((size_t)(nglyphs * size));
if (!chars)
goto bail1;
}
@@ -111,7 +111,7 @@ XftGlyphRender (Display *dpy,
switch (width) {
case 1: char8[i] = (char) wire; break;
case 2: char16[i] = (unsigned short) wire; break;
- case 4: char32[i] = (unsigned long) wire; break;
+ case 4: char32[i] = (unsigned int) wire; break;
}
}
switch (width) {
@@ -217,7 +217,7 @@ XftGlyphSpecRender (Display *dpy,
chars = char_local;
if (nglyphs * size > NUM_LOCAL)
{
- chars = malloc (nglyphs * size);
+ chars = malloc ((size_t)(nglyphs * size));
if (!chars)
goto bail1;
}
@@ -269,7 +269,7 @@ XftGlyphSpecRender (Display *dpy,
elts = elts_local;
if (nelt > NUM_ELT_LOCAL)
{
- elts = malloc (nelt * sizeof (XGlyphElt8));
+ elts = malloc ((size_t)nelt * sizeof (XGlyphElt8));
if (!elts)
goto bail2;
}
@@ -366,7 +366,7 @@ XftCharSpecRender (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (XftGlyphSpec));
+ glyphs = malloc ((size_t)len * sizeof (XftGlyphSpec));
if (!glyphs)
return;
}
@@ -489,7 +489,7 @@ XftGlyphFontSpecRender (Display *dpy,
chars = char_local;
if (nglyphs * size > NUM_LOCAL)
{
- chars = malloc (nglyphs * size);
+ chars = malloc ((size_t)(nglyphs * size));
if (!chars)
goto bail1;
}
@@ -554,7 +554,7 @@ XftGlyphFontSpecRender (Display *dpy,
elts = elts_local;
if (nelt > NUM_ELT_LOCAL)
{
- elts = malloc (nelt * sizeof (XGlyphElt8));
+ elts = malloc ((size_t)nelt * sizeof (XGlyphElt8));
if (!elts)
goto bail2;
}
@@ -656,7 +656,7 @@ XftCharFontSpecRender (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (XftGlyphFontSpec));
+ glyphs = malloc ((size_t)len * sizeof (XftGlyphFontSpec));
if (!glyphs)
return;
}
@@ -693,7 +693,7 @@ XftTextRender8 (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
@@ -725,7 +725,7 @@ XftTextRender16 (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
@@ -757,13 +757,13 @@ XftTextRender16BE (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
for (i = 0; i < len; i++)
glyphs[i] = XftCharIndex (dpy, pub,
- (string[i*2]<<8) | string[i*2+1]);
+ (FcChar32)((string[i*2]<<8) | string[i*2+1]));
XftGlyphRender (dpy, op, src, pub, dst,
srcx, srcy, x, y, glyphs, len);
if (glyphs != glyphs_local)
@@ -790,13 +790,13 @@ XftTextRender16LE (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
for (i = 0; i < len; i++)
glyphs[i] = XftCharIndex (dpy, pub,
- string[i*2] | (string[i*2+1]<<8));
+ (FcChar32)(string[i*2] | (string[i*2+1]<<8)));
XftGlyphRender (dpy, op, src, pub, dst,
srcx, srcy, x, y, glyphs, len);
if (glyphs != glyphs_local)
@@ -823,7 +823,7 @@ XftTextRender32 (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
@@ -855,16 +855,16 @@ XftTextRender32BE (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
for (i = 0; i < len; i++)
glyphs[i] = XftCharIndex (dpy, pub,
- (string[i*4] << 24) |
- (string[i*4+1] << 16) |
- (string[i*4+2] << 8) |
- (string[i*4+3]));
+ (FcChar32)((string[i*4] << 24) |
+ (string[i*4+1] << 16) |
+ (string[i*4+2] << 8) |
+ (string[i*4+3])));
XftGlyphRender (dpy, op, src, pub, dst,
srcx, srcy, x, y, glyphs, len);
if (glyphs != glyphs_local)
@@ -891,16 +891,16 @@ XftTextRender32LE (Display *dpy,
glyphs = glyphs_local;
else
{
- glyphs = malloc (len * sizeof (FT_UInt));
+ glyphs = malloc ((size_t)len * sizeof (FT_UInt));
if (!glyphs)
return;
}
for (i = 0; i < len; i++)
glyphs[i] = XftCharIndex (dpy, pub,
- (string[i*4]) |
- (string[i*4+1] << 8) |
- (string[i*4+2] << 16) |
- (string[i*4+3] << 24));
+ (FcChar32)((string[i*4]) |
+ (string[i*4+1] << 8) |
+ (string[i*4+2] << 16) |
+ (string[i*4+3] << 24)));
XftGlyphRender (dpy, op, src, pub, dst,
srcx, srcy, x, y, glyphs, len);
if (glyphs != glyphs_local)
@@ -933,14 +933,14 @@ XftTextRenderUtf8 (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)
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);
@@ -983,14 +983,14 @@ XftTextRenderUtf16 (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)
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);