Ticket #3547: mc-3547-diffviewer.c-use-gboolean-at-WDiff-struct.patch

File mc-3547-diffviewer.c-use-gboolean-at-WDiff-struct.patch, 5.8 KB (added by and, 7 years ago)
  • src/diffviewer/internal.h

    From 113672e309bab1118d48dde0a0e69f27e926b3d9 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 20 Dec 2015 19:05:00 +0000
    Subject: [PATCH] diffviewer.c: use gboolean at WDiff struct
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/diffviewer/internal.h |  8 ++++----
     src/diffviewer/ydiff.c    | 38 +++++++++++++++++++-------------------
     2 files changed, 23 insertions(+), 23 deletions(-)
    
    diff --git a/src/diffviewer/internal.h b/src/diffviewer/internal.h
    index 41f0de5..728d4b5 100644
    a b typedef struct WDiff 
    9797    int ndiff;                  /* number of hunks */ 
    9898    DSRC dsrc;                  /* data source: memory or temporary file */ 
    9999 
    100     int view_quit:1;            /* Quit flag */ 
     100    gboolean view_quit;         /* Quit flag */ 
    101101 
    102102    int height; 
    103103    int half1; 
    typedef struct WDiff 
    105105    int width1; 
    106106    int width2; 
    107107    int bias; 
    108     int new_frame; 
     108    gboolean new_frame; 
    109109    int skip_rows; 
    110110    int skip_cols; 
    111111    int display_symbols; 
    112112    int display_numbers; 
    113     int show_cr; 
     113    gboolean show_cr; 
    114114    int tab_size; 
    115115    diff_place_t ord; 
    116     int full; 
     116    gboolean full; 
    117117 
    118118#ifdef HAVE_CHARSET 
    119119    gboolean utf8; 
  • src/diffviewer/ydiff.c

    diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c
    index d1597cc..238e73b 100644
    a b cvt_ncpy (char *dst, int dstsize, const char **_src, size_t srcsize, int base, i 
    13631363 */ 
    13641364 
    13651365static int 
    1366 cvt_mget (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int ts, int show_cr) 
     1366cvt_mget (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int ts, gboolean show_cr) 
    13671367{ 
    13681368    int sz = 0; 
    13691369 
    cvt_mget (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int 
    14611461 */ 
    14621462 
    14631463static int 
    1464 cvt_mgeta (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int ts, int show_cr, 
     1464cvt_mgeta (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int ts, gboolean show_cr, 
    14651465           GArray * hdiff, diff_place_t ord, char *att) 
    14661466{ 
    14671467    int sz = 0; 
    cvt_mgeta (const char *src, size_t srcsize, char *dst, int dstsize, int skip, in 
    15621562 */ 
    15631563 
    15641564static int 
    1565 cvt_fget (FBUF * f, off_t off, char *dst, size_t dstsize, int skip, int ts, int show_cr) 
     1565cvt_fget (FBUF * f, off_t off, char *dst, size_t dstsize, int skip, int ts, gboolean show_cr) 
    15661566{ 
    15671567    int base = 0; 
    15681568    int old_base = base; 
    dview_init (WDiff * dview, const char *args, const char *file1, const char *file 
    24552455 
    24562456    dview->ndiff = ndiff; 
    24572457 
    2458     dview->view_quit = 0; 
     2458    dview->view_quit = FALSE; 
    24592459 
    24602460    dview->bias = 0; 
    2461     dview->new_frame = 1; 
     2461    dview->new_frame = TRUE; 
    24622462    dview->skip_rows = 0; 
    24632463    dview->skip_cols = 0; 
    24642464    dview->display_symbols = 0; 
    24652465    dview->display_numbers = 0; 
    2466     dview->show_cr = 1; 
     2466    dview->show_cr = TRUE; 
    24672467    dview->tab_size = 8; 
    24682468    dview->ord = DIFF_LEFT; 
    2469     dview->full = 0; 
     2469    dview->full = FALSE; 
    24702470 
    24712471    dview->search.handle = NULL; 
    24722472    dview->search.last_string = NULL; 
    dview_display_file (const WDiff * dview, diff_place_t ord, int r, int c, int hei 
    25312531    int skip = dview->skip_cols; 
    25322532    int display_symbols = dview->display_symbols; 
    25332533    int display_numbers = dview->display_numbers; 
    2534     int show_cr = dview->show_cr; 
     2534    gboolean show_cr = dview->show_cr; 
    25352535    int tab_size = 8; 
    25362536    const DIFFLN *p; 
    25372537    int nwidth = display_numbers; 
    dview_update (WDiff * dview) 
    28612861                tty_draw_vline (2, width1 + xwidth, ACS_VLINE, height - 2); 
    28622862            } 
    28632863        } 
    2864         dview->new_frame = 0; 
     2864        dview->new_frame = FALSE; 
    28652865    } 
    28662866 
    28672867    if (width1 > 2) 
    dview_load_options (WDiff * dview) 
    30933093    dview->opt.ignore_case = 
    30943094        mc_config_get_bool (mc_main_config, "DiffView", "diff_ignore_case", FALSE); 
    30953095 
    3096     dview->new_frame = 1; 
     3096    dview->new_frame = TRUE; 
    30973097} 
    30983098 
    30993099/* --------------------------------------------------------------------------------------------- */ 
    dview_execute_cmd (WDiff * dview, long command) 
    31533153    { 
    31543154    case CK_ShowSymbols: 
    31553155        dview->display_symbols ^= 1; 
    3156         dview->new_frame = 1; 
     3156        dview->new_frame = TRUE; 
    31573157        break; 
    31583158    case CK_ShowNumbers: 
    31593159        dview->display_numbers ^= calc_nwidth ((const GArray ** const) dview->a); 
    3160         dview->new_frame = 1; 
     3160        dview->new_frame = TRUE; 
    31613161        break; 
    31623162    case CK_SplitFull: 
    3163         dview->full ^= 1; 
    3164         dview->new_frame = 1; 
     3163        dview->full = !dview->full; 
     3164        dview->new_frame = TRUE; 
    31653165        break; 
    31663166    case CK_SplitEqual: 
    31673167        if (!dview->full) 
    31683168        { 
    31693169            dview->bias = 0; 
    3170             dview->new_frame = 1; 
     3170            dview->new_frame = TRUE; 
    31713171        } 
    31723172        break; 
    31733173    case CK_SplitMore: 
    31743174        if (!dview->full) 
    31753175        { 
    31763176            dview_compute_split (dview, 1); 
    3177             dview->new_frame = 1; 
     3177            dview->new_frame = TRUE; 
    31783178        } 
    31793179        break; 
    31803180 
    dview_execute_cmd (WDiff * dview, long command) 
    31823182        if (!dview->full) 
    31833183        { 
    31843184            dview_compute_split (dview, -1); 
    3185             dview->new_frame = 1; 
     3185            dview->new_frame = TRUE; 
    31863186        } 
    31873187        break; 
    31883188    case CK_Tab2: 
    dview_execute_cmd (WDiff * dview, long command) 
    32843284        view_other_cmd (); 
    32853285        break; 
    32863286    case CK_Quit: 
    3287         dview->view_quit = 1; 
     3287        dview->view_quit = TRUE; 
    32883288        break; 
    32893289    case CK_Save: 
    32903290        dview_do_save (dview); 
    dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    33433343        return MSG_HANDLED; 
    33443344 
    33453345    case MSG_DRAW: 
    3346         dview->new_frame = 1; 
     3346        dview->new_frame = TRUE; 
    33473347        dview_update (dview); 
    33483348        return MSG_HANDLED; 
    33493349