This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Ada fixes for mingw32- adaint.c (6/6)
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: charlet at act-europe dot fr
- Date: Wed, 22 Oct 2003 19:50:31 +1000 (EST)
- Subject: PATCH: Ada fixes for mingw32- adaint.c (6/6)
This silences the warnings in ada/adaint.c.
ada/Changelog
2003-10-22 Danny Smith <dannysmith@users.sourceforge.net>
* adaint.c: Include ctype.h if __MINGW32__.
(__gnat_readlink): Mark arguments as possibly unused.
(__gnat_symlink): Likewise.
(__gnat_is_symbolic_link): Likewise.
(__gnat_portable_spawn): Likewise. Cast last arg of spawnvp to match
declaration
(__gnat_file_time_name): Don't declare struct stat statbuf when
not needed.
(__gnat_is_absolute_path): Add parenthesis around condition of
'if' statement to avoid warning.
(__gnat_plist_init): Specify void as parameter.
(plist_enter): Likewise.
(plist_leave): Likewise.
(remove_handle): Make static. Initialize prev.
Index: adaint.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/adaint.c,v
retrieving revision 1.16
diff -c -p -3 -r1.16 adaint.c
*** adaint.c 21 Oct 2003 13:41:57 -0000 1.16
--- adaint.c 22 Oct 2003 09:24:25 -0000
***************
*** 69,74 ****
--- 69,75 ----
#ifdef __MINGW32__
#include "mingw32.h"
#include <sys/utime.h>
+ #include <ctype.h>
#else
#ifndef VMS
#include <utime.h>
*************** __gnat_to_gm_time
*** 312,318 ****
OS/2 and vxworks, always return -1. */
int
! __gnat_readlink (char *path, char *buf, size_t bufsiz)
{
#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
return -1;
--- 313,321 ----
OS/2 and vxworks, always return -1. */
int
! __gnat_readlink (char *path ATTRIBUTE_UNUSED,
! char *buf ATTRIBUTE_UNUSED,
! size_t bufsiz ATTRIBUTE_UNUSED)
{
#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
return -1;
*************** __gnat_readlink (char *path, char *buf,
*** 330,336 ****
Interix and VMS, always return -1. */
int
! __gnat_symlink (char *oldpath, char *newpath)
{
#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
return -1;
--- 333,340 ----
Interix and VMS, always return -1. */
int
! __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
! char *newpath ATTRIBUTE_UNUSED)
{
#if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
return -1;
*************** win32_filetime (HANDLE h)
*** 826,832 ****
time_t
__gnat_file_time_name (char *name)
{
- struct stat statbuf;
#if defined (__EMX__) || defined (MSDOS)
int fd = open (name, O_RDONLY | O_BINARY);
--- 830,835 ----
*************** __gnat_file_time_name (char *name)
*** 841,847 ****
CloseHandle (h);
return ret;
#else
!
(void) __gnat_stat (name, &statbuf);
#ifdef VMS
/* VMS has file versioning. */
--- 844,850 ----
CloseHandle (h);
return ret;
#else
! struct stat statbuf;
(void) __gnat_stat (name, &statbuf);
#ifdef VMS
/* VMS has file versioning. */
*************** __gnat_is_absolute_path (char *name)
*** 1343,1349 ****
{
return (*name == '/' || *name == DIR_SEPARATOR
#if defined (__EMX__) || defined (MSDOS) || defined (WINNT)
! || strlen (name) > 1 && isalpha (name[0]) && name[1] == ':'
#endif
);
}
--- 1346,1352 ----
{
return (*name == '/' || *name == DIR_SEPARATOR
#if defined (__EMX__) || defined (MSDOS) || defined (WINNT)
! || (strlen (name) > 1 && isalpha (name[0]) && name[1] == ':')
#endif
);
}
*************** __gnat_set_readonly (char *name)
*** 1421,1427 ****
}
int
! __gnat_is_symbolic_link (char *name)
{
#if defined (__vxworks)
return 0;
--- 1424,1430 ----
}
int
! __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
{
#if defined (__vxworks)
return 0;
*************** int
*** 1455,1465 ****
__gnat_portable_spawn (char *args[])
{
int status = 0;
! int finished;
! int pid;
#if defined (MSDOS) || defined (_WIN32)
! status = spawnvp (P_WAIT, args[0], args);
if (status < 0)
return -1;
else
--- 1458,1468 ----
__gnat_portable_spawn (char *args[])
{
int status = 0;
! int finished ATTRIBUTE_UNUSED;
! int pid ATTRIBUTE_UNUSED;
#if defined (MSDOS) || defined (_WIN32)
! status = spawnvp (P_WAIT, args[0],(const char* const*)args);
if (status < 0)
return -1;
else
*************** __gnat_portable_spawn (char *args[])
*** 1512,1530 ****
static CRITICAL_SECTION plist_cs;
void
! __gnat_plist_init ()
{
InitializeCriticalSection (&plist_cs);
}
static void
! plist_enter ()
{
EnterCriticalSection (&plist_cs);
}
static void
! plist_leave ()
{
LeaveCriticalSection (&plist_cs);
}
--- 1515,1533 ----
static CRITICAL_SECTION plist_cs;
void
! __gnat_plist_init (void)
{
InitializeCriticalSection (&plist_cs);
}
static void
! plist_enter (void)
{
EnterCriticalSection (&plist_cs);
}
static void
! plist_leave (void)
{
LeaveCriticalSection (&plist_cs);
}
*************** add_handle (HANDLE h)
*** 1558,1566 ****
plist_leave();
}
! void remove_handle (HANDLE h)
{
! Process_List *pl, *prev;
plist_enter();
--- 1561,1571 ----
plist_leave();
}
! static void
! remove_handle (HANDLE h)
{
! Process_List *pl;
! Process_List *prev = NULL;
plist_enter();
http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.