On Sun, Oct 23, 2011 at 05:55:30AM +0000, corvid wrote:
Here's an idea of what we'd get:
http://www.dillo.org/test/ascii_strcasecmp.diff
- The naming is clear but kind of ugly. - I haven't added explanatory comments yet. - For the moment, it just #defines dStr(n)casecmp to the ASCII version because there are a bunch of them, but I'd go through and change the calls.
Thoughts?
I think it's nasty, but the right way to fix this. Did you find any cases where the localized version actually makes sense? Not sure how a lowercase roman 2 should look like in tr_TR :-)
Skimming through the diff now, I'm noticing the cases like if (dASCIItolower(attrbuf[0]) == 'j') and thinking maybe if (attrbuf[0] == 'j' || attrbuf[0] == 'J') would be better, but then this issue is probably too tiny to waste precious seconds of my life in noticing.
I would guess that you end up with pretty much the same assembler code in both cases.
(Whereas continuing to use tolower() because we know that 'j' is safe would be bad practice, in my opinion.)
right. Independent of this problem I think we should decide on the layering of our base libraries (lout and dlib) to avoid code duplication. My favorite option would be basing dlib on lout. Any opinions? Cheers, Johannes