From dd94068a62e9623a6be8660a775f945dfee5a3d8 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Wed, 30 Sep 2009 02:09:54 +0300 Subject: [PATCH] Ticket #1649: Prepare for prerelease mc-4.7.0-pre3 (code cleanup) Try to compile with {{{ make CFLAGS="-Wall -Werror -Wno-long-long -Wwrite-strings" }}} Signed-off-by: Slava Zanko --- edit/editcmd.c | 23 ++++++----- edit/editcmd_dialogs.c | 10 ++--- edit/editdraw.c | 2 +- src/boxes.c | 2 +- src/filegui.c | 6 +-- src/filehighlight/get-color.c | 2 + src/main.c | 88 ------------------------------------------- src/viewer/actions_cmd.c | 57 +--------------------------- src/viewer/dialogs.c | 2 +- src/viewer/mcviewer.c | 1 - src/viewer/plain.c | 2 +- src/wtools.c | 2 +- vfs/samba/lib/debug.c | 1 + vfs/samba/lib/kanji.c | 2 + vfs/samba/lib/time.c | 2 +- vfs/samba/lib/util.c | 5 ++- vfs/samba/libsmb/clientgen.c | 6 +-- vfs/samba/libsmb/namequery.c | 2 +- vfs/samba/libsmb/nmblib.c | 9 +++-- vfs/samba/libsmb/pwd_cache.c | 5 +++ 20 files changed, 48 insertions(+), 181 deletions(-) diff --git a/edit/editcmd.c b/edit/editcmd.c index aa38c2598..e71718ede 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -485,7 +485,7 @@ edit_get_save_file_as (WEdit *edit) char *filename = edit->filename; - char *lb_names[LB_NAMES] = + const char *lb_names[LB_NAMES] = { N_("&Do not change"), N_("&Unix format (LF)"), @@ -497,7 +497,7 @@ edit_get_save_file_as (WEdit *edit) { QUICK_BUTTON (6, 10, DLG_HEIGHT - 3, DLG_HEIGHT, N_("&Cancel"), B_CANCEL, NULL), QUICK_BUTTON (2, 10, DLG_HEIGHT - 3, DLG_HEIGHT, N_("&OK"), B_ENTER, NULL), - QUICK_RADIO (5, DLG_WIDTH, DLG_HEIGHT - 8, DLG_HEIGHT, LB_NAMES, (const char **) lb_names, &cur_lb), + QUICK_RADIO (5, DLG_WIDTH, DLG_HEIGHT - 8, DLG_HEIGHT, LB_NAMES, lb_names, (int *) &cur_lb), QUICK_LABEL (3, DLG_WIDTH, DLG_HEIGHT - 9, DLG_HEIGHT, N_("Change line breaks to:")), QUICK_INPUT (3, DLG_WIDTH, DLG_HEIGHT - 11, DLG_HEIGHT, filename, DLG_WIDTH - 6, 0, "save-as", &filename), QUICK_LABEL (2, DLG_WIDTH, DLG_HEIGHT - 12, DLG_HEIGHT, N_(" Enter file name: ")), @@ -2315,9 +2315,10 @@ static gboolean is_break_char(char c) } /* find first character of current word */ -static int edit_find_word_start (WEdit *edit, long *word_start, int *word_len) +static int edit_find_word_start (WEdit *edit, long *word_start, gsize *word_len) { - int i, c, last; + int c, last; + gsize i; /* return if at begin of file */ if (edit->curs1 <= 0) @@ -2354,10 +2355,10 @@ static int edit_find_word_start (WEdit *edit, long *word_start, int *word_len) #define MAX_WORD_COMPLETIONS 100 /* in listbox */ /* collect the possible completions */ -static int -edit_collect_completions (WEdit *edit, long start, int word_len, +static gsize +edit_collect_completions (WEdit *edit, long start, gsize word_len, char *match_expr, struct selection *compl, - int *num) + gsize *num) { gsize len = 0; gsize max_len = 0; @@ -2461,8 +2462,7 @@ edit_collect_completions (WEdit *edit, long start, int word_len, void edit_complete_word_cmd (WEdit *edit) { - int word_len = 0, num_compl = 0; - gsize i, max_len; + gsize i, max_len, word_len = 0, num_compl = 0; long word_start = 0; unsigned char *bufpos; char *match_expr; @@ -2507,7 +2507,7 @@ edit_complete_word_cmd (WEdit *edit) g_free (match_expr); /* release memory before return */ - for (i = 0; i < (gsize) num_compl; i++) + for (i = 0; i < num_compl; i++) g_free (compl[i].text); } @@ -2638,9 +2638,8 @@ edit_load_back_cmd (WEdit *edit) void edit_get_match_keyword_cmd (WEdit *edit) { - int word_len = 0; + gsize word_len = 0, max_len = 0; int num_def = 0; - int max_len = 0; int i; long word_start = 0; unsigned char *bufpos; diff --git a/edit/editcmd_dialogs.c b/edit/editcmd_dialogs.c index 06da30045..751cf8d52 100644 --- a/edit/editcmd_dialogs.c +++ b/edit/editcmd_dialogs.c @@ -105,7 +105,7 @@ editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const cha /* 5 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 8, REPLACE_DLG_HEIGHT, N_("&Backwards"), &edit->replace_backwards), /* 6 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 7, REPLACE_DLG_HEIGHT, N_("case &Sensitive"), &edit->replace_case), /* 7 */ QUICK_RADIO (3, REPLACE_DLG_WIDTH, 7, REPLACE_DLG_HEIGHT, - num_of_types, (const char **) list_of_types, &edit->search_type), + num_of_types, (const char **) list_of_types, (int *) &edit->search_type), /* 8 */ QUICK_LABEL (2, REPLACE_DLG_WIDTH, 4, REPLACE_DLG_HEIGHT, N_(" Enter replacement string:")), /* 9 */ QUICK_INPUT (3, REPLACE_DLG_WIDTH, 5, REPLACE_DLG_HEIGHT, replace_default, REPLACE_DLG_WIDTH - 6, 0, "replace", replace_text), @@ -144,7 +144,7 @@ editcmd_dialog_search_show (WEdit * edit, char **search_text) size_t num_of_types; gchar **list_of_types = mc_search_get_types_strings_array (&num_of_types); int SEARCH_DLG_HEIGHT = SEARCH_DLG_MIN_HEIGHT + num_of_types - SEARCH_DLG_HEIGHT_SUPPLY; - int i; + size_t i; int dialog_result; @@ -170,7 +170,7 @@ editcmd_dialog_search_show (WEdit * edit, char **search_text) QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT, N_("case &Sensitive"), &edit->replace_case), /* 8 */ QUICK_RADIO ( 3, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT, - num_of_types, (const char **) list_of_types, &edit->search_type), + num_of_types, (const char **) list_of_types, (int *) &edit->search_type), /* 9 */ QUICK_INPUT (3, SEARCH_DLG_WIDTH, 3, SEARCH_DLG_HEIGHT, *search_text, SEARCH_DLG_WIDTH - 6, 0, MC_HISTORY_SHARED_SEARCH, search_text), @@ -180,9 +180,9 @@ editcmd_dialog_search_show (WEdit * edit, char **search_text) }; #ifdef HAVE_CHARSET - int last_checkbox = 7; + size_t last_checkbox = 7; #else - int last_checkbox = 6; + size_t last_checkbox = 6; #endif QuickDialog Quick_input = diff --git a/edit/editdraw.c b/edit/editdraw.c index 63682a1ba..95509945a 100644 --- a/edit/editdraw.c +++ b/edit/editdraw.c @@ -387,7 +387,7 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col, q)) + edit->start_col; if ( option_line_state ) { cur_line = edit->start_line + row; - if ( cur_line <= edit->total_lines ) { + if ( cur_line <= (unsigned int) edit->total_lines ) { g_snprintf (line_stat, LINE_STATE_WIDTH + 1, "%7i ", cur_line + 1); } else { memset(line_stat, ' ', LINE_STATE_WIDTH); diff --git a/src/boxes.c b/src/boxes.c index d3991617a..54ee2bc78 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -346,7 +346,7 @@ sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive, int *exec_first) /* dialog */ quick_dlg.xlen = dlg_width; /* widgets */ - for (i = 0; i < sizeof (quick_widgets)/sizeof (quick_widgets[0]) - 1; i++) + for (i = 0; (size_t) i < sizeof (quick_widgets)/sizeof (quick_widgets[0]) - 1; i++) quick_widgets[i].x_divisions = dlg_width; /* buttons */ quick_widgets[0].relative_x = dlg_width * 2/3 - cancel_len/2; diff --git a/src/filegui.c b/src/filegui.c index 3544c5021..43178e90f 100644 --- a/src/filegui.c +++ b/src/filegui.c @@ -819,9 +819,9 @@ char * file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text, const char *def_text, int only_one, int *do_background) { - const int FMDY = 13; - const int FMDX = 64; - int fmd_xlen = 0; + const size_t FMDY = 13; + const size_t FMDX = 64; + size_t fmd_xlen = 0; int source_easy_patterns = easy_patterns; size_t i, len; diff --git a/src/filehighlight/get-color.c b/src/filehighlight/get-color.c index 6a7587bb4..a070895ed 100644 --- a/src/filehighlight/get-color.c +++ b/src/filehighlight/get-color.c @@ -128,6 +128,7 @@ static int mc_fhl_get_color_filetype (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, file_entry * fe) { gboolean my_color = FALSE; + (void) fhl; switch (mc_filter->file_type) { case MC_FLHGH_FTYPE_T_FILE: @@ -202,6 +203,7 @@ mc_fhl_get_color_filetype (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, file_ent static int mc_fhl_get_color_regexp (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, file_entry * fe) { + (void) fhl; if (mc_filter->search_condition == NULL) return -1; diff --git a/src/main.c b/src/main.c index 69403de02..ff3e73da1 100644 --- a/src/main.c +++ b/src/main.c @@ -315,89 +315,6 @@ GArray *input_keymap = NULL; const global_key_map_t *main_map; const global_key_map_t *main_x_map; -static void -reload_panelized (WPanel *panel) -{ - int i, j; - dir_list *list = &panel->dir; - - if (panel != current_panel) - mc_chdir (panel->cwd); - - for (i = 0, j = 0; i < panel->count; i++) { - if (list->list[i].f.marked) { - /* Unmark the file in advance. In case the following mc_lstat - * fails we are done, else we have to mark the file again - * (Note: do_file_mark depends on a valid "list->list [i].buf"). - * IMO that's the best way to update the panel's summary status - * -- Norbert - */ - do_file_mark (panel, i, 0); - } - if (mc_lstat (list->list[i].fname, &list->list[i].st)) { - g_free (list->list[i].fname); - continue; - } - if (list->list[i].f.marked) - do_file_mark (panel, i, 1); - if (j != i) - list->list[j] = list->list[i]; - j++; - } - if (j == 0) - panel->count = set_zero_dir (list); - else - panel->count = j; - - if (panel != current_panel) - mc_chdir (current_panel->cwd); -} - -static void -update_one_panel_widget (WPanel *panel, int force_update, - const char *current_file) -{ - int free_pointer; - char *my_current_file = NULL; - - if (force_update & UP_RELOAD) { - panel->is_panelized = 0; - mc_setctl (panel->cwd, VFS_SETCTL_FLUSH, 0); - memset (&(panel->dir_stat), 0, sizeof (panel->dir_stat)); - } - - /* If current_file == -1 (an invalid pointer) then preserve selection */ - if (current_file == UP_KEEPSEL) { - free_pointer = 1; - my_current_file = g_strdup (panel->dir.list[panel->selected].fname); - current_file = my_current_file; - } else - free_pointer = 0; - - if (panel->is_panelized) - reload_panelized (panel); - else - panel_reload (panel); - - try_to_select (panel, current_file); - panel->dirty = 1; - - if (free_pointer) - g_free (my_current_file); -} - -static void -update_one_panel (int which, int force_update, const char *current_file) -{ - WPanel *panel; - - if (get_display_type (which) != view_listing) - return; - - panel = (WPanel *) get_panel_widget (which); - update_one_panel_widget (panel, force_update, current_file); -} - /* Save current stat of directories to avoid reloading the panels */ /* when no modifications have taken place */ void @@ -1197,11 +1114,6 @@ ctl_x_cmd (void) ctl_x_map_enabled = 1; } -static void -nothing (void) -{ -} - static cb_ret_t midnight_execute_cmd(int command) { diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index 1f5d83069..137c8dd51 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -124,62 +124,6 @@ mcview_continue_search_cmd (mcview_t * view) } /* --------------------------------------------------------------------------------------------- */ -static cb_ret_t -mcview_handle_editkey (mcview_t * view, int key) -{ - struct hexedit_change_node *node; - int byte_val; - - /* Has there been a change at this position? */ - node = view->change_list; - while (node && (node->offset != view->hex_cursor)) - node = node->next; - - if (!view->hexview_in_text) { - /* Hex editing */ - unsigned int hexvalue = 0; - - if (key >= '0' && key <= '9') - hexvalue = 0 + (key - '0'); - else if (key >= 'A' && key <= 'F') - hexvalue = 10 + (key - 'A'); - else if (key >= 'a' && key <= 'f') - hexvalue = 10 + (key - 'a'); - else - return MSG_NOT_HANDLED; - - if (node) - byte_val = node->value; - else - mcview_get_byte (view, view->hex_cursor, &byte_val); - - if (view->hexedit_lownibble) { - byte_val = (byte_val & 0xf0) | (hexvalue); - } else { - byte_val = (byte_val & 0x0f) | (hexvalue << 4); - } - } else { - /* Text editing */ - if (key < 256 && ((key == '\n') || is_printable (key))) - byte_val = key; - else - return MSG_NOT_HANDLED; - } - if (!node) { - node = g_new (struct hexedit_change_node, 1); - node->offset = view->hex_cursor; - node->value = byte_val; - mcview_enqueue_change (&view->change_list, node); - } else { - node->value = byte_val; - } - view->dirty++; - mcview_update (view); - mcview_move_right (view, 1); - return MSG_HANDLED; -} - -/* --------------------------------------------------------------------------------------------- */ /* Check for left and right arrows, possibly with modifiers */ static cb_ret_t @@ -289,6 +233,7 @@ static cb_ret_t mcview_execute_cmd (mcview_t * view, int command, int key) { int res = MSG_HANDLED; + (void) key; if (view->hex_mode) { switch (command) { diff --git a/src/viewer/dialogs.c b/src/viewer/dialogs.c index 6de6e6ed8..9b96e3238 100644 --- a/src/viewer/dialogs.c +++ b/src/viewer/dialogs.c @@ -92,7 +92,7 @@ mcview_dialog_search (mcview_t * view) QUICK_CHECKBOX (SEARCH_DLG_WIDTH / 2 + 3, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT, N_("case &Sensitive"), &view->search_case), QUICK_RADIO (3, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT, - num_of_types, (const char **) list_of_types, &view->search_type), + num_of_types, (const char **) list_of_types, (int *) &view->search_type), QUICK_INPUT (3, SEARCH_DLG_WIDTH, 3, SEARCH_DLG_HEIGHT, INPUT_LAST_TEXT, SEARCH_DLG_WIDTH - 6, 0, MC_HISTORY_SHARED_SEARCH, &exp), QUICK_LABEL (2, SEARCH_DLG_WIDTH, 2, SEARCH_DLG_HEIGHT, N_(" Enter search string:")), diff --git a/src/viewer/mcviewer.c b/src/viewer/mcviewer.c index 67908d7d1..83b15201f 100644 --- a/src/viewer/mcviewer.c +++ b/src/viewer/mcviewer.c @@ -170,7 +170,6 @@ mcview_real_event (Gpm_Event * event, void *x) static void mcview_set_keymap (mcview_t * view) { - int i; view->plain_map = default_viewer_keymap; if (viewer_keymap && viewer_keymap->len > 0) view->plain_map = (global_key_map_t *) viewer_keymap->data; diff --git a/src/viewer/plain.c b/src/viewer/plain.c index 343dfd49e..9b1aeeee3 100644 --- a/src/viewer/plain.c +++ b/src/viewer/plain.c @@ -68,7 +68,7 @@ mcview_display_text (mcview_t * view) screen_dimen row, col; off_t from; int cw = 1; - unsigned int c, prev_ch; + int c, prev_ch; gboolean read_res = TRUE; struct hexedit_change_node *curr = view->change_list; diff --git a/src/wtools.c b/src/wtools.c index 24f1d03f2..ce0d3d0e7 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -405,7 +405,7 @@ quick_dialog_skip (QuickDialog *qd, int nskip) for (i = 0; i < qw->u.radio.count; i++) items[i] = g_strdup (qw->u.radio.items[i]); - r = radio_new (ypos, xpos, qw->u.radio.count, items); + r = radio_new (ypos, xpos, qw->u.radio.count, (const char **) items); r->pos = r->sel = *qw->u.radio.value; qw->widget = (Widget *) r; g_strfreev (items); diff --git a/vfs/samba/lib/debug.c b/vfs/samba/lib/debug.c index 1fd892aef..f164b3488 100644 --- a/vfs/samba/lib/debug.c +++ b/vfs/samba/lib/debug.c @@ -118,6 +118,7 @@ static size_t format_pos = 0; */ void setup_logging( const char *pname, BOOL interactive ) { + (void) pname; if( interactive ) { stdout_logging = True; diff --git a/vfs/samba/lib/kanji.c b/vfs/samba/lib/kanji.c index 7bca61b4e..69d1f322d 100644 --- a/vfs/samba/lib/kanji.c +++ b/vfs/samba/lib/kanji.c @@ -1145,6 +1145,7 @@ void interpret_coding_system(const char *str) static size_t skip_non_multibyte_char(char c) { + (void) c; return 0; } @@ -1154,6 +1155,7 @@ static size_t skip_non_multibyte_char(char c) static BOOL not_multibyte_char_1(char c) { + (void) c; return False; } diff --git a/vfs/samba/lib/time.c b/vfs/samba/lib/time.c index af6dcb26a..c76af3b5d 100644 --- a/vfs/samba/lib/time.c +++ b/vfs/samba/lib/time.c @@ -334,7 +334,7 @@ check if it's a null mtime ****************************************************************************/ BOOL null_mtime(time_t mtime) { - if (mtime == 0 || mtime == 0xFFFFFFFF || mtime == (time_t)-1) + if (mtime == (time_t)0 || mtime == (time_t)0xFFFFFFFF || mtime == (time_t)-1) return(True); return(False); } diff --git a/vfs/samba/lib/util.c b/vfs/samba/lib/util.c index 1e61dc849..da2fa83a8 100644 --- a/vfs/samba/lib/util.c +++ b/vfs/samba/lib/util.c @@ -1994,6 +1994,7 @@ static char *automount_lookup(char *user_name) static char *automount_server(const char *user_name) { static pstring server_name; + (void) user_name; /* use the local machine name as the default */ /* this will be the default if WITH_AUTOMOUNT is not used or fails */ @@ -2123,7 +2124,7 @@ void standard_sub_basic(char *str) } r = p+3; - copylen = MIN((q-r),(sizeof(envname)-1)); + copylen = MIN((size_t)(q-r),(size_t)(sizeof(envname)-1)); strncpy(envname,r,copylen); envname[copylen] = '\0'; @@ -2135,7 +2136,7 @@ void standard_sub_basic(char *str) break; } - copylen = MIN((q+1-p),(sizeof(envname)-1)); + copylen = MIN((size_t)(q+1-p),(size_t)(sizeof(envname)-1)); strncpy(envname,p,copylen); envname[copylen] = '\0'; string_sub(p,envname,envval); diff --git a/vfs/samba/libsmb/clientgen.c b/vfs/samba/libsmb/clientgen.c index 97c47dd93..0dd0710c9 100644 --- a/vfs/samba/libsmb/clientgen.c +++ b/vfs/samba/libsmb/clientgen.c @@ -708,7 +708,7 @@ BOOL cli_session_setup(struct cli_state *cli, if (cli->protocol < PROTOCOL_LANMAN1) return True; - if (passlen > sizeof(pword)-1 || ntpasslen > sizeof(ntpword)-1) { + if ((size_t) passlen > sizeof(pword)-1 || (size_t)ntpasslen > sizeof(ntpword)-1) { return False; } @@ -1356,7 +1356,7 @@ size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t int size2; while (issued - received < mpx && issued < blocks) { - int size1 = MIN(block, size-issued*block); + int size1 = MIN(block, (int) size-issued*block); cli_issue_read(cli, fnum, offset+issued*block, size1, issued); issued++; } @@ -1466,7 +1466,7 @@ ssize_t cli_write(struct cli_state *cli, while ((issued - received < mpx) && (issued < blocks)) { int bsent = issued * block; - int size1 = MIN(block, size - bsent); + int size1 = MIN(block, (int) size - bsent); cli_issue_write(cli, fnum, offset + bsent, write_mode, diff --git a/vfs/samba/libsmb/namequery.c b/vfs/samba/libsmb/namequery.c index d7993a547..b15174404 100644 --- a/vfs/samba/libsmb/namequery.c +++ b/vfs/samba/libsmb/namequery.c @@ -509,7 +509,7 @@ BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type) } pstrcpy(name_resolve_list, lp_name_resolve_order()); - if (!name_resolve_list || !*name_resolve_list) + if (name_resolve_list == NULL || *name_resolve_list == '\0') pstrcpy(name_resolve_list, "host"); ptr = name_resolve_list; diff --git a/vfs/samba/libsmb/nmblib.c b/vfs/samba/libsmb/nmblib.c index d1b34bebb..6dd820824 100644 --- a/vfs/samba/libsmb/nmblib.c +++ b/vfs/samba/libsmb/nmblib.c @@ -203,7 +203,7 @@ static int parse_nmb_name(char *inbuf,int offset,int length, struct nmb_name *na unsigned char c1,c2; c1 = ubuf[offset++]-'A'; c2 = ubuf[offset++]-'A'; - if ((c1 & 0xF0) || (c2 & 0xF0) || (n > sizeof(name->name)-1)) + if ((c1 & 0xF0) || (c2 & 0xF0) || ((size_t) n > sizeof(name->name)-1)) return(0); name->name[n++] = (c1<<4) | c2; m -= 2; @@ -234,7 +234,7 @@ static int parse_nmb_name(char *inbuf,int offset,int length, struct nmb_name *na ret += m+1; if (n) name->scope[n++] = '.'; - if (m+2+offset>length || n+m+1>sizeof(name->scope)) + if (m+2+offset>length || (size_t) n+m+1 >sizeof(name->scope)) return(0); offset++; while (m--) @@ -340,7 +340,7 @@ static BOOL parse_alloc_res_rec(char *inbuf,int *offset,int length, (*recs)[i].ttl = RIVAL(inbuf,(*offset)+4); (*recs)[i].rdlength = RSVAL(inbuf,(*offset)+8); (*offset) += 10; - if ((*recs)[i].rdlength>sizeof((*recs)[i].rdata) || + if ((size_t)(*recs)[i].rdlength>sizeof((*recs)[i].rdata) || (*offset)+(*recs)[i].rdlength > length) { free(*recs); return(False); @@ -431,7 +431,7 @@ static BOOL parse_dgram(char *inbuf,int length,struct dgram_packet *dgram) offset += parse_nmb_name(inbuf,offset,length,&dgram->dest_name); } - if (offset >= length || (length-offset > sizeof(dgram->data))) + if (offset >= length || ((size_t)length-offset > sizeof(dgram->data))) return(False); dgram->datasize = length-offset; @@ -630,6 +630,7 @@ static void free_nmb_packet(struct nmb_packet *nmb) static void free_dgram_packet(struct dgram_packet *nmb) { /* We have nothing to do for a dgram packet. */ + (void) nmb; } /******************************************************************* diff --git a/vfs/samba/libsmb/pwd_cache.c b/vfs/samba/libsmb/pwd_cache.c index 50097e3a3..e35fd31d5 100644 --- a/vfs/samba/libsmb/pwd_cache.c +++ b/vfs/samba/libsmb/pwd_cache.c @@ -45,6 +45,7 @@ de-obfuscates a password ****************************************************************************/ static void pwd_deobfuscate(struct pwd_info *pwd) { + (void) pwd; } /**************************************************************************** @@ -52,6 +53,7 @@ obfuscates a password ****************************************************************************/ static void pwd_obfuscate(struct pwd_info *pwd) { + (void) pwd; } /**************************************************************************** @@ -59,6 +61,9 @@ sets the obfuscation key info ****************************************************************************/ void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key) { + (void) pwd; + (void) int_key; + (void) str_key; } #if 0 -- 2.11.4.GIT