Browse Source

Use signed long instead of unsigned long for binded actions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 9 years ago
parent
commit
a6f5767f3f
10 changed files with 38 additions and 38 deletions
  1. 6 6
      lib/keybind.c
  2. 19 19
      lib/keybind.h
  3. 1 1
      lib/widget/buttonbar.c
  4. 1 1
      lib/widget/buttonbar.h
  5. 2 2
      lib/widget/dialog.c
  6. 1 1
      lib/widget/dialog.h
  7. 3 3
      lib/widget/input.c
  8. 2 2
      lib/widget/listbox.c
  9. 2 2
      lib/widget/menu.c
  10. 1 1
      lib/widget/menu.h

+ 6 - 6
lib/keybind.c

@@ -395,7 +395,7 @@ sort_command_names (void)
 /* --------------------------------------------------------------------------------------------- */
 
 static void
-keymap_add (GArray * keymap, long key, unsigned long cmd, const char *caption)
+keymap_add (GArray * keymap, long key, long cmd, const char *caption)
 {
     if (key != 0 && cmd != CK_IgnoreKey)
     {
@@ -413,7 +413,7 @@ keymap_add (GArray * keymap, long key, unsigned long cmd, const char *caption)
 /* --------------------------------------------------------------------------------------------- */
 
 void
-keybind_cmd_bind (GArray * keymap, const char *keybind, unsigned long action)
+keybind_cmd_bind (GArray * keymap, const char *keybind, long action)
 {
     char *caption = NULL;
     long key;
@@ -425,7 +425,7 @@ keybind_cmd_bind (GArray * keymap, const char *keybind, unsigned long action)
 
 /* --------------------------------------------------------------------------------------------- */
 
-unsigned long
+long
 keybind_lookup_action (const char *name)
 {
     const name_keymap_t key = { name, 0 };
@@ -442,7 +442,7 @@ keybind_lookup_action (const char *name)
 /* --------------------------------------------------------------------------------------------- */
 
 const char *
-keybind_lookup_actionname (unsigned long action)
+keybind_lookup_actionname (long action)
 {
     size_t i;
 
@@ -456,7 +456,7 @@ keybind_lookup_actionname (unsigned long action)
 /* --------------------------------------------------------------------------------------------- */
 
 const char *
-keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, unsigned long action)
+keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, long action)
 {
     if (keymap != NULL)
     {
@@ -471,7 +471,7 @@ keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, unsigned long ac
 
 /* --------------------------------------------------------------------------------------------- */
 
-unsigned long
+long
 keybind_lookup_keymap_command (const global_keymap_t * keymap, long key)
 {
     if (keymap != NULL)

+ 19 - 19
lib/keybind.h

@@ -34,11 +34,11 @@
 enum
 {
     /* special commands */
-    CK_InsertChar = -1,
-    CK_IgnoreKey = 0,
+    CK_InsertChar = -1L,
+    CK_IgnoreKey = 0L,
 
     /* common */
-    CK_Enter = 1,
+    CK_Enter = 1L,
     CK_Up,
     CK_Down,
     CK_Left,
@@ -128,7 +128,7 @@ enum
     CK_ExtendedKeyMap,
 
     /* main commands */
-    CK_EditForceInternal = 100,
+    CK_EditForceInternal = 100L,
     CK_View,
     CK_ViewRaw,
     CK_ViewFile,
@@ -186,7 +186,7 @@ enum
     CK_SelectInvert,
 
     /* panels */
-    CK_PanelOtherCd = 200,
+    CK_PanelOtherCd = 200L,
     CK_PanelOtherCdLink,
     CK_Panelize,
     CK_CopySingle,
@@ -207,14 +207,14 @@ enum
     CK_ScrollRight,
 
     /* dialog */
-    CK_Ok = 300,
+    CK_Ok = 300L,
     CK_Cancel,
 
     /* input */
-    CK_Yank = 350,
+    CK_Yank = 350L,
 
     /* help */
-    CK_Index = 400,
+    CK_Index = 400L,
     CK_Back,
     CK_LinkNext,
     CK_LinkPrev,
@@ -222,11 +222,11 @@ enum
     CK_NodePrev,
 
     /* tree */
-    CK_Forget = 450,
+    CK_Forget = 450L,
 
     /* editor */
     /* cursor movements */
-    CK_Tab = 500,
+    CK_Tab = 500L,
     CK_Undo,
     CK_ScrollUp,
     CK_ScrollDown,
@@ -308,7 +308,7 @@ enum
     CK_Mail,
 
     /* viewer */
-    CK_WrapMode = 600,
+    CK_WrapMode = 600L,
     CK_MagicMode,
     CK_NroffMode,
     CK_HexMode,
@@ -321,7 +321,7 @@ enum
     CK_SearchBackwardContinue,
 
     /* diff viewer */
-    CK_ShowSymbols = 700,
+    CK_ShowSymbols = 700L,
     CK_SplitFull,
     CK_Tab2,
     CK_Tab3,
@@ -339,7 +339,7 @@ enum
 typedef struct name_keymap_t
 {
     const char *name;
-    unsigned long val;
+    long val;
 } name_keymap_t;
 
 typedef struct key_config_t
@@ -354,7 +354,7 @@ typedef struct key_config_t
 typedef struct global_keymap_t
 {
     long key;
-    unsigned long command;
+    long command;
     char caption[KEYMAP_SHORTCUT_LENGTH];
 } global_keymap_t;
 
@@ -362,11 +362,11 @@ typedef struct global_keymap_t
 
 /*** declarations of public functions ************************************************************/
 
-void keybind_cmd_bind (GArray * keymap, const char *keybind, unsigned long action);
-unsigned long keybind_lookup_action (const char *name);
-const char *keybind_lookup_actionname (unsigned long action);
-const char *keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, unsigned long action);
-unsigned long keybind_lookup_keymap_command (const global_keymap_t * keymap, long key);
+void keybind_cmd_bind (GArray * keymap, const char *keybind, long action);
+long keybind_lookup_action (const char *name);
+const char *keybind_lookup_actionname (long action);
+const char *keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, long action);
+long keybind_lookup_keymap_command (const global_keymap_t * keymap, long key);
 
 /*** inline functions ****************************************************************************/
 

+ 1 - 1
lib/widget/buttonbar.c

@@ -266,7 +266,7 @@ buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
 {
     if ((bb != NULL) && (idx >= 1) && (idx <= BUTTONBAR_LABELS_NUM))
     {
-        unsigned long command = CK_IgnoreKey;
+        long command = CK_IgnoreKey;
 
         if (keymap != NULL)
             command = keybind_lookup_keymap_command (keymap, KEY_F (idx));

+ 1 - 1
lib/widget/buttonbar.h

@@ -28,7 +28,7 @@ typedef struct WButtonBar
     struct
     {
         char *text;
-        unsigned long command;
+        long command;
         Widget *receiver;
         int end_coord;          /* cumulative width of buttons so far */
     } labels[BUTTONBAR_LABELS_NUM];

+ 2 - 2
lib/widget/dialog.c

@@ -272,7 +272,7 @@ refresh_cmd (void)
 /* --------------------------------------------------------------------------------------------- */
 
 static cb_ret_t
-dlg_execute_cmd (WDialog * h, unsigned long command)
+dlg_execute_cmd (WDialog * h, long command)
 {
     cb_ret_t ret = MSG_HANDLED;
     switch (command)
@@ -341,7 +341,7 @@ dlg_execute_cmd (WDialog * h, unsigned long command)
 static cb_ret_t
 dlg_handle_key (WDialog * h, int d_key)
 {
-    unsigned long command;
+    long command;
 
     command = keybind_lookup_keymap_command (dialog_map, d_key);
 

+ 1 - 1
lib/widget/dialog.h

@@ -64,7 +64,7 @@ typedef enum
 
 /* get string representation of shortcut assigned  with command */
 /* as menu is a widget of dialog, ask dialog about shortcut string */
-typedef char *(*dlg_shortcut_str) (unsigned long command);
+typedef char *(*dlg_shortcut_str) (long command);
 
 /* get dialog name to show in dialog list */
 typedef char *(*dlg_title_str) (const WDialog * h, size_t len);

+ 3 - 3
lib/widget/input.c

@@ -679,7 +679,7 @@ port_region_marked_for_delete (WInput * in)
 /* --------------------------------------------------------------------------------------------- */
 
 static cb_ret_t
-input_execute_cmd (WInput * in, unsigned long command)
+input_execute_cmd (WInput * in, long command)
 {
     cb_ret_t res = MSG_HANDLED;
 
@@ -1133,7 +1133,7 @@ cb_ret_t
 input_handle_char (WInput * in, int key)
 {
     cb_ret_t v;
-    unsigned long command;
+    long command;
 
     if (quote != 0)
     {
@@ -1177,7 +1177,7 @@ input_handle_char (WInput * in, int key)
 int
 input_key_is_in_map (WInput * in, int key)
 {
-    unsigned long command;
+    long command;
 
     (void) in;
 

+ 2 - 2
lib/widget/listbox.c

@@ -266,7 +266,7 @@ listbox_back_n (WListbox * l, int n)
 /* --------------------------------------------------------------------------------------------- */
 
 static cb_ret_t
-listbox_execute_cmd (WListbox * l, unsigned long command)
+listbox_execute_cmd (WListbox * l, long command)
 {
     cb_ret_t ret = MSG_HANDLED;
     Widget *w = WIDGET (l);
@@ -331,7 +331,7 @@ listbox_execute_cmd (WListbox * l, unsigned long command)
 static cb_ret_t
 listbox_key (WListbox * l, int key)
 {
-    unsigned long command;
+    long command;
 
     if (l->list == NULL)
         return MSG_NOT_HANDLED;

+ 2 - 2
lib/widget/menu.c

@@ -57,7 +57,7 @@ struct menu_entry_t
 {
     unsigned char first_letter;
     hotkey_t text;
-    unsigned long command;
+    long command;
     char *shortcut;
 };
 
@@ -774,7 +774,7 @@ menubar_event (Gpm_Event * event, void *data)
 /* --------------------------------------------------------------------------------------------- */
 
 menu_entry_t *
-menu_entry_create (const char *name, unsigned long command)
+menu_entry_create (const char *name, long command)
 {
     menu_entry_t *entry;
 

+ 1 - 1
lib/widget/menu.h

@@ -42,7 +42,7 @@ typedef struct WMenuBar
 
 /*** declarations of public functions ************************************************************/
 
-menu_entry_t *menu_entry_create (const char *name, unsigned long command);
+menu_entry_t *menu_entry_create (const char *name, long command);
 void menu_entry_free (menu_entry_t * me);
 
 menu_t *create_menu (const char *name, GList * entries, const char *help_node);

Some files were not shown because too many files changed in this diff