Re: [PATCH] d3dcompiler: Add a LUT to find compilation targets info. (try 3)
Christian Costa <titan.costa(a)gmail.com> writes:
- if (strlen(target) != 6 || target[1] != 's' || target[2] != '_' || target[4] != '_') + for (i = 0; i < nb_targets; i++) { - FIXME("Unknown compilation target %s.\n", debugstr_a(target)); - return D3DERR_INVALIDCALL; + if (!strcmp(target, targets_info[i].name) || + (targets_info[i].altname && !strcmp(target, targets_info[i].altname)))
A binary search would be much better. -- Alexandre Julliard julliard(a)winehq.org
Le 10/05/2013 16:37, Alexandre Julliard a écrit :
Christian Costa <titan.costa(a)gmail.com> writes:
- if (strlen(target) != 6 || target[1] != 's' || target[2] != '_' || target[4] != '_') + for (i = 0; i < nb_targets; i++) { - FIXME("Unknown compilation target %s.\n", debugstr_a(target)); - return D3DERR_INVALIDCALL; + if (!strcmp(target, targets_info[i].name) || + (targets_info[i].altname && !strcmp(target, targets_info[i].altname))) A binary search would be much better.
Isn't the array a bit small for that? I can do it but in that case alternate names will be entries like others.
participants (2)
-
Alexandre Julliard -
Christian Costa