diff options
Diffstat (limited to 'oldXMenu/AddSel.c')
| -rw-r--r-- | oldXMenu/AddSel.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/oldXMenu/AddSel.c b/oldXMenu/AddSel.c index 9183aba7e8e..9bbcf71cd3c 100644 --- a/oldXMenu/AddSel.c +++ b/oldXMenu/AddSel.c | |||
| @@ -17,8 +17,8 @@ | |||
| 17 | #include "XMenuInt.h" | 17 | #include "XMenuInt.h" |
| 18 | 18 | ||
| 19 | int | 19 | int |
| 20 | XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help) | 20 | XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char const *help) |
| 21 | 21 | ||
| 22 | /* Menu object to be modified. */ | 22 | /* Menu object to be modified. */ |
| 23 | /* Pane number to be modified. */ | 23 | /* Pane number to be modified. */ |
| 24 | /* Data value. */ | 24 | /* Data value. */ |
| @@ -27,7 +27,7 @@ XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, ch | |||
| 27 | /* Help string */ | 27 | /* Help string */ |
| 28 | { | 28 | { |
| 29 | register XMPane *pane; /* Pane containing the new selection. */ | 29 | register XMPane *pane; /* Pane containing the new selection. */ |
| 30 | register XMSelect *select; /* Newly created selection. */ | 30 | register XMSelect *sel; /* Newly created selection. */ |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | int label_length; /* Label lenght in characters. */ | 33 | int label_length; /* Label lenght in characters. */ |
| @@ -49,8 +49,8 @@ XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, ch | |||
| 49 | /* | 49 | /* |
| 50 | * Calloc the XMSelect structure. | 50 | * Calloc the XMSelect structure. |
| 51 | */ | 51 | */ |
| 52 | select = (XMSelect *)calloc(1, sizeof(XMSelect)); | 52 | sel = (XMSelect *)calloc(1, sizeof(XMSelect)); |
| 53 | if (select == NULL) { | 53 | if (sel == NULL) { |
| 54 | _XMErrorCode = XME_CALLOC; | 54 | _XMErrorCode = XME_CALLOC; |
| 55 | return(XM_FAILURE); | 55 | return(XM_FAILURE); |
| 56 | } | 56 | } |
| @@ -65,27 +65,27 @@ XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, ch | |||
| 65 | */ | 65 | */ |
| 66 | if (!strcmp (label, "--") || !strcmp (label, "---")) | 66 | if (!strcmp (label, "--") || !strcmp (label, "---")) |
| 67 | { | 67 | { |
| 68 | select->type = SEPARATOR; | 68 | sel->type = SEPARATOR; |
| 69 | select->active = 0; | 69 | sel->active = 0; |
| 70 | } | 70 | } |
| 71 | else | 71 | else |
| 72 | { | 72 | { |
| 73 | select->type = SELECTION; | 73 | sel->type = SELECTION; |
| 74 | select->active = active; | 74 | sel->active = active; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | select->serial = -1; | 77 | sel->serial = -1; |
| 78 | select->label = label; | 78 | sel->label = label; |
| 79 | select->label_width = label_width; | 79 | sel->label_width = label_width; |
| 80 | select->label_length = label_length; | 80 | sel->label_length = label_length; |
| 81 | select->data = data; | 81 | sel->data = data; |
| 82 | select->parent_p = pane; | 82 | sel->parent_p = pane; |
| 83 | select->help_string = help; | 83 | sel->help_string = help; |
| 84 | 84 | ||
| 85 | /* | 85 | /* |
| 86 | * Insert the selection at the end of the selection list. | 86 | * Insert the selection at the end of the selection list. |
| 87 | */ | 87 | */ |
| 88 | emacs_insque(select, pane->s_list->prev); | 88 | emacs_insque(sel, pane->s_list->prev); |
| 89 | 89 | ||
| 90 | /* | 90 | /* |
| 91 | * Update the selection count. | 91 | * Update the selection count. |
| @@ -103,4 +103,3 @@ XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, ch | |||
| 103 | _XMErrorCode = XME_NO_ERROR; | 103 | _XMErrorCode = XME_NO_ERROR; |
| 104 | return((pane->s_count - 1)); | 104 | return((pane->s_count - 1)); |
| 105 | } | 105 | } |
| 106 | |||