summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-07-03 15:50:55 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-07-04 13:08:31 -0400
commit4739c329307ec58adfe10d76236354fa36b74b7a (patch)
tree94800bd8db79f62ba2c5c305b76b79019d344fba /src
parentc35e10f93b4f93de81fed3b128dabb7db2a490c9 (diff)
downloadxorg-lib-libXaw-4739c329307ec58adfe10d76236354fa36b74b7a.tar.gz
add casts to quiet gcc conversion-warnings, no object change
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r--src/Tip.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/Tip.c b/src/Tip.c
index 8328aac..7a3391d 100644
--- a/src/Tip.c
+++ b/src/Tip.c
@@ -297,7 +297,7 @@ XawTipRealize(Widget w, Mask *mask, XSetWindowAttributes *attr)
attr->backing_store = tip->tip.backing_store;
}
else
- *mask &= ~CWBackingStore;
+ *mask &= (Mask)(~CWBackingStore);
*mask |= CWOverrideRedirect;
attr->override_redirect = True;
@@ -319,26 +319,26 @@ XawTipExpose(Widget w, XEvent *event, Region region)
TipWidget tip = (TipWidget)w;
GC gc = tip->tip.gc;
char *nl, *label = tip->tip.label;
- Position y = tip->tip.top_margin + tip->tip.font->max_bounds.ascent;
+ Position y = (Position)(tip->tip.top_margin + tip->tip.font->max_bounds.ascent);
int len;
if (tip->tip.display_list)
XawRunDisplayList(w, tip->tip.display_list, event, region);
if (tip->tip.international == True) {
- Position ksy = tip->tip.top_margin;
+ Position ksy = (Position)tip->tip.top_margin;
XFontSetExtents *ext = XExtentsOfFontSet(tip->tip.fontset);
- ksy += XawAbs(ext->max_ink_extent.y);
+ ksy = (ksy + XawAbs(ext->max_ink_extent.y));
while ((nl = index(label, '\n')) != NULL) {
XmbDrawString(XtDisplay(w), XtWindow(w), tip->tip.fontset,
gc, tip->tip.left_margin, ksy, label,
(int)(nl - label));
- ksy += ext->max_ink_extent.height;
+ ksy = (ksy + ext->max_ink_extent.height);
label = nl + 1;
}
- len = strlen(label);
+ len = (int)strlen(label);
if (len)
XmbDrawString(XtDisplay(w), XtWindow(w), tip->tip.fontset, gc,
tip->tip.left_margin, ksy, label, len);
@@ -352,11 +352,11 @@ XawTipExpose(Widget w, XEvent *event, Region region)
else
XDrawString(XtDisplay(w), XtWindow(w), gc,
tip->tip.left_margin, y, label, (int)(nl - label));
- y += tip->tip.font->max_bounds.ascent +
- tip->tip.font->max_bounds.descent;
+ y = (Position)(y + (tip->tip.font->max_bounds.ascent +
+ tip->tip.font->max_bounds.descent));
label = nl + 1;
}
- len = strlen(label);
+ len = (int)strlen(label);
if (len) {
if (tip->tip.encoding)
XDrawString16(XtDisplay(w), XtWindow(w), gc,
@@ -426,7 +426,7 @@ TipLayout(XawTipInfo *info)
}
}
else
- width = XmbTextEscapement(fset, label, strlen(label));
+ width = XmbTextEscapement(fset, label, (int)strlen(label));
}
else {
height = fs->max_bounds.ascent + fs->max_bounds.descent;
@@ -449,13 +449,13 @@ TipLayout(XawTipInfo *info)
}
else
width = info->tip->tip.encoding ?
- XTextWidth16(fs, (XChar2b*)label, strlen(label) >> 1) :
- XTextWidth(fs, label, strlen(label));
+ XTextWidth16(fs, (XChar2b*)label, (int)(strlen(label) >> 1)) :
+ XTextWidth(fs, label, (int)strlen(label));
}
- XtWidth(info->tip) = width + info->tip->tip.left_margin +
- info->tip->tip.right_margin;
- XtHeight(info->tip) = height + info->tip->tip.top_margin +
- info->tip->tip.bottom_margin;
+ XtWidth(info->tip) = (width + info->tip->tip.left_margin +
+ info->tip->tip.right_margin);
+ XtHeight(info->tip) = (height + info->tip->tip.top_margin +
+ info->tip->tip.bottom_margin);
}
#define DEFAULT_TIP_Y_OFFSET 12
@@ -469,14 +469,14 @@ TipPosition(XawTipInfo *info)
XQueryPointer(XtDisplay((Widget)info->tip), XtWindow((Widget)info->tip),
&r, &c, &rx, &ry, &wx, &wy, &mask);
- x = rx - (XtWidth(info->tip) >> 1);
- y = ry + DEFAULT_TIP_Y_OFFSET;
+ x = (Position)(rx - (XtWidth(info->tip) >> 1));
+ y = (Position)(ry + DEFAULT_TIP_Y_OFFSET);
if (x >= 0) {
int scr_width = WidthOfScreen(XtScreen(info->tip));
if (x + XtWidth(info->tip) + XtBorderWidth(info->tip) > scr_width)
- x = scr_width - XtWidth(info->tip) - XtBorderWidth(info->tip);
+ x = (Position)(scr_width - XtWidth(info->tip) - XtBorderWidth(info->tip));
}
if (x < 0)
x = 0;
@@ -484,8 +484,8 @@ TipPosition(XawTipInfo *info)
int scr_height = HeightOfScreen(XtScreen(info->tip));
if (y + XtHeight(info->tip) + XtBorderWidth(info->tip) > scr_height)
- y -= XtHeight(info->tip) + XtBorderWidth(info->tip) +
- (DEFAULT_TIP_Y_OFFSET << 1);
+ y = (Position)(y - (XtHeight(info->tip) + XtBorderWidth(info->tip) +
+ (DEFAULT_TIP_Y_OFFSET << 1)));
}
if (y < 0)
y = 0;
@@ -548,7 +548,8 @@ ResetTip(XawTipInfo *info, Bool add_timeout)
if (add_timeout) {
info->tip->tip.timer =
XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)info->tip),
- info->tip->tip.timeout, TipTimeoutCallback,
+ (unsigned long)info->tip->tip.timeout,
+ TipTimeoutCallback,
(XtPointer)info);
}
}