qlit.c (3cf42b8b3af1bd61e736a9ca0f94806c7931ae56) | qlit.c (7dc847ebba953db90853d15f140c20eef74d4fb2) |
---|---|
1/* 2 * QLit literal qobject 3 * 4 * Copyright IBM, Corp. 2009 5 * Copyright (c) 2013, 2015, 2017 Red Hat Inc. 6 * 7 * Authors: 8 * Anthony Liguori <aliguori@us.ibm.com> --- 55 unchanged lines hidden (view full) --- 64bool qlit_equal_qobject(const QLitObject *lhs, const QObject *rhs) 65{ 66 if (!rhs || lhs->type != qobject_type(rhs)) { 67 return false; 68 } 69 70 switch (lhs->type) { 71 case QTYPE_QBOOL: | 1/* 2 * QLit literal qobject 3 * 4 * Copyright IBM, Corp. 2009 5 * Copyright (c) 2013, 2015, 2017 Red Hat Inc. 6 * 7 * Authors: 8 * Anthony Liguori <aliguori@us.ibm.com> --- 55 unchanged lines hidden (view full) --- 64bool qlit_equal_qobject(const QLitObject *lhs, const QObject *rhs) 65{ 66 if (!rhs || lhs->type != qobject_type(rhs)) { 67 return false; 68 } 69 70 switch (lhs->type) { 71 case QTYPE_QBOOL: |
72 return lhs->value.qbool == qbool_get_bool(qobject_to_qbool(rhs)); | 72 return lhs->value.qbool == qbool_get_bool(qobject_to(QBool, rhs)); |
73 case QTYPE_QNUM: | 73 case QTYPE_QNUM: |
74 return lhs->value.qnum == qnum_get_int(qobject_to_qnum(rhs)); | 74 return lhs->value.qnum == qnum_get_int(qobject_to(QNum, rhs)); |
75 case QTYPE_QSTRING: 76 return (strcmp(lhs->value.qstr, | 75 case QTYPE_QSTRING: 76 return (strcmp(lhs->value.qstr, |
77 qstring_get_str(qobject_to_qstring(rhs))) == 0); | 77 qstring_get_str(qobject_to(QString, rhs))) == 0); |
78 case QTYPE_QDICT: | 78 case QTYPE_QDICT: |
79 return qlit_equal_qdict(lhs, qobject_to_qdict(rhs)); | 79 return qlit_equal_qdict(lhs, qobject_to(QDict, rhs)); |
80 case QTYPE_QLIST: | 80 case QTYPE_QLIST: |
81 return qlit_equal_qlist(lhs, qobject_to_qlist(rhs)); | 81 return qlit_equal_qlist(lhs, qobject_to(QList, rhs)); |
82 case QTYPE_QNULL: 83 return true; 84 default: 85 break; 86 } 87 88 return false; 89} --- 36 unchanged lines hidden --- | 82 case QTYPE_QNULL: 83 return true; 84 default: 85 break; 86 } 87 88 return false; 89} --- 36 unchanged lines hidden --- |