[rtems commit] sptests/spwatchdog/init.c: Avoid integer overflow

Joel Sherril joel at rtems.org
Tue Mar 24 13:18:11 UTC 2015


Module:    rtems
Branch:    master
Commit:    73a2caf46b229dc51dff89b83860fcf42515c38e
Changeset: http://git.rtems.org/rtems/commit/?id=73a2caf46b229dc51dff89b83860fcf42515c38e

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Fri Mar 20 10:50:13 2015 -0500

sptests/spwatchdog/init.c: Avoid integer overflow

---

 testsuites/sptests/spwatchdog/init.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/testsuites/sptests/spwatchdog/init.c b/testsuites/sptests/spwatchdog/init.c
index 8e329a4..1d3cb2f 100644
--- a/testsuites/sptests/spwatchdog/init.c
+++ b/testsuites/sptests/spwatchdog/init.c
@@ -36,9 +36,15 @@ static void test_watchdog_routine( Objects_Id id, void *arg )
 
 static void test_watchdog_static_init( void )
 {
+  #if defined(RTEMS_USE_16_BIT_OBJECT)
+    #define JUNK_ID 0x1234
+  #else
+    #define JUNK_ID 0x12345678
+  #endif
+
   static Watchdog_Control a = WATCHDOG_INITIALIZER(
     test_watchdog_routine,
-    0x12345678,
+    JUNK_ID,
     (void *) 0xdeadbeef
   );
   Watchdog_Control b;
@@ -47,7 +53,7 @@ static void test_watchdog_static_init( void )
   _Watchdog_Initialize(
     &b,
     test_watchdog_routine,
-    0x12345678,
+    JUNK_ID,
     (void *) 0xdeadbeef
   );
 



More information about the vc mailing list