8000 MAINT: Simplify npymath by mattip · Pull Request #22090 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Simplify npymath #22090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
strtoull and strtoll are mandatory
  • Loading branch information
mattip committed Aug 21, 2022
commit 759e0cdbc2642211ad2f0adce3ef247428a1e3b3
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ stages:
python3 -m pip install -v . && \
python3 runtests.py -n --deb 8000 ug-info --mode=full -- -rsx --junitxml=junit/test-results.xml && \
python3 tools/openblas_support.py --check_version"
displayName: 'Run 32-bit manylinux2010 Docker Build / Tests'
displayName: 'Run 32-bit manylinux2014 Docker Build / Tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
15 changes: 0 additions & 15 deletions numpy/core/src/common/numpyos.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,27 +770,12 @@ NumPyOS_ascii_ftoLf(FILE *fp, long double *value)
NPY_NO_EXPORT npy_longlong
NumPyOS_strtoll(const char *str, char **endptr, int base)
{
#if defined HAVE_STRTOLL
return strtoll(str, endptr, base);
#elif defined _MSC_VER
return _strtoi64(str, endptr, base);
#else
/* ok on 64 bit posix */
return PyOS_strtol(str, endptr, base);
#endif
}

NPY_NO_EXPORT npy_ulonglong
NumPyOS_strtoull(const char *str, char **endptr, int base)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these now more or less pointless wrapper functions be deprecated somehow...?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed there is more cleanup that can be done to turn one-line functions into defines (if they are exported) or to deprecate them (if they are internal). I was primarily targeting cleaning up the dead code from npymath in this PR. Maybe we should have a github project for code cleanup and add this as a task.

{
#if defined HAVE_STRTOULL
return strtoull(str, endptr, base);
#elif defined _MSC_VER
return _strtoui64(str, endptr, base);
#else
/* ok on 64 bit posix */
return PyOS_strtoul(str, endptr, base);
#endif
}


0