News for hackers. Stuff that matters.
Re:Using signed or unsigned int by default in C (2015) by 10000truths on Tuesday August 23, 2022 @01:27PM (#32568172)
I would rather just use a plain for loop and manipulate the index in the loop body:

  for(uint32_t i = 0; i < length; ++i) {
      i = (length - 1) - i;
      // ...
  }
Much easier for me to understand, making it less likely to mess anything up.
Re:Using signed or unsigned int by default in C (2015) by edflsafoiewq on Tuesday August 23, 2022 @01:32PM (#32568239)
You'll need a new variable there, but otherwise yeah.
Re:Using signed or unsigned int by default in C (2015) by WalterBright on Tuesday August 23, 2022 @03:07PM (#32569725)
Even easier (for D):

    foreach (i; 0 .. length)
D takes care of selecting the correct type for `i`.