summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psgeom.c4
-rw-r--r--utils.c19
-rw-r--r--utils.h9
-rw-r--r--xkbprint.c14
4 files changed, 10 insertions, 36 deletions
diff --git a/psgeom.c b/psgeom.c
index 0365cee..1265a5c 100644
--- a/psgeom.c
+++ b/psgeom.c
@@ -869,7 +869,7 @@ PSPageTrailer(FILE *out, PSState *state)
if (sName == NULL)
sName = "(unknown)";
- lbuf = uAlloc(10 + strlen(sName));
+ lbuf = malloc(10 + strlen(sName));
if (!lbuf) {
uFatalError("Can't allocate memory for string\n");
}
@@ -904,7 +904,7 @@ PSPageTrailer(FILE *out, PSState *state)
if (sName == NULL)
sName = "(unknown)";
- lbuf = uAlloc(12 + strlen(sName));
+ lbuf = malloc(12 + strlen(sName));
if (!lbuf) {
uFatalError("Can't allocate memory for string\n");
}
diff --git a/utils.c b/utils.c
index 240ac1b..b813863 100644
--- a/utils.c
+++ b/utils.c
@@ -36,23 +36,6 @@ unsigned int debugFlags;
/***====================================================================***/
-Opaque
-uAlloc(unsigned size)
-{
- return ((Opaque) malloc(size));
-}
-
-/***====================================================================***/
-
-Opaque
-uCalloc(unsigned n, unsigned size)
-{
- return ((Opaque) calloc(n, size));
-}
-
-
-/***====================================================================***/
-
static FILE *errorFile = NULL;
Boolean
@@ -172,7 +155,7 @@ uStringDup(const char *str)
if (str == NULL)
return NULL;
- rtrn = (char *) uAlloc(strlen(str) + 1);
+ rtrn = (char *) malloc(strlen(str) + 1);
strcpy(rtrn, str);
return rtrn;
}
diff --git a/utils.h b/utils.h
index c277d33..d9cf438 100644
--- a/utils.h
+++ b/utils.h
@@ -76,15 +76,6 @@ typedef int Comparison;
/***====================================================================***/
-extern Opaque uAlloc(unsigned /* size */);
-extern Opaque uCalloc(unsigned /* n */ ,
- unsigned /* size */);
-
-#define uTypedAlloc(t) ((t *)uAlloc((unsigned)sizeof(t)))
-#define uTypedCalloc(n,t) ((t *)uCalloc((unsigned)n,(unsigned)sizeof(t)))
-
-/***====================================================================***/
-
extern Boolean uSetErrorFile(const char *name);
extern void uInformation(const char *s, ...);
extern void uAction(const char *s, ...);
diff --git a/xkbprint.c b/xkbprint.c
index 3b55fbd..41ebec3 100644
--- a/xkbprint.c
+++ b/xkbprint.c
@@ -421,7 +421,7 @@ parseArgs(int argc, char *argv[])
FILE *file = NULL;
if (outputFile == NULL) {
- outputFile = uAlloc(strlen(outputFont) + 5);
+ outputFile = malloc(strlen(outputFont) + 5);
sprintf(outputFile, "%s.pfa", outputFont);
}
else if (uStringEqual(outputFile, "-"))
@@ -484,10 +484,10 @@ parseArgs(int argc, char *argv[])
outputFormat = WANT_PS_FILE;
if ((outputFile == NULL) && (inputFile != NULL) &&
uStringEqual(inputFile, "-")) {
- int len;
+ size_t len;
len = strlen("stdin.eps") + 2;
- outputFile = uTypedCalloc(len, char);
+ outputFile = calloc(len, sizeof(char));
if (outputFile == NULL) {
uInternalError("Cannot allocate space for output file name\n");
@@ -500,7 +500,7 @@ parseArgs(int argc, char *argv[])
sprintf(outputFile, "stdin.ps");
}
else if ((outputFile == NULL) && (inputFile != NULL)) {
- int len;
+ size_t len;
char *base, *ext;
base = strrchr(inputFile, '/');
@@ -510,7 +510,7 @@ parseArgs(int argc, char *argv[])
base++;
len = strlen(base) + strlen("eps") + 2;
- outputFile = uTypedCalloc(len, char);
+ outputFile = calloc(len, sizeof(char));
if (outputFile == NULL) {
uInternalError("Cannot allocate space for output file name\n");
@@ -533,7 +533,7 @@ parseArgs(int argc, char *argv[])
}
}
else if (outputFile == NULL) {
- int len;
+ size_t len;
char *ch, *name, buf[128];
if (inDpyName[0] == ':')
@@ -542,7 +542,7 @@ parseArgs(int argc, char *argv[])
name = inDpyName;
len = strlen(name) + strlen("eps") + 2;
- outputFile = uTypedCalloc(len, char);
+ outputFile = calloc(len, sizeof(char));
if (outputFile == NULL) {
uInternalError("Cannot allocate space for output file name\n");