Skip to content

Commit 082696e

Browse files
elmarcoMarkus Armbruster
authored and
Markus Armbruster
committed
qlit: use QLit prefix consistently
Rename from LiteralQ to QLit. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-4-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
1 parent 28035bc commit 082696e

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

include/qapi/qmp/qlit.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@
1717
#include "qapi-types.h"
1818
#include "qobject.h"
1919

20-
typedef struct LiteralQDictEntry LiteralQDictEntry;
21-
typedef struct LiteralQObject LiteralQObject;
20+
typedef struct QLitDictEntry QLitDictEntry;
21+
typedef struct QLitObject QLitObject;
2222

23-
struct LiteralQObject {
23+
struct QLitObject {
2424
int type;
2525
union {
2626
int64_t qnum;
2727
const char *qstr;
28-
LiteralQDictEntry *qdict;
29-
LiteralQObject *qlist;
28+
QLitDictEntry *qdict;
29+
QLitObject *qlist;
3030
} value;
3131
};
3232

33-
struct LiteralQDictEntry {
33+
struct QLitDictEntry {
3434
const char *key;
35-
LiteralQObject value;
35+
QLitObject value;
3636
};
3737

3838
#define QLIT_QNUM(val) \
39-
(LiteralQObject){.type = QTYPE_QNUM, .value.qnum = (val)}
39+
(QLitObject){.type = QTYPE_QNUM, .value.qnum = (val)}
4040
#define QLIT_QSTR(val) \
41-
(LiteralQObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
41+
(QLitObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
4242
#define QLIT_QDICT(val) \
43-
(LiteralQObject){.type = QTYPE_QDICT, .value.qdict = (val)}
43+
(QLitObject){.type = QTYPE_QDICT, .value.qdict = (val)}
4444
#define QLIT_QLIST(val) \
45-
(LiteralQObject){.type = QTYPE_QLIST, .value.qlist = (val)}
45+
(QLitObject){.type = QTYPE_QLIST, .value.qlist = (val)}
4646

47-
int compare_litqobj_to_qobj(LiteralQObject *lhs, QObject *rhs);
47+
int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
4848

4949
#endif /* QLIT_H */

qobject/qlit.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
typedef struct QListCompareHelper {
2222
int index;
23-
LiteralQObject *objs;
23+
QLitObject *objs;
2424
int result;
2525
} QListCompareHelper;
2626

@@ -41,7 +41,7 @@ static void compare_helper(QObject *obj, void *opaque)
4141
compare_litqobj_to_qobj(&helper->objs[helper->index++], obj);
4242
}
4343

44-
int compare_litqobj_to_qobj(LiteralQObject *lhs, QObject *rhs)
44+
int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs)
4545
{
4646
int64_t val;
4747

tests/check-qjson.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -1065,23 +1065,23 @@ static void simple_dict(void)
10651065
int i;
10661066
struct {
10671067
const char *encoded;
1068-
LiteralQObject decoded;
1068+
QLitObject decoded;
10691069
} test_cases[] = {
10701070
{
10711071
.encoded = "{\"foo\": 42, \"bar\": \"hello world\"}",
1072-
.decoded = QLIT_QDICT(((LiteralQDictEntry[]){
1072+
.decoded = QLIT_QDICT(((QLitDictEntry[]){
10731073
{ "foo", QLIT_QNUM(42) },
10741074
{ "bar", QLIT_QSTR("hello world") },
10751075
{ }
10761076
})),
10771077
}, {
10781078
.encoded = "{}",
1079-
.decoded = QLIT_QDICT(((LiteralQDictEntry[]){
1079+
.decoded = QLIT_QDICT(((QLitDictEntry[]){
10801080
{ }
10811081
})),
10821082
}, {
10831083
.encoded = "{\"foo\": 43}",
1084-
.decoded = QLIT_QDICT(((LiteralQDictEntry[]){
1084+
.decoded = QLIT_QDICT(((QLitDictEntry[]){
10851085
{ "foo", QLIT_QNUM(43) },
10861086
{ }
10871087
})),
@@ -1163,33 +1163,33 @@ static void simple_list(void)
11631163
int i;
11641164
struct {
11651165
const char *encoded;
1166-
LiteralQObject decoded;
1166+
QLitObject decoded;
11671167
} test_cases[] = {
11681168
{
11691169
.encoded = "[43,42]",
1170-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1170+
.decoded = QLIT_QLIST(((QLitObject[]){
11711171
QLIT_QNUM(43),
11721172
QLIT_QNUM(42),
11731173
{ }
11741174
})),
11751175
},
11761176
{
11771177
.encoded = "[43]",
1178-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1178+
.decoded = QLIT_QLIST(((QLitObject[]){
11791179
QLIT_QNUM(43),
11801180
{ }
11811181
})),
11821182
},
11831183
{
11841184
.encoded = "[]",
1185-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1185+
.decoded = QLIT_QLIST(((QLitObject[]){
11861186
{ }
11871187
})),
11881188
},
11891189
{
11901190
.encoded = "[{}]",
1191-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1192-
QLIT_QDICT(((LiteralQDictEntry[]){
1191+
.decoded = QLIT_QLIST(((QLitObject[]){
1192+
QLIT_QDICT(((QLitDictEntry[]){
11931193
{},
11941194
})),
11951195
{},
@@ -1220,38 +1220,38 @@ static void simple_whitespace(void)
12201220
int i;
12211221
struct {
12221222
const char *encoded;
1223-
LiteralQObject decoded;
1223+
QLitObject decoded;
12241224
} test_cases[] = {
12251225
{
12261226
.encoded = " [ 43 , 42 ]",
1227-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1227+
.decoded = QLIT_QLIST(((QLitObject[]){
12281228
QLIT_QNUM(43),
12291229
QLIT_QNUM(42),
12301230
{ }
12311231
})),
12321232
},
12331233
{
12341234
.encoded = " [ 43 , { 'h' : 'b' }, [ ], 42 ]",
1235-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1235+
.decoded = QLIT_QLIST(((QLitObject[]){
12361236
QLIT_QNUM(43),
1237-
QLIT_QDICT(((LiteralQDictEntry[]){
1237+
QLIT_QDICT(((QLitDictEntry[]){
12381238
{ "h", QLIT_QSTR("b") },
12391239
{ }})),
1240-
QLIT_QLIST(((LiteralQObject[]){
1240+
QLIT_QLIST(((QLitObject[]){
12411241
{ }})),
12421242
QLIT_QNUM(42),
12431243
{ }
12441244
})),
12451245
},
12461246
{
12471247
.encoded = " [ 43 , { 'h' : 'b' , 'a' : 32 }, [ ], 42 ]",
1248-
.decoded = QLIT_QLIST(((LiteralQObject[]){
1248+
.decoded = QLIT_QLIST(((QLitObject[]){
12491249
QLIT_QNUM(43),
1250-
QLIT_QDICT(((LiteralQDictEntry[]){
1250+
QLIT_QDICT(((QLitDictEntry[]){
12511251
{ "h", QLIT_QSTR("b") },
12521252
{ "a", QLIT_QNUM(32) },
12531253
{ }})),
1254-
QLIT_QLIST(((LiteralQObject[]){
1254+
QLIT_QLIST(((QLitObject[]){
12551255
{ }})),
12561256
QLIT_QNUM(42),
12571257
{ }
@@ -1282,10 +1282,10 @@ static void simple_varargs(void)
12821282
{
12831283
QObject *embedded_obj;
12841284
QObject *obj;
1285-
LiteralQObject decoded = QLIT_QLIST(((LiteralQObject[]){
1285+
QLitObject decoded = QLIT_QLIST(((QLitObject[]){
12861286
QLIT_QNUM(1),
12871287
QLIT_QNUM(2),
1288-
QLIT_QLIST(((LiteralQObject[]){
1288+
QLIT_QLIST(((QLitObject[]){
12891289
QLIT_QNUM(32),
12901290
QLIT_QNUM(42),
12911291
{}})),

0 commit comments

Comments
 (0)