[ros-kernel] accelerator.c, loop bug?

Mark IJbema mark at ijbema.xs4all.nl
Mon Feb 2 00:00:26 CET 2004


Hi, i noticed something strange about accelerator.c. It contains a for
loop, however it has an increment at the end of the loop, which would
make me think that this was a while loop, not properly converted to
while. If not, shouldn't it just be i+=2 in the loop increment?

the code (last part of accelerator.c):

  for (i = 0; i < AcceleratorTable->Count; i++)
    {
      if (IntTranslateAccelerator(Window, Message->message, Message->wParam, Message->lParam,
                  AcceleratorTable->Table[i].fVirt, AcceleratorTable->Table[i].key,
                  AcceleratorTable->Table[i].cmd))
            {
                  ObDereferenceObject(WindowStation);
          DPRINT1("NtUserTranslateAccelerator(Window %x, Table %x, Message %p) = %i end\n",
            Window, Table, Message, 1);
          return 1;
                }
          if (((AcceleratorTable->Table[i].fVirt & 0x80) > 0))
            {
          break;
            }
          i++;
    }

Mark


More information about the Ros-kernel mailing list