Commit 4d49c6e1 by Arnaud Charlet

[multiple changes]

2014-08-01  Robert Dewar  <dewar@adacore.com>

	* sem_res.adb: Minor comment addition.

2014-08-01  Arnaud Charlet  <charlet@adacore.com>

	* s-crtl.ads, i-cstrea.ads, adaint.c, adaint.h, osint.adb,
	s-fileio.adb (__gnat_fopen, __gnat_freopen): Remove vms_form parameter,
	no longer used.
	* s-os_lib.ads: Minor reformatting.

From-SVN: r213441
parent d18bbd25
2014-08-01 Robert Dewar <dewar@adacore.com>
* sem_res.adb: Minor comment addition.
2014-08-01 Arnaud Charlet <charlet@adacore.com>
* s-crtl.ads, i-cstrea.ads, adaint.c, adaint.h, osint.adb,
s-fileio.adb (__gnat_fopen, __gnat_freopen): Remove vms_form parameter,
no longer used.
* s-os_lib.ads: Minor reformatting.
2014-08-01 Arnaud Charlet <charlet@adacore.com> 2014-08-01 Arnaud Charlet <charlet@adacore.com>
* exp_attr.adb (Is_Inline_Floating_Point_Attribute): Restore more * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Restore more
......
...@@ -744,8 +744,7 @@ __gnat_fputwc(int c, FILE *stream) ...@@ -744,8 +744,7 @@ __gnat_fputwc(int c, FILE *stream)
} }
FILE * FILE *
__gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED, __gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED)
char *vms_form ATTRIBUTE_UNUSED)
{ {
#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS) #if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS)
TCHAR wpath[GNAT_MAX_PATH_LEN]; TCHAR wpath[GNAT_MAX_PATH_LEN];
...@@ -771,8 +770,7 @@ FILE * ...@@ -771,8 +770,7 @@ FILE *
__gnat_freopen (char *path, __gnat_freopen (char *path,
char *mode, char *mode,
FILE *stream, FILE *stream,
int encoding ATTRIBUTE_UNUSED, int encoding ATTRIBUTE_UNUSED)
char *vms_form ATTRIBUTE_UNUSED)
{ {
#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS) #if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS)
TCHAR wpath[GNAT_MAX_PATH_LEN]; TCHAR wpath[GNAT_MAX_PATH_LEN];
......
...@@ -148,10 +148,9 @@ extern int __gnat_rename (char *, char *); ...@@ -148,10 +148,9 @@ extern int __gnat_rename (char *, char *);
extern int __gnat_chdir (char *); extern int __gnat_chdir (char *);
extern int __gnat_rmdir (char *); extern int __gnat_rmdir (char *);
extern FILE *__gnat_fopen (char *, char *, int, extern FILE *__gnat_fopen (char *, char *, int);
char *);
extern FILE *__gnat_freopen (char *, char *, FILE *, extern FILE *__gnat_freopen (char *, char *, FILE *,
int, char *); int);
extern int __gnat_open (char *, int); extern int __gnat_open (char *, int);
extern int __gnat_open_read (char *, int); extern int __gnat_open_read (char *, int);
extern int __gnat_open_rw (char *, int); extern int __gnat_open_rw (char *, int);
......
...@@ -108,9 +108,8 @@ package Interfaces.C_Streams is ...@@ -108,9 +108,8 @@ package Interfaces.C_Streams is
function fopen function fopen
(filename : chars; (filename : chars;
mode : chars; mode : chars;
encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8; encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8)
vms_form : chars := System.Null_Address) return FILEs return FILEs renames System.CRTL.fopen;
renames System.CRTL.fopen;
-- Note: to maintain target independence, use text_translation_required, -- Note: to maintain target independence, use text_translation_required,
-- a boolean variable defined in sysdep.c to deal with the target -- a boolean variable defined in sysdep.c to deal with the target
-- dependent text translation requirement. If this variable is set, -- dependent text translation requirement. If this variable is set,
...@@ -148,9 +147,8 @@ package Interfaces.C_Streams is ...@@ -148,9 +147,8 @@ package Interfaces.C_Streams is
(filename : chars; (filename : chars;
mode : chars; mode : chars;
stream : FILEs; stream : FILEs;
encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8; encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8)
vms_form : chars := System.Null_Address) return FILEs return FILEs renames System.CRTL.freopen;
renames System.CRTL.freopen;
function fseek function fseek
(stream : FILEs; (stream : FILEs;
......
...@@ -1276,21 +1276,6 @@ package body Osint is ...@@ -1276,21 +1276,6 @@ package body Osint is
-- Command_Name(Cindex1 .. Cindex2) is now the equivalent of the -- Command_Name(Cindex1 .. Cindex2) is now the equivalent of the
-- POSIX command "basename argv[0]" -- POSIX command "basename argv[0]"
-- Strip off any versioning information found on some systems. This
-- would take the form of TOOL.exe followed by a ";" or "." and a
-- sequence of one or more numbers.
if Command_Name (Cindex2) in '0' .. '9' then
for J in reverse Cindex1 .. Cindex2 loop
if Command_Name (J) = '.' or else Command_Name (J) = ';' then
Cindex2 := J - 1;
exit;
end if;
exit when Command_Name (J) not in '0' .. '9';
end loop;
end if;
-- Strip off any executable extension (usually nothing or .exe) -- Strip off any executable extension (usually nothing or .exe)
-- but formally reported by autoconf in the variable EXEEXT -- but formally reported by autoconf in the variable EXEEXT
......
...@@ -117,8 +117,7 @@ package System.CRTL is ...@@ -117,8 +117,7 @@ package System.CRTL is
function fopen function fopen
(filename : chars; (filename : chars;
mode : chars; mode : chars;
encoding : Filename_Encoding := Unspecified; encoding : Filename_Encoding := Unspecified) return FILEs;
vms_form : chars := System.Null_Address) return FILEs;
pragma Import (C, fopen, "__gnat_fopen"); pragma Import (C, fopen, "__gnat_fopen");
function fputc (C : int; stream : FILEs) return int; function fputc (C : int; stream : FILEs) return int;
...@@ -137,8 +136,7 @@ package System.CRTL is ...@@ -137,8 +136,7 @@ package System.CRTL is
(filename : chars; (filename : chars;
mode : chars; mode : chars;
stream : FILEs; stream : FILEs;
encoding : Filename_Encoding := Unspecified; encoding : Filename_Encoding := Unspecified) return FILEs;
vms_form : chars := System.Null_Address) return FILEs;
pragma Import (C, freopen, "__gnat_freopen"); pragma Import (C, freopen, "__gnat_freopen");
function fseek function fseek
......
...@@ -1068,7 +1068,7 @@ package body System.File_IO is ...@@ -1068,7 +1068,7 @@ package body System.File_IO is
-- may have changed and we do not want to delete a different file. -- may have changed and we do not want to delete a different file.
Stream := Stream :=
fopen (Namestr'Address, Fopstr'Address, Encoding, Null_Address); fopen (Namestr'Address, Fopstr'Address, Encoding);
if Stream = NULL_Stream then if Stream = NULL_Stream then
...@@ -1222,7 +1222,7 @@ package body System.File_IO is ...@@ -1222,7 +1222,7 @@ package body System.File_IO is
File.Stream := freopen File.Stream := freopen
(File.Name.all'Address, Fopstr'Address, File.Stream, (File.Name.all'Address, Fopstr'Address, File.Stream,
File.Encoding, Null_Address); File.Encoding);
if File.Stream = NULL_Stream then if File.Stream = NULL_Stream then
Close (File_Ptr); Close (File_Ptr);
......
...@@ -426,7 +426,7 @@ package System.OS_Lib is ...@@ -426,7 +426,7 @@ package System.OS_Lib is
-- to the current position (origin = SEEK_CUR), end of file (origin = -- to the current position (origin = SEEK_CUR), end of file (origin =
-- SEEK_END), or start of file (origin = SEEK_SET). -- SEEK_END), or start of file (origin = SEEK_SET).
type Large_File_Size is range -(2 ** 63) .. (2 ** 63) - 1; type Large_File_Size is range -2 ** 63 .. 2 ** 63 - 1;
function File_Length (FD : File_Descriptor) return Long_Integer; function File_Length (FD : File_Descriptor) return Long_Integer;
pragma Import (C, File_Length, "__gnat_file_length_long"); pragma Import (C, File_Length, "__gnat_file_length_long");
......
...@@ -11512,7 +11512,15 @@ package body Sem_Res is ...@@ -11512,7 +11512,15 @@ package body Sem_Res is
Remove_Interp (I); Remove_Interp (I);
end if; end if;
if Present (System_Aux_Id) -- When compiling for a system where Address is of a visible
-- integer type, spurious ambiguities can be produced when
-- arithmetic operations have a literal operand and return
-- System.Address or a descendant of it. These ambiguities
-- are usually resolved by the context, but for conversions
-- there is no context type and the removal of the spurious
-- operations must be done explicitly here.
if not Address_Is_Private
and then Is_Descendent_Of_Address (It.Typ) and then Is_Descendent_Of_Address (It.Typ)
then then
Remove_Interp (I); Remove_Interp (I);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment