diff options
| author | Paul Eggert | 2011-04-16 16:11:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-16 16:11:35 -0700 |
| commit | fd35b6f96777be3305879a9ca60ab5befb254042 (patch) | |
| tree | db72c649acdc7f53d9672fba88b6a08b3601cdda /oldXMenu/Create.c | |
| parent | c4354cb4f4a3982331180439120ca72734d49cc5 (diff) | |
| parent | 399c71d323b8beef139437311c78440d0033c652 (diff) | |
| download | emacs-fd35b6f96777be3305879a9ca60ab5befb254042.tar.gz emacs-fd35b6f96777be3305879a9ca60ab5befb254042.zip | |
Static checks with GCC 4.6.0 and non-default toolkits.
Diffstat (limited to 'oldXMenu/Create.c')
| -rw-r--r-- | oldXMenu/Create.c | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c index 8354208773f..25f1f1c3381 100644 --- a/oldXMenu/Create.c +++ b/oldXMenu/Create.c | |||
| @@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 31 | 31 | ||
| 32 | #include <config.h> | 32 | #include <config.h> |
| 33 | #include "XMenuInt.h" | 33 | #include "XMenuInt.h" |
| 34 | 34 | #include <stdlib.h> | |
| 35 | 35 | ||
| 36 | #ifdef EMACS_BITMAP_FILES | 36 | #ifdef EMACS_BITMAP_FILES |
| 37 | #include "../src/bitmaps/dimple1.xbm" | 37 | #include "../src/bitmaps/dimple1.xbm" |
| @@ -71,7 +71,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 71 | #define DEF_MENU_STYLE LEFT | 71 | #define DEF_MENU_STYLE LEFT |
| 72 | #define DEF_MENU_MODE BOX | 72 | #define DEF_MENU_MODE BOX |
| 73 | #define DEF_INACT_PNUM 3 | 73 | #define DEF_INACT_PNUM 3 |
| 74 | #define MAX_INACT_PNUM 4 | ||
| 75 | 74 | ||
| 76 | #define DEF_P_STYLE CENTER | 75 | #define DEF_P_STYLE CENTER |
| 77 | 76 | ||
| @@ -88,16 +87,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 88 | 87 | ||
| 89 | #define XASSOC_TABLE_SIZE 64 | 88 | #define XASSOC_TABLE_SIZE 64 |
| 90 | 89 | ||
| 91 | #define TILE_BUF_SIZE 5 | 90 | char *x_get_resource_string (char const *, char const *); |
| 92 | |||
| 93 | int atoi(const char *); | ||
| 94 | double atof(const char *); | ||
| 95 | char *x_get_resource_string (char *attribute, char *class); | ||
| 96 | 91 | ||
| 97 | 92 | ||
| 98 | 93 | ||
| 99 | static Status | 94 | static Status |
| 100 | XAllocDisplayColor(Display *display, Colormap map, char *colorName, XColor *color, XColor *junk) | 95 | XAllocDisplayColor(Display *display, Colormap map, char const *colorName, |
| 96 | XColor *color, XColor *junk) | ||
| 101 | { | 97 | { |
| 102 | return (colorName!=0 && | 98 | return (colorName!=0 && |
| 103 | XParseColor(display, map, colorName, color) && | 99 | XParseColor(display, map, colorName, color) && |
| @@ -106,13 +102,11 @@ XAllocDisplayColor(Display *display, Colormap map, char *colorName, XColor *colo | |||
| 106 | 102 | ||
| 107 | 103 | ||
| 108 | XMenu * | 104 | XMenu * |
| 109 | XMenuCreate(Display *display, Window parent, register char *def_env) | 105 | XMenuCreate(Display *display, Window parent, register char const *def_env) |
| 110 | /* ID of previously opened display */ | 106 | /* ID of previously opened display */ |
| 111 | /* Window ID of the menu's parent window. */ | 107 | /* Window ID of the menu's parent window. */ |
| 112 | /* X Defaults program environment name. */ | 108 | /* X Defaults program environment name. */ |
| 113 | { | 109 | { |
| 114 | register int i; /* Loop counter. */ | ||
| 115 | register int j; /* Loop counter. */ | ||
| 116 | register char *def_val; /* X Default value temp variable. */ | 110 | register char *def_val; /* X Default value temp variable. */ |
| 117 | 111 | ||
| 118 | register XMenu *menu; /* Pointer to the new menu. */ | 112 | register XMenu *menu; /* Pointer to the new menu. */ |
| @@ -125,7 +119,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 125 | int reverse; /* Reverse video mode. */ | 119 | int reverse; /* Reverse video mode. */ |
| 126 | 120 | ||
| 127 | XMStyle p_style; /* Pane display style. */ | 121 | XMStyle p_style; /* Pane display style. */ |
| 128 | char *p_fnt_name; /* Flag font name. */ | 122 | char const *p_fnt_name; /* Flag font name. */ |
| 129 | XFontStruct *p_fnt_info; /* Flag font structure */ | 123 | XFontStruct *p_fnt_info; /* Flag font structure */ |
| 130 | int p_fnt_pad; /* Flag font padding in pixels. */ | 124 | int p_fnt_pad; /* Flag font padding in pixels. */ |
| 131 | double p_spread; /* Pane spread in flag height fractions. */ | 125 | double p_spread; /* Pane spread in flag height fractions. */ |
| @@ -138,7 +132,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 138 | GC pane_GC; /* Pane graphics context. */ | 132 | GC pane_GC; /* Pane graphics context. */ |
| 139 | 133 | ||
| 140 | XMStyle s_style; /* Selection display style. */ | 134 | XMStyle s_style; /* Selection display style. */ |
| 141 | char *s_fnt_name; /* Selection font name. */ | 135 | char const *s_fnt_name; /* Selection font name. */ |
| 142 | XFontStruct *s_fnt_info; /* Selection font structure. */ | 136 | XFontStruct *s_fnt_info; /* Selection font structure. */ |
| 143 | int s_fnt_pad; /* Selection font padding in pixels. */ | 137 | int s_fnt_pad; /* Selection font padding in pixels. */ |
| 144 | int s_fnt_height; /* Selection font character height */ | 138 | int s_fnt_height; /* Selection font character height */ |
| @@ -151,10 +145,8 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 151 | GC inverse_select_GC; /* GC used for inverse video selection. */ | 145 | GC inverse_select_GC; /* GC used for inverse video selection. */ |
| 152 | GC inact_GC; /* GC for inactive pane header and */ | 146 | GC inact_GC; /* GC for inactive pane header and */ |
| 153 | /* selections. */ | 147 | /* selections. */ |
| 154 | GC inact_GC_noexpose; | ||
| 155 | 148 | ||
| 156 | XColor color_def; /* Temp color definition holder. */ | 149 | XColor color_def; /* Temp color definition holder. */ |
| 157 | XColor screen_def; /* Temp screen color definition holder */ | ||
| 158 | XColor p_bdr_color; /* Color of border. */ | 150 | XColor p_bdr_color; /* Color of border. */ |
| 159 | XColor s_bdr_color; /* Color of highlight. */ | 151 | XColor s_bdr_color; /* Color of highlight. */ |
| 160 | XColor p_frg_color; /* Color of pane foreground color. */ | 152 | XColor p_frg_color; /* Color of pane foreground color. */ |
| @@ -166,17 +158,6 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 166 | 158 | ||
| 167 | int inact_pnum; /* Inactive background pattern number. */ | 159 | int inact_pnum; /* Inactive background pattern number. */ |
| 168 | 160 | ||
| 169 | Pixel p_bdr_pixel; /* Pane border pixel. */ | ||
| 170 | Pixel s_bdr_pixel; /* Selection border pixel. */ | ||
| 171 | Pixel p_frg_pixel; /* Pane foreground pixel. */ | ||
| 172 | Pixel s_frg_pixel; /* Selection foreground pixel. */ | ||
| 173 | Pixel bkgnd_pixel; /* Menu background pixel. */ | ||
| 174 | |||
| 175 | int *width, *height; | ||
| 176 | Pixmap *bitmap; | ||
| 177 | int *x_hot, *y_hot; | ||
| 178 | int status; /* Return code from XReadBitmapFile. */ | ||
| 179 | |||
| 180 | Pixmap cursor; /* Cursor pixmap holder. */ | 161 | Pixmap cursor; /* Cursor pixmap holder. */ |
| 181 | Pixmap cursor_mask; /* Cursor mask pixmap holder. */ | 162 | Pixmap cursor_mask; /* Cursor mask pixmap holder. */ |
| 182 | Pixmap stipple_pixmap; /* Stipple mask for half-tone text. */ | 163 | Pixmap stipple_pixmap; /* Stipple mask for half-tone text. */ |
| @@ -282,7 +263,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 282 | &mouse_color, &color_def) | 263 | &mouse_color, &color_def) |
| 283 | ); | 264 | ); |
| 284 | 265 | ||
| 285 | else ; | 266 | else {} |
| 286 | 267 | ||
| 287 | def_val = x_get_resource_string ("menuBackground", "MenuBackground"); | 268 | def_val = x_get_resource_string ("menuBackground", "MenuBackground"); |
| 288 | if ( | 269 | if ( |
| @@ -304,7 +285,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 304 | "white", | 285 | "white", |
| 305 | &bkgnd_color, &color_def) | 286 | &bkgnd_color, &color_def) |
| 306 | ); | 287 | ); |
| 307 | else; | 288 | else {} |
| 308 | 289 | ||
| 309 | def_val = x_get_resource_string ("menuInactivePattern", "MenuInactivePattern"); | 290 | def_val = x_get_resource_string ("menuInactivePattern", "MenuInactivePattern"); |
| 310 | if (def_val != NULL) { | 291 | if (def_val != NULL) { |
| @@ -401,7 +382,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 401 | "black", | 382 | "black", |
| 402 | &s_frg_color, &color_def) | 383 | &s_frg_color, &color_def) |
| 403 | ) ; | 384 | ) ; |
| 404 | else ; | 385 | else {} |
| 405 | 386 | ||
| 406 | 387 | ||
| 407 | def_val = x_get_resource_string ("selectionBorder", "SelectionBorder"); | 388 | def_val = x_get_resource_string ("selectionBorder", "SelectionBorder"); |
| @@ -424,7 +405,7 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 424 | "black", | 405 | "black", |
| 425 | &s_bdr_color, &color_def) | 406 | &s_bdr_color, &color_def) |
| 426 | ) ; | 407 | ) ; |
| 427 | else ; | 408 | else {} |
| 428 | 409 | ||
| 429 | def_val = x_get_resource_string ("selectionBorderWidth", "SelectionBorderWidth"); | 410 | def_val = x_get_resource_string ("selectionBorderWidth", "SelectionBorderWidth"); |
| 430 | if (def_val != NULL) s_bdr_width = atoi(def_val); | 411 | if (def_val != NULL) s_bdr_width = atoi(def_val); |
| @@ -681,9 +662,6 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 681 | 662 | ||
| 682 | valuemask |= (GCGraphicsExposures); | 663 | valuemask |= (GCGraphicsExposures); |
| 683 | values->graphics_exposures = False; | 664 | values->graphics_exposures = False; |
| 684 | inact_GC_noexpose = XCreateGC (display, | ||
| 685 | root, | ||
| 686 | valuemask, values); | ||
| 687 | 665 | ||
| 688 | 666 | ||
| 689 | /* | 667 | /* |
| @@ -752,4 +730,3 @@ XMenuCreate(Display *display, Window parent, register char *def_env) | |||
| 752 | _XMErrorCode = XME_NO_ERROR; | 730 | _XMErrorCode = XME_NO_ERROR; |
| 753 | return(menu); | 731 | return(menu); |
| 754 | } | 732 | } |
| 755 | |||