From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XorTQ-0004uY-SP for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:18:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XorTJ-0004Yk-FQ for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:17:56 -0500 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:39355 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XorTJ-0004Yg-9k for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:17:49 -0500 References: <1415751963-4081-1-git-send-email-greg.bellows@linaro.org> <1415751963-4081-16-git-send-email-greg.bellows@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1415751963-4081-16-git-send-email-greg.bellows@linaro.org> Date: Thu, 13 Nov 2014 10:17:48 +0000 Message-ID: <87ppcrh0ab.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v1 15/15] android-console: Add power capacity command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Bellows Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, christoffer.dall@linaro.org Greg Bellows writes: > Add the Android emulator console "power capacity" command along associated help > messages. The "capacity" command allows the battery capacity of the device to > be manipulated. > > Signed-off-by: Greg Bellows > --- > android-commands.h | 7 +++++++ > android-console.c | 26 ++++++++++++++++++++++++++ > android-console.h | 1 + > 3 files changed, 34 insertions(+) > > > +void android_console_power_capacity(Monitor *mon, const QDict *qdict) > +{ > + const char *arg = qdict_get_try_str(qdict, "arg"); > + > + if (arg) { > + int capacity; > + > + if (sscanf(arg, "%d", &capacity) == 1 && > + capacity >= 0 && capacity <= 100) { > + goldfish_battery_set_prop(0, POWER_SUPPLY_PROP_CAPACITY, capacity); > + return; > + } Has the formatting of const/if (arg) gone off there? -- Alex Bennée