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

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


On Wednesday, 8 March 2017 09:15:46 CET Max Noppel wrote:
>  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

Thank you very much for your contribution. However this patch doesn't apply. 
Can you please make sure that it applies on master and resend it as an 
attachment?


Thanks,


	Andreas

> 
> ---
>   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


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

References:
[PATCH] Do not name local variable by c++ keywordMax Noppel <max@noppelmax.online>