sysdep.c: Include conio.h if __MINGW32__ and !OLD_MINGW.
authorDanny Smith <dannysmith@users.sourceforge.net>
Wed, 22 Oct 2003 21:34:51 +0000 (21:34 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Wed, 22 Oct 2003 21:34:51 +0000 (21:34 +0000)
* sysdep.c: Include conio.h if __MINGW32__ and !OLD_MINGW.

* ctrl_c.c (__gnat_int_handler): Remove declaration.

* decl.c (creat_concat_name):  Const-ify prefix.

* 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.

From-SVN: r72824

gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/ctrl_c.c
gcc/ada/decl.c
gcc/ada/sysdep.c

index 15eee43fd7e6d4a74c7cb1f1d2ce878a10787b51..1eb48bf41d4f0b40e7e74b6fac7f4937aeecf79c 100644 (file)
@@ -1,3 +1,26 @@
+2003-10-22  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * sysdep.c: Include conio.h if __MINGW32__ and !OLD_MINGW.
+
+       * ctrl_c.c (__gnat_int_handler): Remove declaration.
+
+       * decl.c (creat_concat_name):  Const-ify prefix.
+
+       * 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.
+
 2003-10-22  Arnaud Charlet  <charlet@act-europe.fr>
 
        * Makefile.in: Disable build of gnatpa. PR ada/10110.
index 44fd33578680a1d3aae436268e200fac8e786abe..6ad07530b8d6349442b0b477469a80c4195249bd 100644 (file)
@@ -69,6 +69,7 @@
 #ifdef __MINGW32__
 #include "mingw32.h"
 #include <sys/utime.h>
+#include <ctype.h>
 #else
 #ifndef VMS
 #include <utime.h>
@@ -312,7 +313,9 @@ __gnat_to_gm_time
    OS/2 and vxworks, always return -1.  */
 
 int
-__gnat_readlink (char *path, char *buf, size_t bufsiz)
+__gnat_readlink (char *path ATTRIBUTE_UNUSED,
+                char *buf ATTRIBUTE_UNUSED,
+                size_t bufsiz ATTRIBUTE_UNUSED)
 {
 #if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
   return -1;
@@ -330,7 +333,8 @@ __gnat_readlink (char *path, char *buf, size_t bufsiz)
    Interix and VMS, always return -1. */
 
 int
-__gnat_symlink (char *oldpath, char *newpath)
+__gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
+               char *newpath ATTRIBUTE_UNUSED)
 {
 #if defined (MSDOS) || defined (_WIN32) || defined (__EMX__)
   return -1;
@@ -826,7 +830,6 @@ win32_filetime (HANDLE h)
 time_t
 __gnat_file_time_name (char *name)
 {
-  struct stat statbuf;
 
 #if defined (__EMX__) || defined (MSDOS)
   int fd = open (name, O_RDONLY | O_BINARY);
@@ -841,7 +844,7 @@ __gnat_file_time_name (char *name)
   CloseHandle (h);
   return ret;
 #else
-
+  struct stat statbuf;
   (void) __gnat_stat (name, &statbuf);
 #ifdef VMS
   /* VMS has file versioning.  */
@@ -1343,7 +1346,7 @@ __gnat_is_absolute_path (char *name)
 {
   return (*name == '/' || *name == DIR_SEPARATOR
 #if defined (__EMX__) || defined (MSDOS) || defined (WINNT)
-      || strlen (name) > 1 && isalpha (name[0]) && name[1] == ':'
+      || (strlen (name) > 1 && isalpha (name[0]) && name[1] == ':')
 #endif
          );
 }
@@ -1421,7 +1424,7 @@ __gnat_set_readonly (char *name)
 }
 
 int
-__gnat_is_symbolic_link (char *name)
+__gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
 {
 #if defined (__vxworks)
   return 0;
@@ -1455,11 +1458,11 @@ int
 __gnat_portable_spawn (char *args[])
 {
   int status = 0;
-  int finished;
-  int pid;
+  int finished ATTRIBUTE_UNUSED;
+  int pid ATTRIBUTE_UNUSED;
 
 #if defined (MSDOS) || defined (_WIN32)
-  status = spawnvp (P_WAIT, args[0], args);
+  status = spawnvp (P_WAIT, args[0],(const char* const*)args);
   if (status < 0)
     return -1;
   else
@@ -1512,19 +1515,19 @@ __gnat_portable_spawn (char *args[])
 static CRITICAL_SECTION plist_cs;
 
 void
-__gnat_plist_init ()
+__gnat_plist_init (void)
 {
   InitializeCriticalSection (&plist_cs);
 }
 
 static void
-plist_enter ()
+plist_enter (void)
 {
   EnterCriticalSection (&plist_cs);
 }
 
 static void
-plist_leave ()
+plist_leave (void)
 {
   LeaveCriticalSection (&plist_cs);
 }
@@ -1558,9 +1561,11 @@ add_handle (HANDLE h)
   plist_leave();
 }
 
-void remove_handle (HANDLE h)
+static void
+remove_handle (HANDLE h)
 {
-  Process_List *pl, *prev;
+  Process_List *pl;
+  Process_List *prev = NULL;
 
   plist_enter();
 
index 7d7eef043e4048853607ad18cda741f0f79364b5..22d00667275dd4bed38e379568771160b543970c 100644 (file)
@@ -48,8 +48,6 @@ void __gnat_install_int_handler (void (*) (void));
 /* __gnat_uninstall_int_handler will reinstall the original handler */
 void __gnat_uninstall_int_handler (void);
 
-static void __gnat_int_handler (int);
-
 /* POSIX implementation */
 
 #if (defined (_AIX) || defined (unix)) && !defined (__vxworks)
@@ -104,7 +102,7 @@ __gnat_uninstall_int_handler (void)
 #include "mingw32.h"
 #include <windows.h>
 
-void (*sigint_intercepted) () = NULL;
+void (*sigint_intercepted) (void) = NULL;
 
 static BOOL WINAPI
 __gnat_int_handler  (DWORD dwCtrlType)
index dd4b427c2e0ae2615e4d7cd22a72d1df1d70424c..bbad5b50e4676eca6744ad05bc4343281a317f4c 100644 (file)
@@ -6451,7 +6451,7 @@ create_concat_name (gnat_entity, suffix)
 
   {
     Entity_Kind kind = Ekind (gnat_entity);
-    char *prefix = "_imp__";
+    const char *prefix = "_imp__";
     int plen = strlen (prefix);
 
     if ((kind == E_Variable || kind == E_Constant)
index 0b9d2c3b750d8f0444ef9a6badd35bff9e960ee9..836f3d53528154e2fbbffce3e8e0ee51ca5eeab3 100644 (file)
@@ -298,6 +298,8 @@ __gnat_ttyname (filedes)
 #ifdef __MINGW32__
 #if OLD_MINGW
 #include <termios.h>
+#else
+#include <conio.h>  /* for getch(), kbhit() */
 #endif
 #else
 #include <termios.h>