Show More
@@ -74,7 +74,7 b' int splitlines(const char *a, int len, s' | |||
|
74 | 74 | if (*p == '\n' || p == a + len - 1) |
|
75 | 75 | i++; |
|
76 | 76 | |
|
77 | *lr = l = malloc(sizeof(struct line) * i); | |
|
77 | *lr = l = (struct line *)malloc(sizeof(struct line) * i); | |
|
78 | 78 | if (!l) |
|
79 | 79 | return -1; |
|
80 | 80 | |
@@ -113,7 +113,7 b' static int equatelines(struct line *a, i' | |||
|
113 | 113 | while (buckets < bn + 1) |
|
114 | 114 | buckets *= 2; |
|
115 | 115 | |
|
116 | h = malloc(buckets * sizeof(struct pos)); | |
|
116 | h = (struct pos *)malloc(buckets * sizeof(struct pos)); | |
|
117 | 117 | buckets = buckets - 1; |
|
118 | 118 | if (!h) |
|
119 | 119 | return 0; |
@@ -237,9 +237,10 b' static struct hunklist diff(struct line ' | |||
|
237 | 237 | |
|
238 | 238 | /* allocate and fill arrays */ |
|
239 | 239 | t = equatelines(a, an, b, bn); |
|
240 | pos = calloc(bn, sizeof(struct pos)); | |
|
240 | pos = (struct pos *)calloc(bn, sizeof(struct pos)); | |
|
241 | 241 | /* we can't have more matches than lines in the shorter file */ |
|
242 |
l.head = l.base = malloc(sizeof(struct hunk) * |
|
|
242 | l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) * | |
|
243 | ((an<bn ? an:bn) + 1)); | |
|
243 | 244 | |
|
244 | 245 | if (pos && l.base && t) { |
|
245 | 246 | /* generate the matching block list */ |
@@ -58,9 +58,9 b' static struct flist *lalloc(int size)' | |||
|
58 | 58 | { |
|
59 | 59 | struct flist *a = NULL; |
|
60 | 60 | |
|
61 | a = malloc(sizeof(struct flist)); | |
|
61 | a = (struct flist *)malloc(sizeof(struct flist)); | |
|
62 | 62 | if (a) { |
|
63 | a->base = malloc(sizeof(struct frag) * size); | |
|
63 | a->base = (struct frag *)malloc(sizeof(struct frag) * size); | |
|
64 | 64 | if (!a->base) { |
|
65 | 65 | free(a); |
|
66 | 66 | a = NULL; |
General Comments 0
You need to be logged in to leave comments.
Login now