Open
Conversation
c72af16 to
fab6cb1
Compare
pkg/noun/urth.c
Outdated
| #include "serial.h" | ||
| #include "ur/ur.h" | ||
| #include "vortex.h" | ||
| // XX: 64 more to do |
Collaborator
There was a problem hiding this comment.
can we remove this?
| u3_assert(_(u3a_is_atom(b))); | ||
|
|
||
| if ( _(u3a_is_cat(b)) ) { | ||
| mpz_init_set_ui(a_mp, b); |
Contributor
There was a problem hiding this comment.
When testing on Windows, I was getting strange results because mpz_init_set_ui takes unsigned long int, which is smaller than c3_w on Windows.
So you want to replace this with something more general, like:
void
mpz_init_set_word(mpz_t a_mp, c3_w b_w)
{
if ( sizeof(unsigned long int) >= sizeof(b_w) ) {
return mpz_init_set_ui(a_mp, b_w);
}
mpz_init2(a_mp, 1 << u3a_word_bits_log);
mpz_import(a_mp, 1, -1, sizeof(c3_w), 0, 0, &b_w);
}
Contributor
There was a problem hiding this comment.
Or maybe don't define a wrapper function for words and just compare to ULONG_MAX. Either way you should check interactions with external API like that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cribbed from #794.
This PR introduces 64-bit Vere.
c3_wis now either 32 or 64 bit, depending on if it was compiled with -DVERE64 (on by default, or off withzig build -Dvere32).The following work still needs to be done:
trace.{c,h}ship.{c,h}nock.hversion.himprison.{c,h}jets.{c,h}allocate.{c,h}retrieve.{c,h}*_tests.clook at diff of pre and post VERE64 compilation with -Wconversion flag. Investigate every instance.size_tto support 64-bit #842(mug .(eny 0, now 0))equality test for fakezods booted in 32-bit and 64-bit modes