diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-03 21:21:19 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-23 12:15:07 -0800 |
commit | 232f1ddf3d060f3ce9d2ebd35f33b1294cac380e (patch) | |
tree | 929cfe2bb4f2497272e0540ea0980a094018b86c | |
parent | 0bc41d5f8d1a6192f57d9bf646cc46ed839b06b9 (diff) |
Fix gcc -Wwrite-strings warnings in XkbGetRulesDflts
Stop temporarily storing a pointer to a constant literal string
in a char *, just to strdup it a few lines later.
Fixes gcc -Wwrite-strings warnings:
xkbInit.c: In function 'XkbGetRulesDflts':
xkbInit.c:121:38: warning: assignment discards qualifiers from pointer target type
xkbInit.c:123:23: warning: assignment discards qualifiers from pointer target type
xkbInit.c:125:24: warning: assignment discards qualifiers from pointer target type
xkbInit.c:127:25: warning: assignment discards qualifiers from pointer target type
xkbInit.c:129:25: warning: assignment discards qualifiers from pointer target type
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | xkb/xkbInit.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 1ec4e55c6..f578f1679 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -117,22 +117,11 @@ static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; void XkbGetRulesDflts(XkbRMLVOSet *rmlvo) { - if (XkbRulesDflt) rmlvo->rules = XkbRulesDflt; - else rmlvo->rules = XKB_DFLT_RULES; - if (XkbModelDflt) rmlvo->model= XkbModelDflt; - else rmlvo->model= XKB_DFLT_MODEL; - if (XkbLayoutDflt) rmlvo->layout= XkbLayoutDflt; - else rmlvo->layout= XKB_DFLT_LAYOUT; - if (XkbVariantDflt) rmlvo->variant= XkbVariantDflt; - else rmlvo->variant= XKB_DFLT_VARIANT; - if (XkbOptionsDflt) rmlvo->options= XkbOptionsDflt; - else rmlvo->options= XKB_DFLT_OPTIONS; - - rmlvo->rules = strdup(rmlvo->rules); - rmlvo->model = strdup(rmlvo->model); - rmlvo->layout = strdup(rmlvo->layout); - rmlvo->variant = strdup(rmlvo->variant); - rmlvo->options = strdup(rmlvo->options); + rmlvo->rules = strdup(XkbRulesDflt ? XkbRulesDflt : XKB_DFLT_RULES); + rmlvo->model = strdup(XkbModelDflt ? XkbModelDflt : XKB_DFLT_MODEL); + rmlvo->layout = strdup(XkbLayoutDflt ? XkbLayoutDflt : XKB_DFLT_LAYOUT); + rmlvo->variant= strdup(XkbVariantDflt ? XkbVariantDflt : XKB_DFLT_VARIANT); + rmlvo->options= strdup(XkbOptionsDflt ? XkbOptionsDflt : XKB_DFLT_OPTIONS); } void |