Hi John,
On Mon, Mar 23, 2026 at 12:01 AM John Naylor <johncnaylorls@gmail.com> wrote:
> It's not that bad that the hard-coded indexes are in two places, but
> it's also not necessary. I think "#define EAX 0 ...etc" is a fine,
> straightforward increase in readability compared to what we have now,
> and I don't see any downside. I suppose one argument in favor of the
> struct is that it avoids declaring variables of type
> array-of-4-unsigned in multiple places, but I think the array is fine,
> and adding a new typedef is additional cognitive friction.
Sounds good, lets do it that way - adjusted to use macros instead of a struct.
> Speaking of signedness, why is the array of ints sometimes signed and
> sometimes unsigned?
The signedness is a MSVC-ism - I think its reasonable for us to work
with unsigned integers in our code, and pass them by casting to
__cpuid/__cpuidex (the MSVC variants).
> + * Returns false if the CPUID leaf/subleaf is not supported.
>
> Okay, thanks. I'd suggest using "true if X is supported" or "true if X
> is supported, false otherwise" phrasing.
Yup, agreed, that reads better, adjusted.
See attached v13 with your feedback addressed in 0001 and 0005,
otherwise the same as before.
Thanks,
Lukas
--
Lukas Fittl