From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9841 invoked by alias); 23 Oct 2009 16:45:09 -0000 Received: (qmail 9811 invoked by uid 22791); 23 Oct 2009 16:45:07 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Oct 2009 16:45:03 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 1F9681361C for ; Fri, 23 Oct 2009 09:45:01 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by jupiter.vmware.com (Postfix) with ESMTP id 10552DC05E for ; Fri, 23 Oct 2009 09:45:01 -0700 (PDT) Message-ID: <4AE1DBF3.1040501@vmware.com> Date: Fri, 23 Oct 2009 16:45:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [RFA] Eliminate byteswap.h functions from record.c Content-Type: multipart/mixed; boundary="------------080809030408060600050504" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00595.txt.bz2 This is a multi-part message in MIME format. --------------080809030408060600050504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 79 Since these aren't available on all hosts, let's use the "native gdb" method. --------------080809030408060600050504 Content-Type: text/plain; name="bswap.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bswap.txt" Content-length: 1763 2009-10-23 Michael Snyder * record.c (top level): Don't include byteswap.h. (netorder64): Use store_unsigned_integer instead of bswap_64. (netorder32): Use store_unsigned_integer instead of bswap_32. (netorder16): Use store_unsigned_integer instead of bswap_16. Index: record.c =================================================================== RCS file: /cvs/src/src/gdb/record.c,v retrieving revision 1.33 diff -u -p -r1.33 record.c --- record.c 23 Oct 2009 16:11:37 -0000 1.33 +++ record.c 23 Oct 2009 16:40:05 -0000 @@ -31,7 +31,6 @@ #include "elf-bfd.h" #include "gcore.h" -#include #include /* This module implements "target record", also known as "process @@ -1953,27 +1952,33 @@ bfdcore_read (bfd *obfd, asection *osec, } static inline uint64_t -netorder64 (uint64_t fromfile) +netorder64 (uint64_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_64 (fromfile) - : fromfile; + uint64_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BYTE_ORDER, input); + return ret; } static inline uint32_t -netorder32 (uint32_t fromfile) +netorder32 (uint32_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_32 (fromfile) - : fromfile; + uint32_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BYTE_ORDER, input); + return ret; } static inline uint16_t -netorder16 (uint16_t fromfile) +netorder16 (uint16_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_16 (fromfile) - : fromfile; + uint16_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BYTE_ORDER, input); + return ret; } /* Restore the execution log from a core_bfd file. */ --------------080809030408060600050504--