From patchwork Mon Feb 11 16:41:53 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: 219637 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 ED8CE2C02CC for ; Tue, 12 Feb 2013 03:42:23 +1100 (EST) Received: from localhost ([::1]:51136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4wST-00062v-OS for incoming@patchwork.ozlabs.org; Mon, 11 Feb 2013 11:42:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4wSB-00061d-Oq for qemu-devel@nongnu.org; Mon, 11 Feb 2013 11:42:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4wSA-0006ca-0i for qemu-devel@nongnu.org; Mon, 11 Feb 2013 11:42:03 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39461 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4wS9-0006cM-RV for qemu-devel@nongnu.org; Mon, 11 Feb 2013 11:42:01 -0500 Received: from relay2.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 5983CA3A49; Mon, 11 Feb 2013 17:42:01 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2013 17:41:53 +0100 Message-Id: <1360600914-5448-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360600914-5448-1-git-send-email-afaerber@suse.de> References: <1360600914-5448-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 RESEND v2 1/2] 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) {