Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Paul Eggert
Fri, 10 Nov 1989 22:01
GNU DIFF3 1.10 lint fixes
Author: Paul Eggert
Date: Fri, 10 Nov 1989 22:01
Date: Fri, 10 Nov 1989 22:01
344 lines
8350 bytes
8350 bytes
This is a companion to "GNU diff 1.10 runtime and lint fixes". The Makefile
chicanery prevents -Ddiff from screwing up diff3.c, which has many variables
named 'diff'. There are only lint fixes here, because Saber C didn't handle
diff3's subprocesses.
===================================================================
RCS file: RCS/Makefile,v
retrieving revision 1.1
diff -c -r1.1 Makefile
*** /tmp/,RCSt1a22748 Fri Nov 10 13:57:39 1989
--- Makefile Fri Nov 10 13:56:18 1989
***************
*** 21,32 ****
# You can compile this with ordinary cc as well,
# but gcc makes it faster.
# Also, gcc supports -O and -g together.
! CC=gcc -O
! CFLAGS = -g
INSTALL = install
# On system V, enable these three lines:
! # CFLAGS = -g -DUSG
# LIBS = -lPW
# INSTALL = cp
# (If you compile with GCC, you don't need to define LIBS.)
--- 21,32 ----
# You can compile this with ordinary cc as well,
# but gcc makes it faster.
# Also, gcc supports -O and -g together.
! CC=gcc -O -g
! CFLAGS = -Ddiff
INSTALL = install
# On system V, enable these three lines:
! # CFLAGS = -DUSG
# LIBS = -lPW
# INSTALL = cp
# (If you compile with GCC, you don't need to define LIBS.)
***************
*** 61,67 ****
$(archpfx)context.o $(archpfx)diff.o: regex.h
$(archpfx)diff3.o: diff3.c
! $(CC) -c $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/diff\" diff3.c \
$(OUTPUT_OPTION)
clean:
--- 61,67 ----
$(archpfx)context.o $(archpfx)diff.o: regex.h
$(archpfx)diff3.o: diff3.c
! $(CC) -c -DDIFF_PROGRAM=\"$(bindir)/diff\" diff3.c \
$(OUTPUT_OPTION)
clean:
===================================================================
RCS file: RCS/diff3.c,v
retrieving revision 1.1
diff -c -r1.1 diff3.c
*** /tmp/,RCSt1a22748 Fri Nov 10 13:57:40 1989
--- diff3.c Fri Nov 10 13:56:20 1989
***************
*** 200,206 ****
struct diff3_block *create_diff3_block ();
int compare_line_list ();
! int read_diff ();
enum diff_type process_diff_control ();
char *scan_diff_line ();
--- 200,207 ----
struct diff3_block *create_diff3_block ();
int compare_line_list ();
! unsigned myread ();
! unsigned read_diff ();
enum diff_type process_diff_control ();
char *scan_diff_line ();
***************
*** 309,315 ****
diff = make_3way_diff (thread1, thread2);
if (edscript)
output_diff3_edscript (stdout, diff, mapping, argv[optind],
! argv[optind + 1], argv[optind + 2]);
else
output_diff3 (stdout, diff, mapping);
--- 310,316 ----
diff = make_3way_diff (thread1, thread2);
if (edscript)
output_diff3_edscript (stdout, diff, mapping, argv[optind],
! argv[optind + 2]);
else
output_diff3 (stdout, diff, mapping);
***************
*** 425,432 ****
*current[2];
int
! high_water_mark,
! base_water_mark;
int
high_water_thread,
--- 426,432 ----
*current[2];
int
! high_water_mark;
int
high_water_thread,
***************
*** 476,484 ****
high_water_diff = current[high_water_thread];
- /* low and high waters start off same diff */
- base_water_mark = D_LOWLINE (high_water_diff, FILE0);
-
high_water_mark = D_HIGHLINE (high_water_diff, FILE0);
/* Make the diff you just got info from into the using class */
--- 476,481 ----
***************
*** 588,596 ****
struct diff3_block *result;
struct diff_block *ptr;
int i;
- int current_line;
- struct diff_block *last_block;
- char **result_line_ptr;
int current0line;
/* Find the range in file0 */
--- 585,590 ----
***************
*** 893,899 ****
* Routines to input and parse two way diffs.
*/
! extern char *environ; /* I hope this is here */
#define DIFF_CHUNK_SIZE 10000
--- 887,893 ----
* Routines to input and parse two way diffs.
*/
! extern char **environ; /* I hope this is here */
#define DIFF_CHUNK_SIZE 10000
***************
*** 902,908 ****
char *filea, *fileb;
{
char *diff_contents;
! int diff_size;
char *scan_diff;
enum diff_type dt;
int i;
--- 896,902 ----
char *filea, *fileb;
{
char *diff_contents;
! unsigned diff_size;
char *scan_diff;
enum diff_type dt;
int i;
***************
*** 1023,1029 ****
struct diff_block *db;
{
char *s = *string;
- int done = 0;
int holdnum;
enum diff_type type;
--- 1017,1022 ----
***************
*** 1093,1099 ****
return type;
}
! int
read_diff (filea, fileb, output_placement)
char *filea, *fileb;
char **output_placement;
--- 1086,1092 ----
return type;
}
! unsigned
read_diff (filea, fileb, output_placement)
char *filea, *fileb;
char **output_placement;
***************
*** 1101,1110 ****
char *argv[4];
int fds[2];
char *diff_result;
! long current_chunk_size;
! int bytes;
! char *buffer_ptr;
! int total;
argv[0] = diff_program;
argv[1] = filea;
--- 1094,1102 ----
char *argv[4];
int fds[2];
char *diff_result;
! unsigned current_chunk_size;
! unsigned bytes;
! unsigned total;
argv[0] = diff_program;
argv[1] = filea;
***************
*** 1192,1198 ****
{
int rev_mapping[3];
static int eliminate[3] = { 1, 0, 0};
! int i, j;
int oddoneout;
char *cp;
struct diff3_block *ptr;
--- 1184,1190 ----
{
int rev_mapping[3];
static int eliminate[3] = { 1, 0, 0};
! int i;
int oddoneout;
char *cp;
struct diff3_block *ptr;
***************
*** 1289,1299 ****
* routine pays attention to.
*/
void
! output_diff3_edscript (outputfile, diff, mapping, file0, file1, file2)
FILE *outputfile;
struct diff3_block *diff;
int mapping[3];
! char *file0, *file1, *file2;
{
int rev_mapping[3];
int i;
--- 1281,1291 ----
* routine pays attention to.
*/
void
! output_diff3_edscript (outputfile, diff, mapping, file0, file2)
FILE *outputfile;
struct diff3_block *diff;
int mapping[3];
! char *file0, *file2;
{
int rev_mapping[3];
int i;
***************
*** 1441,1462 ****
return prev;
}
! int
myread (fd, ptr, size)
! int fd, size;
char *ptr;
{
! int result = read (fd, ptr, size);
if (result < 0)
perror_with_exit ("Read failed");
! return result;
}
void *
xmalloc (size)
! int size;
{
! void *result = (void *) malloc (size);
if (!result)
fatal ("Malloc failed");
return result;
--- 1433,1456 ----
return prev;
}
! unsigned
myread (fd, ptr, size)
! int fd;
char *ptr;
+ unsigned size;
{
! int result = read (fd, ptr, (int)size);
if (result < 0)
perror_with_exit ("Read failed");
! return (unsigned)result;
}
void *
xmalloc (size)
! unsigned size;
{
! extern void *malloc();
! void *result = malloc (size);
if (!result)
fatal ("Malloc failed");
return result;
***************
*** 1465,1473 ****
void *
xrealloc (ptr, size)
void *ptr;
! int size;
{
! void *result = (void *) realloc (ptr, size);
if (!result)
fatal ("Malloc failed");
return result;
--- 1459,1468 ----
void *
xrealloc (ptr, size)
void *ptr;
! unsigned size;
{
! extern void *realloc();
! void *result = realloc (ptr, size);
if (!result)
fatal ("Malloc failed");
return result;
***************
*** 1483,1488 ****
--- 1478,1484 ----
perror_with_exit (string)
char *string;
{
+ extern void perror ();
perror (string);
exit (1);
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads