From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50431 invoked by alias); 9 Apr 2015 14:18:05 -0000 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 Received: (qmail 50416 invoked by uid 89); 9 Apr 2015 14:18:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Apr 2015 14:18:03 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t39EI2Zm025700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 9 Apr 2015 10:18:02 -0400 Received: from blade.nx (ovpn-116-118.ams2.redhat.com [10.36.116.118]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t39EI1XL010801; Thu, 9 Apr 2015 10:18:01 -0400 Received: by blade.nx (Postfix, from userid 1000) id 5E6FF26410C; Thu, 9 Apr 2015 15:18:00 +0100 (BST) Date: Thu, 09 Apr 2015 14:18:00 -0000 From: Gary Benson To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: [PATCH] Rename common-remote-fileio.[ch] as fileio.[ch] Message-ID: <20150409141800.GA4980@blade.nx> References: <20150409132132.GA30389@blade.nx> <1428588756-3553-1-git-send-email-gbenson@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428588756-3553-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00334.txt.bz2 git diff -M version as promised... diff --git a/gdb/common/common-remote-fileio.c b/gdb/common/fileio.c similarity index 68% rename from gdb/common/common-remote-fileio.c rename to gdb/common/fileio.c index 30c2c6b..5d3e6ae 100644 --- a/gdb/common/common-remote-fileio.c +++ b/gdb/common/fileio.c @@ -1,4 +1,4 @@ -/* Remote File-I/O communications +/* File-I/O functions for GDB, the GNU debugger. Copyright (C) 2003-2015 Free Software Foundation, Inc. @@ -18,13 +18,13 @@ along with this program. If not, see . */ #include "common-defs.h" -#include "common-remote-fileio.h" +#include "fileio.h" #include -/* See common-remote-fileio.h. */ +/* See fileio.h. */ int -remote_fileio_to_fio_error (int error) +host_to_fileio_error (int error) { switch (error) { @@ -77,7 +77,7 @@ remote_fileio_to_fio_error (int error) /* Convert a host-format mode_t into a bitmask of File-I/O flags. */ static LONGEST -remote_fileio_mode_to_target (mode_t mode) +fileio_mode_pack (mode_t mode) { mode_t tmode = 0; @@ -121,52 +121,51 @@ remote_fileio_mode_to_target (mode_t mode) /* Pack a host-format mode_t into an fio_mode_t. */ static void -remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) +host_to_fileio_mode (mode_t num, fio_mode_t fnum) { - remote_fileio_to_be (remote_fileio_mode_to_target (num), - (char *) fnum, 4); + host_to_bigendian (fileio_mode_pack (num), (char *) fnum, 4); } /* Pack a host-format integer into an fio_ulong_t. */ static void -remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) +host_to_fileio_ulong (LONGEST num, fio_ulong_t fnum) { - remote_fileio_to_be (num, (char *) fnum, 8); + host_to_bigendian (num, (char *) fnum, 8); } -/* See common-remote-fileio.h. */ +/* See fileio.h. */ void -remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) +host_to_fileio_stat (struct stat *st, struct fio_stat *fst) { LONGEST blksize; - remote_fileio_to_fio_uint ((long) st->st_dev, fst->fst_dev); - remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); - remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode); - remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); - remote_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); - remote_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); - remote_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); - remote_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); + host_to_fileio_uint ((long) st->st_dev, fst->fst_dev); + host_to_fileio_uint ((long) st->st_ino, fst->fst_ino); + host_to_fileio_mode (st->st_mode, fst->fst_mode); + host_to_fileio_uint ((long) st->st_nlink, fst->fst_nlink); + host_to_fileio_uint ((long) st->st_uid, fst->fst_uid); + host_to_fileio_uint ((long) st->st_gid, fst->fst_gid); + host_to_fileio_uint ((long) st->st_rdev, fst->fst_rdev); + host_to_fileio_ulong ((LONGEST) st->st_size, fst->fst_size); #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE blksize = st->st_blksize; #else blksize = 512; #endif - remote_fileio_to_fio_ulong (blksize, fst->fst_blksize); + host_to_fileio_ulong (blksize, fst->fst_blksize); #if HAVE_STRUCT_STAT_ST_BLOCKS - remote_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); + host_to_fileio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); #else /* FIXME: This is correct for DJGPP, but other systems that don't have st_blocks, if any, might prefer 512 instead of st_blksize. (eliz, 30-12-2003) */ - remote_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) - / blksize, - fst->fst_blocks); + host_to_fileio_ulong (((LONGEST) st->st_size + blksize - 1) + / blksize, + fst->fst_blocks); #endif - remote_fileio_to_fio_time (st->st_atime, fst->fst_atime); - remote_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); - remote_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); + host_to_fileio_time (st->st_atime, fst->fst_atime); + host_to_fileio_time (st->st_mtime, fst->fst_mtime); + host_to_fileio_time (st->st_ctime, fst->fst_ctime); } diff --git a/gdb/common/common-remote-fileio.h b/gdb/common/fileio.h similarity index 56% rename from gdb/common/common-remote-fileio.h rename to gdb/common/fileio.h index 96e4aa5..69a735f 100644 --- a/gdb/common/common-remote-fileio.h +++ b/gdb/common/fileio.h @@ -1,4 +1,4 @@ -/* Remote File-I/O communications +/* File-I/O functions for GDB, the GNU debugger. Copyright (C) 2003-2015 Free Software Foundation, Inc. @@ -17,23 +17,22 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef COMMON_REMOTE_FILEIO_H -#define COMMON_REMOTE_FILEIO_H +#ifndef FILEIO_H +#define FILEIO_H #include "gdb/fileio.h" #include -/* Convert a errno error number to a File-I/O error number for - transmission over the remote protocol. */ +/* Convert a host-format errno value to a File-I/O error number. */ -extern int remote_fileio_to_fio_error (int error); +extern int host_to_fileio_error (int error); -/* Pack a host-format integer into a byte buffer in big-endian format - ready for transmission over the remote protocol. BYTES specifies - the size of the integer to pack in bytes. */ +/* Pack a host-format integer into a byte buffer in big-endian + format. BYTES specifies the size of the integer to pack in + bytes. */ static inline void -remote_fileio_to_be (LONGEST num, char *buf, int bytes) +host_to_bigendian (LONGEST num, char *buf, int bytes) { int i; @@ -44,22 +43,21 @@ remote_fileio_to_be (LONGEST num, char *buf, int bytes) /* Pack a host-format integer into an fio_uint_t. */ static inline void -remote_fileio_to_fio_uint (long num, fio_uint_t fnum) +host_to_fileio_uint (long num, fio_uint_t fnum) { - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); + host_to_bigendian ((LONGEST) num, (char *) fnum, 4); } /* Pack a host-format time_t into an fio_time_t. */ static inline void -remote_fileio_to_fio_time (time_t num, fio_time_t fnum) +host_to_fileio_time (time_t num, fio_time_t fnum) { - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); + host_to_bigendian ((LONGEST) num, (char *) fnum, 4); } /* Pack a host-format struct stat into a struct fio_stat. */ -extern void remote_fileio_to_fio_stat (struct stat *st, - struct fio_stat *fst); +extern void host_to_fileio_stat (struct stat *st, struct fio_stat *fst); -#endif /* COMMON_REMOTE_FILEIO_H */ +#endif /* FILEIO_H */