[cdo] 01/04: remove register statements that break ppc64el code

Alastair McKinstry mckinstry at moszumanska.debian.org
Mon Jul 13 10:06:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to tag debian/1.6.6+dfsg.1-2
in repository cdo.

commit 7a217034d27bc3a5061be78b58cabd798cd3a444
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jul 8 20:46:49 2015 +0100

    remove register statements that break ppc64el code
---
 debian/changelog                |   8 ++
 debian/patches/deregister.patch | 189 ++++++++++++++++++++++++++++++++++++++++
 debian/patches/series           |   1 +
 3 files changed, 198 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f90c7ca..4fedc83 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+cdo (1.6.6+dfsg.1-2) UNRELEASED; urgency=medium
+
+  * deregister.patch: remove obsolete 'register' statements from some code. 
+    Finding the address of a register strictly verboten and breaks 
+    ppc64el code. 
+
+ -- Alastair McKinstry <mckinstry at debian.org>  Wed, 08 Jul 2015 20:44:36 +0100
+
 cdo (1.6.6+dfsg.1-1) unstable; urgency=medium
 
   * New upstream release 
diff --git a/debian/patches/deregister.patch b/debian/patches/deregister.patch
new file mode 100644
index 0000000..0c7944b
--- /dev/null
+++ b/debian/patches/deregister.patch
@@ -0,0 +1,189 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Bugs-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790393
+Description: Remove 'register' from C code. Especially never try to get the
+ address of a register. Breaks HPPA code at least, and compilers do this
+ better in the 21st century.
+Last-Updated: 2015-06-29
+Forwarded: no
+
+Index: cdo-1.6.6+dfsg.1/libcdi/src/cdilib.c
+===================================================================
+--- cdo-1.6.6+dfsg.1.orig/libcdi/src/cdilib.c
++++ cdo-1.6.6+dfsg.1/libcdi/src/cdilib.c
+@@ -6020,7 +6020,7 @@ memcrc(const unsigned char *b, size_t n)
+ 
+   /* Extend with the length of the string. */
+   while (n != 0) {
+-    register uint32_t c = n & 0377;
++     uint32_t c = n & 0377;
+     n >>= 8;
+     s = (s << 8) ^ crctab[(s >> 24) ^ c];
+   }
+@@ -6038,9 +6038,9 @@ memcrc_r(uint32_t *state, const unsigned
+  */
+ 
+ 
+-  register uint32_t c, s = *state;
+-  register size_t n = block_len;
+-  register const unsigned char *b = block;
++   uint32_t c, s = *state;
++   size_t n = block_len;
++   const unsigned char *b = block;
+ 
+   for (; n > 0; --n) {
+     c = (uint32_t)(*b++);
+@@ -6052,7 +6052,7 @@ memcrc_r(uint32_t *state, const unsigned
+ 
+ #define SWAP_CSUM(BITWIDTH,BYTEWIDTH,NACC)                              \
+   do {                                                                  \
+-    register const uint##BITWIDTH##_t *b = (uint##BITWIDTH##_t *)elems; \
++     const uint##BITWIDTH##_t *b = (uint##BITWIDTH##_t *)elems; \
+     for (size_t i = 0; i < num_elems; ++i) {                            \
+       for(size_t aofs = NACC; aofs > 0; --aofs) {                       \
+         uint##BITWIDTH##_t accum = b[i + aofs - 1];                     \
+@@ -6079,7 +6079,7 @@ memcrc_r_eswap(uint32_t *state, const un
+                size_t elem_size)
+ {
+ #ifdef WORDS_BIGENDIAN
+-  register uint32_t s = *state;
++   uint32_t s = *state;
+ 
+   switch (elem_size)
+   {
+@@ -6109,8 +6109,8 @@ memcrc_r_eswap(uint32_t *state, const un
+ uint32_t
+ memcrc_finish(uint32_t *state, off_t total_size)
+ {
+-  register uint32_t c, s = *state;
+-  register uint64_t n = (uint64_t)total_size;
++   uint32_t c, s = *state;
++   uint64_t n = (uint64_t)total_size;
+ 
+   /* Extend with the length of the string. */
+   while (n != 0) {
+@@ -48913,7 +48913,7 @@ void avx_minmax_val_double(const double
+   double fmin[4], fmax[4];
+   __m256d current_max, current_min, work;
+ 
+-  // load max and min values into all four slots of the YMM registers
++  // load max and min values into all four slots of the YMM s
+   current_min = _mm256_set1_pd(*min);
+   current_max = _mm256_set1_pd(*max);
+ 
+@@ -49006,7 +49006,7 @@ void sse2_minmax_val_double(const double
+ {
+   __m128d current_max, current_min, work;
+   
+-  // load starting max and min values into all slots of the XMM registers
++  // load starting max and min values into all slots of the XMM s
+   current_min = _mm_set1_pd(*min);
+   current_max = _mm_set1_pd(*max);
+   
+@@ -49091,8 +49091,8 @@ void pwr6_minmax_val_double_unrolled6(co
+     size_t i, j;
+     size_t residual =  datasize % __UNROLL_DEPTH_1;
+     size_t ofs = datasize - residual;
+-    double register dmin[__UNROLL_DEPTH_1];
+-    double register dmax[__UNROLL_DEPTH_1];
++    double  dmin[__UNROLL_DEPTH_1];
++    double  dmax[__UNROLL_DEPTH_1];
+ 
+     for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+       {
+@@ -63703,7 +63703,7 @@ void listInitialize ( void )
+   pthread_mutexattr_destroy(&ma);
+ #endif
+   /* file is special and has its own table, which needs to be
+-   * created, before we register the listDestroy exit handler */
++   * created, before we  the listDestroy exit handler */
+   {
+     int null_id;
+     null_id = fileOpen_serial("/dev/null", "r");
+Index: cdo-1.6.6+dfsg.1/libcdi/src/cgribexlib.c
+===================================================================
+--- cdo-1.6.6+dfsg.1.orig/libcdi/src/cgribexlib.c
++++ cdo-1.6.6+dfsg.1/libcdi/src/cgribexlib.c
+@@ -763,7 +763,7 @@ void avx_minmax_val_double(const double
+   double fmin[4], fmax[4];
+   __m256d current_max, current_min, work;
+ 
+-  // load max and min values into all four slots of the YMM registers
++  // load max and min values into all four slots of the YMM s
+   current_min = _mm256_set1_pd(*min);
+   current_max = _mm256_set1_pd(*max);
+ 
+@@ -856,7 +856,7 @@ void sse2_minmax_val_double(const double
+ {
+   __m128d current_max, current_min, work;
+   
+-  // load starting max and min values into all slots of the XMM registers
++  // load starting max and min values into all slots of the XMM s
+   current_min = _mm_set1_pd(*min);
+   current_max = _mm_set1_pd(*max);
+   
+@@ -941,8 +941,8 @@ void pwr6_minmax_val_double_unrolled6(co
+     size_t i, j;
+     size_t residual =  datasize % __UNROLL_DEPTH_1;
+     size_t ofs = datasize - residual;
+-    double register dmin[__UNROLL_DEPTH_1];
+-    double register dmax[__UNROLL_DEPTH_1];
++    double  dmin[__UNROLL_DEPTH_1];
++    double  dmax[__UNROLL_DEPTH_1];
+ 
+     for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+       {
+Index: cdo-1.6.6+dfsg.1/libcdi/src/cksum.c
+===================================================================
+--- cdo-1.6.6+dfsg.1.orig/libcdi/src/cksum.c
++++ cdo-1.6.6+dfsg.1/libcdi/src/cksum.c
+@@ -82,7 +82,7 @@ memcrc(const unsigned char *b, size_t n)
+ 
+   /* Extend with the length of the string. */
+   while (n != 0) {
+-    register uint32_t c = n & 0377;
++    uint32_t c = n & 0377;
+     n >>= 8;
+     s = (s << 8) ^ crctab[(s >> 24) ^ c];
+   }
+@@ -100,9 +100,9 @@ memcrc_r(uint32_t *state, const unsigned
+  */
+ 
+ 
+-  register uint32_t c, s = *state;
+-  register size_t n = block_len;
+-  register const unsigned char *b = block;
++  uint32_t c, s = *state;
++  size_t n = block_len;
++  const unsigned char *b = block;
+ 
+   for (; n > 0; --n) {
+     c = (uint32_t)(*b++);
+@@ -114,7 +114,7 @@ memcrc_r(uint32_t *state, const unsigned
+ 
+ #define SWAP_CSUM(BITWIDTH,BYTEWIDTH,NACC)                              \
+   do {                                                                  \
+-    register const uint##BITWIDTH##_t *b = (uint##BITWIDTH##_t *)elems; \
++    const uint##BITWIDTH##_t *b = (uint##BITWIDTH##_t *)elems; \
+     for (size_t i = 0; i < num_elems; ++i) {                            \
+       for(size_t aofs = NACC; aofs > 0; --aofs) {                       \
+         uint##BITWIDTH##_t accum = b[i + aofs - 1];                     \
+@@ -141,7 +141,7 @@ memcrc_r_eswap(uint32_t *state, const un
+                size_t elem_size)
+ {
+ #ifdef WORDS_BIGENDIAN
+-  register uint32_t s = *state;
++  uint32_t s = *state;
+ 
+   switch (elem_size)
+   {
+@@ -171,8 +171,8 @@ memcrc_r_eswap(uint32_t *state, const un
+ uint32_t
+ memcrc_finish(uint32_t *state, off_t total_size)
+ {
+-  register uint32_t c, s = *state;
+-  register uint64_t n = (uint64_t)total_size;
++  uint32_t c, s = *state;
++  uint64_t n = (uint64_t)total_size;
+ 
+   /* Extend with the length of the string. */
+   while (n != 0) {
diff --git a/debian/patches/series b/debian/patches/series
index 700c500..cf725a2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+deregister.patch
 fix_typos.patch
 ignore.patch
 build-fixes.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cdo.git



More information about the debian-science-commits mailing list