diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2005-02-21 21:08:27 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2005-02-21 21:08:27 +0000 |
commit | 85eb751e4e1683af6cee3ee9dce29f74911a639d (patch) | |
tree | b40f699ee646462a8f223b919ba68dda1d8fc371 /include/X11/IntrinsicI.h | |
parent | 94150cb72d9d641c64325cd70323d93b9a3701a5 (diff) |
Convert lib/Xt to ANSI C (Thomas Dickey). Fixes for a few valgrind warningsXORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_1
(Thomas Dickey).
Diffstat (limited to 'include/X11/IntrinsicI.h')
-rw-r--r-- | include/X11/IntrinsicI.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/include/X11/IntrinsicI.h b/include/X11/IntrinsicI.h index 9ce362c..6cdbc70 100644 --- a/include/X11/IntrinsicI.h +++ b/include/X11/IntrinsicI.h @@ -29,13 +29,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -117,16 +117,18 @@ SOFTWARE. #ifdef UNALIGNED #define XtMemmove(dst, src, size) \ - if (size == sizeof(int)) \ - *((int *) (dst)) = *((int *) (src)); \ - else if (size == sizeof(char)) \ - *((char *) (dst)) = *((char *) (src)); \ - else if (size == sizeof(short)) \ - *((short *) (dst)) = *((short *) (src)); \ - else \ - (void) memcpy((char *) (dst), (char *) (src), (int) (size)) - -#define XtBZero(dst, size) \ + if ((char *)(dst) != (char *)(src)) { \ + if (size == sizeof(int)) \ + *((int *) (dst)) = *((int *) (src)); \ + else if (size == sizeof(char)) \ + *((char *) (dst)) = *((char *) (src)); \ + else if (size == sizeof(short)) \ + *((short *) (dst)) = *((short *) (src)); \ + else \ + (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ + } + +#define XtBZero(dst, size) \ if (size == sizeof(int)) \ *((int *) (dst)) = 0; \ else \ @@ -141,7 +143,9 @@ SOFTWARE. #else #define XtMemmove(dst, src, size) \ - (void) memcpy((char *) (dst), (char *) (src), (int) (size)) + if ((char *)(dst) != (char *)(src)) { \ + (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ + } #define XtBZero(dst, size) \ bzero((char *) (dst), (int) (size)) @@ -164,7 +168,7 @@ SOFTWARE. : XtMalloc((unsigned)(size))) #define XtStackFree(pointer, stack_cache_array) \ - if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else + { if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); } /*************************************************************** * @@ -225,7 +229,7 @@ extern void _XtGClistFree(Display *dpy, XtPerDisplay pd); extern void _XtGeoTab (int); extern void _XtGeoTrace ( - Widget widget, + Widget widget, ... ); @@ -233,7 +237,7 @@ extern void _XtGeoTrace ( #else /* XT_GEO_TATTLER */ -#define CALLGEOTAT(f) +#define CALLGEOTAT(f) #endif /* XT_GEO_TATTLER */ |