Ticket #4131: 0001-Ticket-4131-use-G_UNICODE_SPACING_MARK-instead-of-G_.patch

File 0001-Ticket-4131-use-G_UNICODE_SPACING_MARK-instead-of-G_.patch, 2.3 KB (added by andrew_b, 4 years ago)
  • lib/strutil/strutilutf8.c

    From 5bf714b008210c88dfa9cde6b921ebdc0e562664 Mon Sep 17 00:00:00 2001
    From: Andrew Borodin <aborodin@vmail.ru>
    Date: Thu, 15 Oct 2020 15:16:24 +0300
    Subject: [PATCH] Ticket #4131: use G_UNICODE_SPACING_MARK instead of
     G_UNICODE_COMBINING_MARK.
    
    G_UNICODE_COMBINING_MARK is deperecated in glib >= 30.
    
    Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
    ---
     lib/strutil/strutilutf8.c |  2 +-
     src/viewer/ascii.c        | 10 ++--------
     2 files changed, 3 insertions(+), 9 deletions(-)
    
    diff --git a/lib/strutil/strutilutf8.c b/lib/strutil/strutilutf8.c
    index efec6be54..5ac0015e6 100644
    a b str_unichar_iscombiningmark (gunichar uni) 
    7070    GUnicodeType type; 
    7171 
    7272    type = g_unichar_type (uni); 
    73     return (type == G_UNICODE_COMBINING_MARK) 
     73    return (type == G_UNICODE_SPACING_MARK) 
    7474        || (type == G_UNICODE_ENCLOSING_MARK) || (type == G_UNICODE_NON_SPACING_MARK); 
    7575} 
    7676 
  • src/viewer/ascii.c

    diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c
    index 67b653434..e2a3ce934 100644
    a b  
    162162 
    163163/*** file scope macro definitions ****************************************************************/ 
    164164 
    165 #if GLIB_CHECK_VERSION (2, 30, 0) 
    166 #define SPACING_MARK G_UNICODE_SPACING_MARK 
    167 #else 
    168 #define SPACING_MARK G_UNICODE_COMBINING_MARK 
    169 #endif 
    170  
    171165/* The Unicode standard recommends that lonely combining characters are printed over a dotted 
    172166 * circle. If the terminal is not UTF-8, this will be replaced by a dot anyway. */ 
    173167#define BASE_CHARACTER_FOR_LONELY_COMBINING 0x25CC      /* dotted circle */ 
    mcview_is_spacing_mark (const WView * view, int c) 
    266260{ 
    267261#ifdef HAVE_CHARSET 
    268262    if (view->utf8) 
    269         return g_unichar_type (c) == SPACING_MARK; 
     263        return g_unichar_type (c) == G_UNICODE_SPACING_MARK; 
    270264#else 
    271265    (void) view; 
    272266    (void) c; 
    mcview_next_combining_char_sequence (WView * view, mcview_state_machine_t * stat 
    535529            return i; 
    536530        if (!mcview_ismark (view, cs[i]) || !mcview_isprint (view, cs[i])) 
    537531            return i; 
    538         if (g_unichar_type (cs[i]) == SPACING_MARK) 
     532        if (g_unichar_type (cs[i]) == G_UNICODE_SPACING_MARK) 
    539533        { 
    540534            /* Only allow as the first combining char. Stop processing in either case. */ 
    541535            if (i == 1)