mbox series

[v2,0/10] parser: fix various data type problems

Message ID 20240712152253.3702-1-ceggers@arri.de
Headers show
Series parser: fix various data type problems | expand

Message

Christian Eggers July 12, 2024, 3:22 p.m. UTC
There are places where the pointer supplied to GET_FIELD_foo()
doesn't match the pointer cast used for assigned the value within
the libconfig/libjson adapters (e.g 'bool *' vs. 'unsigned int *').
Additionally weaken the "type equality" requirements, so that
older SWU files can be used furthermore.

v2:
- add patches 1/10..9/10
- weaken "type equality" requirements between INT and INT64

Christian Eggers (10):
  parser: field_type_t::TYPE_STRING: remove
  parser: field_type_t::TYPE_FLOAT: rename to TYPE_DOUBLE
  Fix usage of GET_FIELD_BOOL()
  Fix usage of GET_FIELD_INT()
  Fix usage of GET_FIELD_INT64()
  parser: GET_FIELD_*: add type safety
  parser: use SWUpdate internal type as master
  parser: add forward declaration for struct swupdate_cfg
  parser: print warning in case of type mismatch in sw-description
  parser: libconfig: allow implicit conversion from INT to INT64

 core/stream_interface.c             |  2 +-
 corelib/parsing_library_libconfig.c | 40 +++++++++++++++++------------
 corelib/parsing_library_libjson.c   | 38 +++++++++++++--------------
 corelib/server_utils.c              |  2 +-
 corelib/swupdate_settings.c         |  4 +--
 include/parselib.h                  | 31 +++++++++++++++++-----
 include/parsers.h                   |  2 ++
 include/swupdate_image.h            |  6 ++---
 mongoose/mongoose_interface.c       |  2 +-
 parser/parser.c                     |  2 +-
 10 files changed, 79 insertions(+), 50 deletions(-)

Comments

Stefano Babic July 13, 2024, 10:29 a.m. UTC | #1
On 12.07.24 17:22, Christian Eggers wrote:
> There are places where the pointer supplied to GET_FIELD_foo()
> doesn't match the pointer cast used for assigned the value within
> the libconfig/libjson adapters (e.g 'bool *' vs. 'unsigned int *').
> Additionally weaken the "type equality" requirements, so that
> older SWU files can be used furthermore.

Series is fine for me, and it does what I meant. I am applying it.

Best regards,
Stefano

>
> v2:
> - add patches 1/10..9/10
> - weaken "type equality" requirements between INT and INT64
>
> Christian Eggers (10):
>    parser: field_type_t::TYPE_STRING: remove
>    parser: field_type_t::TYPE_FLOAT: rename to TYPE_DOUBLE
>    Fix usage of GET_FIELD_BOOL()
>    Fix usage of GET_FIELD_INT()
>    Fix usage of GET_FIELD_INT64()
>    parser: GET_FIELD_*: add type safety
>    parser: use SWUpdate internal type as master
>    parser: add forward declaration for struct swupdate_cfg
>    parser: print warning in case of type mismatch in sw-description
>    parser: libconfig: allow implicit conversion from INT to INT64
>
>   core/stream_interface.c             |  2 +-
>   corelib/parsing_library_libconfig.c | 40 +++++++++++++++++------------
>   corelib/parsing_library_libjson.c   | 38 +++++++++++++--------------
>   corelib/server_utils.c              |  2 +-
>   corelib/swupdate_settings.c         |  4 +--
>   include/parselib.h                  | 31 +++++++++++++++++-----
>   include/parsers.h                   |  2 ++
>   include/swupdate_image.h            |  6 ++---
>   mongoose/mongoose_interface.c       |  2 +-
>   parser/parser.c                     |  2 +-
>   10 files changed, 79 insertions(+), 50 deletions(-)
>