From patchwork Wed Feb 6 18:33:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 218717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0C83F2C02C3 for ; Thu, 7 Feb 2013 05:47:37 +1100 (EST) Received: from localhost ([::1]:42421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3A1v-00060Z-8L for incoming@patchwork.ozlabs.org; Wed, 06 Feb 2013 13:47:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3A1n-00060G-8x for qemu-devel@nongnu.org; Wed, 06 Feb 2013 13:47:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3A1m-0008Iy-Aa for qemu-devel@nongnu.org; Wed, 06 Feb 2013 13:47:27 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54041 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U39pA-0004V6-VX for qemu-devel@nongnu.org; Wed, 06 Feb 2013 13:34:25 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 7C355A3B99; Wed, 6 Feb 2013 19:33:43 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 6 Feb 2013 19:33:26 +0100 Message-Id: <1360175610-8992-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360175610-8992-1-git-send-email-afaerber@suse.de> References: <1360175610-8992-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Subject: [Qemu-devel] [PATCH for-1.4 v2 1/5] qtest: Use strtoull() for uint64_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 32-bit hosts, unsigned long may be uint32_t and uint64_t may be unsigned long long. Account for this by always using strtoull(). We were already using strtoll() for int64_t. Signed-off-by: Andreas Färber Reviewed-by: Anthony Liguori --- qtest.c | 8 ++++---- 1 Datei geändert, 4 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-) diff --git a/qtest.c b/qtest.c index b7a3821..4663a38 100644 --- a/qtest.c +++ b/qtest.c @@ -282,8 +282,8 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) uint8_t *data; g_assert(words[1] && words[2]); - addr = strtoul(words[1], NULL, 0); - len = strtoul(words[2], NULL, 0); + addr = strtoull(words[1], NULL, 0); + len = strtoull(words[2], NULL, 0); data = g_malloc(len); cpu_physical_memory_read(addr, data, len); @@ -302,8 +302,8 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) size_t data_len; g_assert(words[1] && words[2] && words[3]); - addr = strtoul(words[1], NULL, 0); - len = strtoul(words[2], NULL, 0); + addr = strtoull(words[1], NULL, 0); + len = strtoull(words[2], NULL, 0); data_len = strlen(words[3]); if (data_len < 3) {