Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] Cast input argument for json_object_add_value_int to long long
@ 2014-06-24 22:59 Puthikorn Voravootivat
  2014-06-25  1:31 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Puthikorn Voravootivat @ 2014-06-24 22:59 UTC (permalink / raw)
  To: Jens Axboe; +Cc: FIO List, Gwendal Grignou, Puthikorn Voravootivat

The latency related (and some other) variables type is uint32_t
but the JSON integer type is long long. So we need to cast
the numbers to long long type to make JSON output correctly.

Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
---
Found this bug when test on arm. Fix may be a little hacky.
Feel free to change to better idea.
 json.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/json.h b/json.h
index 081afd6..962c11c 100644
--- a/json.h
+++ b/json.h
@@ -52,7 +52,7 @@ void json_free_object(struct json_object *obj);
 
 int json_object_add_value_type(struct json_object *obj, const char *name, int type, ...);
 #define json_object_add_value_int(obj, name, val) \
-	json_object_add_value_type((obj), name, JSON_TYPE_INTEGER, (val))
+	json_object_add_value_type((obj), name, JSON_TYPE_INTEGER, (long long) (val))
 #define json_object_add_value_float(obj, name, val) \
 	json_object_add_value_type((obj), name, JSON_TYPE_FLOAT, (val))
 #define json_object_add_value_string(obj, name, val) \
-- 
2.0.0.526.g5318336



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-25  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 22:59 [PATCH] Cast input argument for json_object_add_value_int to long long Puthikorn Voravootivat
2014-06-25  1:31 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox