From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:50:37 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8C3337B404; Sat, 12 Apr 2003 08:50:36 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92B0037B401 for ; Sat, 12 Apr 2003 08:50:36 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEB8D43FAF for ; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFoZ0U020082 for ; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFoZKf020076 for perforce@freebsd.org; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) Date: Sat, 12 Apr 2003 08:50:35 -0700 (PDT) Message-Id: <200304121550.h3CFoZKf020076@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28823 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2003 15:50:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=28823 Change 28823 by robert@robert_spes on 2003/04/12 08:50:32 Use exact (and more) casts to be able to compile this with GCC 3.3 without warnings, which in turn enables compilation of libstand with -Werror. Affected files ... .. //depot/projects/mips/lib/libc/string/bcopy.c#2 edit Differences ... ==== //depot/projects/mips/lib/libc/string/bcopy.c#2 (text+ko) ==== @@ -40,6 +40,8 @@ #include __FBSDID("$FreeBSD: src/lib/libc/string/bcopy.c,v 1.5 2002/09/01 21:53:46 robert Exp $"); +#include + /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -88,13 +90,13 @@ /* * Copy forward. */ - t = (int)src; /* only need low bits */ - if ((t | (int)dst) & wmask) { + t = (uint32_t)(uintptr_t)src; /* only need low bits */ + if ((t | (uint32_t)(uintptr_t)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ - if ((t ^ (int)dst) & wmask || length < wsize) + if ((t ^ (uint32_t)(uintptr_t)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); @@ -116,9 +118,9 @@ */ src += length; dst += length; - t = (int)src; - if ((t | (int)dst) & wmask) { - if ((t ^ (int)dst) & wmask || length <= wsize) + t = (uint32_t)(uintptr_t)src; + if ((t | (uint32_t)(uintptr_t)dst) & wmask) { + if ((t ^ (uint32_t)(uintptr_t)dst) & wmask || length <= wsize) t = length; else t &= wmask;