public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Minor Ada front end fixes for MinGW
@ 2004-09-13  1:14 Aaron W. LaFramboise
  2004-09-23 10:50 ` Arnaud Charlet
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron W. LaFramboise @ 2004-09-13  1:14 UTC (permalink / raw)
  To: Gcc Patch List

The following three fixes eliminate some warnings in the Ada front end
on MinGW:
1) value is a char, but Win32 BYTE is unsigned.
2) The args_0 temporary variable is const but shouldn't be because args
is not.
3) MAXPATHLEN is defined by mingwrt.

2004-09-12  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* adaint.c (__gnat_get_libraries_from_registry): Cast value
        to LPBYTE.
	(__gnat_portable_spawn): Remove const.
	* mingw32.h (MAXPATHLEN): Check for previous definition.

Index: gcc/gcc/ada/adaint.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ada/adaint.c,v
retrieving revision 1.37
diff -c -3 -p -r1.37 adaint.c
*** gcc/gcc/ada/adaint.c	16 Aug 2004 09:00:19 -0000	1.37
--- gcc/gcc/ada/adaint.c	11 Sep 2004 23:47:39 -0000
*************** __gnat_get_libraries_from_registry (void
*** 1348,1354 ****
      {
        value_size = name_size = 256;
        res = RegEnumValue (reg_key, index, name, &name_size, 0,
!                           &type, value, &value_size);

        if (res == ERROR_SUCCESS && type == REG_SZ)
          {
--- 1348,1354 ----
      {
        value_size = name_size = 256;
        res = RegEnumValue (reg_key, index, name, &name_size, 0,
!                           &type, (LPBYTE)value, &value_size);

        if (res == ERROR_SUCCESS && type == REG_SZ)
          {
*************** __gnat_portable_spawn (char *args[])
*** 1551,1557 ****

  #if defined (MSDOS) || defined (_WIN32)
    /* args[0] must be quotes as it could contain a full pathname with
spaces */
!   const char *args_0 = args[0];
    args[0] = (char *)xmalloc (strlen (args_0) + 3);
    strcpy (args[0], "\"");
    strcat (args[0], args_0);
--- 1551,1557 ----

  #if defined (MSDOS) || defined (_WIN32)
    /* args[0] must be quotes as it could contain a full pathname with
spaces */
!   char *args_0 = args[0];
    args[0] = (char *)xmalloc (strlen (args_0) + 3);
    strcpy (args[0], "\"");
    strcat (args[0], args_0);
Index: gcc/gcc/ada/mingw32.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ada/mingw32.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 mingw32.h
*** gcc/gcc/ada/mingw32.h	22 Oct 2003 07:59:32 -0000	1.1
--- gcc/gcc/ada/mingw32.h	11 Sep 2004 23:47:41 -0000
***************
*** 49,54 ****
--- 49,56 ----

  #define OLD_MINGW (!(STD_MINGW))

+ #ifndef MAXPATHLEN
  #define MAXPATHLEN MAX_PATH
+ #endif

  #endif /* _MINGW32_H */

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

end of thread, other threads:[~2004-10-18 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13  1:14 Minor Ada front end fixes for MinGW Aaron W. LaFramboise
2004-09-23 10:50 ` Arnaud Charlet
2004-10-14  7:50   ` Aaron W. LaFramboise
2004-10-15 12:20     ` Arnaud Charlet
2004-10-15 21:02       ` Aaron W. LaFramboise
2004-10-18 12:05         ` Arnaud Charlet

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