From dde0bbff1f2bda34a9e6796c1255b2e7a40acced Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Tue, 29 Oct 2013 20:53:09 +0000 Subject: [PATCH] Quiesce warnings regarding assignement of loop conditionals by implementing the solution from the compiler to wrap the statement in parens. --- contrib/libreadline/bind.c | 8 ++++---- contrib/libreadline/complete.c | 6 +++--- contrib/libreadline/histexpand.c | 2 +- contrib/libreadline/history.c | 2 +- contrib/libreadline/input.c | 2 +- contrib/libreadline/tilde.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/contrib/libreadline/bind.c b/contrib/libreadline/bind.c index 08c906bfcc3..2330a58da94 100644 --- a/contrib/libreadline/bind.c +++ b/contrib/libreadline/bind.c @@ -442,7 +442,7 @@ rl_translate_keyseq (seq, array, len) { register int i, c, l, temp; - for (i = l = 0; c = seq[i]; i++) + for (i = l = 0; (c = seq[i]); i++) { if (c == '\\') { @@ -1185,7 +1185,7 @@ rl_parse_and_bind (string) { int passc = 0; - for (i = 1; c = string[i]; i++) + for (i = 1; (c = string[i]); i++) { if (passc) { @@ -1276,7 +1276,7 @@ rl_parse_and_bind (string) int delimiter, passc; delimiter = string[i++]; - for (passc = 0; c = string[i]; i++) + for (passc = 0; (c = string[i]); i++) { if (passc) { @@ -2048,7 +2048,7 @@ rl_function_dumper (print_readably) fprintf (rl_outstream, "\n"); - for (i = 0; name = names[i]; i++) + for (i = 0; (name = names[i]); i++) { rl_command_func_t *function; char **invokers; diff --git a/contrib/libreadline/complete.c b/contrib/libreadline/complete.c index 9a930a1a040..b3bdc79bbf3 100644 --- a/contrib/libreadline/complete.c +++ b/contrib/libreadline/complete.c @@ -884,7 +884,7 @@ _rl_find_completion_word (fp, dp) /* We didn't find an unclosed quoted substring upon which to do completion, so use the word break characters to find the substring on which to complete. */ - while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) + while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))) { scan = rl_line_buffer[rl_point]; @@ -1803,7 +1803,7 @@ rl_completion_matches (text, entry_function) match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list[1] = (char *)NULL; - while (string = (*entry_function) (text, matches)) + while ((string = (*entry_function) (text, matches))) { if (matches + 1 == match_list_size) match_list = (char **)xrealloc @@ -1854,7 +1854,7 @@ rl_username_completion_function (text, state) } #if defined (HAVE_GETPWENT) - while (entry = getpwent ()) + while ((entry = getpwent ())) { /* Null usernames should result in all users as possible completions. */ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) diff --git a/contrib/libreadline/histexpand.c b/contrib/libreadline/histexpand.c index f46c0b2a45d..eae8ed2c85d 100644 --- a/contrib/libreadline/histexpand.c +++ b/contrib/libreadline/histexpand.c @@ -203,7 +203,7 @@ get_history_event (string, caller_index, delimiting_quote) } /* Only a closing `?' or a newline delimit a substring search string. */ - for (local_index = i; c = string[i]; i++) + for (local_index = i; (c = string[i]); i++) { #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) diff --git a/contrib/libreadline/history.c b/contrib/libreadline/history.c index 1ccf4db786c..a1a83811b66 100644 --- a/contrib/libreadline/history.c +++ b/contrib/libreadline/history.c @@ -306,7 +306,7 @@ add_history (string) } } - temp = alloc_history_entry (string, hist_inittime ()); + temp = alloc_history_entry ((char *)string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; diff --git a/contrib/libreadline/input.c b/contrib/libreadline/input.c index b91548e5198..85b56c93166 100644 --- a/contrib/libreadline/input.c +++ b/contrib/libreadline/input.c @@ -428,7 +428,7 @@ rl_read_key () else { /* If input is coming from a macro, then use that. */ - if (c = _rl_next_macro_key ()) + if ((c = _rl_next_macro_key ())) return (c); /* If the user has an event function, then call it periodically. */ diff --git a/contrib/libreadline/tilde.c b/contrib/libreadline/tilde.c index 1b76c9f2404..b59b5021961 100644 --- a/contrib/libreadline/tilde.c +++ b/contrib/libreadline/tilde.c @@ -196,7 +196,7 @@ tilde_expand (string) int result_size, result_index; result_index = result_size = 0; - if (result = strchr (string, '~')) + if ((result = strchr (string, '~'))) result = (char *)xmalloc (result_size = (strlen (string) + 16)); else result = (char *)xmalloc (result_size = (strlen (string) + 1));