On Sat, Mar 31, 2012 at 01:47:18AM +0300, Paul Irofti wrote:
> After the report from a few weeks ago I went ahead and fixed most (if
> not all) of the signed integer usages in the AML parser.
>
> Please have a look at this diff, test it thoroughly and comment/okay it.
Some comments inline.
> +_aml_setvalue(struct aml_value *lhs, int type, u_int64_t ival, const void
> *bval)
> {
> memset(&lhs->_, 0x0, sizeof(lhs->_));
>
> @@ -923,7 +920,7 @@ _aml_setvalue(struct aml_value *lhs, int
> memcpy(lhs->v_buffer, bval, ival);
> break;
> case AML_OBJTYPE_STRING:
> - if (ival == -1)
> + if ((signed)ival == -1)
Very a-typical way of doing this. Better cast the constant to the
target type, that's the comon idiom. (signed) is a shorthand for
(signed int) and not (the signed variant of the type). It is very
uncommon to use it.
-Otto