removes "int32_t xmin" from FLUSH
authorMoritz Hanke <hanke@dkrz.de>
Tue, 9 Sep 2014 14:25:12 +0000 (16:25 +0200)
committerMathis Rosenhauer <rosenhauer@dkrz.de>
Fri, 24 Oct 2014 14:08:26 +0000 (16:08 +0200)
src/decode.c

index 526a643..099fc44 100644 (file)
                                                                         \
             } else {                                                    \
                                                                         \
-              int32_t xmax, xmin, d;                                    \
+              int32_t xmax, d;                                          \
               data = state->last_out;                                   \
-              xmin = state->xmin;                                       \
               xmax = state->xmax;                                       \
                                                                         \
               for (bp = state->flush_start; bp < flush_end; bp++) {     \
                   half_d = ((uint32_t)d >> 1) + (d & 1);                \
                                                                         \
                   if (data < 0) {                                       \
-                      if (half_d <= data - xmin) {                      \
+                      if (half_d <= xmax + data + 1) {                  \
                           data += ((uint32_t)d >> 1)^(~((d & 1) - 1));  \
                       } else {                                          \
-                          data = xmin + d;                              \
+                          data = d - xmax - 1;                          \
                       }                                                 \
                   } else {                                              \
                       if (half_d <= xmax - data) {                      \