On Tue, 18 Feb 2020 16:19:05 +0100, Marco Bodrato wrote:

> Il 2020-02-18 12:39 Marco Bodrato ha scritto:
> > A proposed patch:
> Looking at it twice, it is probably better to propose a cleaner patch, that
> can be adopted also upstream:

Thanks for your help!

I have to admit that I haven't seen a non-unified patch in ages, and
unfortunately it doesn't apply [0].

I tried to convert it into the following unified patch:
 
#v+
--- a/squfof126.c
+++ b/squfof126.c
@@ -43,15 +43,12 @@
   return v;
 }
 static INLINE void mpz_set64(mpz_t n, SQUFOF_TYPE v) {
-  if (v == 0) {
-    mpz_set_ui(n,0);
-  } else if (GMP_LIMB_BITS < 64 || sizeof(mp_limb_t) < sizeof(SQUFOF_TYPE)) {
+  if (v > ULONG_MAX) {
     mpz_set_ui(n, (uint32_t)(v >> 32));
     mpz_mul_2exp(n, n, 32);
     mpz_add_ui(n, n, (uint32_t)v);
   } else {
-    n->_mp_d[0] = v;
-    n->_mp_size = 1;
+    mpz_set_ui(n, v);
   }
 }
 
#v-

Does this look correct? And/or could you try to 1) produce a patch
with "diff -u" and 2) send it as an attachment so it doesn't get
mangled?

(The package builds and passes all tests with the above patch.)


Cheers,
gregor

[0]
% patch --dry-run --verbose -p0 < ~/tmp/perl/gmp.patch
Hmm...patch: **** malformed patch at line 11: {                           
 


-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   NP: Element Of Crime: Narzissen und Kakteen

Attachment: signature.asc
Description: Digital Signature

Reply via email to