0001-Replace-removed-is_error-macro.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 0db8dc6022f67a4e1f49397b8bf519b2a34f74c9 Mon Sep 17 00:00:00 2001
  2. From: Jelle van der Waa <jelle@vdwaa.nl>
  3. Date: Wed, 27 Dec 2017 11:05:45 +0100
  4. Subject: [PATCH] Replace removed is_error macro
  5. The json-c library removed the is_error macro in 0.13, replaced the
  6. macro calls with a != NULL statement.
  7. ---
  8. bti.c | 6 +++---
  9. 1 file changed, 3 insertions(+), 3 deletions(-)
  10. diff --git a/bti.c b/bti.c
  11. index 7f485a8..9b68e17 100644
  12. --- a/bti.c
  13. +++ b/bti.c
  14. @@ -451,7 +451,7 @@ static void parse_timeline(char *document, struct session *session)
  15. struct json_object *val; \
  16. struct lh_entry *entry; \
  17. for (entry = json_object_get_object(obj)->head; \
  18. - ({ if(entry && !is_error(entry)) { \
  19. + ({ if(entry && entry != NULL) { \
  20. key = (char*)entry->k; \
  21. val = (struct json_object*)entry->v; \
  22. } ; entry; }); \
  23. @@ -667,7 +667,7 @@ static int parse_response_json(char *document, struct session *session)
  24. /* make global for now */
  25. store_session = session;
  26. - if (!is_error(jobj)) {
  27. + if (jobj != NULL) {
  28. /* guards against a json pre 0.10 bug */
  29. json_parse(jobj,0);
  30. }
  31. @@ -692,7 +692,7 @@ static void parse_timeline_json(char *document, struct session *session)
  32. /* make global for now */
  33. store_session = session;
  34. - if (!is_error(jobj)) {
  35. + if (jobj != NULL) {
  36. /* guards against a json pre 0.10 bug */
  37. if (json_object_get_type(jobj)==json_type_array) {
  38. json_parse_array(jobj, NULL, 0);
  39. --
  40. 2.15.1