To add the current position (%n) conversion, some reorganization needed
to be done. The "write a number to this pointer using the length
modifier" utilities and a couple other shared parsing functions have
been moved into converter_utils.h. This made implementing
current_pos_converter very simple.
Details
- Reviewers
sivachandra lntue - Commits
- rGafa764c9a6d6: [libc] add scanf current position conversion
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/stdio/scanf_core/converter_utils.h | ||
---|---|---|
23–33 | For consistency, can you keep LIBC_INLINE before return types in the definitions. | |
libc/src/stdio/scanf_core/current_pos_converter.cpp | ||
19 | This function is quite short. Will it get more complicated later? Otherwise you can inline it in the header instead. |
libc/src/stdio/scanf_core/converter_utils.h | ||
---|---|---|
23–33 | Not just consistency, it is a requirement as we want to be able to add attributes. I will update the documentation with this information. It should be listed before constexpr also. |
move inline annotations in function headers
remove current_pos_converter.cpp
libc/src/stdio/scanf_core/current_pos_converter.cpp | ||
---|---|---|
19 | I moved it to the header and also tagged it as LIBC_INLINE. |
For consistency, can you keep LIBC_INLINE before return types in the definitions.