2014-04-16 Niels Möller <nisse@lysator.liu.se>
+ * examples/eratosthenes.c (vector_alloc): Use sizeof(*vector)
+ instead of explicit type in malloc call.
+ (vector_init): Make constant explicitly unsigned long.
+
* tools/input.c (sexp_get_quoted_char): Deleted useless for loop.
2014-04-13 Niels Möller <nisse@lysator.liu.se>
vector_alloc(unsigned long size)
{
unsigned long end = (size + BITS_PER_LONG - 1) / BITS_PER_LONG;
- unsigned long *vector = malloc (end * sizeof(long));
+ unsigned long *vector = malloc (end * sizeof(*vector));
if (!vector)
{
unsigned long i;
for (i = 0; i < end; i++)
- vector[i] = ~0;
+ vector[i] = ~0UL;
}
static void