poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] pk_mi_json convert functions between a pk_val and a json_obj


From: Jose E. Marchesi
Subject: Re: [PATCH] pk_mi_json convert functions between a pk_val and a json_object.
Date: Wed, 22 Jul 2020 15:46:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Kostas.

Your commits broke the build.  First, it duplicates prototypes in
pk-mi-json.h:

../../poke/pk-mi-json.h:111:8: error: conflicting types for 'pk_mi_json_to_val'
 pk_val pk_mi_json_to_val (const char *str, char **errmsg);
        ^~~~~~~~~~~~~~~~~
../../poke/pk-mi-json.h:85:5: note: previous declaration of 'pk_mi_json_to_val' 
was here
 int pk_mi_json_to_val (pk_val *value, const char *str, char **errmsg);
     ^~~~~~~~~~~~~~~~~
I fixed that, but then I stumbled on many errors in the .c file:

../../poke/pk-mi-json.c: In function 'pk_mi_int_to_json':
../../poke/pk-mi-json.c:477:22: warning: implicit declaration of function 
'json_object_new_uint64' [-Wimplicit-function-declaration]
       value_object = json_object_new_uint64 (pk_uint_value (integer));
                      ^~~~~~~~~~~~~~~~~~~~~~
../../poke/pk-mi-json.c:477:20: warning: assignment makes pointer from integer 
without a cast [-Wint-conversion]
       value_object = json_object_new_uint64 (pk_uint_value (integer));
                    ^
../../poke/pk-mi-json.c:499:15: error: void value not ignored as it ought to be
               json_object_object_add (int_object, "type", type_object) != -1,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../poke/pk-mi-json.c:34:13: note: in definition of macro 'PK_MI_CHECK'
       if (!(A))                        \
             ^
../../poke/pk-mi-json.c:502:15: error: void value not ignored as it ought to be
               json_object_object_add (int_object, "value", value_object) != -1,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[... etc ...]

So I just reverted the two commits in master:

2a332807 moved config.h on top of header
ad3ad417 MI: pk_val->json, json->pk_val convert functions.

Please fix these problems and re-push.
Thanks! :)

PS: I would move PK_MI_CHECK and PK_MI_DEBUG from pk-mi-json.h to
    pk-mi-json.c, since these macros are not to be used anywhere else.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]