diff options
author | raf <none@none> | 2006-08-31 12:13:33 -0700 |
---|---|---|
committer | raf <none@none> | 2006-08-31 12:13:33 -0700 |
commit | 4088bb40326b75ef60834a6c2a92e29e25474b68 (patch) | |
tree | a5b45d72fb6f00432e93b1e67b6ff941b7f5fdc0 /usr/src/cmd/vi | |
parent | 3bf5ae9eedb977fad5c8a4029f296a9ec010c06e (diff) | |
download | illumos-joyent-4088bb40326b75ef60834a6c2a92e29e25474b68.tar.gz |
PSARC 2006/477 malloc library cleanup
6464344 malloc library cleanup
--HG--
rename : usr/src/lib/libmapmalloc/common/mallopt.c => deleted_files/usr/src/lib/libmapmalloc/common/mallopt.c
Diffstat (limited to 'usr/src/cmd/vi')
-rw-r--r-- | usr/src/cmd/vi/misc/ctags.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/usr/src/cmd/vi/misc/ctags.c b/usr/src/cmd/vi/misc/ctags.c index 86aff67aba..910257d04a 100644 --- a/usr/src/cmd/vi/misc/ctags.c +++ b/usr/src/cmd/vi/misc/ctags.c @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -455,8 +455,8 @@ bool f; /* f == TRUE when function */ if (index(name, ' ') != NULL) #endif { - (void) strcpy(name, (char *) strtok(name, " ")); - while (nametk = (char *) strtok(0, " ")) + (void) strcpy(name, strtok(name, " ")); + while (nametk = strtok(0, " ")) (void) strcat(name, nametk); } np->entry = savestr(name); @@ -973,11 +973,9 @@ static void free_tree(node) NODE *node; { - extern void cfree(); - while (node) { free_tree(node->right); - cfree(node); + free(node); node = node->left; } } @@ -1450,14 +1448,14 @@ char **av; /* ptr to original argument space */ i = mac = fflag = 0; /* proper initializations */ - mav_sz = (size_t) ((ac + 1) * sizeof (char *)); - if ((mav = malloc(mav_sz)) == (char **) NULL) { + mav_sz = ((ac + 1) * sizeof (char *)); + if ((mav = malloc(mav_sz)) == (char **)NULL) { perror("Can't malloc argument space"); exit(1); } /* for each argument, see if we need to change things: */ - for (; (av[i] != (char *) NULL) && (av[i][0] != (char) NULL); i++) { + for (; (av[i] != (char *)NULL) && (av[i][0] != (char)NULL); i++) { if (strcmp(av[i], "--") == 0) { fflag = 1; /* just handle filenames now */ @@ -1486,15 +1484,15 @@ char **av; /* ptr to original argument space */ */ mav_sz += sizeof (char *); if ((mav = realloc(mav, mav_sz)) == - (char **) NULL) { + (char **)NULL) { perror("Can't realloc " "argument space"); exit(1); } } - if ((mav[mac] = malloc((size_t) CPFLAG)) == - (char *) NULL) { + if ((mav[mac] = malloc((size_t)CPFLAG)) == + (char *)NULL) { perror("Can't malloc argument space"); exit(1); } @@ -1503,7 +1501,7 @@ char **av; /* ptr to original argument space */ } } else { /* otherwise, just copy the argument: */ - if ((mav[mac] = malloc(sz + 1)) == (char *) NULL) { + if ((mav[mac] = malloc(sz + 1)) == (char *)NULL) { perror("Can't malloc argument space"); exit(1); } @@ -1512,5 +1510,5 @@ char **av; /* ptr to original argument space */ } } - mav[mac] = (char *) NULL; + mav[mac] = (char *)NULL; } |