On 01/09/2016 06:50 AM, Eric Blake wrote:
On 01/08/2016 01:37 AM, Cao jin wrote:
buf[rc] = 0;
rc = qemu_strtoul(buf, &endptr, base, &value);
Do you still need a local 'value' variable, or can you just reuse pvalue
here?
I guess so, or else it won`t compile, because, *pvalue* is int*, *value* is
unsigned long*, and qemu_strtoul() require a unsigned long* for the last
param.
And I guess that is why author use a local 'value'. I just want to make
the patch
small for the reviewer, so I reuse most of original code.
but yes, maybe it can be:
rc = qemu_strtoul(buf, &endptr, base, (unsigned long *)pvalue);
--
Yours Sincerely,
Cao jin