[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Do not name local variable by c++ keyword


From f0d84baeb1691fe031749b7840841a79f81c5960 Mon Sep 17 00:00:00 2001
From: noppel <noppel@xxxxxxxxxxxxx>
Date: Wed, 8 Mar 2017 09:13:27 +0100
Subject: [PATCH] Do not name local variable by c++ keyword

---
 src/cmocka.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/cmocka.c b/src/cmocka.c
index a74a8e5..b91dd65 100644
--- a/src/cmocka.c
+++ b/src/cmocka.c
@@ -1912,7 +1912,7 @@ void *_test_realloc(void *ptr,
     MallocBlockInfo *block_info;
     char *block = ptr;
     size_t block_size = size;
-    void *new;
+    void *newBlock;

     if (ptr == NULL) {
         return _test_malloc(size, file, line);
@@ -1926,8 +1926,8 @@ void *_test_realloc(void *ptr,
     block_info = (MallocBlockInfo*)(block - (MALLOC_GUARD_SIZE +
                                              sizeof(*block_info)));

-    new = _test_malloc(size, file, line);
-    if (new == NULL) {
+    newBlock = _test_malloc(size, file, line);
+    if (newBlock == NULL) {
         return NULL;
     }

@@ -1935,12 +1935,12 @@ void *_test_realloc(void *ptr,
         block_size = block_info->size;
     }

-    memcpy(new, ptr, block_size);
+    memcpy(newBlock, ptr, block_size);

     /* Free previous memory */
     _test_free(ptr, file, line);

-    return new;
+    return newBlock;
 }
 #define realloc test_realloc

--
2.6.1.windows.1



Follow-Ups:
Re: [PATCH] Do not name local variable by c++ keywordAndreas Schneider <asn@xxxxxxxxxxxxxx>