From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16320 invoked from network); 15 Nov 2005 09:27:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Nov 2005 09:27:44 -0000 Received: (qmail 83381 invoked from network); 15 Nov 2005 09:27:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Nov 2005 09:27:27 -0000 Received: (qmail 15130 invoked by alias); 15 Nov 2005 09:27:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22001 Received: (qmail 15121 invoked from network); 15 Nov 2005 09:27:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Nov 2005 09:27:24 -0000 Received: (qmail 83059 invoked from network); 15 Nov 2005 09:27:24 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 15 Nov 2005 09:27:23 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id C232FC858; Tue, 15 Nov 2005 01:27:20 -0800 (PST) Date: Tue, 15 Nov 2005 01:27:20 -0800 From: Wayne Davison To: zsh-workers@sunsite.dk Subject: Removing forced casts between signed/unsigned char pointers Message-ID: <20051115092720.GA13478@dot.blorf.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i There were a few compiler warnings about pointers and differ in signedness in the non-multibyte code that I wanted to fix. I first looked at the easy fix of adding a few new forced casts, but I didn't like how many casts to and from "unsigned char *" and "char *" we were getting in the code. Instead, I decided to change some of the functions and global pointers that were taking/returning unsigned char pointers to make them take/return normal char pointers. This allowed me to remove a bunch of forced casts. I was careful in my changes to preserve any unsigned features of the old code (for instance, ztrcmp() still compares the character values in an unsigned manner even though it takes normal "char *" strings). In two spots in the code there were unsigned char values being assigned and restored to/from a "char save" value, so this potentially fixed a problem for those broken systems that have trouble converting signed<->unsigned char values without extra casts. If anyone would like to see all the changes I just checked in, you'll find a unified diff of them here: http://opencoder.net/zsh-less-unsigned-char.patch ..wayne..