1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Catch up with the subversion conversion and apply these build-time patches.

This commit is contained in:
David E. O'Brien 2012-08-17 18:20:38 +00:00
parent 1ec9bedabe
commit 6f5e32433e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239360
5 changed files with 13 additions and 94 deletions

View File

@ -29,7 +29,7 @@
# define TIMESPEC_NS(timespec) 0
#endif
size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int);
size_t nstrftime (char *, size_t, char const *, struct tm const *, int, long);
static char const *find_function (char const * const *, lin);
static struct change *find_hunk (struct change *);
@ -57,12 +57,12 @@ print_context_label (char const *mark,
char buf[MAX (INT_STRLEN_BOUND (int) + 32,
INT_STRLEN_BOUND (time_t) + 11)];
struct tm const *tm = localtime (&inf->stat.st_mtime);
int nsec = TIMESPEC_NS (inf->stat.st_mtim);
long nsec = TIMESPEC_NS (inf->stat.st_mtim);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
long int sec = inf->stat.st_mtime;
time_t sec = inf->stat.st_mtime;
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
sprintf (buf, "%ld.%.9d", sec, nsec);
sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec);
}
fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
}

View File

@ -137,7 +137,7 @@ exclude_options (void)
}
static char const shortopts[] =
"0123456789abBcC:dD:eEfF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:y";
"0123456789abBcC:dD:eEfF:hHiI:lL:nNopPqrsS:tTuU:vwW:x:X:y";
/* Values for long options that do not have single-letter equivalents. */
enum
@ -265,14 +265,15 @@ main (int argc, char **argv)
initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
c_stack_action (0);
function_regexp_list.buf = &function_regexp;
ignore_regexp_list.buf = &ignore_regexp;
re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
re_set_syntax (RE_SYNTAX_GREP);
excluded = new_exclude ();
prepend_default_options (getenv ("DIFF_OPTIONS"), &argc, &argv);
/* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1)
@ -428,6 +429,11 @@ main (int argc, char **argv)
new_file = true;
break;
case 'o':
/* Output in the old tradition style. */
specify_style (OUTPUT_NORMAL);
break;
case 'p':
show_c_function = true;
add_regexp (&function_regexp_list, "^[[:alpha:]$_]");
@ -983,8 +989,6 @@ specify_style (enum output_style style)
{
if (output_style != style)
{
if (output_style != OUTPUT_UNSPECIFIED)
try_help ("conflicting output style options", 0);
output_style = style;
}
}

View File

@ -27,10 +27,4 @@ SUBDIR+=doc
DPADD= ${LIBGNUREGEX}
LDADD= -lgnuregex
.for f in diff.c context.c
${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
CLEANFILES+= ${f}
.endfor
.include <bsd.prog.mk>

View File

@ -1,28 +0,0 @@
$FreeBSD$
--- context.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ context.c 2007-06-16 22:25:11.705063242 +0800
@@ -29,7 +29,7 @@
# define TIMESPEC_NS(timespec) 0
#endif
-size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int);
+size_t nstrftime (char *, size_t, char const *, struct tm const *, int, long);
static char const *find_function (char const * const *, lin);
static struct change *find_hunk (struct change *);
@@ -57,12 +57,12 @@
char buf[MAX (INT_STRLEN_BOUND (int) + 32,
INT_STRLEN_BOUND (time_t) + 11)];
struct tm const *tm = localtime (&inf->stat.st_mtime);
- int nsec = TIMESPEC_NS (inf->stat.st_mtim);
+ long nsec = TIMESPEC_NS (inf->stat.st_mtim);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
- long int sec = inf->stat.st_mtime;
+ time_t sec = inf->stat.st_mtime;
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
- sprintf (buf, "%ld.%.9d", sec, nsec);
+ sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec);
}
fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
}

View File

@ -1,51 +0,0 @@
$FreeBSD$
--- diff.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ diff.c 2007-06-15 14:51:05.506679851 +0800
@@ -137,7 +137,7 @@
}
static char const shortopts[] =
-"0123456789abBcC:dD:eEfF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:y";
+"0123456789abBcC:dD:eEfF:hHiI:lL:nNopPqrsS:tTuU:vwW:x:X:y";
/* Values for long options that do not have single-letter equivalents. */
enum
@@ -265,14 +265,15 @@
initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
c_stack_action (0);
function_regexp_list.buf = &function_regexp;
ignore_regexp_list.buf = &ignore_regexp;
- re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
+ re_set_syntax (RE_SYNTAX_GREP);
excluded = new_exclude ();
+ prepend_default_options (getenv ("DIFF_OPTIONS"), &argc, &argv);
+
/* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1)
@@ -428,6 +429,11 @@
new_file = true;
break;
+ case 'o':
+ /* Output in the old tradition style. */
+ specify_style (OUTPUT_NORMAL);
+ break;
+
case 'p':
show_c_function = true;
add_regexp (&function_regexp_list, "^[[:alpha:]$_]");
@@ -983,8 +989,6 @@
{
if (output_style != style)
{
- if (output_style != OUTPUT_UNSPECIFIED)
- try_help ("conflicting output style options", 0);
output_style = style;
}
}