Skip to contentSkip to conversation

Format per CODING_STYLE

Qemu-devel Kevin Wolf 1 participant 1 message May 20, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Kevin Wolf

author
#1 lore raw
Quoted 3 lines · Anthony Liguori

From: malc <[email protected]>

Is it really necessary to have commits that change nothing but style? We could have hundreds of commits just converting all the code to the new coding style, but in the end all you achieve is to clutter up the log and make git blame meaningless.

I would really prefer to apply the new coding style only to new or (semantically) changed code.

Kevin

Quoted 54 lines
qemu-malloc.c +10 -6
index 5e9f47f..295d185 100644
@@ -26,8 +26,9 @@
 
 static void *oom_check(void *ptr)
 {
-    if (ptr == NULL)
+    if (ptr == NULL) {
         abort();
+    }
     return ptr;
 }
 
@@ -43,18 +44,20 @@ void qemu_free(void *ptr)
 
 void *qemu_malloc(size_t size)
 {
-    if (!size)
+    if (!size) {
         abort();
+    }
     return oom_check(malloc(size));
 }
 
 void *qemu_realloc(void *ptr, size_t size)
 {
-    if (size)
+    if (size) {
         return oom_check(realloc(ptr, size));
-    else {
-        if (ptr)
+    } else {
+        if (ptr) {
             return realloc(ptr, size);
+        }
     }
     abort();
 }
@@ -81,8 +84,9 @@ char *qemu_strndup(const char *str, size_t size)
     const char *end = memchr(str, 0, size);
     char *new;
 
-    if (end)
+    if (end) {
         size = end - str;
+    }
 
     new = qemu_malloc(size + 1);
     new[size] = 0;