From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sel9W-0003zF-3E for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sel9P-0008OI-VP for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:50:17 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:63498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sel9P-0008O2-Md for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:50:11 -0400 Received: by dalh21 with SMTP id h21so933378dal.34 for ; Wed, 13 Jun 2012 03:50:09 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FD8705C.2010503@redhat.com> Date: Wed, 13 Jun 2012 12:50:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1339575768-2557-1-git-send-email-lersek@redhat.com> <1339575768-2557-6-git-send-email-lersek@redhat.com> In-Reply-To: <1339575768-2557-6-git-send-email-lersek@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org Il 13/06/2012 10:22, Laszlo Ersek ha scritto: > +static void > +opts_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) > +{ > + OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v); > + const QemuOpt *opt; > + const char *str; > + > + opt = lookup_scalar(ov, name, errp); > + if (!opt) { > + return; > + } > + > + str = opt->str; > + if (str != NULL) { > + while (isspace((unsigned char)*str)) { > + ++str; > + } > + > + if (*str != '-' && *str != '\0') { > + unsigned long long val; > + char *endptr; > + > + /* non-empty, non-negative subject sequence */ > + errno = 0; > + val = strtoull(str, &endptr, 0); > + if (*endptr == '\0' && errno == 0 && val <= UINT64_MAX) { I would have expected a warning from GCC here, but obviously that's not the case? Reviewed-by: Paolo Bonzini