From owner-svn-src-all@FreeBSD.ORG Wed Jul 21 11:26:19 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 DD08E106564A; Wed, 21 Jul 2010 11:26:18 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0FA8FC21; Wed, 21 Jul 2010 11:26:18 +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 o6LBQI90003052; Wed, 21 Jul 2010 11:26:18 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LBQIpE003050; Wed, 21 Jul 2010 11:26:18 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211126.o6LBQIpE003050@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 11:26:18 +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: r210344 - head/lib/libelf 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: Wed, 21 Jul 2010 11:26:19 -0000 Author: kaiw Date: Wed Jul 21 11:26:18 2010 New Revision: 210344 URL: http://svn.freebsd.org/changeset/base/210344 Log: Avoid switching between "unsigned char" and "char" in the C code generated from "libelf_convert.m4". Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf_convert.m4 Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Wed Jul 21 11:01:40 2010 (r210343) +++ head/lib/libelf/libelf_convert.m4 Wed Jul 21 11:26:18 2010 (r210344) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006,2007 Joseph Koshy + * Copyright (c) 2006-2008 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,22 +85,22 @@ __FBSDID("$FreeBSD$"); * destination pointer is incremented after the write. */ #define WRITE_BYTE(P,X) do { \ - unsigned char *const _p = (unsigned char *) (P); \ - _p[0] = (unsigned char) (X); \ + char *const _p = (char *) (P); \ + _p[0] = (char) (X); \ (P) = _p + 1; \ } while (0) #define WRITE_HALF(P,X) do { \ uint16_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ (P) = _p + 2; \ } while (0) #define WRITE_WORD(P,X) do { \ uint32_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ _p[2] = _q[2]; \ @@ -112,8 +112,8 @@ __FBSDID("$FreeBSD$"); #define WRITE_SWORD(P,X) WRITE_WORD(P,X) #define WRITE_WORD64(P,X) do { \ uint64_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ _p[2] = _q[2]; \ @@ -141,16 +141,16 @@ __FBSDID("$FreeBSD$"); */ #define READ_BYTE(P,X) do { \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + const char *const _p = \ + (const char *) (P); \ (X) = _p[0]; \ (P) = (P) + 1; \ } while (0) #define READ_HALF(P,X) do { \ uint16_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ (P) = (P) + 2; \ @@ -158,9 +158,9 @@ __FBSDID("$FreeBSD$"); } while (0) #define READ_WORD(P,X) do { \ uint32_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ _q[2] = _p[2]; \ @@ -173,9 +173,9 @@ __FBSDID("$FreeBSD$"); #define READ_SWORD(P,X) READ_WORD(P,X) #define READ_WORD64(P,X) do { \ uint64_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ _q[2] = _p[2]; \ @@ -428,12 +428,12 @@ libelf_cvt$3_$1_tom(char *dst, size_t ds int byteswap) { Elf$3_$2 t, *d; - unsigned char *s,*s0; + char *s,*s0; size_t fsz; fsz = elf$3_fsize(ELF_T_$1, (size_t) 1, EV_CURRENT); d = ((Elf$3_$2 *) (uintptr_t) dst) + (count - 1); - s0 = (unsigned char *) src + (count - 1) * fsz; + s0 = (char *) src + (count - 1) * fsz; if (dsz < count * sizeof(Elf$3_$2)) return (0);