meta-agl-core: fix connman-ncurses compilation
[AGL/meta-agl.git] / meta-agl-core / recipes-connectivity / connman-ncurses / connman-ncurses / stdbool-fixes.patch
1 Replace some TRUE/FALSE usage with stdbool.h definitions
2
3 Newer versions of json-c dropped its previous #defines for TRUE and
4 FALSE, update affected code to use the stdbool.h boolean definitions
5 to fix compilation.
6
7 Upstream-Status: Pending
8 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
9
10 ---
11 diff --git a/json_regex.c b/json_regex.c
12 index 2524c18..cdb6801 100644
13 --- a/json_regex.c
14 +++ b/json_regex.c
15 @@ -24,6 +24,7 @@
16  #endif
17  
18  #include <json.h>
19 +#include <stdbool.h>
20  
21  #include "json_regex.h"
22  #include "keys.h"
23 @@ -64,7 +65,7 @@ void generate_trusted_json(void)
24         json_object_object_add(jregex_agent_response, "Username", json_object_new_string("^([[:print:]]*)$"));
25         json_object_object_add(jregex_agent_response, "Password", json_object_new_string("^([[:print:]]*)$"));
26  
27 -       jregex_agent_retry_response = json_object_new_boolean(TRUE);
28 +       jregex_agent_retry_response = json_object_new_boolean(true);
29  
30         // See commands.c __cmd_config_service for a better idea of the format.
31         jregex_config_service = json_object_new_object();
32 @@ -94,7 +95,7 @@ void generate_trusted_json(void)
33         json_object_array_add(arr, json_object_new_string("^([[:print:]]*)$"));
34         json_object_object_add(tmp, key_serv_proxy_excludes, arr);
35         json_object_object_add(opt, key_serv_proxy_config, tmp);
36 -       json_object_object_add(opt, key_serv_autoconnect, json_object_new_boolean(TRUE));
37 +       json_object_object_add(opt, key_serv_autoconnect, json_object_new_boolean(true));
38         arr = json_object_new_array();
39         json_object_array_add(arr, json_object_new_string("^([[:print:]]*)$"));
40         json_object_object_add(opt, key_serv_domains_config, arr);
41 diff --git a/json_utils.c b/json_utils.c
42 index f66d08a..8f2c195 100644
43 --- a/json_utils.c
44 +++ b/json_utils.c
45 @@ -83,7 +83,7 @@ static bool json_match_object(struct json_object *jobj,
46                 key_is_trusted = json_object_object_get_ex(jtrusted, key,
47                                 &tmp_trusted);
48  
49 -               if (key_is_trusted == FALSE)
50 +               if (key_is_trusted == false)
51                         return false;
52  
53                 res = __json_type_dispatch(val, tmp_trusted);