Skip to content

remove snprintf/strncat/strlen from fp_ident - #33

Merged
sjaeckel merged 3 commits into
libtom:developfrom
ryancdotorg:ryancdotorg/non_str_funcs
Oct 16, 2024
Merged

sjaeckel merged 3 commits into
libtom:developfrom
ryancdotorg:ryancdotorg/non_str_funcs

Conversation

@ryancdotorg

Copy link
Copy Markdown
Contributor

fp_ident is the only place tomsfast math uses string manipulation functions when built as a library. This commit replaces them with safe, trivial functions for concatenating static strings and numbers together.

This is a smaller part of a patchset to allow tomsfastmath to be compiled without stdlib, e.g. for freestanding webassembly.

ryancdotorg and others added 3 commits September 21, 2024 14:30
fp_ident is the only place tomsfast math uses string manipulation
functions when built as a library. This commit replaces them with
safe, trivial functions for concatonating static strings and numbers
together.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* do error checking.
* also print `SIZEOF_FP_DIGIT` and `DIGIT_SHIFT`.
* cut static buffer in half, currently the output string is 183 chars
  on my machine, so it's still more than enough for all the other options.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
@sjaeckel
sjaeckel force-pushed the ryancdotorg/non_str_funcs branch from 0ca5ea3 to 1519aa1 Compare September 21, 2024 12:59
@sjaeckel

Copy link
Copy Markdown
Member

I took the liberty to force-push after incorporating some changes. I hope that's fine with you? :)

@levitte levitte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sum total of changes look good to me

@sjaeckel
sjaeckel merged commit 6a5d01c into libtom:develop Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants