diff options
author | Markus Armbruster | 2020-12-11 18:11:52 +0100 |
---|---|---|
committer | Markus Armbruster | 2020-12-19 10:39:41 +0100 |
commit | 4ac76ba414ecb94f086d73621775d8b38b6f0a43 (patch) | |
tree | 14a3da0ae64a62bcbe23d122e34b750902284b27 /include | |
parent | block: Use GString instead of QString to build filenames (diff) | |
download | qemu-4ac76ba414ecb94f086d73621775d8b38b6f0a43.tar.gz qemu-4ac76ba414ecb94f086d73621775d8b38b6f0a43.tar.xz qemu-4ac76ba414ecb94f086d73621775d8b38b6f0a43.zip |
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')
-rw-r--r-- | include/qapi/qmp/qstring.h | 8 |
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 */ |