str-two-way.h cleanup

Tom de Vries Tom_deVries@mentor.com
Thu Feb 7 11:28:00 GMT 2013


Maxim,

this patch is a cleanup of string/str-two-way.h.

It:
- fixes a typo in a macro name in the header comment
- adds 2 macros to a macro list in the header comment
- removes 3 superfluous undefines at the end of the file
- adds one missing undefine at the end of the file

I haven't build or tested this, but I checked that str-two-way.h is only used in
3 source files in the string dir:
...
$ find -type f | egrep -v '\.patch|ChangeLog|\.git' | xargs grep str-two-way.h
./string/strcasestr.c:#include "str-two-way.h"
./string/strstr.c:#include "str-two-way.h"
./string/memmem.c:#include "str-two-way.h"
...

I've grepped in those files (and the header file) for AVAILABLE1 and AVAILABLE2:
...
$ egrep 'AVAILABLE1|AVAILABLE2' string/*.c string/str-two-way.h
string/str-two-way.h:#undef AVAILABLE1
string/str-two-way.h:#undef AVAILABLE2
string/str-two-way.h:#undef AVAILABLE1_USES_J
...
and the only hits where the undefs, so that justifies the removal of those undefs.

And I've grepped in those files for CHECK_EOL:
...
$ egrep 'CHECK_EOL|str-two-way.h' string/*.c
string/memmem.c:#include "str-two-way.h"
string/strcasestr.c:#define CHECK_EOL (1)
string/strcasestr.c:#include "str-two-way.h"
string/strstr.c:#define CHECK_EOL (1)
string/strstr.c:#include "str-two-way.h"
...
and only found the defines in front of the include of str-two-way.h. That
justifies the addition of the undef of CHECK_EOL.

I'll build and test this somewhere in the coming weeks.

Does this patch look ok?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: str-two-way-h-cleanup.patch
Type: text/x-patch
Size: 1549 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130207/0a160c25/attachment.bin>


More information about the Libc-alpha mailing list