[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg s
From: |
Liviu Ionescu |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument |
Date: |
Thu, 7 May 2015 09:51:38 +0300 |
> On 06 May 2015, at 17:57, Leon Alrae <address@hidden> wrote:
>
> +static int add_semihosting_arg(const char *name, const char *val, void
> *opaque)
> +{
> + SemihostingConfig *s = opaque;
> + if (strcmp(name, "arg") == 0) {
> + s->argc++;
> + s->argv = g_realloc(s->argv, s->argc * sizeof(void *));
> + s->argv[s->argc - 1] = val;
> + }
> + return 0;
> +}
being done at init time probably it has no impact, but, as a matter of style, I
would avoid iterating realloc when the buffer size is actually known.
is it that difficult to count the "arg"s and correctly alloc the array?
regards,
Liviu
- [Qemu-devel] [PATCH 0/4] semihosting: clean up and add --semihosting-config arg, Leon Alrae, 2015/05/06
- [Qemu-devel] [PATCH 1/4] semihosting: remove semihosting_enabled declaration from sysemu.h, Leon Alrae, 2015/05/06
- [Qemu-devel] [PATCH 3/4] semihosting: create SemihostingConfig struct, Leon Alrae, 2015/05/06
- [Qemu-devel] [PATCH 2/4] semihosting: remove semihosting_target declaration from gdbstub.h, Leon Alrae, 2015/05/06
- [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Leon Alrae, 2015/05/06
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument,
Liviu Ionescu <=
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Leon Alrae, 2015/05/07
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Liviu Ionescu, 2015/05/07
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Leon Alrae, 2015/05/07
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Liviu Ionescu, 2015/05/07
- Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument, Leon Alrae, 2015/05/07
Re: [Qemu-devel] [PATCH 0/4] semihosting: clean up and add --semihosting-config arg, Liviu Ionescu, 2015/05/06