aboutsummaryrefslogtreecommitdiff
path: root/include/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-12-11 18:11:52 +0100
committerMarkus Armbruster <armbru@redhat.com>2020-12-19 10:39:41 +0100
commit4ac76ba414ecb94f086d73621775d8b38b6f0a43 (patch)
tree14a3da0ae64a62bcbe23d122e34b750902284b27 /include/qapi
parent18cf67c5e1d6e23042b752831aa6f9e4e478787b (diff)
qobject: Make QString immutable
The functions to modify a QString's string are all unused now. Drop them, and make the string immutable. Saves 16 bytes per QString on my system. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-21-armbru@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r--include/qapi/qmp/qstring.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h
index 53567db6c0..1d8ba46936 100644
--- a/include/qapi/qmp/qstring.h
+++ b/include/qapi/qmp/qstring.h
@@ -17,19 +17,13 @@
struct QString {
struct QObjectBase_ base;
- char *string;
- size_t length;
- size_t capacity;
+ const char *string;
};
QString *qstring_new(void);
QString *qstring_from_str(const char *str);
QString *qstring_from_substr(const char *str, size_t start, size_t end);
QString *qstring_from_gstring(GString *gstr);
-size_t qstring_get_length(const QString *qstring);
const char *qstring_get_str(const QString *qstring);
-void qstring_append_int(QString *qstring, int64_t value);
-void qstring_append(QString *qstring, const char *str);
-void qstring_append_chr(QString *qstring, int c);
#endif /* QSTRING_H */