Skip to content
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

Misc fixes #452

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Misc fixes #452

merged 3 commits into from
Nov 6, 2023

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented Nov 4, 2023

2e96fb6 Avoid computing _PyHASH_MODULUS in GMPy_MPQ_Hash_Slot()
324e284 Fix compiler warning
8a7b1ff Fix rst markup in docstrings (for emphasis)
12afc77 Use gmpy2.__package__ to get project name in sphinx
b470a3b Set doctest_global_cleanup sphinx directive

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2023

Codecov Report

Merging #452 (874c95b) into master (21ccbf7) will not change coverage.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master     #452   +/-   ##
=======================================
  Coverage   84.97%   84.97%           
=======================================
  Files          49       49           
  Lines       11738    11738           
  Branches     2206     2206           
=======================================
  Hits         9974     9974           
  Misses       1764     1764           
Files Coverage Δ
src/gmpy2_mpz_misc.c 100.00% <ø> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@skirpichev skirpichev changed the title Misc Misc fixes Nov 4, 2023
Copy link
Collaborator

@casevh casevh left a comment

Choose a reason for hiding this comment

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

I need to test the _PyHASH_MODULUS change on 64-bit Windows. mpz_set_si() accepts a long (32-bit) but _PyHASH_MODULUS is too large. At least that's my first reaction. I will respond later with the test results.

@skirpichev
Copy link
Contributor Author

skirpichev commented Nov 5, 2023 via email

Copy link
Collaborator

@casevh casevh left a comment

Choose a reason for hiding this comment

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

It's worse than that. 64-bit Windows defines long as a 32-bit integer and long long as a 64-bit integer. Most other 64-bit platforms define both long and long long as 64-bit integers. GMP expects si and ui to be long and they don't offer functions that accept long long.

Here is the compile error message with the last change:
\gmpy\src\gmpy2_hash.c(67): warning C4305: 'function': truncation from 'unsigned __int64' to 'unsigned long'

One of the quirks that makes supporting Windows difficult.

Let's just skip the _PyHASH change for now. I found a few other conversion warnings that I need to resolve first.

@skirpichev
Copy link
Contributor Author

Ok, first comment was removed. It seems we really want _PyHASH_BITS macro.

@skirpichev
Copy link
Contributor Author

Change in _mpfr_hash() was reverted too, @casevh

@casevh casevh merged commit a2d5eb3 into aleaxit:master Nov 6, 2023
9 checks passed
@casevh
Copy link
Collaborator

casevh commented Nov 6, 2023

Thanks for your patience in dealing with these subtle issues.

@skirpichev skirpichev deleted the misc branch November 6, 2023 05:26
@skirpichev
Copy link
Contributor Author

Hash-related patch was moved to #453

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