mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 13:28:05 +01:00
Remove warnings
* Remove assigned but not used variables (GCC 4.6) * Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need to be tweaked on a per-implementation basis as problems arise)
This commit is contained in:
committed by
Carlos R. Mafra
parent
43c7abe79f
commit
f65b99e615
@@ -30,6 +30,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
|
||||
#include "wconfig.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
@@ -111,9 +112,6 @@ static const char *index_to_name(int indice)
|
||||
static void x_reset_modifier_mapping(Display * display)
|
||||
{
|
||||
int modifier_index, modifier_key, column, mkpm;
|
||||
int warned_about_overlapping_modifiers = 0;
|
||||
int warned_about_predefined_modifiers = 0;
|
||||
int warned_about_duplicate_modifiers = 0;
|
||||
int meta_bit = 0;
|
||||
int hyper_bit = 0;
|
||||
int super_bit = 0;
|
||||
@@ -123,26 +121,22 @@ static void x_reset_modifier_mapping(Display * display)
|
||||
|
||||
#define modwarn(name,old,other) \
|
||||
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
|
||||
name, code, index_to_name (old), other), \
|
||||
warned_about_overlapping_modifiers = 1
|
||||
name, code, index_to_name (old), other)
|
||||
|
||||
#define modbarf(name,other) \
|
||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||
name, code, other), \
|
||||
warned_about_predefined_modifiers = 1
|
||||
name, code, other)
|
||||
|
||||
#define check_modifier(name,mask) \
|
||||
if ((1<<modifier_index) != mask) \
|
||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||
name, code, index_to_name (modifier_index)), \
|
||||
warned_about_predefined_modifiers = 1
|
||||
name, code, index_to_name (modifier_index))
|
||||
|
||||
#define store_modifier(name,old) \
|
||||
if (old && old != modifier_index) \
|
||||
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
|
||||
name, code, index_to_name (old), \
|
||||
index_to_name (modifier_index)), \
|
||||
warned_about_duplicate_modifiers = 1; \
|
||||
index_to_name (modifier_index)); \
|
||||
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
|
||||
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
|
||||
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
|
||||
@@ -254,7 +248,7 @@ static void x_reset_modifier_mapping(Display * display)
|
||||
warn = "Alt", alt_bit = 0;
|
||||
if (warn) {
|
||||
wwarning("%s is being used for both Mode_switch and %s.",
|
||||
index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
|
||||
index_to_name(mode_bit), warn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,35 +258,6 @@ static void x_reset_modifier_mapping(Display * display)
|
||||
AltMask = (alt_bit ? (1 << alt_bit) : 0);
|
||||
ModeMask = (mode_bit ? (1 << mode_bit) : 0); /* unused */
|
||||
|
||||
#if 0
|
||||
if (warned_about_overlapping_modifiers)
|
||||
wwarning("\n"
|
||||
" Two distinct modifier keys (such as Meta and Hyper) cannot generate\n"
|
||||
" the same modifier bit, because Emacs won't be able to tell which\n"
|
||||
" modifier was actually held down when some other key is pressed. It\n"
|
||||
" won't be able to tell Meta-x and Hyper-x apart, for example. Change\n"
|
||||
" one of these keys to use some other modifier bit. If you intend for\n"
|
||||
" these keys to have the same behavior, then change them to have the\n"
|
||||
" same keysym as well as the same modifier bit.\n");
|
||||
|
||||
if (warned_about_predefined_modifiers)
|
||||
wwarning("\n"
|
||||
" The semantics of the modifier bits ModShift, ModLock, and ModControl\n"
|
||||
" are predefined. It does not make sense to assign ModControl to any\n"
|
||||
" keysym other than Control_L or Control_R, or to assign any modifier\n"
|
||||
" bits to the \"control\" keysyms other than ModControl. You can't\n"
|
||||
" turn a \"control\" key into a \"meta\" key (or vice versa) by simply\n"
|
||||
" assigning the key a different modifier bit. You must also make that\n"
|
||||
" key generate an appropriate keysym (Control_L, Meta_L, etc).\n");
|
||||
|
||||
/* No need to say anything more for warned_about_duplicate_modifiers. */
|
||||
|
||||
if (warned_about_overlapping_modifiers || warned_about_predefined_modifiers)
|
||||
wwarning("\n"
|
||||
" The meanings of the modifier bits Mod1 through Mod5 are determined\n"
|
||||
" by the keysyms used to control those bits. Mod1 does NOT always\n"
|
||||
" mean Meta, although some non-ICCCM-compliant programs assume that.\n");
|
||||
#endif
|
||||
XFreeModifiermap(x_modifier_keymap);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user