Greg Bellows <[email protected]> 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 <[email protected]>
> ---
>  android-commands.h |  7 +++++++
>  android-console.c  | 26 ++++++++++++++++++++++++++
>  android-console.h  |  1 +
>  3 files changed, 34 insertions(+)
>
<snip>
>  
> +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

Reply via email to