[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 06/47] qlit: use QLit prefix consistently
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL v2 06/47] qlit: use QLit prefix consistently |
Date: |
Fri, 1 Sep 2017 17:37:17 +0200 |
From: Marc-André Lureau <address@hidden>
Rename from LiteralQ to QLit.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
include/qapi/qmp/qlit.h | 24 ++++++++++++------------
qobject/qlit.c | 4 ++--
tests/check-qjson.c | 40 ++++++++++++++++++++--------------------
3 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
index 280db5064a..a4ad91321b 100644
--- a/include/qapi/qmp/qlit.h
+++ b/include/qapi/qmp/qlit.h
@@ -17,33 +17,33 @@
#include "qapi-types.h"
#include "qobject.h"
-typedef struct LiteralQDictEntry LiteralQDictEntry;
-typedef struct LiteralQObject LiteralQObject;
+typedef struct QLitDictEntry QLitDictEntry;
+typedef struct QLitObject QLitObject;
-struct LiteralQObject {
+struct QLitObject {
int type;
union {
int64_t qnum;
const char *qstr;
- LiteralQDictEntry *qdict;
- LiteralQObject *qlist;
+ QLitDictEntry *qdict;
+ QLitObject *qlist;
} value;
};
-struct LiteralQDictEntry {
+struct QLitDictEntry {
const char *key;
- LiteralQObject value;
+ QLitObject value;
};
#define QLIT_QNUM(val) \
- (LiteralQObject){.type = QTYPE_QNUM, .value.qnum = (val)}
+ (QLitObject){.type = QTYPE_QNUM, .value.qnum = (val)}
#define QLIT_QSTR(val) \
- (LiteralQObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
+ (QLitObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
#define QLIT_QDICT(val) \
- (LiteralQObject){.type = QTYPE_QDICT, .value.qdict = (val)}
+ (QLitObject){.type = QTYPE_QDICT, .value.qdict = (val)}
#define QLIT_QLIST(val) \
- (LiteralQObject){.type = QTYPE_QLIST, .value.qlist = (val)}
+ (QLitObject){.type = QTYPE_QLIST, .value.qlist = (val)}
-int compare_litqobj_to_qobj(LiteralQObject *lhs, QObject *rhs);
+int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
#endif /* QLIT_H */
diff --git a/qobject/qlit.c b/qobject/qlit.c
index 5917c3584e..262d64988d 100644
--- a/qobject/qlit.c
+++ b/qobject/qlit.c
@@ -20,7 +20,7 @@
typedef struct QListCompareHelper {
int index;
- LiteralQObject *objs;
+ QLitObject *objs;
int result;
} QListCompareHelper;
@@ -41,7 +41,7 @@ static void compare_helper(QObject *obj, void *opaque)
compare_litqobj_to_qobj(&helper->objs[helper->index++], obj);
}
-int compare_litqobj_to_qobj(LiteralQObject *lhs, QObject *rhs)
+int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs)
{
int64_t val;
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 525f79e60b..82b3681327 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -1065,23 +1065,23 @@ static void simple_dict(void)
int i;
struct {
const char *encoded;
- LiteralQObject decoded;
+ QLitObject decoded;
} test_cases[] = {
{
.encoded = "{\"foo\": 42, \"bar\": \"hello world\"}",
- .decoded = QLIT_QDICT(((LiteralQDictEntry[]){
+ .decoded = QLIT_QDICT(((QLitDictEntry[]){
{ "foo", QLIT_QNUM(42) },
{ "bar", QLIT_QSTR("hello world") },
{ }
})),
}, {
.encoded = "{}",
- .decoded = QLIT_QDICT(((LiteralQDictEntry[]){
+ .decoded = QLIT_QDICT(((QLitDictEntry[]){
{ }
})),
}, {
.encoded = "{\"foo\": 43}",
- .decoded = QLIT_QDICT(((LiteralQDictEntry[]){
+ .decoded = QLIT_QDICT(((QLitDictEntry[]){
{ "foo", QLIT_QNUM(43) },
{ }
})),
@@ -1163,11 +1163,11 @@ static void simple_list(void)
int i;
struct {
const char *encoded;
- LiteralQObject decoded;
+ QLitObject decoded;
} test_cases[] = {
{
.encoded = "[43,42]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(43),
QLIT_QNUM(42),
{ }
@@ -1175,21 +1175,21 @@ static void simple_list(void)
},
{
.encoded = "[43]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(43),
{ }
})),
},
{
.encoded = "[]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
{ }
})),
},
{
.encoded = "[{}]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
- QLIT_QDICT(((LiteralQDictEntry[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
+ QLIT_QDICT(((QLitDictEntry[]){
{},
})),
{},
@@ -1220,11 +1220,11 @@ static void simple_whitespace(void)
int i;
struct {
const char *encoded;
- LiteralQObject decoded;
+ QLitObject decoded;
} test_cases[] = {
{
.encoded = " [ 43 , 42 ]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(43),
QLIT_QNUM(42),
{ }
@@ -1232,12 +1232,12 @@ static void simple_whitespace(void)
},
{
.encoded = " [ 43 , { 'h' : 'b' }, [ ], 42 ]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(43),
- QLIT_QDICT(((LiteralQDictEntry[]){
+ QLIT_QDICT(((QLitDictEntry[]){
{ "h", QLIT_QSTR("b") },
{ }})),
- QLIT_QLIST(((LiteralQObject[]){
+ QLIT_QLIST(((QLitObject[]){
{ }})),
QLIT_QNUM(42),
{ }
@@ -1245,13 +1245,13 @@ static void simple_whitespace(void)
},
{
.encoded = " [ 43 , { 'h' : 'b' , 'a' : 32 }, [ ], 42 ]",
- .decoded = QLIT_QLIST(((LiteralQObject[]){
+ .decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(43),
- QLIT_QDICT(((LiteralQDictEntry[]){
+ QLIT_QDICT(((QLitDictEntry[]){
{ "h", QLIT_QSTR("b") },
{ "a", QLIT_QNUM(32) },
{ }})),
- QLIT_QLIST(((LiteralQObject[]){
+ QLIT_QLIST(((QLitObject[]){
{ }})),
QLIT_QNUM(42),
{ }
@@ -1282,10 +1282,10 @@ static void simple_varargs(void)
{
QObject *embedded_obj;
QObject *obj;
- LiteralQObject decoded = QLIT_QLIST(((LiteralQObject[]){
+ QLitObject decoded = QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(1),
QLIT_QNUM(2),
- QLIT_QLIST(((LiteralQObject[]){
+ QLIT_QLIST(((QLitObject[]){
QLIT_QNUM(32),
QLIT_QNUM(42),
{}})),
--
2.13.5
- [Qemu-devel] [PULL v2 13/47] tests/check-qlit: New, covering qobject/qlit.c, (continued)
- [Qemu-devel] [PULL v2 13/47] tests/check-qlit: New, covering qobject/qlit.c, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 28/47] qapi-schema: Fold event.json back into qapi-schema.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 26/47] qapi-schema: Collect TPM stuff in qapi/tpm.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 39/47] quorum: Use qapi_enum_parse() in quorum_open(), Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 25/47] qapi-schema: Collect transaction stuff in qapi/transaction.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 32/47] qapi: Update qapi-code-gen.txt examples to match current code, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 27/47] qapi-schema: Move block events from event.json to block.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 42/47] qapi: Avoid unnecessary use of enum lookup table's sentinel, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 06/47] qlit: use QLit prefix consistently,
Markus Armbruster <=
- [Qemu-devel] [PULL v2 29/47] qapi-schema: Make block-core.json self-contained, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 11/47] qlit: add QLIT_QNULL and QLIT_BOOL, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 16/47] qapi-schema: Document how generated documentation is ordered, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 31/47] qapi-schema: Improve section headings, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 41/47] qapi: Use qapi_enum_parse() in input_type_enum(), Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 15/47] qlit: Tighten QLit list vs QList comparison, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 45/47] qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup(), Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 47/47] qapi: drop the sentinel in enum array, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 21/47] qapi-schema: Collect char device stuff in qapi/char.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL v2 40/47] crypto: Use qapi_enum_parse() in qcrypto_block_luks_name_lookup(), Markus Armbruster, 2017/09/01