svn commit: r257366 - head/contrib/libreadline

Sean Bruno sbruno at FreeBSD.org
Tue Oct 29 20:53:11 UTC 2013


Author: sbruno
Date: Tue Oct 29 20:53:09 2013
New Revision: 257366
URL: http://svnweb.freebsd.org/changeset/base/257366

Log:
  Quiesce warnings regarding assignement of loop conditionals by implementing
  the solution from the compiler to wrap the statement in parens.

Modified:
  head/contrib/libreadline/bind.c
  head/contrib/libreadline/complete.c
  head/contrib/libreadline/histexpand.c
  head/contrib/libreadline/history.c
  head/contrib/libreadline/input.c
  head/contrib/libreadline/tilde.c

Modified: head/contrib/libreadline/bind.c
==============================================================================
--- head/contrib/libreadline/bind.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/bind.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -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;

Modified: head/contrib/libreadline/complete.c
==============================================================================
--- head/contrib/libreadline/complete.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/complete.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -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_funct
   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, s
     }
 
 #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)))

Modified: head/contrib/libreadline/histexpand.c
==============================================================================
--- head/contrib/libreadline/histexpand.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/histexpand.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -203,7 +203,7 @@ get_history_event (string, caller_index,
     }
 
   /* 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)

Modified: head/contrib/libreadline/history.c
==============================================================================
--- head/contrib/libreadline/history.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/history.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -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;

Modified: head/contrib/libreadline/input.c
==============================================================================
--- head/contrib/libreadline/input.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/input.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -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. */

Modified: head/contrib/libreadline/tilde.c
==============================================================================
--- head/contrib/libreadline/tilde.c	Tue Oct 29 20:38:58 2013	(r257365)
+++ head/contrib/libreadline/tilde.c	Tue Oct 29 20:53:09 2013	(r257366)
@@ -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));


More information about the svn-src-all mailing list