From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8bqf-0002w4-7g for qemu-devel@nongnu.org; Tue, 06 Jan 2015 16:39:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8bqa-0004z6-J5 for qemu-devel@nongnu.org; Tue, 06 Jan 2015 16:39:33 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41881 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8bqa-0004yv-CQ for qemu-devel@nongnu.org; Tue, 06 Jan 2015 16:39:28 -0500 Message-ID: <54AC560E.6050900@suse.de> Date: Tue, 06 Jan 2015 22:39:26 +0100 From: Alexander Graf MIME-Version: 1.0 References: <1419604968-87437-1-git-send-email-agraf@suse.de> <1419604968-87437-2-git-send-email-agraf@suse.de> <54AC023D.80501@redhat.com> In-Reply-To: <54AC023D.80501@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/5] QJSON: Add JSON writer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, pbonzini@redhat.com, afaerber@suse.de, quintela@redhat.com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06.01.15 16:41, Eric Blake wrote: > On 12/26/2014 07:42 AM, Alexander Graf wrote: >> To support programmatic JSON assembly while keeping the code that >> generates it readable, this patch introduces a simple JSON >> writer. It emits JSON serially into a buffer in memory. >> >> The nice thing about this writer is its simplicity and low memory >> overhead. Unlike the QMP JSON writer, this one does not need to >> spawn QObjects for every element it wants to represent. >> >> This is a prerequisite for the migration stream format >> description generator. >> >> Signed-off-by: Alexander Graf --- Makefile.objs >> | 1 + include/qjson.h | 28 +++++++++++++++++ qjson.c | >> 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 >> files changed, 126 insertions(+) create mode 100644 >> include/qjson.h create mode 100644 qjson.c > >> +struct QJSON { + QString *str; + bool omit_comma; + >> unsigned long self_size_offset; > > Would size_t be smarter for this field? Turns out the smartest thing to do is to remove the field - it was unused :). Btw, thanks a lot for the review! Alex -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJUrFYOAAoJECszeR4D/txgCFgP/0r29Xbr/5Ly0MJsP2TN9VcK NKSL31izigBmQ60Z6cf8sTzqPwZ0mgrFEUBelqz102dWu2DXe+DHa0Uel15/Gxd2 ZR8RVtY86mIvSfdARGShF+pzcUdzMUKlliYbagQglb9zHnnRkYR0VtXy6G1CQczq lzQDZT0OW9m75+/PPC2V1/g8aWYZbgODI0w+CKEFQM8znhq3qVqiFcRx3HuLHwch 8FiuLYen4XzGjOZDj2oLyU8Aescwkdot4AkfAgf63TJmN2zyhXZQy6BFuJOfoYJK 5no4k7xNvjHX83fx9cT0RdQ6fZzfF/NcRKNlMdJmoi+0dDe87mzahR4Yufs0X+ir xPIRKXuQWSSJgroboHVQOAlg0IYNdYn5Km3JK8Jx9yBnl6Me0Ow5P6oI0ZAeorWF vzf395oFq6m29uaMUtmyMfk8dL023xJYIbYr2euoP0gipVvWAKKnBpWc4nWVrq3y 6SnlMbzyA5mb4I0iHGyaQp4WGvFFA/uwW8k+Xz5KpMJgQQoIrtvDaUw0E3f+YHGC x2/a3FLmxhDAYIBfKlSBWpejG5OuIT6Af5t5xvDO45B+izGVm3WPctEYVkkYTSeq jaqDpkdBZY8HxG+oYnJzH8wxPSELLM61PqYZyrDTMPdzepthepYgXCSWTFmBMZD7 OhJSkVksn4Khk0x7l1gy =5f/z -----END PGP SIGNATURE-----