diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-12 21:02:39 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-12 22:10:14 -0800 |
commit | 9fbe47e349fb261a3845c3c74f8832dbadfdbe8d (patch) | |
tree | 5831c7020a5a08beeff24a69196a2572ada68334 | |
parent | c968ddd21a83f64c5bbe26b1b3adbfcfd3d04ff7 (diff) |
Remove unused u*alloc functions from utils.c
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | utils.c | 55 | ||||
-rw-r--r-- | utils.h | 36 | ||||
-rw-r--r-- | xkbvleds.c | 1 | ||||
-rw-r--r-- | xkbwatch.c | 1 |
4 files changed, 0 insertions, 93 deletions
@@ -30,61 +30,6 @@ #include <stdlib.h> /***====================================================================***/ - -Opaque -uAlloc(unsigned size) -{ - return ((Opaque) malloc(size)); -} - -/***====================================================================***/ - -Opaque -uCalloc(unsigned n, unsigned size) -{ - return ((Opaque) calloc(n, size)); -} - -/***====================================================================***/ - -Opaque -uRealloc(Opaque old, unsigned newSize) -{ - if (old == NULL) - return ((Opaque) malloc(newSize)); - else - return ((Opaque) realloc((char *) old, newSize)); -} - -/***====================================================================***/ - -Opaque -uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned itemSize) -{ - char *rtrn; - - if (old == NULL) - rtrn = (char *) calloc(nNew, itemSize); - else { - rtrn = (char *) realloc((char *) old, nNew * itemSize); - if ((rtrn) && (nNew > nOld)) { - bzero(&rtrn[nOld * itemSize], (nNew - nOld) * itemSize); - } - } - return (Opaque) rtrn; -} - -/***====================================================================***/ - -void -uFree(Opaque ptr) -{ - if (ptr != (Opaque) NULL) - free((char *) ptr); - return; -} - -/***====================================================================***/ /*** PRINT FUNCTIONS ***/ /***====================================================================***/ @@ -48,13 +48,6 @@ _XFUNCPROTOBEGIN /***====================================================================***/ -#ifndef OPAQUE_DEFINED -typedef void *Opaque; -#endif -#ifndef NullOpaque -#define NullOpaque ((Opaque)NULL) -#endif - #ifndef BOOLEAN_DEFINED typedef char Boolean; #endif @@ -77,35 +70,6 @@ typedef int Comparison; /***====================================================================***/ -extern Opaque uAlloc(unsigned /* size */); - -extern Opaque uCalloc(unsigned /* n */, - unsigned /* size */); - -extern Opaque uRealloc(Opaque /* old */, - unsigned /* newSize */); - -extern Opaque uRecalloc(Opaque /* old */, - unsigned /* nOld */, - unsigned /* nNew */, - unsigned /* newSize */); - -extern void uFree(Opaque /* ptr */); - -#define uTypedAlloc(t) ((t *)uAlloc((unsigned)sizeof(t))) -#define uTypedCalloc(n,t) ((t *)uCalloc((unsigned)n,(unsigned)sizeof(t))) -#define uTypedRealloc(pO,n,t) ((t *)uRealloc((Opaque)pO,((unsigned)n)*sizeof(t))) -#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((Opaque)pO,((unsigned)o),((unsigned)n),sizeof(t))) -#if (defined mdHasAlloca) && (mdHasAlloca) -#define uTmpAlloc(n) ((Opaque)alloca((unsigned)n)) -#define uTmpFree(p) -#else -#define uTmpAlloc(n) uAlloc(n) -#define uTmpFree(p) uFree(p) -#endif - -/***====================================================================***/ - extern Boolean uSetErrorFile(const char *name); extern void uInformation(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2); extern void uAction(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2); @@ -34,7 +34,6 @@ #include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Box.h> -#define OPAQUE_DEFINED #define BOOLEAN_DEFINED #include "utils.h" #include "LED.h" @@ -34,7 +34,6 @@ #include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Box.h> -#define OPAQUE_DEFINED #define BOOLEAN_DEFINED #include "utils.h" #include "LED.h" |