summaryrefslogtreecommitdiff
path: root/oldXMenu/XMenu.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-04-16 01:25:42 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-04-16 01:25:42 -0700
commit55660072db3bb05d1daba0eb67865913b82d313a (patch)
treebbeda328257b0960f227c5509224077c7cf9c158 /oldXMenu/XMenu.h
parentaefd87e148d11777492fc068f3eddf2945cfbfc5 (diff)
downloademacs-55660072db3bb05d1daba0eb67865913b82d313a.tar.gz
emacs-55660072db3bb05d1daba0eb67865913b82d313a.tar.bz2
emacs-55660072db3bb05d1daba0eb67865913b82d313a.zip
Modernize to C89, for better static checking.
* Activate.c (XMenuActivate): Callback's first arg is readonly. * AddPane.c (XMenuAddPane): Label is readonly. Rename local to avoid shadowing. * AddSel.c (XMenuAddSelection): Help arg is readonly. Rename local. * Create.c (atoi, atof): Remove decls; include <stdlib.h>. (MAX_INACT_PNUM, TILE_BUF_SIZE): Remove; unused. (x_get_resource_string): Args are readonly. (XAllocDisplayColor): colorName is readonly. (XMenuCreate): def_env is readonly. Remove unused locals. Avoid "else;". * Destroy.c (XMenuDestroy): Return void. * Error.c (XMenuError): Remove const pointer. * EvHand.c (XMenuEventHandler): Return void. * FindPane.c, FindSel.c: Include <string.h>. * InsPane.c (XMenuInsertPane): Rename local to avoid shadowing. * InsSel.c (XMenuInsertSelection): Likewise. * Internal.c (toggle_color, BUFFER_SIZE): Remove; unused. (_XMErrorList): Now const. (_XMWinQueInit, _XMRecomputeGlobals, _XMTransToOrigin, _XMRefreshPane): (_XMRefreshSelection): Return void. (_XMWinQueFlush, _XMRefreshSelection): Rename locals to avoid shadowing. (_XMWinQueFlush): Use stack, not heap. Don't use uninitialized var. * SetAEQ.c (XMenuSetAEQ): Now returns void. * SetFrz.c (XMenuSetFreeze): Likewise. * X10.h (XAssoc): Use void * for generic pointer. * XDelAssoc.c: Include XMenuInt.h rather than duplicating part of it. * XDestAssoc.c, XMakeAssoc.c: Likewise. * XDestAssoc.c (XDestroyAssocTable): Return void. * XMakeAssoc.c (XMakeAssoc): Use void * for generic pointer. * XMenu.h, XMenuInt.h: Adjust to signature changes. Use const for pointers to readonly storage. * insque.c: Include XMenuInt.h, to check our own signature. (emacs_insque, emacs_remque): Use void * for generic pointers.
Diffstat (limited to 'oldXMenu/XMenu.h')
-rw-r--r--oldXMenu/XMenu.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/oldXMenu/XMenu.h b/oldXMenu/XMenu.h
index b94c6c3cede..bf1e77b5ff7 100644
--- a/oldXMenu/XMenu.h
+++ b/oldXMenu/XMenu.h
@@ -54,7 +54,7 @@
* XMenu error code and error list definitions.
*/
extern int _XMErrorCode;
-extern char *_XMErrorList[];
+extern char const *const _XMErrorList[];
/*
* Define the XMWindow datatypes.
@@ -106,7 +106,7 @@ typedef struct _xmpane {
int active; /* Window active? */
int activated; /* Window activated? */
int serial; /* -- Pane serial number. */
- char *label; /* -- Pane label. */
+ char const *label; /* -- Pane label. */
int label_width; /* -- Pane label width in pixels. */
int label_length; /* -- Pane label length in chars. */
int label_x; /* -- Pane label X offset. */
@@ -141,7 +141,7 @@ typedef struct _xmselect {
struct _xmwindow *pad_l9; /* ---- */
char *data; /* -- Selection data pointer. */
struct _xmpane *parent_p; /* -- Selection parent pane structure. */
- char *help_string; /* Help string or null. */
+ char const *help_string; /* Help string or null. */
} XMSelect;
@@ -240,29 +240,29 @@ typedef void (*Wait_func)(void*);
/*
* XMenu library routine declarations.
*/
-XMenu *XMenuCreate(Display *display, Window parent, register char *def_env);
-int XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active);
-int XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help);
-int XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active);
-int XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active);
-int XMenuFindPane(register XMenu *menu, register char *label);
-int XMenuFindSelection(register XMenu *menu, int p_num, register char *label);
-int XMenuChangePane(register XMenu *menu, register int p_num, char *label);
-int XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw);
-int XMenuSetPane(register XMenu *menu, register int p_num, register int active);
-int XMenuSetSelection(register XMenu *menu, register int p_num, register int s_num, int active);
-int XMenuRecompute(Display *display, register XMenu *menu);
-int XMenuEventHandler(int (*handler) (XEvent *)); /* No value actually returned. */
-int XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height);
-int XMenuSetFreeze(register XMenu *menu, register int freeze); /* No value actually returned. */
+XMenu *XMenuCreate(Display *display, Window parent, char const *def_env);
+int XMenuAddPane(Display *display, XMenu *menu, char const *label, int active);
+int XMenuAddSelection(Display *display, XMenu *menu, int p_num, char *data, char *label, int active, char const *help);
+int XMenuInsertPane(XMenu *menu, int p_num, char *label, int active);
+int XMenuInsertSelection(XMenu *menu, int p_num, int s_num, char *data, char *label, int active);
+int XMenuFindPane(XMenu *menu, char *label);
+int XMenuFindSelection(XMenu *menu, int p_num, char *label);
+int XMenuChangePane(XMenu *menu, int p_num, char *label);
+int XMenuChangeSelection(Display *display, XMenu *menu, int p_num, int s_num, char *data, int data_sw, char *label, int label_sw);
+int XMenuSetPane(XMenu *menu, int p_num, int active);
+int XMenuSetSelection(XMenu *menu, int p_num, int s_num, int active);
+int XMenuRecompute(Display *display, XMenu *menu);
+void XMenuEventHandler(int (*handler) (XEvent *));
+int XMenuLocate(Display *display, XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height);
+void XMenuSetFreeze(XMenu *menu, int freeze);
void XMenuActivateSetWaitFunction(Wait_func func, void *data);
-int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char *, int, int));
-char *XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask);
-int XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num);
-int XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num);
-int XMenuDestroy(Display *display, register XMenu *menu); /* No value actually returned. */
-char *XMenuError(void);
+int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int));
+char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask);
+int XMenuDeletePane(Display *display, XMenu *menu, int p_num);
+int XMenuDeleteSelection(Display *display, XMenu *menu, int p_num, int s_num);
+void XMenuDestroy(Display *display, XMenu *menu);
+char const *XMenuError(void);
+void XMenuSetAEQ(XMenu *menu, int aeq);
#endif
/* Don't add after this point. */
-