From owner-svn-src-all@FreeBSD.ORG Tue Nov 23 15:08:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D36F1065670; Tue, 23 Nov 2010 15:08:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55A268FC17; Tue, 23 Nov 2010 15:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANF8uHf034279; Tue, 23 Nov 2010 15:08:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANF8ulx034277; Tue, 23 Nov 2010 15:08:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011231508.oANF8ulx034277@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 23 Nov 2010 15:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215752 - head/usr.bin/locate/locate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 15:08:56 -0000 Author: nwhitehorn Date: Tue Nov 23 15:08:56 2010 New Revision: 215752 URL: http://svn.freebsd.org/changeset/base/215752 Log: Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation of locate(1) on systems on which char is unsigned by default (ARM and PowerPC). Reported by: Paul Mather MFC after: 4 days Modified: head/usr.bin/locate/locate/locate.h Modified: head/usr.bin/locate/locate/locate.h ============================================================================== --- head/usr.bin/locate/locate/locate.h Tue Nov 23 14:36:14 2010 (r215751) +++ head/usr.bin/locate/locate/locate.h Tue Nov 23 15:08:56 2010 (r215752) @@ -48,15 +48,15 @@ #define LDC_MAX 28 /* 128-255 bigram codes (128 most common, as determined by 'updatedb') */ -#define BIGRAM_MIN (UCHAR_MAX - CHAR_MAX) +#define BIGRAM_MIN (UCHAR_MAX - SCHAR_MAX) #define BIGRAM_MAX UCHAR_MAX /* 32-127 single character (printable) ascii residue (ie, literal) */ #define ASCII_MIN 32 -#define ASCII_MAX CHAR_MAX +#define ASCII_MAX SCHAR_MAX -/* #define TO7BIT(x) (x = ( ((u_char)x) & CHAR_MAX )) */ -#define TO7BIT(x) (x = x & CHAR_MAX ) +/* #define TO7BIT(x) (x = ( ((u_char)x) & SCHAR_MAX )) */ +#define TO7BIT(x) (x = x & SCHAR_MAX ) #if UCHAR_MAX >= 4096