summaryrefslogtreecommitdiff
path: root/app/xfontsel/ULabel.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 16:24:16 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 16:24:16 +0000
commit2b6a19ae737e110c762371c2602a5cfedafd2c63 (patch)
treec50d1496efdef975742c842b079edaa0929aaaec /app/xfontsel/ULabel.c
parentcda963a723ee68c22b614e7bb7901e02c8891001 (diff)
Update to xfontsel 1.0.6
Diffstat (limited to 'app/xfontsel/ULabel.c')
-rw-r--r--app/xfontsel/ULabel.c63
1 files changed, 7 insertions, 56 deletions
diff --git a/app/xfontsel/ULabel.c b/app/xfontsel/ULabel.c
index 285fb1cb6..bac4992a2 100644
--- a/app/xfontsel/ULabel.c
+++ b/app/xfontsel/ULabel.c
@@ -67,9 +67,6 @@ SOFTWARE.
#define MULTI_LINE_LABEL 32767
-#ifdef CRAY
-#define WORD64
-#endif
/****************************************************************
*
@@ -179,52 +176,6 @@ static void ClassInitialize(void)
static XChar2b *buf2b;
static int buf2blen = 0;
-#ifndef WORD64
-
-#define TXT16 XChar2b
-
-#else
-
-#define TXT16 char
-
-static int _XawLabelWidth16(XFontStruct *fs, char *str, int n)
-{
- int i;
- XChar2b *ptr;
-
- if (n > buf2blen) {
- buf2b = (XChar2b *)XtRealloc((char *)buf2b, n * sizeof(XChar2b));
- buf2blen = n;
- }
- for (ptr = buf2b, i = n; --i >= 0; ptr++) {
- ptr->byte1 = *str++;
- ptr->byte2 = *str++;
- }
- return XTextWidth16(fs, buf2b, n);
-}
-
-static void _XawLabelDraw16(Display *dpy, Drawable d, GC gc,
- int x, int y, char *str, int n)
-{
- int i;
- XChar2b *ptr;
-
- if (n > buf2blen) {
- buf2b = (XChar2b *)XtRealloc((char *)buf2b, n * sizeof(XChar2b));
- buf2blen = n;
- }
- for (ptr = buf2b, i = n; --i >= 0; ptr++) {
- ptr->byte1 = *str++;
- ptr->byte2 = *str++;
- }
- XDrawString16(dpy, d, gc, x, y, buf2b, n);
-}
-
-#define XTextWidth16 _XawLabelWidth16
-#define XDrawString16 _XawLabelDraw16
-
-#endif /* WORD64 */
-
static void _XawLabelDrawUCS(Display *dpy, Drawable d, GC gc,
int x, int y, char *str, int n)
{
@@ -255,7 +206,7 @@ static void _XawLabelDrawUCS(Display *dpy, Drawable d, GC gc,
codepoint=(unsigned)'?';
str++;
}
- ptr->byte1 = (codepoint >> 8) & 0xff;;
+ ptr->byte1 = (codepoint >> 8) & 0xff;
ptr->byte2 = codepoint & 0xff;
}
XDrawString16(dpy, d, gc, x, y, buf2b, ptr - buf2b);
@@ -294,7 +245,7 @@ static int _XawLabelWidthUCS(
codepoint=(unsigned)'?';
str++;
}
- ptr->byte1 = (codepoint >> 8) & 0xff;;
+ ptr->byte1 = (codepoint >> 8) & 0xff;
ptr->byte2 = codepoint & 0xff;
}
return XTextWidth16(fs, buf2b, ptr - buf2b);
@@ -376,7 +327,7 @@ static void SetTextWidthAndHeight(UCSLabelWidget lw)
int width;
if (lw->label.encoding == XawTextEncodingChar2b)
- width = XTextWidth16(fs, (TXT16*)label, (int)(nl - label)/2);
+ width = XTextWidth16(fs, (XChar2b *)label, (int)(nl - label)/2);
else if (lw->label.encoding == XawTextEncodingUCS)
width = XTextWidthUCS(fs, label, nl - label);
else
@@ -392,7 +343,7 @@ static void SetTextWidthAndHeight(UCSLabelWidget lw)
int width;
if (lw->label.encoding == XawTextEncodingChar2b)
- width = XTextWidth16(fs, (TXT16*)label, (int)strlen(label)/2);
+ width = XTextWidth16(fs, (XChar2b *)label, (int)strlen(label)/2);
else if (lw->label.encoding == XawTextEncodingUCS)
width = XTextWidthUCS(fs, label, strlen(label));
else
@@ -404,7 +355,7 @@ static void SetTextWidthAndHeight(UCSLabelWidget lw)
lw->label.label_len = strlen(lw->label.label);
if (lw->label.encoding == XawTextEncodingChar2b)
lw->label.label_width =
- XTextWidth16(fs, (TXT16*)lw->label.label,
+ XTextWidth16(fs, (XChar2b *)lw->label.label,
(int) lw->label.label_len/2);
else if (lw->label.encoding == XawTextEncodingUCS)
lw->label.label_width = XTextWidthUCS(fs, lw->label.label,
@@ -610,7 +561,7 @@ static void Redisplay(Widget gw, XEvent *event, Region region)
if (w->label.encoding == XawTextEncodingChar2b)
XDrawString16(XtDisplay(gw), XtWindow(gw), gc,
w->label.label_x, y,
- (TXT16*)label, (int)(nl - label)/2);
+ (XChar2b *)label, (int)(nl - label)/2);
else if (w->label.encoding == XawTextEncodingUCS)
XDrawStringUCS(XtDisplay(gw), XtWindow(gw), gc,
w->label.label_x, y, label, (int)(nl - label));
@@ -626,7 +577,7 @@ static void Redisplay(Widget gw, XEvent *event, Region region)
if (len) {
if (w->label.encoding == XawTextEncodingChar2b)
XDrawString16(XtDisplay(gw), XtWindow(gw), gc,
- w->label.label_x, y, (TXT16*)label, len/2);
+ w->label.label_x, y, (XChar2b *)label, len/2);
else if (w->label.encoding == XawTextEncodingUCS)
XDrawStringUCS(XtDisplay(gw), XtWindow(gw), gc,
w->label.label_x, y, label, len);