From 450203587305a000cdb73a0811a9d2d5ea5e1943 Mon Sep 17 00:00:00 2001
From: "Wesley W. Terpstra" <w.terpstra@gsi.de>
Date: Mon, 13 Feb 2012 12:21:38 +0000
Subject: [PATCH] Right-shift a signed integer doesn't clear high bit. Just use
 unsigned.

---
 api/format/master.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/api/format/master.c b/api/format/master.c
index efdcc96..e6ba80f 100644
--- a/api/format/master.c
+++ b/api/format/master.c
@@ -117,7 +117,7 @@ void eb_device_flush(eb_device_t devicep) {
     eb_operation_t operationp;
     eb_operation_t scanp;
     int needs_check;
-    int ops, maxops;
+    unsigned int ops, maxops;
     
     cycle = EB_CYCLE(cyclep);
     nextp = cycle->next;
@@ -163,10 +163,7 @@ void eb_device_flush(eb_device_t devicep) {
     if (needs_check) {
       maxops = stride * 8;
     } else {
-      /* windows doesn't have INT_MAX */
-      maxops = 0; 
-      maxops = ~maxops;
-      maxops >>= 1;
+      maxops = -1; 
     }
     
     /* Begin formatting the packet into records */
-- 
GitLab