aboutsummaryrefslogtreecommitdiff
path: root/libXt/src/Resources.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-25 10:41:05 +0000
committermarha <marha@users.sourceforge.net>2011-03-25 10:41:05 +0000
commit272e57235cd60a2e65ac8258d96a02eb3939b687 (patch)
tree789d74bd6ec1cc468f1f81aab97d4e4dfdb2d5c5 /libXt/src/Resources.c
parentb39f063f74bf0163eaf34db03134f226d18142ec (diff)
downloadvcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.tar.gz
vcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.tar.bz2
vcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.zip
git update until 25 Mar 2011
xserver fontconfig glproto libXau libXft libXmu libfontenc libxcb mesa mkfontscale pixman randrproto xkeyboard-config xtrans xwininfo updated following packages: xproto-7.0.21 xineramaproto-1.2.1 libXt-1.1.1 libxkbfile-1.0.7 libXpm-3.5.9 libXfont-1.4.3 libXaw-1.0.9 bdftopcf-1.0.3 encodings-1.0.4 fixesproto-5.0 font-adobe-100dpi-1.0.3 font-adobe-75dpi-1.0.3 font-adobe-utopia-100dpi-1.0.4 font-adobe-utopia-75dpi-1.0.4 font-adobe-utopia-type1-1.0.4 font-alias-1.0.3 font-arabic-misc-1.0.3 font-bh-100dpi-1.0.3 font-bh-75dpi-1.0.3 font-bh-lucidatypewriter-100dpi-1.0.3 font-bh-lucidatypewriter-75dpi-1.0.3 font-bh-ttf-1.0.3 font-bh-type1-1.0.3 font-bitstream-100dpi-1.0.3 font-bitstream-75dpi-1.0.3 font-bitstream-speedo-1.0.2 font-bitstream-type1-1.0.3 font-cronyx-cyrillic-1.0.3 font-cursor-misc-1.0.3 font-daewoo-misc-1.0.3 font-dec-misc-1.0.3 font-ibm-type1-1.0.3 font-isas-misc-1.0.3 font-jis-misc-1.0.3 font-micro-misc-1.0.3 font-misc-cyrillic-1.0.3 font-misc-ethiopic-1.0.3 font-misc-meltho-1.0.3 font-misc-misc-1.1.2 font-mutt-misc-1.0.3 font-schumacher-misc-1.1.2 font-screen-cyrillic-1.0.4 font-sony-misc-1.0.3 font-sun-misc-1.0.3 font-util-1.2.0 font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4
Diffstat (limited to 'libXt/src/Resources.c')
-rw-r--r--libXt/src/Resources.c101
1 files changed, 6 insertions, 95 deletions
diff --git a/libXt/src/Resources.c b/libXt/src/Resources.c
index 0f5bf1c32..dc0f563cc 100644
--- a/libXt/src/Resources.c
+++ b/libXt/src/Resources.c
@@ -1,7 +1,5 @@
-/* $Xorg: Resources.c,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */
-
/***********************************************************
-Copyright 1993 Sun Microsystems, Inc. All rights reserved.
+Copyright (c) 1993, Oracle and/or its affiliates. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -70,8 +68,6 @@ in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/Xt/Resources.c,v 1.11tsi Exp $ */
-
/*LINTLIBRARY*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -113,92 +109,6 @@ void _XtCopyFromParent(
} /* _XtCopyFromParent */
-/* If the alignment characteristics of your machine are right, these may be
- faster */
-
-#ifdef UNALIGNED
-
-void _XtCopyFromArg(
- XtArgVal src,
- char* dst,
- register unsigned int size)
-{
- if (size == sizeof(long)) *(long *)dst = (long)src;
- else if (size == sizeof(short)) *(short *)dst = (short)src;
- else if (size == sizeof(char)) *(char *)dst = (char)src;
- else if (size == sizeof(XtPointer)) *(XtPointer *)dst = (XtPointer)src;
- else if (size == sizeof(char*)) *(char **)dst = (char*)src;
- else if (size == sizeof(XtArgVal)) *(XtArgVal *)dst = src;
- else if (size > sizeof(XtArgVal))
- (void) memmove((char *) dst, (char *) src, (int) size);
- else
- (void) memmove((char *) dst, (char *) &src, (int) size);
-} /* _XtCopyFromArg */
-
-void _XtCopyToArg(
- char* src,
- XtArgVal *dst,
- register unsigned int size)
-{
- if (! (*dst)) {
-#ifdef GETVALUES_BUG
- /* old GetValues semantics (storing directly into arglists) are bad,
- * but preserve for compatibility as long as arglist contains NULL.
- */
- if (size == sizeof(long)) *dst = (XtArgVal)*(long*)src;
- else if (size == sizeof(short)) *dst = (XtArgVal)*(short*)src;
- else if (size == sizeof(char)) *dst = (XtArgVal)*(char*)src;
- else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
- else if (size == sizeof(char*)) *dst = (XtArgVal)*(char**)src;
- else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
- else (void) memmove((char*)dst, (char*)src, (int)size);
-#else
- XtErrorMsg("invalidGetValues", "xtGetValues", XtCXtToolkitError,
- "NULL ArgVal in XtGetValues", (String*) NULL, (Cardinal*) NULL);
-#endif
- }
- else {
- /* proper GetValues semantics: argval is pointer to destination */
- if (size == sizeof(long)) *((long*)*dst) = *(long*)src;
- else if (size == sizeof(short)) *((short*)*dst) = *(short*)src;
- else if (size == sizeof(char)) *((char*)*dst) = *(char*)src;
- else if (size == sizeof(XtPointer)) *((XtPointer*)*dst) = *(XtPointer*)src;
- else if (size == sizeof(char*)) *((char**)*dst) = *(char**)src;
- else if (size == sizeof(XtArgVal)) *((XtArgVal*)*dst)= *(XtArgVal*)src;
- else (void) memmove((char*)*dst, (char*)src, (int)size);
- }
-} /* _XtCopyToArg */
-
-static void CopyToArg(
- char* src,
- XtArgVal *dst,
- register unsigned int size)
-{
- if (! (*dst)) {
- /* old GetValues semantics (storing directly into arglists) are bad,
- * but preserve for compatibility as long as arglist contains NULL.
- */
- if (size == sizeof(long)) *dst = (XtArgVal)*(long*)src;
- else if (size == sizeof(short)) *dst = (XtArgVal)*(short*)src;
- else if (size == sizeof(char)) *dst = (XtArgVal)*(char*)src;
- else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
- else if (size == sizeof(char*)) *dst = (XtArgVal)*(char**)src;
- else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
- else (void) memmove((char*)dst, (char*)src, (int)size);
- }
- else {
- /* proper GetValues semantics: argval is pointer to destination */
- if (size == sizeof(long)) *((long*)*dst) = *(long*)src;
- else if (size == sizeof(short)) *((short*)*dst) = *(short*)src;
- else if (size == sizeof(char)) *((char*)*dst) = *(char*)src;
- else if (size == sizeof(XtPointer)) *((XtPointer*)*dst) = *(XtPointer*)src;
- else if (size == sizeof(char*)) *((char**)*dst) = *(char**)src;
- else if (size == sizeof(XtArgVal)) *((XtArgVal*)*dst)= *(XtArgVal*)src;
- else (void) memmove((char*)*dst, (char*)src, (int)size);
- }
-} /* CopyToArg */
-
-#else
void _XtCopyFromArg(
XtArgVal src,
char* dst,
@@ -317,7 +227,6 @@ static void CopyToArg(
}
} /* CopyToArg */
-#endif
static Cardinal CountTreeDepth(
Widget w)
@@ -948,7 +857,7 @@ static XtCacheRef *GetResources(
register XtTypedArg* arg = typed_args + typed[j] - 1;
register int i;
- for (i = num_typed_args - typed[j]; i; i--, arg++) {
+ for (i = num_typed_args - typed[j]; i > 0; i--, arg++) {
*arg = *(arg+1);
}
num_typed_args--;
@@ -971,8 +880,10 @@ static XtCacheRef *GetResources(
if (cache_ptr && *cache_ptr)
cache_ptr++;
} else {
- *((XtTranslations *)&widget->core.tm.current_state) =
- *((XtTranslations *)value.addr);
+ /* value.addr can be NULL see: !already_copied */
+ if (value.addr)
+ *((XtTranslations *)&widget->core.tm.current_state) =
+ *((XtTranslations *)value.addr);
}
}
}