Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/diff/diffreg.c
Show First 20 Lines • Show All 1,339 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Hash function taken from Robert Sedgewick, Algorithms in C, 3d ed., p 578. | * Hash function taken from Robert Sedgewick, Algorithms in C, 3d ed., p 578. | ||||
*/ | */ | ||||
static int | static int | ||||
readhash(FILE *f, int flags) | readhash(FILE *f, int flags) | ||||
{ | { | ||||
int i, t, space; | int i, t, space; | ||||
int sum; | unsigned sum; | ||||
sum = 1; | sum = 1; | ||||
space = 0; | space = 0; | ||||
for (i = 0;;) { | for (i = 0;;) { | ||||
switch (t = getc(f)) { | switch (t = getc(f)) { | ||||
case '\r': | case '\r': | ||||
if (flags & D_STRIPCR) { | if (flags & D_STRIPCR) { | ||||
t = getc(f); | t = getc(f); | ||||
▲ Show 20 Lines • Show All 334 Lines • Show Last 20 Lines |