Thomas Faber thfabba@gmx.de writes:
Hi,
what can I do to get this in committable shape? I don't see how it can be reasonably split up; tests are in place.
I've noticed I forgot to remove the L prefixes on character constants, which I'll correct. I'll gladly fix any other style issues.
The function _could_ be implemented using strto(u)l instead of using its own conversion function, but that would require the removal of some tests as "too strict". I much prefer the "correct" version.
If there's an app that depends on this, sure. If it's just because you are testing every unlikely side-effect that no app is ever going to depend on, it doesn't justify adding lots of complexity.
Even if you absolutely want to do your own conversion, you should at least reuse some existing code instead of writing a new function from scratch. You should also think about simplifying your code, you shouldn't need 200 lines of code for this.