From: Niels Möller Date: Wed, 16 Apr 2014 05:10:06 +0000 (+0200) Subject: Stylistic fixes. X-Git-Tag: nettle_3.0_release_20140607~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14b6bc2ce682f1d6558ed61b31e819513cc24a22;p=thirdparty%2Fnettle.git Stylistic fixes. --- diff --git a/ChangeLog b/ChangeLog index 3f1f3f5b..ee82c3ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-04-16 Niels Möller + * 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 diff --git a/examples/eratosthenes.c b/examples/eratosthenes.c index 3e1bd39f..7a54561d 100644 --- a/examples/eratosthenes.c +++ b/examples/eratosthenes.c @@ -93,7 +93,7 @@ static unsigned long * 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) { @@ -110,7 +110,7 @@ vector_init(unsigned long *vector, unsigned long size) unsigned long i; for (i = 0; i < end; i++) - vector[i] = ~0; + vector[i] = ~0UL; } static void