Compare commits

...

13 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult b3142e6486 HACK: add netbsd build
wip: libdrm build doesnt work yet (tests cant compile)
2024-04-26 19:29:10 +02:00
Enrico Weigelt, metux IT consult 8da9dc8d1d HACK: use my own templates repo 2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 1fd975d4f6 (submit/fix-char-signedness) xkb: xkbInit: fix char signess mismatch
On NetBSD gives warning:

../xkb/xkbInit.c: In function ‘XkbProcessArguments’:
../xkb/xkbInit.c:778:57: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  778 |             if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                         ^
../xkb/xkbInit.c:782:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  782 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:792:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  792 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:799:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  799 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 10cbefdf85 (submit/fix-char-signedness) xkb: xkbtext: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../xkb/xkbtext.c:32:
../xkb/xkbtext.c: In function ‘XkbAtomText’:
../xkb/xkbtext.c:94:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   94 |             if ((tmp == rtrn) && (!isalpha(*tmp)))
      |                                            ^
../xkb/xkbtext.c:96:31: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   96 |             else if (!isalnum(*tmp))
      |                               ^
../xkb/xkbtext.c: In function ‘XkbIMWhichStateMaskText’:
../xkb/xkbtext.c:470:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  470 |                 buf[len + 9] = toupper(buf[len + 9]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbControlsMaskText’:
../xkb/xkbtext.c:532:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  532 |                 buf[len + 3] = toupper(buf[len + 3]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbStringText’:
../xkb/xkbtext.c:563:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  563 |         if (!isprint(*in)) {
      |                      ^
../xkb/xkbtext.c:584:21: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  584 |         if (isprint(*in))
      |                     ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 90db2fa113 (submit/fix-char-signedness) os: utils: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/utils.c:75:
../os/utils.c: In function ‘VerifyDisplayName’:
../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  624 |         if (!isdigit(d[i])) {
      |                       ^
../os/utils.c: In function ‘ProcessCommandLine’:
../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  942 |             if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
      |                                            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 78e8bf021c (submit/fix-char-signedness) os: access: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/access.c:96:
../os/access.c: In function ‘ResetHosts’:
../os/access.c:981:49: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  981 |                 lhostname[i] = tolower(ohostname[i]);
      |                                                 ^
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 4c333669c0 (submit/fix-char-signedness) xfree86: parser: scan: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/parser/scan.c:58:
../hw/xfree86/parser/scan.c: In function ‘xf86getToken’:
../hw/xfree86/parser/scan.c:343:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  343 |         else if ((c == ',') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c:346:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  346 |         else if ((c == '-') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c: In function ‘xf86nameCompare’:
../hw/xfree86/parser/scan.c:1031:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                   ^
../hw/xfree86/parser/scan.c:1031:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                  ^
../hw/xfree86/parser/scan.c:1032:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                   ^
../hw/xfree86/parser/scan.c:1032:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                  ^
../hw/xfree86/parser/scan.c:1042:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                       ^
../hw/xfree86/parser/scan.c:1042:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                      ^
../hw/xfree86/parser/scan.c:1043:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                       ^
../hw/xfree86/parser/scan.c:1043:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 71874dce1e (submit/fix-char-signedness) xfree86: common: xf86Configure: fix char signess mismatch
On NetBSD gives warning:

../hw/xfree86/common/xf86Configure.c: In function ‘xf86AddBusDeviceToConfigure’:
../hw/xfree86/common/xf86Configure.c:125:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  125 |     for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
      |                                                  ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 7147f88c2c (submit/fix-char-signedness) xfree86: common: xf86pciBus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86pciBus.c:35:
../hw/xfree86/common/xf86pciBus.c: In function ‘xf86ParsePciBusString’:
../hw/xfree86/common/xf86pciBus.c:286:27: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  286 |             if (!isdigit(d[i])) {
      |                           ^
../hw/xfree86/common/xf86pciBus.c:293:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  293 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:307:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  307 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:320:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  320 |         if (!isdigit(p[i])) {
      |                       ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 0077c83414 (submit/fix-char-signedness) xfree86: common: xf86Option: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Option.c:39:
../hw/xfree86/common/xf86Option.c: In function ‘xf86NormalizeName’:
../hw/xfree86/common/xf86Option.c:915:25: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  915 |             if (isupper(*p))
      |                         ^
../hw/xfree86/common/xf86Option.c:916:32: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  916 |                 *q++ = tolower(*p);
      |                                ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 968353a8be (submit/fix-char-signedness) xfree86: common: xf86Bus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Bus.c:36:
../hw/xfree86/common/xf86Bus.c: In function ‘StringToBusType’:
../hw/xfree86/common/xf86Bus.c:270:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  270 |     if (isdigit(busID[0])) {
      |                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-26 19:05:22 +02:00
Enrico Weigelt, metux IT consult 8e2f829870 (submit/ci-freebsd) ci: refactor distro variables
Moving out the distro variables (FDO_DISTRIBUTION_*) out of the global
variables and introduce target templates for that. Now the debian-based
builds extent .xorg-image@debian, the freebsd-based using .xorg-image@freebsd.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-25 16:34:15 +02:00
Enrico Weigelt, metux IT consult ac78fa0414 (submit/ci-freebsd) ci: add FreeBSD build
Build the Xserver in FreeBSD VM.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-04-25 14:18:55 +02:00
10 changed files with 160 additions and 37 deletions

View File

@ -4,7 +4,7 @@
# Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/
.templates_sha: &template_sha c5626190ec14b475271288dda7a7dae8dbe0cd76 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha wip/bsd # see https://docs.gitlab.com/ee/ci/yaml/#includefile
# FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs.
# If the image doesn't exist yet, the docker-image stage generates it.
@ -16,17 +16,30 @@
# gcc/clang or other packages, which might break the build with older commits
# using the same tag.
variables:
FDO_UPSTREAM_REPO: xorg/xserver
FDO_DISTRIBUTION_VERSION: bullseye-slim
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
FDO_DISTRIBUTION_TAG: "2024-03-26-explicit-sync-2"
MESON_BUILDDIR: "build"
FDO_UPSTREAM_REPO: xorg/xserver
MESON_BUILDDIR: "build"
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
REPO_URL_LIBDRM: 'https://gitlab.freedesktop.org/mesa/drm.git'
XORG_DEBIAN_VERSION: 'bullseye-slim'
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
XORG_DEBIAN_TAG: '2024-03-26-explicit-sync-2'
XORG_FREEBSD_VERSION: '14.0'
XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-04-25.0'
XORG_NETBSD_VERSION: '10.0'
XORG_NETBSD_TAG: '2024-04-17.27'
include:
- project: 'freedesktop/ci-templates'
- project: 'metux/ci-templates'
ref: *template_sha
file: '/templates/debian.yml'
- project: 'freedesktop/ci-templates'
- project: 'metux/ci-templates'
ref: *template_sha
file: '/templates/freebsd.yml'
- project: 'metux/ci-templates'
ref: *template_sha
file: '/templates/netbsd.yml'
- project: 'metux/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
- template: Security/SAST.gitlab-ci.yml
@ -101,10 +114,63 @@ debian-bullseye:
stage: docker-image
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: "$XORG_DEBIAN_VERSION"
FDO_DISTRIBUTION_EXEC: "$XORG_DEBIAN_EXEC"
FDO_DISTRIBUTION_TAG: "$XORG_DEBIAN_TAG"
freebsd-image:
extends:
- .fdo.qemu-build@freebsd@x86_64
stage: docker-image
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_TAG: "$XORG_FREEBSD_TAG"
FDO_DISTRIBUTION_VERSION: "$XORG_FREEBSD_VERSION"
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util'
netbsd-image:
extends:
- .fdo.qemu-build@netbsd@x86_64
stage: docker-image
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_TAG: "$XORG_NETBSD_TAG"
FDO_DISTRIBUTION_VERSION: "$XORG_NETBSD_VERSION"
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git pkgconf autoconf automake xorg-util-macros'
.xorg-image@debian:
extends:
- .fdo.distribution-image@debian
variables:
FDO_DISTRIBUTION_VERSION: "$XORG_DEBIAN_VERSION"
FDO_DISTRIBUTION_EXEC: "$XORG_DEBIAN_EXEC"
FDO_DISTRIBUTION_TAG: "$XORG_DEBIAN_TAG"
.xorg-image@freebsd:
extends:
- .fdo.distribution-image@freebsd
variables:
GIT_DEPTH: 1
PKG_CONFIG_PATH: /usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/pkg/share/pkgconfig:/usr/pkg/lib/pkgconfig:/usr/local/libdata/pkgconfig
FDO_DISTRIBUTION_VERSION: "$XORG_FREEBSD_VERSION"
FDO_DISTRIBUTION_EXEC: "$XORG_FREEBSD_EXEC"
FDO_DISTRIBUTION_TAG: "$XORG_FREEBSD_TAG"
.xorg-image@netbsd:
extends:
- .fdo.distribution-image@netbsd
variables:
GIT_DEPTH: 1
PKG_CONFIG_PATH: /usr/X11R7/share/pkgconfig:/usr/X11R7/lib/pkgconfig:/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig
FDO_DISTRIBUTION_VERSION: "$XORG_NETBSD_VERSION"
FDO_DISTRIBUTION_EXEC: "$XORG_NETBSD_EXEC"
FDO_DISTRIBUTION_TAG: "$XORG_NETBSD_TAG"
.common-build-and-test:
extends:
- .fdo.distribution-image@debian
- .xorg-image@debian
- .ci-run-policy
stage: build-and-test
artifacts:
@ -154,6 +220,63 @@ mingw-cross-build:
variables:
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dsecure-rpc=false -Dlisten_tcp=true
freebsd:
stage: build-and-test
extends:
- .xorg-image@freebsd
variables:
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
PKG_CONFIG_PATH: /usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/pkg/share/pkgconfig:/usr/pkg/lib/pkgconfig
script:
# running of of disk space without this
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
- git gc
- git clone $REPO_URL_XORGPROTO dep.xorgproto
- /app/vmctl start
- set +e
- scp -r $PWD "vm:"
# need to install newer xorgproto
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr && make && make install"
- /app/vmctl exec "cd $CI_PROJECT_NAME && PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
# test not working yet, so skipped
# - scp -r vm:$CI_PROJECT_NAME/test-results.xml .
- /app/vmctl stop
- set -e
- test -e .success || exit 1
netbsd:
stage: build-and-test
extends:
- .xorg-image@netbsd
variables:
# fixme: try glx and glamor
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
X_PATH: /sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin
script:
# running of of disk space without this
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
- git gc
- git clone $REPO_URL_XORGPROTO dep.xorgproto
- git clone $REPO_URL_LIBDRM dep.libdrm
- /app/vmctl start
- set +e
- scp -r $PWD "vm:"
- /app/vmctl exec "pkgin -4 update"
# for reasons yet unknown, installing meson in the image breaks autotools, so do it afterwards
- /app/vmctl exec "pkgin -V -4 -y install meson"
# xorgproto on NetBSD is too old - install recent version
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr/X11R7 && make && make install"
# libdrm on NetBSD is too old - install recent version
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.libdrm && meson setup --prefix=/usr/X11R7 ../build.libdrm"
- /app/vmctl exec "cd $CI_PROJECT_NAME/build.libdrm && meson compile && meson install"
# 2do: upgrade libdrm to 2.4.116
- /app/vmctl exec "export PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" PATH=\"$X_PATH\" ; cd $CI_PROJECT_NAME && CI_JOB_ID=\"$CI_JOB_ID\" CI_JOB_NAME=\"$CI_JOB_NAME\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
# tests not working yet, so skipped
# - scp -r vm:$CI_PROJECT_NAME/test-results.xml .
- /app/vmctl stop
- set -e
- test -e .success || exit 1
meson-dist:
extends: .common-build-and-test
artifacts:
@ -172,7 +295,7 @@ meson-dist:
xf86-driver-build-test:
extends:
- .fdo.distribution-image@debian
- .xorg-image@debian
- .ci-run-policy
stage: drivers
parallel:

View File

@ -266,7 +266,7 @@ StringToBusType(const char *busID, const char **retID)
BusType ret = BUS_NONE;
/* If no type field, Default to PCI */
if (isdigit(busID[0])) {
if (isdigit((unsigned char)busID[0])) {
if (retID)
*retID = busID;
return BUS_PCI;

View File

@ -124,7 +124,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData,
/* Fill in what we know, converting the driver name to lower case */
lower_driver = xnfalloc(strlen(driver) + 1);
for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
for (j = 0; (lower_driver[j] = tolower((unsigned char)driver[j])); j++);
DevToConfig[i].GDev.driver = lower_driver;
switch (bus) {

View File

@ -912,8 +912,8 @@ xf86NormalizeName(const char *s)
case '\t':
continue;
default:
if (isupper(*p))
*q++ = tolower(*p);
if (isupper((unsigned char)*p))
*q++ = tolower((unsigned char)*p);
else
*q++ = *p;
}

View File

@ -282,14 +282,14 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
if (d != NULL) {
*(d++) = 0;
for (i = 0; d[i] != 0; i++) {
if (!isdigit(d[i])) {
if (!isdigit((unsigned char)d[i])) {
free(s);
return FALSE;
}
}
}
for (i = 0; p[i] != 0; i++) {
if (!isdigit(p[i])) {
if (!isdigit((unsigned char)p[i])) {
free(s);
return FALSE;
}
@ -303,7 +303,7 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
return FALSE;
}
for (i = 0; p[i] != 0; i++) {
if (!isdigit(p[i])) {
if (!isdigit((unsigned char)p[i])) {
free(s);
return FALSE;
}
@ -316,7 +316,7 @@ xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
return TRUE;
}
for (i = 0; p[i] != 0; i++) {
if (!isdigit(p[i])) {
if (!isdigit((unsigned char)p[i])) {
free(s);
return FALSE;
}

View File

@ -340,10 +340,10 @@ xf86getToken(const xf86ConfigSymTabRec * tab)
}
/* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */
else if ((c == ',') && !isalpha(configBuf[configPos])) {
else if ((c == ',') && !isalpha((unsigned char)configBuf[configPos])) {
return COMMA;
}
else if ((c == '-') && !isalpha(configBuf[configPos])) {
else if ((c == '-') && !isalpha((unsigned char)configBuf[configPos])) {
return DASH;
}
@ -1028,8 +1028,8 @@ xf86nameCompare(const char *s1, const char *s2)
s1++;
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
s2++;
c1 = (isupper(*s1) ? tolower(*s1) : *s1);
c2 = (isupper(*s2) ? tolower(*s2) : *s2);
c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1);
c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2);
while (c1 == c2) {
if (c1 == '\0')
return 0;
@ -1039,8 +1039,8 @@ xf86nameCompare(const char *s1, const char *s2)
s1++;
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
s2++;
c1 = (isupper(*s1) ? tolower(*s1) : *s1);
c2 = (isupper(*s2) ? tolower(*s2) : *s2);
c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1);
c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2);
}
return c1 - c2;
}

View File

@ -984,7 +984,7 @@ ResetHosts(const char *display)
*ptr = 0;
hostlen = strlen(ohostname) + 1;
for (i = 0; i < hostlen; i++)
lhostname[i] = tolower(ohostname[i]);
lhostname[i] = tolower((unsigned char)ohostname[i]);
hostname = ohostname;
if (!strncmp("local:", lhostname, 6)) {
family = FamilyLocalHost;

View File

@ -622,7 +622,7 @@ VerifyDisplayName(const char *d)
for digits, or exception of :0.0 and similar (two decimal points max)
*/
for (i = 0; i < strlen(d); i++) {
if (!isdigit(d[i])) {
if (!isdigit((unsigned char)d[i])) {
if (d[i] != '.' || period_found)
return 0;
period_found = TRUE;
@ -940,7 +940,7 @@ ProcessCommandLine(int argc, char *argv[])
else if (strcmp(argv[i], "-terminate") == 0) {
dispatchExceptionAtReset = DE_TERMINATE;
terminateDelay = -1;
if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
if ((i + 1 < argc) && (isdigit((unsigned char)*argv[i + 1])))
terminateDelay = atoi(argv[++i]);
terminateDelay = max(0, terminateDelay);
}

View File

@ -778,11 +778,11 @@ XkbProcessArguments(int argc, char *argv[], int i)
else {
XkbWantAccessX = 1;
if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
if (((i + 1) < argc) && (isdigit((unsigned char)argv[i + 1][0]))) {
XkbDfltAccessXTimeout = atoi(argv[++i]);
j++;
if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
if (((i + 1) < argc) && (isdigit((unsigned char)argv[i + 1][0]))) {
/*
* presumption that the reasonably useful range of
* values fits in 0..MAXINT since SunOS 4 doesn't
@ -792,14 +792,14 @@ XkbProcessArguments(int argc, char *argv[], int i)
strtol(argv[++i], NULL, 16);
j++;
}
if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
if (((i + 1) < argc) && (isdigit((unsigned char)argv[i + 1][0]))) {
if (argv[++i][0] == '1')
XkbDfltAccessXFeedback = XkbAccessXFeedbackMask;
else
XkbDfltAccessXFeedback = 0;
j++;
}
if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
if (((i + 1) < argc) && (isdigit((unsigned char)argv[i + 1][0]))) {
XkbDfltAccessXOptions = (unsigned short)
strtol(argv[++i], NULL, 16);
j++;

View File

@ -91,9 +91,9 @@ XkbAtomText(Atom atm, unsigned format)
}
if (format == XkbCFile) {
for (tmp = rtrn; *tmp != '\0'; tmp++) {
if ((tmp == rtrn) && (!isalpha(*tmp)))
if ((tmp == rtrn) && (!isalpha((unsigned char)*tmp)))
*tmp = '_';
else if (!isalnum(*tmp))
else if (!isalnum((unsigned char)*tmp))
*tmp = '_';
}
}
@ -467,7 +467,7 @@ XkbIMWhichStateMaskText(unsigned use_which, unsigned format)
if (len != 0)
buf[len++] = '|';
sprintf(&buf[len], "XkbIM_Use%s", imWhichNames[i]);
buf[len + 9] = toupper(buf[len + 9]);
buf[len + 9] = toupper((unsigned char)buf[len + 9]);
}
else {
if (len != 0)
@ -529,7 +529,7 @@ XkbControlsMaskText(unsigned ctrls, unsigned format)
if (len != 0)
buf[len++] = '|';
sprintf(&buf[len], "Xkb%sMask", ctrlNames[i]);
buf[len + 3] = toupper(buf[len + 3]);
buf[len + 3] = toupper((unsigned char)buf[len + 3]);
}
else {
if (len != 0)
@ -560,7 +560,7 @@ XkbStringText(char *str, unsigned format)
else if (format == XkbXKMFile)
return str;
for (ok = TRUE, len = 0, in = str; *in != '\0'; in++, len++) {
if (!isprint(*in)) {
if (!isprint((unsigned char)*in)) {
ok = FALSE;
switch (*in) {
case '\n':
@ -581,7 +581,7 @@ XkbStringText(char *str, unsigned format)
return str;
buf = tbGetBuffer(len + 1);
for (in = str, out = buf; *in != '\0'; in++) {
if (isprint(*in))
if (isprint((unsigned char)*in))
*out++ = *in;
else {
*out++ = '\\';