]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fixed bug #34541: LWIP_U32_DIFF is unnecessarily complex: removed that define
authorSimon Goldschmidt <goldsimon@gmx.de>
Thu, 13 Oct 2011 17:29:48 +0000 (19:29 +0200)
committerSimon Goldschmidt <goldsimon@gmx.de>
Thu, 13 Oct 2011 17:29:48 +0000 (19:29 +0200)
CHANGELOG
src/core/timers.c
src/include/lwip/def.h

index e2fe0a2318b9858f2819a49353b5c6f84bb4feb6..0f2bc6e5fe9601710e70094d1c64b9dd549a2615 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -69,6 +69,9 @@ HISTORY
 
  ++ Bugfixes:
 
+  2011-10-13: Simon Goldschmidt
+  * def.h, timers.c: fixed bug #34541: LWIP_U32_DIFF is unnecessarily complex
+
   2011-10-13: Simon Goldschmidt
   * sockets.c, api_lib.c: fixed bug #34540: compiler error when CORE_LOCKING is
     used and not all protocols are enabled
index 5ae6d0c4e17bb7964ad71e1f7b0a7d9faef9eeeb..c8ead4e7ecc6f9bcca2b015eb17a71ee9fa0973a 100644 (file)
@@ -426,7 +426,7 @@ sys_check_timeouts(void)
 
     now = sys_now();
     /* this cares for wraparounds */
-    diff = LWIP_U32_DIFF(now, timeouts_last_time);
+    diff = now - timeouts_last_time;
     do
     {
 #if PBUF_POOL_FREE_OOSEQ
index 9b6de6a8b81ab9c96f0d03d0e42b9296bbe89cbe..73a1b560b31523c12e38450bdc6137cdcf01b9dc 100644 (file)
@@ -47,10 +47,6 @@ extern "C" {
 #define NULL ((void *)0)
 #endif
 
-/** Get the absolute difference between 2 u32_t values (correcting overflows)
- * 'a' is expected to be 'higher' (without overflow) than 'b'. */
-#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1))) 
-
 /* Endianess-optimized shifting of two u8_t to create one u16_t */
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define LWIP_MAKE_U16(a, b) ((a << 8) | b)