diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-28 09:56:26 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-28 09:56:26 +0000 |
commit | 696b5cb8009852a4fdac5b68192d72ed56c0cf5a (patch) | |
tree | ae3293acd95d310ad3d5ac3183421ee250a95ec7 /Build/source/texk | |
parent | 0696868cdd6ddc367c14e173c8faf92f03166c12 (diff) |
makeindex: Do not typecast the result of malloc()
git-svn-id: svn://tug.org/texlive/trunk@27214 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/makeindexk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/makeindexk/mkind.c | 2 | ||||
-rw-r--r-- | Build/source/texk/makeindexk/qsort.h | 2 | ||||
-rw-r--r-- | Build/source/texk/makeindexk/scanid.c | 4 |
4 files changed, 9 insertions, 3 deletions
diff --git a/Build/source/texk/makeindexk/ChangeLog b/Build/source/texk/makeindexk/ChangeLog index aab94aaa1ae..aba6cabe8b2 100644 --- a/Build/source/texk/makeindexk/ChangeLog +++ b/Build/source/texk/makeindexk/ChangeLog @@ -1,3 +1,7 @@ +2012-07-28 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mkind.c, scanid.c: Do not typecast the result of malloc(). + 2012-07-27 Peter Breitenlohner <peb@mppmu.mpg.de> Cleanup Nelson Beebe's qqsort() used instead of qsort(). diff --git a/Build/source/texk/makeindexk/mkind.c b/Build/source/texk/makeindexk/mkind.c index a118fc34687..8b85f06d7b3 100644 --- a/Build/source/texk/makeindexk/mkind.c +++ b/Build/source/texk/makeindexk/mkind.c @@ -410,7 +410,7 @@ check_idx(char *fn, int open_fn) STRING_MAX,totmem); #endif /* DEBUG */ - if ((tmp_fn = (char *) malloc(STRING_MAX+5)) == NULL) + if ((tmp_fn = malloc(STRING_MAX+5)) == NULL) FATAL("Not enough core...abort.\n"); snprintf(tmp_fn, STRING_MAX+5, "%s%s", base, INDEX_IDX); idx_fn = tmp_fn; diff --git a/Build/source/texk/makeindexk/qsort.h b/Build/source/texk/makeindexk/qsort.h index 0c3087c5a1a..13e4972fec3 100644 --- a/Build/source/texk/makeindexk/qsort.h +++ b/Build/source/texk/makeindexk/qsort.h @@ -12,3 +12,5 @@ typedef int (*qq_compar_fn_t)(const void *, const void *); extern void qqsort (void *base, size_t n, size_t size, qq_compar_fn_t compar); + +#define qsort qqsort diff --git a/Build/source/texk/makeindexk/scanid.c b/Build/source/texk/makeindexk/scanid.c index 1740b38186c..1c126933cc8 100644 --- a/Build/source/texk/makeindexk/scanid.c +++ b/Build/source/texk/makeindexk/scanid.c @@ -181,7 +181,7 @@ make_key(void) len,totmem); #endif /* DEBUG */ - if ((ptr = (NODE_PTR) malloc(len)) == NULL) + if ((ptr = malloc(len)) == NULL) fprintf (stderr, "Not enough core...abort.\n"); bzero(ptr, len); @@ -239,7 +239,7 @@ make_string(char **ppstr, int n) * sort key may differ at german_sort and strange indexentries * <werner@suse.de> */ - (*ppstr) = (char*)malloc(n); + (*ppstr) = malloc(n); if (!(*ppstr)) fprintf (stderr, "Not enough core...abort.\n"); bzero(*ppstr, n); /* Always zero anything, <werner@suse.de> */ |