[AD] Re: r5642 - allegro/branches/4.2/src/win

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, 2006-01-02 at 02:39 -0500, tjaden wrote:
> -   for (i = 0; i < 256; i++) {
> -      for (j = 0; j < 256; j++) {
> -         if (hw_to_mycode[j] == i) {
> -            reverse_mapping[i] = j;
> -            break;
> -         }
> +
> +   for (j = 0; j < 256; j++) {
> +      i = hw_to_mycode[j];
> +      if (i > 0) {
> +         ASSERT(i < sizeof reverse_mapping/sizeof reverse_mapping[0]);
> +         reverse_mapping[i] = j;

Oh my god, thanks for spotting this. Let's just claim I had coded the
original version after lots of sleep deprivation :)

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/