[PATCH vkd3d v3 2/4] vkd3d-shader: Implement basic support for #if and #endif.

Zebediah Figura (she/her) zfigura at codeweavers.com
Mon Dec 21 14:28:14 CST 2020


On 12/21/20 3:11 AM, Matteo Bruni wrote:
> Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
> ---
> Apparently I never got the email so I'm adding a couple of comments
> right here...
> 
> preproc_was_writing() manages to trigger my review alarms every
> time. The function is definitely correct though, and clearly so after
> patch 4/4. So nothing to do but ignore the alarm.

Yeah, I know :-/

I'm not sure there's a better option though, besides crawling the whole
stack in preproc_is_writing(). Granted, that may not be awful for
performance (who's going to stack that many #ifs?)

> 
> +static uint32_t preproc_parse_integer(const char *s)
> +{
> +    uint32_t base = 10, ret = 0;
> +    int digit;
> +
> +    if (s[0] == '0')
> +    {
> +        base = 8;
> 
> I'd "++s;" here
> 
> +        if (s[1] == 'x' || s[1] == 'X')
> +        {
> +            base = 16;
> +            s += 2;
> 
> And then replace this one with another "++s;" (fixing up the if
> condition above to now check *s).
> 
> +        }
> +    }
> +
> +    while ((digit = char_to_int(*s++)) >= 0)
> +        ret = ret * base + (uint32_t)digit;
> +    return ret;
> +}
> 
> AFAICS this should still work. It's all just a nitpick, it doesn't
> really matter.
> 

Sounds reasonable; I'll adjust that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x0D9D358A07A17840.asc
Type: application/pgp-keys
Size: 1769 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20201221/0c663fd1/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20201221/0c663fd1/attachment.sig>


More information about the wine-devel mailing list