Attention is currently required from: Thomas Heijligen.
Stefan Reinauer has uploaded this change for review.
Hook up mjson into build system
Simple compile fixes, and enable debugging
Change-Id: I714b35f7c869932924ff50c505ad39cf88cf3950
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
---
M Makefile
M meson.build
M mjson.c
M mjson.h
4 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/75648/1
diff --git a/Makefile b/Makefile
index da5203e..94f084f 100644
--- a/Makefile
+++ b/Makefile
@@ -384,7 +384,7 @@
CHIP_OBJS = jedec.o printlock.o stm50.o w39.o w29ee011.o \
sst28sf040.o 82802ab.o \
- sst49lfxxxc.o sst_fwhub.o edi.o flashchips.o spi.o spi25.o spi25_statusreg.o \
+ sst49lfxxxc.o sst_fwhub.o edi.o mjson.o flashchips.o spi.o spi25.o spi25_statusreg.o \
spi95.o opaque.o sfdp.o en29lv640b.o at45db.o s25f.o \
writeprotect.o writeprotect_ranges.o
diff --git a/meson.build b/meson.build
index 18359db..f9b0bc0 100644
--- a/meson.build
+++ b/meson.build
@@ -73,6 +73,7 @@
'edi.c',
'en29lv640b.c',
'erasure_layout.c',
+ 'mjson.c',
'flashchips.c',
'flashrom.c',
'fmap.c',
diff --git a/mjson.c b/mjson.c
index ddb30d6..4a230d7 100644
--- a/mjson.c
+++ b/mjson.c
@@ -190,7 +190,7 @@
in_escape, in_val_token, post_val, post_element
} state = 0;
#ifdef DEBUG_ENABLE
- char *statenames[] = {
+ const char *statenames[] = {
"init", "await_attr", "in_attr", "await_value", "in_val_string",
"in_escape", "in_val_token", "post_val", "post_element",
};
@@ -750,6 +750,8 @@
else
++cp;
break;
+#else
+ case t_time:
#endif /* TIME_ENABLE */
case t_real:
arr->arr.reals.store[offset] = strtod(cp, &ep);
diff --git a/mjson.h b/mjson.h
index dd36e15..ac3da1a 100644
--- a/mjson.h
+++ b/mjson.h
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-2-clause
*/
+#define DEBUG_ENABLE
+
#include <stdbool.h>
#include <stdio.h>
#include <ctype.h>
@@ -20,7 +22,7 @@
json_type;
struct json_enum_t {
- char *name;
+ const char *name;
int value;
};
@@ -60,7 +62,7 @@
};
struct json_attr_t {
- char *attribute;
+ const char *attribute;
json_type type;
union {
int *integer;
To view, visit change 75648. To unsubscribe, or for help writing mail filters, visit settings.