[PING^2][PATCH] Reformat malloc to gnu style.
Joseph S. Myers
joseph@codesourcery.com
Thu Jan 2 16:28:00 GMT 2014
Several of the changes committed in commit
6c8dbf00f536d78b1937b5af6f57be47fd376344 are wrong - sufficiently many
that I think it should be reverted, and then smaller patches submitted
after the freeze each of which addresses exactly one formatting issue
(e.g. bad indentation), everywhere it occurs (or only some places it
occurs, if needed to keep the patch below 1000 lines). For example:
* In malloc.c you change "2 * SIZE_SZ" (correct) to "2 *SIZE_SZ"
(incorrect).
* Indentation changes such as
- __THROW __attribute_malloc__ __wur;
+__THROW __attribute_malloc__ __wur;
are wrong (maybe two-column indentation is right - it's what emacs does -
but certainly not zero-column).
* Function pointer declarations are meant to have a space before the open
parenthesis of the parameter list, but you are wrongly removing those
spaces in some cases, e.g.:
-static void (*old_free_hook) (__ptr_t ptr, const __ptr_t);
+static void (*old_free_hook)(__ptr_t ptr, const __ptr_t);
* Similarly in function pointer calls:
- (*old_free_hook) (ptr, caller);
+ (*old_free_hook)(ptr, caller);
* Another case of wrong zero-column indentation you have is:
-static void
-flood (ptr, val, size)
- __ptr_t ptr;
- int val;
- size_t size;
+static void flood (ptr, val, size)
+__ptr_t ptr;
+int val;
+size_t size;
Although prototype definitions are preferred, five-column indentation is
correct in an old-style definition like this.
* I don't follow what logic you are using for indentation in macro
definitions such as arena_get. I reckon the preferred style is
#define macro
do
{
}
while (0)
with backslashes in the positions emacs C-C C-\ puts them in. This
accords with what the GNU Coding Standards say. (Once the braces are on
their own lines, selecting the whole file and doing TAB in emacs is a
convenient way of reindenting and adjusting backslash placement - that's
what I did for soft-fp.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list