File deregister.patch of Package cdo

Author: Alastair McKinstry <mckinstry@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.9.1+dfsg.1/libcdi/src/cdilib.c
===================================================================
--- cdo-1.9.1+dfsg.1.orig/libcdi/src/cdilib.c
+++ cdo-1.9.1+dfsg.1/libcdi/src/cdilib.c
@@ -6358,8 +6358,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++) 
       {
@@ -19564,7 +19564,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];
   }
@@ -19582,9 +19582,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++);
@@ -19597,7 +19597,7 @@ memcrc_r(uint32_t *state, const unsigned
 #ifdef WORDS_BIGENDIAN
 #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];                     \
@@ -19624,7 +19624,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)
   {
@@ -19654,8 +19654,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) {
Index: cdo-1.9.1+dfsg.1/libcdi/src/cgribexlib.c
===================================================================
--- cdo-1.9.1+dfsg.1.orig/libcdi/src/cgribexlib.c
+++ cdo-1.9.1+dfsg.1/libcdi/src/cgribexlib.c
@@ -704,8 +704,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.9.1+dfsg.1/libcdi/src/cksum.c
===================================================================
--- cdo-1.9.1+dfsg.1.orig/libcdi/src/cksum.c
+++ cdo-1.9.1+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++);
@@ -115,7 +115,7 @@ memcrc_r(uint32_t *state, const unsigned
 #ifdef WORDS_BIGENDIAN
 #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];                     \
@@ -142,7 +142,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)
   {
@@ -172,8 +172,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) {
openSUSE Build Service is sponsored by