From owner-freebsd-hackers Thu Jul 29 0:18:51 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id E2CC614E53; Thu, 29 Jul 1999 00:18:47 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id BAA72348; Thu, 29 Jul 1999 01:17:15 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id BAA74680; Thu, 29 Jul 1999 01:18:49 -0600 (MDT) Message-Id: <199907290718.BAA74680@harmony.village.org> To: "Brian F. Feldman" Subject: Re: interesting bug in /usr/bin/cmp Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Thu, 29 Jul 1999 00:52:27 EDT." References: Date: Thu, 29 Jul 1999 01:18:48 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message "Brian F. Feldman" writes: : if ((p1 = (u_char *)mmap(NULL, : - (size_t)length, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED) : + (size_t)mlength, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED) : err(ERR_EXIT, "%s", file1); This would be a good candiate for different line breaks for clarity if ((p1 = (u_char *)mmap(NULL, (size_t)mlength, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED) would be more readable and not violate the 80 column rule. Since the call to mmap is already split and you are already changing it, I don't think this would be a problem. While I do try to minimize stylistic changes, I think this one makes good sense.... : - (size_t)length, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED) : + (size_t)mlength, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED) : err(ERR_EXIT, "%s", file2); See above :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message