aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/diff
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/diff
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/diff')
-rw-r--r--src/cmd/diff/diffio.c4
-rw-r--r--src/cmd/diff/diffreg.c18
-rw-r--r--src/cmd/diff/main.c8
3 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/diff/diffio.c b/src/cmd/diff/diffio.c
index 93de4e37..75a725ff 100644
--- a/src/cmd/diff/diffio.c
+++ b/src/cmd/diff/diffio.c
@@ -54,7 +54,7 @@ readline(Biobuf *bp, char *buf)
/*
* hashing has the effect of
* arranging line in 7-bit bytes and then
- * summing 1-s complement in 16-bit hunks
+ * summing 1-s complement in 16-bit hunks
*/
static int
readhash(Biobuf *bp, char *buf)
@@ -346,7 +346,7 @@ flushchanges(void)
if(nchanges == 0)
return;
-
+
for(i=0; i<nchanges; ){
j = changeset(i);
a = changes[i].a-Lines;
diff --git a/src/cmd/diff/diffreg.c b/src/cmd/diff/diffreg.c
index bb3fd112..ed4d17b8 100644
--- a/src/cmd/diff/diffreg.c
+++ b/src/cmd/diff/diffreg.c
@@ -19,7 +19,7 @@
* on the hash (called value). In particular, this
* collects the equivalence classes in file1 together.
* Subroutine equiv replaces the value of each line in
-* file0 by the index of the first element of its
+* file0 by the index of the first element of its
* matching equivalence in (the reordered) file1.
* To save space equiv squeezes file1 into a single
* array member in which the equivalence classes
@@ -34,15 +34,15 @@
* of "k-candidates". At step i a k-candidate is a matched
* pair of lines x,y (x in file0 y in file1) such that
* there is a common subsequence of lenght k
-* between the first i lines of file0 and the first y
+* between the first i lines of file0 and the first y
* lines of file1, but there is no such subsequence for
* any smaller y. x is the earliest possible mate to y
* that occurs in such a subsequence.
*
* Whenever any of the members of the equivalence class of
-* lines in file1 matable to a line in file0 has serial number
-* less than the y of some k-candidate, that k-candidate
-* with the smallest such y is replaced. The new
+* lines in file1 matable to a line in file0 has serial number
+* less than the y of some k-candidate, that k-candidate
+* with the smallest such y is replaced. The new
* k-candidate is chained (via pred) to the current
* k-1 candidate so that the actual subsequence can
* be recovered. When a member has serial number greater
@@ -64,7 +64,7 @@
* The core requirements for problems larger than somewhat
* are (in words) 2*length(file0) + length(file1) +
* 3*(number of k-candidates installed), typically about
-* 6n words for files of length n.
+* 6n words for files of length n.
*/
/* TIDY THIS UP */
struct cand {
@@ -91,7 +91,7 @@ long *ixold; /*will be overlaid on klist*/
long *ixnew; /*will be overlaid on file[1]*/
/* END OF SOME TIDYING */
-static void
+static void
sort(struct line *a, int n) /*shellsort CACM #201*/
{
int m;
@@ -352,14 +352,14 @@ cmp(Biobuf* b1, Biobuf* b2)
break;
if(memcmp((void *)b1s, (void *)b2s, n) != 0){
return 1;
- }
+ }
nc += n;
b1s += n;
b2s += n;
}
if(b1e - b1s == b2e - b2s)
return 0;
- return 1;
+ return 1;
}
void
diff --git a/src/cmd/diff/main.c b/src/cmd/diff/main.c
index 408ad90f..2697cb88 100644
--- a/src/cmd/diff/main.c
+++ b/src/cmd/diff/main.c
@@ -22,7 +22,7 @@ rmtmpfiles(void)
}
}
-void
+void
done(int status)
{
rmtmpfiles();
@@ -72,7 +72,7 @@ mkpathname(char *pathname, char *path, char *name)
sprint(pathname, "%s/%s", path, name);
return 0;
}
-
+
static char *
mktmpfile(int input, Dir **sb)
{
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
int i;
Dir *fsb, *tsb;
extern int _p9usepwlibrary;
-
+
_p9usepwlibrary = 0;
Binit(&stdout, 1, OWRITE);
progname = *argv;
@@ -214,7 +214,7 @@ main(int argc, char *argv[])
break;
case 'm':
- mflag = 1;
+ mflag = 1;
break;
case 'h':