home · contact · privacy
Minor code-stylistic improvements in control library.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 1 Dec 2013 03:58:11 +0000 (04:58 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 1 Dec 2013 03:58:11 +0000 (04:58 +0100)
src/ai.c
src/control.c
src/control.h

index aee8e738de50e245a40a057e513753723ba13eaf..7efacf240293c17d9cc06f96e910ffccf75401c0 100644 (file)
--- a/src/ai.c
+++ b/src/ai.c
@@ -45,8 +45,7 @@ static void clockwise_path(char ** path_ptr)
     for (; i < len; i++)
     {
         uint8_t next_i = i + 1;
-        if (   next_i == len
-            || old_char != path[next_i])
+        if (next_i == len || old_char != path[next_i])
         {
             break;
         }
index 26b0e2d575ebb82f4402d14d2ffcd7fdebd7958c..1e9265e73074da48e2f884e93fa2ee94b00c1ed9 100644 (file)
@@ -1,8 +1,7 @@
 /* control.c */
 
 #include "control.h"
-#include <stdint.h> /* for uint8_t */
-#include <string.h> /* for strcmp() */
+#include <stdint.h> /* for uint8_t, uint16_t */
 #include "windows.h" /* for cycle_active_win(), shift_active_win(), struct Win,
                       *  struct WinMeta
                       */
 #include "map.h" /* for map_scroll(), map_center() */
 #include "main.h" /* for world global */
 #include "wincontrol.h" /* for struct WinConf, scroll_pad(), toggle_window(),
-                         * growshrink_active_window(),toggle_winconfig(),
-                         * toggle_size_type()
+                         * growshrink_active_window(), toggle_winconfig(),
+                         * toggle_win_size_type()
                          */
-#include "map_object_actions.h" /* for struct MapObjAct, actor_wait(),
-                                 * actor_move(), actor_drop(), actor_pick(),
-                                 * actor_pick(), get_moa_id_by_name()
-                                 */
+#include "map_object_actions.h" /* for get_moa_id_by_name() */
 #include "command_db.h" /* for is_command_id_shortdsc() */
 #include "misc.h" /* for reload_interface_conf(), save_interface_conf(),
                    * nav_inventory(), turn_over()
@@ -35,8 +31,8 @@ static uint8_t try_cmd_1args(int cmd, char * match, void (* f) (char), char c);
 static uint8_t try_cmd_2args(int cmd, char * match,
                              void (* f) (char, char), char c1, char c2);
 
-/* If "action" is id of command named "match", set player->arg, ->command and
- * call turn_over().
+/* If "action" is id of command named "match", set player's .arg and .command
+ * and call turn_over().
  */
 static uint8_t try_player_cmd(int action, char * match, char * command,
                               uint8_t arg);
index 8c44cc0a423a64fff73fa624479f49e1c51459bc..492b80b1688f8ad176dd57adc7397cac11d86661 100644 (file)
@@ -19,15 +19,12 @@ extern uint16_t get_available_keycode_to_action(char * name);
 extern uint8_t player_control_by_key(int key);
 extern uint8_t player_control_by_id(int action);
 
-/* Control via "key" active window's geometry / keybindings in respective config
- * view.
- */
+/* Control via "key" active window's config view's geometry / keybindings. */
 extern uint8_t wingeom_control(int key);
 extern uint8_t winkeyb_control(int key);
 
-/* Call by "key" further game / window management actions that don't influence
- * the player character. If the "quit" action is called, return 1 (instead of
- * exiting directly).
+/* Call via "key" further game/window management actions not influencing the
+ * player character. If "quit" is called, return 1, else 0.
  */
 extern uint8_t meta_control(int key);