| IntrinsicI.h | | IntrinsicI.h | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 109 | |
| | | | |
| /**************************************************************** | | /**************************************************************** | |
| * | | * | |
| * Byte utilities | | * Byte utilities | |
| * | | * | |
| ****************************************************************/ | | ****************************************************************/ | |
| | | | |
| #define _XBCOPYFUNC _XtBcopy | | #define _XBCOPYFUNC _XtBcopy | |
| #include <X11/Xfuncs.h> | | #include <X11/Xfuncs.h> | |
| | | | |
|
| /* If the alignment characteristics of your machine are right, these may be | | | |
| faster */ | | | |
| | | | |
| #ifdef UNALIGNED | | | |
| | | | |
| #define XtMemmove(dst, src, 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 \ | | | |
| bzero((char *) (dst), (int) (size)) | | | |
| | | | |
| #define XtMemcmp(b1, b2, size) \ | | | |
| (size == sizeof(int) ? \ | | | |
| *((int *) (b1)) != *((int *) (b2)) \ | | | |
| : memcmp((char *) (b1), (char *) (b2), (int) (size)) \ | | | |
| ) | | | |
| | | | |
| #else | | | |
| | | | |
| #define XtMemmove(dst, src, size) \ | | #define XtMemmove(dst, src, size) \ | |
| if ((char *)(dst) != (char *)(src)) { \ | | if ((char *)(dst) != (char *)(src)) { \ | |
| (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ | | (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ | |
| } | | } | |
| | | | |
| #define XtBZero(dst, size) \ | | #define XtBZero(dst, size) \ | |
| bzero((char *) (dst), (int) (size)) | | bzero((char *) (dst), (int) (size)) | |
| | | | |
| #define XtMemcmp(b1, b2, size) \ | | #define XtMemcmp(b1, b2, size) \ | |
| memcmp((char *) (b1), (char *) (b2), (int) (size)) | | memcmp((char *) (b1), (char *) (b2), (int) (size)) | |
| | | | |
|
| #endif | | | |
| | | | |
| /**************************************************************** | | /**************************************************************** | |
| * | | * | |
| * Stack cache allocation/free | | * Stack cache allocation/free | |
| * | | * | |
| ****************************************************************/ | | ****************************************************************/ | |
| | | | |
| #define XtStackAlloc(size, stack_cache_array) \ | | #define XtStackAlloc(size, stack_cache_array) \ | |
| ((size) <= sizeof(stack_cache_array) \ | | ((size) <= sizeof(stack_cache_array) \ | |
| ? (XtPointer)(stack_cache_array) \ | | ? (XtPointer)(stack_cache_array) \ | |
| : XtMalloc((unsigned)(size))) | | : XtMalloc((unsigned)(size))) | |
| | | | |
End of changes. 2 change blocks. |
| 33 lines changed or deleted | | 0 lines changed or added | |
|