comparison mercurial/mpatch.c @ 1978:10606ee61107

do proper typecasting on malloc() and calloc() calls to support build on Solaris 2.6 using Sun Pro SC4.0 (C++ 4.1) compiler.
author TK Soh <teekaysoh@yahoo.com>
date Mon, 20 Mar 2006 08:46:29 +0100
parents 299c3e26ee45
children 8f9660c568b8 441ea218414e
comparison
equal deleted inserted replaced
1977:7eb694a1c1af 1978:10606ee61107
56 56
57 static struct flist *lalloc(int size) 57 static struct flist *lalloc(int size)
58 { 58 {
59 struct flist *a = NULL; 59 struct flist *a = NULL;
60 60
61 a = malloc(sizeof(struct flist)); 61 a = (struct flist *)malloc(sizeof(struct flist));
62 if (a) { 62 if (a) {
63 a->base = malloc(sizeof(struct frag) * size); 63 a->base = (struct frag *)malloc(sizeof(struct frag) * size);
64 if (!a->base) { 64 if (!a->base) {
65 free(a); 65 free(a);
66 a = NULL; 66 a = NULL;
67 } else 67 } else
68 a->head = a->tail = a->base; 68 a->head = a->tail = a->base;