poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] testsuite: Fix warnings in poke.mi-json/mi-json.c


From: Jose E. Marchesi
Subject: Re: [PATCH] testsuite: Fix warnings in poke.mi-json/mi-json.c
Date: Sat, 20 Feb 2021 01:24:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Mohammed.

> 2021-02-20  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
>
>       * testsuite/poke.mi-json/mi-json.c (test_json_pk_sct): Remove unused
>       variable(s).
>       (test_val_to_json): Likewise.
>       (read_json_object): Change the type of `cap` to `ssize_t` to make the
>       compiler happy (-Wsign-compare).

OK for master.
Thanks!


> ---
>  ChangeLog                        | 8 ++++++++
>  testsuite/poke.mi-json/mi-json.c | 6 +-----
>  2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 6f892fd8..c90b35d0 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,11 @@
> +2021-02-20  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
> +
> +     * testsuite/poke.mi-json/mi-json.c (test_json_pk_sct): Remove unused
> +     variable(s).
> +     (test_val_to_json): Likewise.
> +     (read_json_object): Change the type of `cap` to `ssize_t` to make the
> +     compiler happy (-Wsign-compare).
> +
>  2021-02-20  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
>  
>       * libpoke/pvm.jitter (PVM_PRINTI): Fix bit-depth of printed negative
> diff --git a/testsuite/poke.mi-json/mi-json.c 
> b/testsuite/poke.mi-json/mi-json.c
> index a2befddc..666e12d7 100644
> --- a/testsuite/poke.mi-json/mi-json.c
> +++ b/testsuite/poke.mi-json/mi-json.c
> @@ -248,7 +248,6 @@ test_json_pk_sct (json_object *pk_sct_obj, pk_val pk_sct)
>  {
>    json_object *current, *pk_sct_fields_obj, *pk_sct_field_obj;
>    pk_val pk_sct_name, pk_sct_fname, pk_sct_fboffset, pk_sct_fvalue;
> -  int signed_p;
>    const char *typename;
>  
>    /* Poke struct properties are : "type", "name", "fields" and "mapping".  */
> @@ -465,7 +464,7 @@ read_json_object (FILE *ifp)
>    ssize_t nread, s_read = 0;
>    size_t len = 0;
>    char *line = NULL, *json_str = NULL;
> -  size_t cap = 1024;
> +  ssize_t cap = 1024;
>  
>    /* Optimistic allocation, to avoid multiple reallocations.  */
>    json_str = (char *) malloc (cap);
> @@ -555,10 +554,7 @@ test_val_to_json (const char *pk_obj_str, pk_val val)
>  void
>  test_json_file (const char *filename, FILE *ifp)
>  {
> -  char *poke_datadir, *line = NULL;
>    const char *json_obj_str;
> -  ssize_t nread;
> -  size_t len = 0;
>    pk_compiler pkc;
>    pk_val val;



reply via email to

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