diff mbox series

[10/27] lib: fwts_json.h: fix casting warning, add missing const

Message ID 20180815131129.24146-11-colin.king@canonical.com
State Accepted
Headers show
Series [01/27] lib: fwts_framework: ensure src pointer is const | expand

Commit Message

Colin Ian King Aug. 15, 2018, 1:11 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

We need to be comparing a const pointer, add in the missing const
to clean up a build warning.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/include/fwts_json.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Hung Aug. 15, 2018, 5:55 p.m. UTC | #1
On 2018-08-15 06:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> We need to be comparing a const pointer, add in the missing const
> to clean up a build warning.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/include/fwts_json.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lib/include/fwts_json.h b/src/lib/include/fwts_json.h
> index 82a0cc09..d81b60d4 100644
> --- a/src/lib/include/fwts_json.h
> +++ b/src/lib/include/fwts_json.h
> @@ -29,6 +29,6 @@
>    *  versions return NULL, so check for these. Sigh.
>    */
>   #define FWTS_JSON_ERROR(ptr) \
> -	( (ptr == NULL) || ((json_object*)ptr == __FWTS_JSON_ERR_PTR__) )
> +	( (ptr == NULL) || ((const json_object *)ptr == __FWTS_JSON_ERR_PTR__) )
>   
>   #endif
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 16, 2018, 9:14 a.m. UTC | #2
On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> We need to be comparing a const pointer, add in the missing const
> to clean up a build warning.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/include/fwts_json.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/include/fwts_json.h b/src/lib/include/fwts_json.h
> index 82a0cc09..d81b60d4 100644
> --- a/src/lib/include/fwts_json.h
> +++ b/src/lib/include/fwts_json.h
> @@ -29,6 +29,6 @@
>   *  versions return NULL, so check for these. Sigh.
>   */
>  #define FWTS_JSON_ERROR(ptr) \
> -	( (ptr == NULL) || ((json_object*)ptr == __FWTS_JSON_ERR_PTR__) )
> +	( (ptr == NULL) || ((const json_object *)ptr == __FWTS_JSON_ERR_PTR__) )
>  
>  #endif

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/include/fwts_json.h b/src/lib/include/fwts_json.h
index 82a0cc09..d81b60d4 100644
--- a/src/lib/include/fwts_json.h
+++ b/src/lib/include/fwts_json.h
@@ -29,6 +29,6 @@ 
  *  versions return NULL, so check for these. Sigh.
  */
 #define FWTS_JSON_ERROR(ptr) \
-	( (ptr == NULL) || ((json_object*)ptr == __FWTS_JSON_ERR_PTR__) )
+	( (ptr == NULL) || ((const json_object *)ptr == __FWTS_JSON_ERR_PTR__) )
 
 #endif