Ticket #1976: 1976-unifying-some-declarations-in-src-dir.patch

File 1976-unifying-some-declarations-in-src-dir.patch, 14.2 KB (added by vit_r, 14 years ago)

trivial changes in some src-dir C-files

  • src/args.c

    From 6f9d17e6541df19caa115e398b15b454eb3bf4cf Mon Sep 17 00:00:00 2001
    From: Vit Rosin <vit_r@list.ru>
    Date: Sun, 24 Jan 2010 21:00:39 +0000
    Subject: [PATCH]  unifying some declarations in src dir
    
    ---
     src/args.c                   |    2 +-
     src/cmd.c                    |    6 +++---
     src/cmd.h                    |    4 ++--
     src/ext.c                    |    6 +++---
     src/file.c                   |    2 +-
     src/filehighlight/internal.h |    2 +-
     src/find.c                   |   18 +++++++++---------
     src/main.c                   |    6 +++---
     src/panel.h                  |    4 ++--
     src/screen.c                 |    2 +-
     src/tty/mouse.c              |    3 +++
     src/viewer/display.c         |    6 +++++-
     src/viewer/internal.h        |    4 ++--
     src/viewer/mcviewer.c        |    4 ++--
     src/viewer/mcviewer.h        |    4 ++--
     src/viewer/nroff.c           |    2 +-
     src/viewer/search.c          |    6 +++---
     17 files changed, 44 insertions(+), 37 deletions(-)
    
    diff --git a/src/args.c b/src/args.c
    index f845aed..4e560a0 100644
    a b static const GOptionEntry argument_terminal_table[] = { 
    235235 
    236236GOptionGroup *color_group; 
    237237#define ARGS_COLOR_OPTIONS 0 
    238 // #define ARGS_COLOR_OPTIONS G_OPTION_FLAG_IN_MAIN 
     238/* #define ARGS_COLOR_OPTIONS G_OPTION_FLAG_IN_MAIN */ 
    239239static const GOptionEntry argument_color_table[] = { 
    240240    /* color options */ 
    241241    { 
  • src/cmd.c

    diff --git a/src/cmd.c b/src/cmd.c
    index 182a896..ad912cf 100644
    a b int select_flags = SELECT_MATCH_CASE | SELECT_SHELL_PATTERNS; 
    113113 
    114114int 
    115115view_file_at_line (const char *filename, int plain_view, int internal, 
    116                    int start_line) 
     116                   long start_line) 
    117117{ 
    118118    static const char *viewer = NULL; 
    119119    int move_dir = 0; 
    view_file_at_line (const char *filename, int plain_view, int internal, 
    150150        char view_entry[BUF_TINY]; 
    151151 
    152152        if (start_line != 0) 
    153             g_snprintf (view_entry, sizeof (view_entry), "View:%d", 
     153            g_snprintf (view_entry, sizeof (view_entry), "View:%ld", 
    154154                        start_line); 
    155155        else 
    156156            strcpy (view_entry, "View"); 
    filtered_view_cmd (void) 
    295295} 
    296296 
    297297void 
    298 do_edit_at_line (const char *what, int start_line) 
     298do_edit_at_line (const char *what, long start_line) 
    299299{ 
    300300    static const char *editor = NULL; 
    301301 
  • src/cmd.h

    diff --git a/src/cmd.h b/src/cmd.h
    index cca7473..23069d3 100644
    a b void smart_dirsize_cmd (void); 
    1818void single_dirsize_cmd (void); 
    1919void dirsizes_cmd (void); 
    2020int view_file_at_line (const char *filename, int plain_view, int internal, 
    21                        int start_line); 
     21                       long start_line); 
    2222int view_file (const char *filename, int normal, int internal); 
    2323void view_cmd (void); 
    2424void view_file_cmd (void); 
    2525void view_simple_cmd (void); 
    2626void filtered_view_cmd (void); 
    27 void do_edit_at_line (const char *what, int start_line); 
     27void do_edit_at_line (const char *what, long start_line); 
    2828void edit_cmd (void); 
    2929void edit_cmd_new (void); 
    3030void copy_cmd (void); 
  • src/ext.c

    diff --git a/src/ext.c b/src/ext.c
    index 7e368e8..6e26931 100644
    a b typedef char *(*quote_func_t) (const char *name, int quote_percent); 
    6767 
    6868static void 
    6969exec_extension (const char *filename, const char *lc_data, int *move_dir, 
    70                 int start_line) 
     70                long start_line) 
    7171{ 
    7272    char *fn; 
    7373    char *file_name; 
    regex_command (const char *filename, const char *action, int *move_dir) 
    433433    int error_flag = 0; 
    434434    int ret = 0; 
    435435    struct stat mystat; 
    436     int view_at_line_number; 
     436    long view_at_line_number; 
    437437    char *include_target; 
    438438    int include_target_len; 
    439439    int have_type = 0;          /* Flag used by regex_check_type() */ 
    440440 
    441441    /* Check for the special View:%d parameter */ 
    442442    if (strncmp (action, "View:", 5) == 0) { 
    443         view_at_line_number = atoi (action + 5); 
     443        view_at_line_number = atol (action + 5); 
    444444        action = "View"; 
    445445    } else { 
    446446        view_at_line_number = 0; 
  • src/file.c

    diff --git a/src/file.c b/src/file.c
    index f0b0c02..3041d72 100644
    a b end_bg_process (FileOpContext *ctx, enum OperationMode mode) { 
    18001800    ctx->pid = 0; 
    18011801 
    18021802    unregister_task_with_pid(pid); 
    1803 //    file_op_context_destroy(ctx); 
     1803/*    file_op_context_destroy(ctx); */ 
    18041804    return 1; 
    18051805} 
    18061806#endif 
  • src/filehighlight/internal.h

    diff --git a/src/filehighlight/internal.h b/src/filehighlight/internal.h
    index 4b66254..3856af6 100644
    a b typedef enum { 
    2626    MC_FLHGH_FTYPE_T_SPECIAL, 
    2727    MC_FLHGH_FTYPE_T_SPECIAL_SOCKET, 
    2828    MC_FLHGH_FTYPE_T_SPECIAL_FIFO, 
    29     MC_FLHGH_FTYPE_T_SPECIAL_DOOR, 
     29    MC_FLHGH_FTYPE_T_SPECIAL_DOOR 
    3030} mc_flhgh_ftype_type; 
    3131 
    3232/*** structures declarations (and typedefs of structures)*****************************************/ 
  • src/find.c

    diff --git a/src/find.c b/src/find.c
    index 1d0a3e0..bfac3eb 100644
    a b static char *old_dir = NULL; 
    117117 
    118118/* Where did we stop */ 
    119119static int resuming; 
    120 static int last_line; 
    121 static int last_pos; 
     120static long last_line; 
     121static long last_pos; 
    122122 
    123123static Dlg_head *find_dlg;      /* The dialog */ 
    124124static WButton *stop_button;    /* pointer to the stop button */ 
    find_add_match (const char *dir, const char *file) 
    644644 * has_newline - is there newline ? 
    645645 */ 
    646646static char * 
    647 get_line_at (int file_fd, char *buf, int buf_size, int *pos, int *n_read, 
     647get_line_at (int file_fd, char *buf, int buf_size, long *pos, long *n_read, 
    648648             gboolean *has_newline) 
    649649{ 
    650650    char *buffer = NULL; 
    search_content (Dlg_head *h, const char *directory, const char *filename) 
    753753    tty_got_interrupt (); 
    754754 
    755755    { 
    756         int line = 1; 
    757         int pos = 0; 
    758         int n_read = 0; 
     756        long line = 1; 
     757        long pos = 0; 
     758        long n_read = 0; 
    759759        gboolean has_newline; 
    760760        char *p = NULL; 
    761761        gboolean found = FALSE; 
    search_content (Dlg_head *h, const char *directory, const char *filename) 
    774774            if (!found          /* Search in binary line once */ 
    775775                    && mc_search_run (search_content_handle, 
    776776                                        (const void *) p, 0, strlen (p), &found_len)) { 
    777                 g_snprintf (result, sizeof (result), "%d:%s", line, filename); 
     777                g_snprintf (result, sizeof (result), "%ld:%s", line, filename); 
    778778                find_add_match (directory, result); 
    779779                found = TRUE; 
    780780            } 
    find_do_view_edit (int unparsed_view, int edit, char *dir, char *file) 
    10181018{ 
    10191019    char *fullname = NULL; 
    10201020    const char *filename = NULL; 
    1021     int line; 
     1021    long line; 
    10221022 
    10231023    if (content_pattern != NULL) { 
    10241024        filename = strchr (file + 4, ':') + 1; 
    1025         line = atoi (file + 4); 
     1025        line = atol (file + 4); 
    10261026    } else { 
    10271027        filename = file + 4; 
    10281028        line = 0; 
  • src/main.c

    diff --git a/src/main.c b/src/main.c
    index a12fb12..82b39f7 100644
    a b const char *view_one_file = NULL; 
    280280const char *edit_one_file = NULL; 
    281281 
    282282/* Line to start the editor on */ 
    283 static int edit_one_file_start_line = 0; 
     283static long edit_one_file_start_line = 0; 
    284284 
    285285/* Used so that widgets know if they are being destroyed or 
    286286   shut down */ 
    mc_main__setup_by_args (int argc, char *argv[]) 
    20522052                 */ 
    20532053                if (mc_stat (tmp, &st) == -1 && mc_stat (fname, &st) != -1) { 
    20542054                    edit_one_file = fname; 
    2055                     edit_one_file_start_line = atoi (p); 
     2055                    edit_one_file_start_line = atol (p); 
    20562056                } else { 
    20572057                    g_free (fname); 
    20582058                    goto try_plus_filename; 
    mc_main__setup_by_args (int argc, char *argv[]) 
    20602060            } else { 
    20612061            try_plus_filename: 
    20622062                if (*tmp == '+' && g_ascii_isdigit ((gchar) tmp[1])) { 
    2063                     int start_line = atoi (tmp); 
     2063                    long start_line = atol (tmp); 
    20642064                    if (start_line > 0) { 
    20652065                        char *file = (argc > 1) ? argv[2] : NULL; 
    20662066                        if (file) { 
  • src/panel.h

    diff --git a/src/panel.h b/src/panel.h
    index b32dabc..0415abd 100644
    a b typedef enum { 
    2727    view_listing        = 0,            /* Directory listing */ 
    2828    view_info           = 1,            /* Information panel */ 
    2929    view_tree           = 2,            /* Tree view */ 
    30     view_quick          = 3,            /* Quick view */ 
    31     view_nothing        = 4,            /* Undefined */ 
     30    view_quick          = 3             /* Quick view */ 
     31/*  view_nothing        = 4                Undefined */ 
    3232} panel_view_mode_t; 
    3333 
    3434enum panel_display_enum { 
  • src/screen.c

    diff --git a/src/screen.c b/src/screen.c
    index 6abfac6..ade7af9 100644
    a b panel_get_title_without_hotkey(const char *title) 
    13811381 
    13821382    hkey = strchr(translated_title, '&'); 
    13831383    if ((hkey != NULL) && (hkey[1] != '\0')) 
    1384         memmove((void *) hkey, (void *) hkey+1,strlen(hkey)); 
     1384        memmove((void *) hkey, (void *) (hkey + 1), strlen (hkey)); 
    13851385 
    13861386    return translated_title; 
    13871387} 
  • src/tty/mouse.c

    diff --git a/src/tty/mouse.c b/src/tty/mouse.c
    index a811c05..841d377 100644
    a b show_mouse_pointer (int x, int y) 
    4747#ifdef HAVE_LIBGPM 
    4848    if (use_mouse_p == MOUSE_GPM) 
    4949        Gpm_DrawPointer (x, y, gpm_consolefd); 
     50#else 
     51    (void) x; 
     52    (void) y; 
    5053#endif /* HAVE_LIBGPM */ 
    5154} 
    5255 
  • src/viewer/display.c

    diff --git a/src/viewer/display.c b/src/viewer/display.c
    index 87a94a2..f67afba 100644
    a b  
    4949#include "internal.h" 
    5050#include "mcviewer.h" 
    5151 
     52#ifdef HAVE_CHARSET 
     53#include "charsets.h"                   /* get_codepage_id () */ 
     54#endif 
     55 
    5256/*** global variables ****************************************************************************/ 
    5357 
    5458/*** file scope macro definitions ****************************************************************/ 
    mcview_display_status (mcview_t * view) 
    127131    const screen_dimen width = view->status_area.width; 
    128132    const screen_dimen height = view->status_area.height; 
    129133    const char *file_label; 
    130     screen_dimen file_label_width, i = 0; 
     134    screen_dimen file_label_width; 
    131135 
    132136    if (height < 1) 
    133137        return; 
  • src/viewer/internal.h

    diff --git a/src/viewer/internal.h b/src/viewer/internal.h
    index 22391c6..348385f 100644
    a b gboolean mcview_get_byte_none (mcview_t *, off_t, int *); 
    231231void mcview_set_byte (mcview_t *, off_t, byte); 
    232232void mcview_file_load_data (mcview_t *, off_t); 
    233233void mcview_close_datasource (mcview_t *); 
    234 void mcview_set_datasource_file (mcview_t *, int, const struct stat *); 
     234void mcview_set_datasource_file (mcview_t * view, int fd, const struct stat *st); 
    235235gboolean mcview_load_command_output (mcview_t *, const char *); 
    236236void mcview_set_datasource_vfs_pipe (mcview_t *, int); 
    237237void mcview_set_datasource_string (mcview_t *, const char *); 
    void mcview_moveto_match (mcview_t *); 
    297297 
    298298/* nroff.c: */ 
    299299void mcview_display_nroff (mcview_t *view); 
    300 int mcview__get_nroff_real_len (mcview_t *view, off_t, off_t p); 
     300int mcview_get_nroff_real_len (mcview_t *view, off_t, off_t p); 
    301301 
    302302mcview_nroff_t *mcview_nroff_seq_new_num (mcview_t *view, off_t p); 
    303303mcview_nroff_t *mcview_nroff_seq_new (mcview_t * view); 
  • src/viewer/mcviewer.c

    diff --git a/src/viewer/mcviewer.c b/src/viewer/mcviewer.c
    index a2aecf4..d9f2020 100644
    a b mcview_new (int y, int x, int lines, int cols, int is_panel) 
    261261 
    262262/* Real view only */ 
    263263int 
    264 mcview_viewer (const char *command, const char *file, int *move_dir_p, int start_line) 
     264mcview_viewer (const char *command, const char *file, int *move_dir_p, long start_line) 
    265265{ 
    266266    gboolean succeeded; 
    267267    mcview_t *lc_mcview; 
    mcview_viewer (const char *command, const char *file, int *move_dir_p, int start 
    295295/* --------------------------------------------------------------------------------------------- */ 
    296296 
    297297gboolean 
    298 mcview_load (mcview_t * view, const char *command, const char *file, int start_line) 
     298mcview_load (mcview_t * view, const char *command, const char *file, long start_line) 
    299299{ 
    300300    int i, type; 
    301301    int fd = -1; 
  • src/viewer/mcviewer.h

    diff --git a/src/viewer/mcviewer.h b/src/viewer/mcviewer.h
    index 89ba277..6bea829 100644
    a b extern struct mcview_struct *mcview_new (int y, int x, int lines, int cols, int 
    4444 * wants to move (-1 = previous file, 1 = next file, 0 = do nothing). 
    4545 */ 
    4646extern int mcview_viewer (const char *command, const char *file, 
    47                           int *move_dir_p, int start_line); 
     47                          int *move_dir_p, long start_line); 
    4848 
    49 extern gboolean mcview_load (struct mcview_struct *, const char *, const char *, int); 
     49extern gboolean mcview_load (struct mcview_struct *, const char *, const char *, long start_line); 
    5050 
    5151#endif 
  • src/viewer/nroff.c

    diff --git a/src/viewer/nroff.c b/src/viewer/nroff.c
    index 8602572..045f577 100644
    a b mcview_display_nroff (mcview_t * view) 
    197197/* --------------------------------------------------------------------------------------------- */ 
    198198 
    199199int 
    200 mcview__get_nroff_real_len (mcview_t * view, off_t start, off_t length) 
     200mcview_get_nroff_real_len (mcview_t * view, off_t start, off_t length) 
    201201{ 
    202202    mcview_nroff_t *nroff; 
    203203    int ret = 0; 
  • src/viewer/search.c

    diff --git a/src/viewer/search.c b/src/viewer/search.c
    index 63d639e..b5df1b2 100644
    a b mcview_search_show_result(mcview_t * view, Dlg_head **d, size_t match_len) 
    111111{ 
    112112 
    113113        view->search_start = view->search->normal_offset + 
    114                 mcview__get_nroff_real_len (view, 
     114                mcview_get_nroff_real_len (view, 
    115115                                            view->search->start_buffer, 
    116116                                            view->search->normal_offset - 
    117117                                            view->search->start_buffer); 
    mcview_search_show_result(mcview_t * view, Dlg_head **d, size_t match_len) 
    120120            view->search_start++; 
    121121 
    122122        view->search_end = view->search_start + match_len + 
    123             mcview__get_nroff_real_len (view, view->search_start - 1, match_len); 
     123            mcview_get_nroff_real_len (view, view->search_start - 1, match_len); 
    124124 
    125125        if (view->hex_mode) { 
    126126            view->hex_cursor = view->search_start; 
    mcview_do_search (mcview_t * view) 
    221221    if (view->search_start) { 
    222222        search_start = (view->search_backwards) ? -2 : 2; 
    223223        search_start = view->search_start + search_start + 
    224             mcview__get_nroff_real_len (view, view->search_start, 2) * search_start; 
     224            mcview_get_nroff_real_len (view, view->search_start, 2) * search_start; 
    225225    } else { 
    226226        search_start = view->search_start; 
    227227    }