summaryrefslogtreecommitdiff
path: root/src/XawIm.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2024-02-29 16:45:23 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2024-03-02 11:28:34 -0500
commit6ded4c0487220253a2cb2fefc4983ff31e486dd4 (patch)
tree068bc928ff7d847844e49c2823f2f4bdfbfe09b8 /src/XawIm.c
parentf181d10b934c85a30f27de6aa0b71c94e68d2293 (diff)
cppcheck scope and assignment warnings
Diffstat (limited to 'src/XawIm.c')
-rw-r--r--src/XawIm.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/XawIm.c b/src/XawIm.c
index ebc5ede..81d32df 100644
--- a/src/XawIm.c
+++ b/src/XawIm.c
@@ -264,18 +264,19 @@ GetInputStyleOfIC(XawVendorShellExtPart *ve)
static void
ConfigureCB(Widget w, XtPointer closure _X_UNUSED, XEvent *event, Boolean *unused _X_UNUSED)
{
- XawIcTableList p;
XawVendorShellExtPart *ve;
VendorShellWidget vw;
- XVaNestedList pe_attr;
- XRectangle pe_area;
- XawTextMargin *margin;
if (event->type != ConfigureNotify) return;
if ((vw = SearchVendorShell(w)) == NULL) return;
if ((ve = GetExtPart(vw)) != NULL) {
+ XawIcTableList p;
+ XVaNestedList pe_attr;
+ XRectangle pe_area;
+ XawTextMargin *margin;
+
if (IsSharedIC(ve)) return;
if ((ve->im.xim == NULL) ||
((p = GetIcTableShared(w, ve)) == NULL) ||
@@ -450,7 +451,7 @@ OpenIM(XawVendorShellExtPart *ve)
{
int i;
_Xconst char *s, *ns, *end;
- char *p, *pbuf, buf[32];
+ char *p, buf[32];
XIM xim = NULL;
XIMStyles *xim_styles;
XIMStyle input_style = 0;
@@ -462,6 +463,8 @@ OpenIM(XawVendorShellExtPart *ve)
if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
} else {
+ char *pbuf;
+
/* no fragment can be longer than the whole string */
Cardinal len = (Cardinal)strlen (ve->im.input_method) + 5;
@@ -791,7 +794,6 @@ CreateIC(Widget w, XawVendorShellExtPart *ve)
XPointer ic_a[20], pe_a[20], st_a[20];
Dimension height = 0;
int ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
- XawTextMargin *margin;
if (!XtIsRealized(w)) return;
if (((ve->im.xim == NULL) || (p = GetIcTableShared(w, ve)) == NULL) ||
@@ -839,6 +841,7 @@ CreateIC(Widget w, XawVendorShellExtPart *ve)
st_a[st_cnt] = (XPointer) p->line_spacing; st_cnt++;
}
}
+
if (p->input_style & XIMPreeditArea) {
pe_area.x = 0;
pe_area.y = (short)(ve->parent->core.height - height);
@@ -847,7 +850,10 @@ CreateIC(Widget w, XawVendorShellExtPart *ve)
pe_a[pe_cnt] = (XPointer) XNArea; pe_cnt++;
pe_a[pe_cnt] = (XPointer) &pe_area; pe_cnt++;
}
+
if (p->input_style & XIMPreeditPosition) {
+ XawTextMargin *margin;
+
pe_area.x = 0;
pe_area.y = 0;
pe_area.width = w->core.width;
@@ -1085,13 +1091,13 @@ CurrentSharedIcTable(XawVendorShellExtPart *ve)
static void
SetICFocus(Widget w, XawVendorShellExtPart *ve)
{
- XawIcTableList p, pp;
+ XawIcTableList p;
if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
(p->xic == NULL)) return;
if (IsSharedIC(ve)) {
- pp = CurrentSharedIcTable(ve);
+ XawIcTableList pp = CurrentSharedIcTable(ve);
if (pp == NULL || pp->widget != w) {
SharedICChangeFocusWindow(w, ve, p);
}
@@ -1232,10 +1238,12 @@ UnsetFocus(Widget inwidg)
{
XawVendorShellExtPart *ve;
VendorShellWidget vw;
- XawIcTableList p;
if ((vw = SearchVendorShell(inwidg)) == NULL) return;
+
if ((ve = GetExtPart(vw)) != NULL) {
+ XawIcTableList p;
+
if ((p = GetIcTableShared(inwidg, ve)) == NULL) return;
if (p->flg & CIICFocus) {
p->flg &= (unsigned long)(~CIICFocus);