On Mon, Jan 05, 2004 at 01:44:37AM -0600, John Van Essen wrote: > On Sun, 4 Jan 2004, jw schultz <[EMAIL PROTECTED]> wrote: [snip] > Your changes are almost identical to mine, so I will address only the > main differences... > > > =================================================================== > > RCS file: /data/cvs/rsync/hlink.c,v > > retrieving revision 1.23 > > diff -p -u -r1.23 hlink.c > > --- hlink.c 2 Jan 2004 07:34:49 -0000 1.23 > > +++ hlink.c 4 Jan 2004 13:21:14 -0000 > > @@ -24,45 +24,43 @@ extern int dry_run; > > extern int verbose; > > > > #if SUPPORT_HARD_LINKS > > -static int hlink_compare(struct file_struct *f1, struct file_struct *f2) > > +static int hlink_compare(struct file_struct **f1, struct file_struct **f2) > > { > > - if (!S_ISREG(f1->mode) && !S_ISREG(f2->mode)) > > + if (!S_ISREG((*f1)->mode) && !S_ISREG((*f2)->mode)) > > return 0; > > - if (!S_ISREG(f1->mode)) > > + if (!S_ISREG((*f1)->mode)) > > return -1; > > - if (!S_ISREG(f2->mode)) > > + if (!S_ISREG((*f2)->mode)) > > return 1; > > > > - if (f1->dev != f2->dev) > > - return (int) (f1->dev > f2->dev ? 1 : -1); > > + if ((*f1)->dev != (*f2)->dev) > > + return (int) ((*f1)->dev > (*f2)->dev ? 1 : -1); > > > > - if (f1->inode != f2->inode) > > - return (int) (f1->inode > f2->inode ? 1 : -1); > > + if ((*f1)->inode != (*f2)->inode) > > + return (int) ((*f1)->inode > (*f2)->inode ? 1 : -1); > > > > - return file_compare(&f1, &f2); > > + > > + return file_compare(f1, f2); > > } > > > I did that differently (and more simply, I think). Changed only one line > and added two lines: > > @@ -24,8 +24,11 @@ > extern int verbose; > > #if SUPPORT_HARD_LINKS > -static int hlink_compare(struct file_struct *f1, struct file_struct *f2) > +static int hlink_compare(struct file_struct **f1p, struct file_struct **f2p) > { > + struct file_struct *f1 = *f1p; > + struct file_struct *f2 = *f2p; > + > if (!S_ISREG(f1->mode) && !S_ISREG(f2->mode)) > return 0; > if (!S_ISREG(f1->mode))
My changes were patterned after file_compare(). The compiler should produce approximately the same code but your's is a little more readable. If we go with yours i'd suggest we update file_compare() to match. Consistancy of code is more important that patch size. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: [EMAIL PROTECTED] Remember Cernan and Schmitt -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html