Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 19:29:36 +0000
From:      zy@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r222157 - in soc2011/zy/nvi-iconv/head/usr.bin/nvi: cl common ex include
Message-ID:  <20110518192936.C9033106564A@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zy
Date: Wed May 18 19:29:36 2011
New Revision: 222157
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=222157

Log:
  Stops hiding O_DIRECTORY in fcntl.h; eliminates some warnings.

Modified:
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_funcs.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_main.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/exf.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/options.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_cscope.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_tag.c
  soc2011/zy/nvi-iconv/head/usr.bin/nvi/include/options_def.h

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_funcs.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_funcs.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_funcs.c	Wed May 18 19:29:36 2011	(r222157)
@@ -24,7 +24,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_TERM_H
+#include <term.h>
+#else
 #include <termios.h>
+#endif
 #include <unistd.h>
 
 #include "../common/common.h"

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_main.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_main.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/cl/cl_main.c	Wed May 18 19:29:36 2011	(r222157)
@@ -24,7 +24,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_TERM_H
+#include <term.h>
+#else
 #include <termios.h>
+#endif
 #include <unistd.h>
 
 #include "../common/common.h"

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/exf.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/exf.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/exf.c	Wed May 18 19:29:36 2011	(r222157)
@@ -187,10 +187,10 @@
 	 */
 	oname = frp->name;
 	if (LF_ISSET(FS_OPENERR) || oname == NULL || !exists) {
-		if (opts_empty(sp, O_DIRECTORY, 0))
+		if (opts_empty(sp, O_TMPDIR, 0))
 			goto err;
 		(void)snprintf(tname, sizeof(tname),
-		    "%s/vi.XXXXXXXXXX", O_STR(sp, O_DIRECTORY));
+		    "%s/vi.XXXXXXXXXX", O_STR(sp, O_TMPDIR));
 		if ((fd = mkstemp(tname)) == -1) {
 			msgq(sp, M_SYSERR,
 			    "237|Unable to create temporary file");

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/options.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/options.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/common/options.c	Wed May 18 19:29:36 2011	(r222157)
@@ -64,7 +64,7 @@
 	{"columns",	f_columns,	OPT_NUM,	OPT_NOSAVE},
 /* O_COMMENT	  4.4BSD */
 	{"comment",	NULL,		OPT_0BOOL,	0},
-/* O_DIRECTORY	    4BSD */
+/* O_TMPDIR	    4BSD */
 	{"directory",	NULL,		OPT_STR,	0},
 /* O_EDCOMPATIBLE   4BSD */
 	{"edcompatible",NULL,		OPT_0BOOL,	0},
@@ -244,7 +244,7 @@
 	{"aw",		O_AUTOWRITE},		/*     4BSD */
 	{"bf",		O_BEAUTIFY},		/*     4BSD */
 	{"co",		O_COLUMNS},		/*   4.4BSD */
-	{"dir",		O_DIRECTORY},		/*     4BSD */
+	{"dir",		O_TMPDIR},		/*     4BSD */
 	{"eb",		O_ERRORBELLS},		/*     4BSD */
 	{"ed",		O_EDCOMPATIBLE},	/*     4BSD */
 	{"ex",		O_EXRC},		/* System V (undocumented) */
@@ -347,7 +347,7 @@
 	 */
 	(void)snprintf(b1, sizeof(b1),
 	    "directory=%s", (s = getenv("TMPDIR")) == NULL ? _PATH_TMP : s);
-	OI(O_DIRECTORY, b1);
+	OI(O_TMPDIR, b1);
 	OI(O_ESCAPETIME, "escapetime=6");
 	OI(O_KEYTIME, "keytime=6");
 	OI(O_MATCHTIME, "matchtime=7");

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_cscope.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_cscope.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_cscope.c	Wed May 18 19:29:36 2011	(r222157)
@@ -496,7 +496,7 @@
 		 * search cscope command character and a leading space
 		 * there.)
 		 */
-		(void)fprintf(csc->to_fp, "%d%s\n", search, tqp->tag + 2);
+		(void)fprintf(csc->to_fp, "%lu%s\n", search, tqp->tag + 2);
 		(void)fflush(csc->to_fp);
 
 		/* Read the output. */

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_tag.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_tag.c	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/ex/ex_tag.c	Wed May 18 19:29:36 2011	(r222157)
@@ -1083,7 +1083,7 @@
 	 * then only if we didn't find the tag.
 	 */
 	snprintf(command, sizeof(command), "global -%s '%s'", ref ? "rx" : "x", tag);
-	if (fp = popen(command, "r")) {
+	if ((fp = popen(command, "r"))) {
 		while (fgets(buf, sizeof(buf), fp)) {
 			if (buf[strlen(buf)-1] == '\n')		/* chop(buf) */
 				buf[strlen(buf)-1] = 0;

Modified: soc2011/zy/nvi-iconv/head/usr.bin/nvi/include/options_def.h
==============================================================================
--- soc2011/zy/nvi-iconv/head/usr.bin/nvi/include/options_def.h	Wed May 18 18:36:40 2011	(r222156)
+++ soc2011/zy/nvi-iconv/head/usr.bin/nvi/include/options_def.h	Wed May 18 19:29:36 2011	(r222157)
@@ -8,7 +8,7 @@
 #define O_CEDIT 7
 #define O_COLUMNS 8
 #define O_COMMENT 9
-#define O_DIRECTORY 10
+#define O_TMPDIR 10
 #define O_EDCOMPATIBLE 11
 #define O_ESCAPETIME 12
 #define O_ERRORBELLS 13



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