]> Kevux Git Server - fll/commitdiff
Update: make the interrupt handler pointer variables constant pointers.
authorKevin Day <thekevinday@gmail.com>
Thu, 23 Dec 2021 03:45:40 +0000 (21:45 -0600)
committerKevin Day <thekevinday@gmail.com>
Thu, 23 Dec 2021 03:45:40 +0000 (21:45 -0600)
level_3/fake/c/private-fake.c

index c2986eebc3ce4ce3bc493183a4c68670c6063f0b..d9b5f3a14ec0df3f241495b86b42f14afc30b82b 100644 (file)
@@ -497,13 +497,13 @@ extern "C" {
       return F_interrupt_not;
     }
 
-    f_state_t *state_ptr = (f_state_t *) state;
+    f_state_t * const state_ptr = (f_state_t *) state;
 
     if (!state_ptr->custom) {
       return F_interrupt_not;
     }
 
-    fake_main_t *main = (fake_main_t *) state_ptr->custom;
+    fake_main_t * const main = (fake_main_t *) state_ptr->custom;
 
     if (!((++main->signal_check) % fake_signal_check_d)) {
       if (fake_signal_received(main)) {
@@ -524,13 +524,13 @@ extern "C" {
       return F_interrupt_not;
     }
 
-    f_state_t *state_ptr = (f_state_t *) state;
+    f_state_t * const state_ptr = (f_state_t *) state;
 
     if (!state_ptr->custom) {
       return F_interrupt_not;
     }
 
-    fake_main_t *main = (fake_main_t *) state_ptr->custom;
+    fake_main_t * const main = (fake_main_t *) state_ptr->custom;
 
     if (!((++main->signal_check) % fake_signal_check_d)) {
       if (fake_signal_received(main)) {