* lib/ffsl.h (FUNC): Use 'unsigned int' instead of 'int'.
+2011-07-15 Bruno Haible <bruno@clisp.org>
+
+ ffsl, ffsll: Avoid unportable behaviour.
+ * lib/ffsl.h (FUNC): Use 'unsigned int' instead of 'int'.
+
2011-07-15 Bruno Haible <bruno@clisp.org>
ffs: More tests.
return 0;
while (1)
{
- if ((int) j)
- return result + ffs (j);
- j >>= CHAR_BIT * sizeof (int);
- result += CHAR_BIT * sizeof (int);
+ if ((unsigned int) j)
+ return result + ffs ((unsigned int) j);
+ j >>= CHAR_BIT * sizeof (unsigned int);
+ result += CHAR_BIT * sizeof (unsigned int);
}
}