public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Patch: binutils/rename.c  -Werror fixes for  _WIN32
@ 2005-03-25 14:44 Danny Smith
  2005-03-25 15:47 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: Danny Smith @ 2005-03-25 14:44 UTC (permalink / raw)
  To: binutils

The static function simple_copy() in rename.c is not used by
__MINGW32__.  Nor is the preserve_dates arg of smart_rename.

This fixes -Werror failure.

Tested with i686-pc-mingw32, gcc version 4.1.0 20050321 (experimental)
 
Changelog

2005-03-24  Danny Smith  <dannysmith@users.sourceforge.net>

	* rename.c (simple_copy): Remove unneeded prototype. Guard
	definition with !defined (_WIN32) || defined (__CYGWIN__).
	(smart_rename): Mark preserve_dates arg as unused.
	Spell __CYGWIN32__ as __CYGWIN__.

Index: rename.c
===================================================================
RCS file: /cvs/src/src/binutils/rename.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 rename.c
*** rename.c	27 Nov 2003 08:24:01 -0000	1.8
--- rename.c	25 Mar 2005 00:55:47 -0000
***************
*** 37,44 ****
  #define O_BINARY 0
  #endif
  
- static int simple_copy (const char *, const char *);
  
  /* The number of bytes to copy at once.  */
  #define COPY_BUF 8192
  
--- 37,44 ----
  #define O_BINARY 0
  #endif
  
  
+ #if !defined (_WIN32) || defined (__CYGWIN__)
  /* The number of bytes to copy at once.  */
  #define COPY_BUF 8192
  
*************** simple_copy (const char *from, const cha
*** 88,93 ****
--- 88,94 ----
      }
    return 0;
  }
+ #endif /* !defined (_WIN32) || defined (__CYGWIN__) */
  
  /* Set the times of the file DESTINATION to be the same as those in
     STATBUF.  */
*************** set_times (const char *destination, cons
*** 140,146 ****
     Return 0 if ok, -1 if error.  */
  
  int
! smart_rename (const char *from, const char *to, int preserve_dates)
  {
    bfd_boolean exists;
    struct stat s;
--- 141,148 ----
     Return 0 if ok, -1 if error.  */
  
  int
! smart_rename (const char *from, const char *to,
! 	      int preserve_dates ATTRIBUTE_UNUSED)
  {
    bfd_boolean exists;
    struct stat s;
*************** smart_rename (const char *from, const ch
*** 148,154 ****
  
    exists = lstat (to, &s) == 0;
  
! #if defined (_WIN32) && !defined (__CYGWIN32__)
    /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
       fail instead.  Also, chown is not present.  */
  
--- 150,156 ----
  
    exists = lstat (to, &s) == 0;
  
! #if defined (_WIN32) && !defined (__CYGWIN__)
    /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
       fail instead.  Also, chown is not present.  */
  
*************** smart_rename (const char *from, const ch
*** 211,217 ****
  	set_times (to, &s);
        unlink (from);
      }
! #endif /* _WIN32 && !__CYGWIN32__ */
  
    return ret;
  }
--- 213,219 ----
  	set_times (to, &s);
        unlink (from);
      }
! #endif /* _WIN32 && !__CYGWIN__ */
  
    return ret;
  }

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch: binutils/rename.c  -Werror fixes for  _WIN32
  2005-03-25 14:44 Patch: binutils/rename.c -Werror fixes for _WIN32 Danny Smith
@ 2005-03-25 15:47 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2005-03-25 15:47 UTC (permalink / raw)
  To: dannysmith, binutils

On Fri, Mar 25, 2005 at 01:00:08PM +1200, Danny Smith wrote:
>The static function simple_copy() in rename.c is not used by
>__MINGW32__.  Nor is the preserve_dates arg of smart_rename.
>
>This fixes -Werror failure.
>
>Tested with i686-pc-mingw32, gcc version 4.1.0 20050321 (experimental)
> 
>Changelog
>
>2005-03-24  Danny Smith  <dannysmith@users.sourceforge.net>
>
>	* rename.c (simple_copy): Remove unneeded prototype. Guard
>	definition with !defined (_WIN32) || defined (__CYGWIN__).
>	(smart_rename): Mark preserve_dates arg as unused.
>	Spell __CYGWIN32__ as __CYGWIN__.

Looks good to me. Thanks for fixing the ancient __CYGWIN32__.

cgf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-25  2:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-25 14:44 Patch: binutils/rename.c -Werror fixes for _WIN32 Danny Smith
2005-03-25 15:47 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).