Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 16:10:15 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228645 - head/contrib/less
Message-ID:  <201112171610.pBHGAFN8066765@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Dec 17 16:10:14 2011
New Revision: 228645
URL: http://svn.freebsd.org/changeset/base/228645

Log:
  In contrib/less, cast away const a bunch of times, to make it build
  without conversion warnings.  This code desparately needs a good dose of
  const poison, but fixing all the issues would be rather disruptive.
  
  MFC after:	1 week

Modified:
  head/contrib/less/command.c
  head/contrib/less/prompt.c

Modified: head/contrib/less/command.c
==============================================================================
--- head/contrib/less/command.c	Sat Dec 17 15:57:39 2011	(r228644)
+++ head/contrib/less/command.c	Sat Dec 17 16:10:14 2011	(r228645)
@@ -1461,7 +1461,7 @@ commands()
 				error("Command not available", NULL_PARG);
 				break;
 			}
-			start_mca(A_EXAMINE, "Examine: ", ml_examine, 0);
+			start_mca(A_EXAMINE, "Examine: ", (void*)ml_examine, 0);
 			c = getcc();
 			goto again;
 #else
@@ -1491,7 +1491,7 @@ commands()
 				error("WARNING: This file was viewed via LESSOPEN",
 					NULL_PARG);
 			}
-			start_mca(A_SHELL, "!", ml_shell, 0);
+			start_mca(A_SHELL, "!", (void*)ml_shell, 0);
 			/*
 			 * Expand the editor prototype string
 			 * and pass it to the system to execute.
@@ -1655,7 +1655,7 @@ commands()
 				error("Command not available", NULL_PARG);
 				break;
 			}
-			start_mca(A_SHELL, "!", ml_shell, 0);
+			start_mca(A_SHELL, "!", (void*)ml_shell, 0);
 			c = getcc();
 			goto again;
 #else
@@ -1706,7 +1706,7 @@ commands()
 			if (badmark(c))
 				break;
 			pipec = c;
-			start_mca(A_PIPE, "!", ml_shell, 0);
+			start_mca(A_PIPE, "!", (void*)ml_shell, 0);
 			c = getcc();
 			goto again;
 #else

Modified: head/contrib/less/prompt.c
==============================================================================
--- head/contrib/less/prompt.c	Sat Dec 17 15:57:39 2011	(r228644)
+++ head/contrib/less/prompt.c	Sat Dec 17 16:10:14 2011	(r228645)
@@ -555,7 +555,7 @@ pr_expand(proto, maxwidth)
 	public char *
 eq_message()
 {
-	return (pr_expand(eqproto, 0));
+	return (pr_expand((char*)eqproto, 0));
 }
 
 /*
@@ -572,7 +572,7 @@ pr_string()
 
 	type = (!less_is_more) ? pr_type : pr_type ? 0 : 1;
 	prompt = pr_expand((ch_getflags() & CH_HELPFILE) ?
-				hproto : prproto[type],
+				(char*)hproto : prproto[type],
 			sc_width-so_s_width-so_e_width-2);
 	new_file = 0;
 	return (prompt);
@@ -584,5 +584,5 @@ pr_string()
 	public char *
 wait_message()
 {
-	return (pr_expand(wproto, sc_width-so_s_width-so_e_width-2));
+	return (pr_expand((char*)wproto, sc_width-so_s_width-so_e_width-2));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112171610.pBHGAFN8066765>