From f6e25b291f1948a4a2388b66d0e54e2990aec7ab Mon Sep 17 00:00:00 2001 From: sf-exg Date: Sat, 30 Jan 2010 20:43:56 +0000 Subject: [PATCH] Simplify rxvt_temp_buf usage. --- src/main.C | 8 ++++---- src/rxvtfont.C | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.C b/src/main.C index 9d8acc69..58c4a253 100644 --- a/src/main.C +++ b/src/main.C @@ -1167,7 +1167,7 @@ xim_preedit_draw (XIC ic, XPointer client_data, XIMPreeditDrawCallbackStruct *ca if (text) { - void *str; + wchar_t *str; if (!text->encoding_is_wchar && text->string.multi_byte) { @@ -1175,14 +1175,14 @@ xim_preedit_draw (XIC ic, XPointer client_data, XIMPreeditDrawCallbackStruct *ca if (term->rs[Rs_imLocale]) SET_LOCALE (term->rs[Rs_imLocale]); - str = rxvt_temp_buf ((text->length + 1) * sizeof (wchar_t)); - mbstowcs ((wchar_t *)str, text->string.multi_byte, text->length + 1); + str = rxvt_temp_buf (text->length + 1); + mbstowcs (str, text->string.multi_byte, text->length + 1); if (term->rs[Rs_imLocale]) SET_LOCALE (term->locale); } else - str = (void *)text->string.wide_char; + str = text->string.wide_char; HOOK_INVOKE ((term, HOOK_XIM_PREEDIT_DRAW, DT_INT, call_data->caret, diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 8f52614e..a4dd1d67 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -1295,7 +1295,7 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y, int fg, int bg) { XGlyphInfo extents; - XftGlyphSpec *enc = (XftGlyphSpec *)rxvt_temp_buf (len * sizeof (XftGlyphSpec)); + XftGlyphSpec *enc = rxvt_temp_buf (len); XftGlyphSpec *ep = enc; dTermDisplay; -- 2.34.1