Since we are not longer trying to remain C89 compliant for XScreensaver, reduce the...
authorAaron Taylor <ataylor@subgeniuskitty.com>
Sun, 11 Jul 2021 00:49:17 +0000 (17:49 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Sun, 11 Jul 2021 00:50:25 +0000 (17:50 -0700)
hacks/NEDsim/NEDsim.c

index fb4dd72..ad2baaa 100644 (file)
@@ -493,8 +493,7 @@ draw_wordline(struct NEDsim * nedsim, int x, int y)
     draw_rect_area(nedsim, x, y, WORDLINE_WIDTH, WORDLINE_HEIGHT, False, True, False, False);
 
     // Now, draw stripes in the secondary color.
     draw_rect_area(nedsim, x, y, WORDLINE_WIDTH, WORDLINE_HEIGHT, False, True, False, False);
 
     // Now, draw stripes in the secondary color.
-    int i;
-    for (i = 0; i < (WORDLINE_WIDTH/(2*WORDLINE_BITS_PER_STRIPE)); i++) {
+    for (int i = 0; i < (WORDLINE_WIDTH/(2*WORDLINE_BITS_PER_STRIPE)); i++) {
         set_color(nedsim, COLOR(secondary));
         draw_rect_area(nedsim, (x+(i*(WORDLINE_WIDTH/WORDLINE_BITS_PER_STRIPE))), y,
                 WORDLINE_BITS_PER_STRIPE, WORDLINE_HEIGHT, False, True, False, False);
         set_color(nedsim, COLOR(secondary));
         draw_rect_area(nedsim, (x+(i*(WORDLINE_WIDTH/WORDLINE_BITS_PER_STRIPE))), y,
                 WORDLINE_BITS_PER_STRIPE, WORDLINE_HEIGHT, False, True, False, False);
@@ -617,8 +616,7 @@ update_display(struct NEDsim * nedsim)
 
 
     // Draw the SC.
 
 
     // Draw the SC.
-    int i;
-    for (i = 0; i < SC_WIDTH; i++) {
+    for (int i = 0; i < SC_WIDTH; i++) {
         if ((SC_WIDTH-1-i) == nedsim->nedstate->active_thread->sc) {
             set_color(nedsim, COLOR(light_on));
         } else {
         if ((SC_WIDTH-1-i) == nedsim->nedstate->active_thread->sc) {
             set_color(nedsim, COLOR(light_on));
         } else {
@@ -632,7 +630,7 @@ update_display(struct NEDsim * nedsim)
 
     // Draw the stack lights.
     int64_t top_of_stack = ((int64_t)nedsim->nedstate->active_thread->sp) - 1;
 
     // Draw the stack lights.
     int64_t top_of_stack = ((int64_t)nedsim->nedstate->active_thread->sp) - 1;
-    for (i = 0; i < nedsim->num_data_rows; i++) {
+    for (int i = 0; i < nedsim->num_data_rows; i++) {
         if ((top_of_stack-i) >= 0) {
             draw_wordline_lights(nedsim, nedsim->nedstate->active_thread->stack[top_of_stack-i], STACK_X_OFFSET, STACK_Y_OFFSET+STACK_LABEL_HEIGHT+i);
         } else {
         if ((top_of_stack-i) >= 0) {
             draw_wordline_lights(nedsim, nedsim->nedstate->active_thread->stack[top_of_stack-i], STACK_X_OFFSET, STACK_Y_OFFSET+STACK_LABEL_HEIGHT+i);
         } else {
@@ -648,7 +646,7 @@ update_display(struct NEDsim * nedsim)
     draw_text(nedsim, stack_size, (STACK_X_OFFSET+(STACK_WIDTH/2)+1), STACK_Y_OFFSET, STACK_WIDTH, STACK_LABEL_HEIGHT, False);
 
     // Draw the heap lights.
     draw_text(nedsim, stack_size, (STACK_X_OFFSET+(STACK_WIDTH/2)+1), STACK_Y_OFFSET, STACK_WIDTH, STACK_LABEL_HEIGHT, False);
 
     // Draw the heap lights.
-    for (i = 0; i < nedsim->num_data_rows; i++) {
+    for (int i = 0; i < nedsim->num_data_rows; i++) {
         draw_wordline_lights(nedsim, ram_r_word(nedsim->nedstate, HEAP_START_ADDRESS+(i*BPW)), HEAP_X_OFFSET, HEAP_Y_OFFSET+HEAP_LABEL_HEIGHT+i);
     }
 }
         draw_wordline_lights(nedsim, ram_r_word(nedsim->nedstate, HEAP_START_ADDRESS+(i*BPW)), HEAP_X_OFFSET, HEAP_Y_OFFSET+HEAP_LABEL_HEIGHT+i);
     }
 }