[PATCH 2/2] wined3d: Print opcode names instead of enum values.

Józef Kucia joseph.kucia at gmail.com
Fri Dec 4 06:09:54 CST 2015


On Thu, Dec 3, 2015 at 4:48 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 3 December 2015 at 11:04, Józef Kucia <jkucia at codeweavers.com> wrote:
>> +const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
>> +{
>> +    if (handler_idx >= sizeof(shader_opcode_names) / sizeof(*shader_opcode_names))
>> +    {
>> +        FIXME("Unrecognized shader instruction handler %#x.\n", handler_idx);
>> +        return "UNRECOGNIZED";
> You can do something like "wine_dbg_sprintf("UNRECOGNIZED(%#x)",
> handler_idx);" and have it print the handler_idx. (See also e.g.
> debug_d3dstate().) Note that we could also move this to utils.c, not
> sure if that's worth it.
>

I agree that wine_dbg_sprintf is probably better. However this code
should never be executed unless something is very wrong.



More information about the wine-devel mailing list