[haiku-commits] Re: haiku: hrev43559 - src/system/libroot/posix/string

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 27 Dec 2011 00:36:49 +0100

On 12/25/2011 05:02 PM, fredrik.holmqvist@xxxxxxxxx wrote:
+       /* Align access for four byte reads */
+       for (; (((addr_t) s + length)&  3) != 0; length++)
+               if (s[length] == '\0')
+                       return length;

The 'for' spans multiple lines, and therefore needs {}.

+       /* Check four bytes for zero char */
+       for (valuePointer = (uint32*) (s + length); !HasZeroByte(*valuePointer);
+               valuePointer++);

For clarity, those should be written like this:
        for (...)
                ;

I would agree it's not pretty, but your intentions are clear this way.

Bye,
   Axel.

Other related posts: