From 58078ba2acf2906885ee1995b64946a4a5eca1a1 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 4 Mar 2012 22:49:13 +0100 Subject: ebus-racket: fix layer7 data2c --- ebus-racket/layer7.rkt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ebus-racket') diff --git a/ebus-racket/layer7.rkt b/ebus-racket/layer7.rkt index eb37e91..b335ddc 100644 --- a/ebus-racket/layer7.rkt +++ b/ebus-racket/layer7.rkt @@ -110,11 +110,13 @@ (+ 256 (bitwise-not v))) (if (= (bitwise-and highByte 128) 128) (* -1 - (+ (* 16 (u-not highByte)) - (highNibble (u-not lowByte)) - (/ (lowNibble (u-not lowByte) 16)))) - (+ (* 16 (u-not highByte)) - (highNibble lowByte) + (/ + (+ (arithmetic-shift (u-not highByte) 4) + (u-not (highNibble lowByte)) + (+ (u-not (lowNibble lowByte)) 1)) + 16.0)) + (+ (* 16 highByte) + (arithmetic-shift lowByte -4) (/ (lowNibble lowByte) 16)))) ;; type byteEnum -- cgit v1.2.1