Commit deeab820 by Andreas Jaeger

chdir.c, [...]: Include <string.h> for prototypes.

	* intrinsics/chdir.c, intrinsics/getlog.c, intrinsics/link.c,
	intrinsics/symlnk.c, intrinsics/perror.c: Include <string.h> for
	prototypes.

	* runtime/string.c (compare0): Remove unused variable.
	* io/unit.c (init_units): Remove unused variables.
	* intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
	* intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
	* intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
	stat_i8_sub): Remove unused variable.

From-SVN: r99716
parent 64fbae21
2005-05-15 Andreas Jaeger <aj@suse.de>
* intrinsics/chdir.c, intrinsics/getlog.c, intrinsics/link.c,
intrinsics/symlnk.c, intrinsics/perror.c: Include <string.h> for
prototypes.
* runtime/string.c (compare0): Remove unused variable.
* io/unit.c (init_units): Remove unused variables.
* intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
* intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
* intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
stat_i8_sub): Remove unused variable.
2005-05-12 Thomas Koenig <Thomas.Koenig@online.de> 2005-05-12 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21324 PR libfortran/21324
...@@ -179,7 +192,7 @@ ...@@ -179,7 +192,7 @@
from WRITING to READING. from WRITING to READING.
2005-04-22 Paul Thomas <pault@gcc.gnu.org> 2005-04-22 Paul Thomas <pault@gcc.gnu.org>
Jerry DeLisle <jvdelisle@verizon.net> Jerry DeLisle <jvdelisle@verizon.net>
* io/write.c (nml_write_obj): Provide 1 more byte for ext_name. * io/write.c (nml_write_obj): Provide 1 more byte for ext_name.
* io/list_read.c (nml_get_obj_data): Put extra brackets in get_mem * io/list_read.c (nml_get_obj_data): Put extra brackets in get_mem
...@@ -355,7 +368,7 @@ ...@@ -355,7 +368,7 @@
environment variables we want to be positive. environment variables we want to be positive.
(init_integer): Function to allow negative environment (init_integer): Function to allow negative environment
variables (e.g. for GFORTRAN_STDIN_UNIT). variables (e.g. for GFORTRAN_STDIN_UNIT).
2005-04-10 Thomas Koenig <Thomas.Koenig@online.de> 2005-04-10 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/17992 PR libfortran/17992
...@@ -466,7 +479,7 @@ ...@@ -466,7 +479,7 @@
2005-04-09 Thomas Koenig <Thomas.Koenig@online.de> 2005-04-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/20163 PR libfortran/20163
* runtime/string.c (compare0): Use fstrlen() to * runtime/string.c (compare0): Use fstrlen() to
strip trailing blanks from option string. strip trailing blanks from option string.
2005-04-09 Andrew Pinski <pinskia@physics.uc.edu> 2005-04-09 Andrew Pinski <pinskia@physics.uc.edu>
......
...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */
#include "../io/io.h" #include "../io/io.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -60,11 +63,11 @@ chdir_i4_sub (char *dir, GFC_INTEGER_4 *status, gfc_charlen_type dir_len) ...@@ -60,11 +63,11 @@ chdir_i4_sub (char *dir, GFC_INTEGER_4 *status, gfc_charlen_type dir_len)
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str = gfc_alloca (dir_len + 1); str = gfc_alloca (dir_len + 1);
memcpy (str, dir, dir_len); memcpy (str, dir, dir_len);
str[dir_len] = '\0'; str[dir_len] = '\0';
val = chdir (str); val = chdir (str);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(chdir_i4_sub); iexport(chdir_i4_sub);
...@@ -85,11 +88,11 @@ chdir_i8_sub (char *dir, GFC_INTEGER_8 *status, gfc_charlen_type dir_len) ...@@ -85,11 +88,11 @@ chdir_i8_sub (char *dir, GFC_INTEGER_8 *status, gfc_charlen_type dir_len)
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str = gfc_alloca (dir_len + 1); str = gfc_alloca (dir_len + 1);
memcpy (str, dir, dir_len); memcpy (str, dir, dir_len);
str[dir_len] = '\0'; str[dir_len] = '\0';
val = chdir (str); val = chdir (str);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(chdir_i8_sub); iexport(chdir_i8_sub);
......
/* Implementation of the GETCWD intrinsic. /* Implementation of the GETCWD intrinsic.
Copyright (C) 2004 Free Software Foundation, Inc. Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Steven G. Kargl <kargls@comcast.net>. Contributed by Steven G. Kargl <kargls@comcast.net>.
This file is part of the GNU Fortran 95 runtime library (libgfortran). This file is part of the GNU Fortran 95 runtime library (libgfortran).
...@@ -46,7 +46,7 @@ iexport_proto(getcwd_i4_sub); ...@@ -46,7 +46,7 @@ iexport_proto(getcwd_i4_sub);
void void
getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len) getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len)
{ {
char str[cwd_len + 1], *s; char str[cwd_len + 1];
GFC_INTEGER_4 stat; GFC_INTEGER_4 stat;
memset(cwd, ' ', (size_t) cwd_len); memset(cwd, ' ', (size_t) cwd_len);
...@@ -58,7 +58,7 @@ getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len) ...@@ -58,7 +58,7 @@ getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len)
stat = 0; stat = 0;
memcpy (cwd, str, strlen (str)); memcpy (cwd, str, strlen (str));
} }
if (status != NULL) if (status != NULL)
*status = stat; *status = stat;
} }
iexport(getcwd_i4_sub); iexport(getcwd_i4_sub);
......
...@@ -31,6 +31,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -31,6 +31,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "libgfortran.h" #include "libgfortran.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -44,7 +47,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -44,7 +47,7 @@ Boston, MA 02111-1307, USA. */
void PREFIX(getlog) (char *, gfc_charlen_type); void PREFIX(getlog) (char *, gfc_charlen_type);
export_proto_np(PREFIX(getlog)); export_proto_np(PREFIX(getlog));
void void
PREFIX(getlog) (char * login, gfc_charlen_type login_len) PREFIX(getlog) (char * login, gfc_charlen_type login_len)
{ {
int p_len; int p_len;
......
...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */
#include "../io/io.h" #include "../io/io.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -64,15 +67,15 @@ link_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status, ...@@ -64,15 +67,15 @@ link_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status,
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str1 = gfc_alloca (path1_len + 1); str1 = gfc_alloca (path1_len + 1);
memcpy (str1, path1, path1_len); memcpy (str1, path1, path1_len);
str1[path1_len] = '\0'; str1[path1_len] = '\0';
str2 = gfc_alloca (path2_len + 1); str2 = gfc_alloca (path2_len + 1);
memcpy (str2, path2, path2_len); memcpy (str2, path2, path2_len);
str2[path2_len] = '\0'; str2[path2_len] = '\0';
val = link (str1, str2); val = link (str1, str2);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(link_i4_sub); iexport(link_i4_sub);
...@@ -97,15 +100,15 @@ link_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status, ...@@ -97,15 +100,15 @@ link_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status,
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str1 = gfc_alloca (path1_len + 1); str1 = gfc_alloca (path1_len + 1);
memcpy (str1, path1, path1_len); memcpy (str1, path1, path1_len);
str1[path1_len] = '\0'; str1[path1_len] = '\0';
str2 = gfc_alloca (path2_len + 1); str2 = gfc_alloca (path2_len + 1);
memcpy (str2, path2, path2_len); memcpy (str2, path2, path2_len);
str2[path2_len] = '\0'; str2[path2_len] = '\0';
val = link (str1, str2); val = link (str1, str2);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(link_i8_sub); iexport(link_i8_sub);
......
...@@ -36,6 +36,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -36,6 +36,9 @@ Boston, MA 02111-1307, USA. */
#include "../io/io.h" #include "../io/io.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/* SUBROUTINE PERROR(STRING) /* SUBROUTINE PERROR(STRING)
CHARACTER(len=*), INTENT(IN) :: STRING */ CHARACTER(len=*), INTENT(IN) :: STRING */
...@@ -56,7 +59,7 @@ perror_sub (char *string, gfc_charlen_type string_len) ...@@ -56,7 +59,7 @@ perror_sub (char *string, gfc_charlen_type string_len)
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str = gfc_alloca (string_len + 1); str = gfc_alloca (string_len + 1);
memcpy (str, string, string_len); memcpy (str, string, string_len);
str[string_len] = '\0'; str[string_len] = '\0';
perror (str); perror (str);
} }
......
/* Implementation of the STAT and FSTAT intrinsics. /* Implementation of the STAT and FSTAT intrinsics.
Copyright (C) 2004 Free Software Foundation, Inc. Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Steven G. Kargl <kargls@comcast.net>. Contributed by Steven G. Kargl <kargls@comcast.net>.
This file is part of the GNU Fortran 95 runtime library (libgfortran). This file is part of the GNU Fortran 95 runtime library (libgfortran).
...@@ -73,8 +73,6 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status, ...@@ -73,8 +73,6 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
char *str; char *str;
struct stat sb; struct stat sb;
index_type stride[GFC_MAX_DIMENSIONS];
/* If the rank of the array is not 1, abort. */ /* If the rank of the array is not 1, abort. */
if (GFC_DESCRIPTOR_RANK (sarray) != 1) if (GFC_DESCRIPTOR_RANK (sarray) != 1)
runtime_error ("Array rank of SARRAY is not 1."); runtime_error ("Array rank of SARRAY is not 1.");
...@@ -93,11 +91,11 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status, ...@@ -93,11 +91,11 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
/* Make a null terminated copy of the string. */ /* Make a null terminated copy of the string. */
str = gfc_alloca (name_len + 1); str = gfc_alloca (name_len + 1);
memcpy (str, name, name_len); memcpy (str, name, name_len);
str[name_len] = '\0'; str[name_len] = '\0';
val = stat(str, &sb); val = stat(str, &sb);
if (val == 0) if (val == 0)
{ {
/* Device ID */ /* Device ID */
sarray->data[0 * sarray->dim[0].stride] = sb.st_dev; sarray->data[0 * sarray->dim[0].stride] = sb.st_dev;
...@@ -116,7 +114,7 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status, ...@@ -116,7 +114,7 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
/* Owner's gid */ /* Owner's gid */
sarray->data[5 * sarray->dim[0].stride] = sb.st_gid; sarray->data[5 * sarray->dim[0].stride] = sb.st_gid;
/* ID of device containing directory entry for file (0 if not available) */ /* ID of device containing directory entry for file (0 if not available) */
#if HAVE_STRUCT_STAT_ST_RDEV #if HAVE_STRUCT_STAT_ST_RDEV
sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev; sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev;
...@@ -151,7 +149,7 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status, ...@@ -151,7 +149,7 @@ stat_i4_sub (char *name, gfc_array_i4 *sarray, GFC_INTEGER_4 *status,
#endif #endif
} }
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(stat_i4_sub); iexport(stat_i4_sub);
...@@ -168,8 +166,6 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status, ...@@ -168,8 +166,6 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
char *str; char *str;
struct stat sb; struct stat sb;
index_type stride[GFC_MAX_DIMENSIONS];
/* If the rank of the array is not 1, abort. */ /* If the rank of the array is not 1, abort. */
if (GFC_DESCRIPTOR_RANK (sarray) != 1) if (GFC_DESCRIPTOR_RANK (sarray) != 1)
runtime_error ("Array rank of SARRAY is not 1."); runtime_error ("Array rank of SARRAY is not 1.");
...@@ -188,7 +184,7 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status, ...@@ -188,7 +184,7 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
/* Make a null terminated copy of the string. */ /* Make a null terminated copy of the string. */
str = gfc_alloca (name_len + 1); str = gfc_alloca (name_len + 1);
memcpy (str, name, name_len); memcpy (str, name, name_len);
str[name_len] = '\0'; str[name_len] = '\0';
val = stat(str, &sb); val = stat(str, &sb);
...@@ -205,13 +201,13 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status, ...@@ -205,13 +201,13 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
/* Number of (hard) links */ /* Number of (hard) links */
sarray->data[3 * sarray->dim[0].stride] = sb.st_nlink; sarray->data[3 * sarray->dim[0].stride] = sb.st_nlink;
/* Owner's uid */ /* Owner's uid */
sarray->data[4 * sarray->dim[0].stride] = sb.st_uid; sarray->data[4 * sarray->dim[0].stride] = sb.st_uid;
/* Owner's gid */ /* Owner's gid */
sarray->data[5 * sarray->dim[0].stride] = sb.st_gid; sarray->data[5 * sarray->dim[0].stride] = sb.st_gid;
/* ID of device containing directory entry for file (0 if not available) */ /* ID of device containing directory entry for file (0 if not available) */
#if HAVE_STRUCT_STAT_ST_RDEV #if HAVE_STRUCT_STAT_ST_RDEV
sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev; sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev;
...@@ -246,7 +242,7 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status, ...@@ -246,7 +242,7 @@ stat_i8_sub (char *name, gfc_array_i8 *sarray, GFC_INTEGER_8 *status,
#endif #endif
} }
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(stat_i8_sub); iexport(stat_i8_sub);
...@@ -275,13 +271,13 @@ stat_i8 (char *name, gfc_array_i8 *sarray, gfc_charlen_type name_len) ...@@ -275,13 +271,13 @@ stat_i8 (char *name, gfc_array_i8 *sarray, gfc_charlen_type name_len)
/* SUBROUTINE FSTAT(UNIT, SARRAY, STATUS) /* SUBROUTINE FSTAT(UNIT, SARRAY, STATUS)
INTEGER, INTENT(IN) :: UNIT INTEGER, INTENT(IN) :: UNIT
INTEGER, INTENT(OUT) :: SARRAY(13) INTEGER, INTENT(OUT) :: SARRAY(13)
INTEGER, INTENT(OUT), OPTIONAL :: STATUS INTEGER, INTENT(OUT), OPTIONAL :: STATUS
FUNCTION FSTAT(UNIT, SARRAY) FUNCTION FSTAT(UNIT, SARRAY)
INTEGER FSTAT INTEGER FSTAT
INTEGER, INTENT(IN) :: UNIT INTEGER, INTENT(IN) :: UNIT
INTEGER, INTENT(OUT) :: SARRAY(13) */ INTEGER, INTENT(OUT) :: SARRAY(13) */
extern void fstat_i4_sub (GFC_INTEGER_4 *, gfc_array_i4 *, GFC_INTEGER_4 *); extern void fstat_i4_sub (GFC_INTEGER_4 *, gfc_array_i4 *, GFC_INTEGER_4 *);
...@@ -293,8 +289,6 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status) ...@@ -293,8 +289,6 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status)
int val; int val;
struct stat sb; struct stat sb;
index_type stride[GFC_MAX_DIMENSIONS];
/* If the rank of the array is not 1, abort. */ /* If the rank of the array is not 1, abort. */
if (GFC_DESCRIPTOR_RANK (sarray) != 1) if (GFC_DESCRIPTOR_RANK (sarray) != 1)
runtime_error ("Array rank of SARRAY is not 1."); runtime_error ("Array rank of SARRAY is not 1.");
...@@ -318,7 +312,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status) ...@@ -318,7 +312,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status)
/* Inode number */ /* Inode number */
sarray->data[1 * sarray->dim[0].stride] = sb.st_ino; sarray->data[1 * sarray->dim[0].stride] = sb.st_ino;
/* File mode */ /* File mode */
sarray->data[2 * sarray->dim[0].stride] = sb.st_mode; sarray->data[2 * sarray->dim[0].stride] = sb.st_mode;
...@@ -330,7 +324,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status) ...@@ -330,7 +324,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status)
/* Owner's gid */ /* Owner's gid */
sarray->data[5 * sarray->dim[0].stride] = sb.st_gid; sarray->data[5 * sarray->dim[0].stride] = sb.st_gid;
/* ID of device containing directory entry for file (0 if not available) */ /* ID of device containing directory entry for file (0 if not available) */
#if HAVE_STRUCT_STAT_ST_RDEV #if HAVE_STRUCT_STAT_ST_RDEV
sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev; sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev;
...@@ -365,7 +359,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status) ...@@ -365,7 +359,7 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_array_i4 *sarray, GFC_INTEGER_4 *status)
#endif #endif
} }
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(fstat_i4_sub); iexport(fstat_i4_sub);
...@@ -379,8 +373,6 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status) ...@@ -379,8 +373,6 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status)
int val; int val;
struct stat sb; struct stat sb;
index_type stride[GFC_MAX_DIMENSIONS];
/* If the rank of the array is not 1, abort. */ /* If the rank of the array is not 1, abort. */
if (GFC_DESCRIPTOR_RANK (sarray) != 1) if (GFC_DESCRIPTOR_RANK (sarray) != 1)
runtime_error ("Array rank of SARRAY is not 1."); runtime_error ("Array rank of SARRAY is not 1.");
...@@ -416,7 +408,7 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status) ...@@ -416,7 +408,7 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status)
/* Owner's gid */ /* Owner's gid */
sarray->data[5 * sarray->dim[0].stride] = sb.st_gid; sarray->data[5 * sarray->dim[0].stride] = sb.st_gid;
/* ID of device containing directory entry for file (0 if not available) */ /* ID of device containing directory entry for file (0 if not available) */
#if HAVE_STRUCT_STAT_ST_RDEV #if HAVE_STRUCT_STAT_ST_RDEV
sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev; sarray->data[6 * sarray->dim[0].stride] = sb.st_rdev;
...@@ -451,7 +443,7 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status) ...@@ -451,7 +443,7 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_array_i8 *sarray, GFC_INTEGER_8 *status)
#endif #endif
} }
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(fstat_i8_sub); iexport(fstat_i8_sub);
......
...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */
#include "../io/io.h" #include "../io/io.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -64,15 +67,15 @@ symlnk_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status, ...@@ -64,15 +67,15 @@ symlnk_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status,
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str1 = gfc_alloca (path1_len + 1); str1 = gfc_alloca (path1_len + 1);
memcpy (str1, path1, path1_len); memcpy (str1, path1, path1_len);
str1[path1_len] = '\0'; str1[path1_len] = '\0';
str2 = gfc_alloca (path2_len + 1); str2 = gfc_alloca (path2_len + 1);
memcpy (str2, path2, path2_len); memcpy (str2, path2, path2_len);
str2[path2_len] = '\0'; str2[path2_len] = '\0';
val = symlink (str1, str2); val = symlink (str1, str2);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(symlnk_i4_sub); iexport(symlnk_i4_sub);
...@@ -97,15 +100,15 @@ symlnk_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status, ...@@ -97,15 +100,15 @@ symlnk_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status,
/* Make a null terminated copy of the strings. */ /* Make a null terminated copy of the strings. */
str1 = gfc_alloca (path1_len + 1); str1 = gfc_alloca (path1_len + 1);
memcpy (str1, path1, path1_len); memcpy (str1, path1, path1_len);
str1[path1_len] = '\0'; str1[path1_len] = '\0';
str2 = gfc_alloca (path2_len + 1); str2 = gfc_alloca (path2_len + 1);
memcpy (str2, path2, path2_len); memcpy (str2, path2, path2_len);
str2[path2_len] = '\0'; str2[path2_len] = '\0';
val = symlink (str1, str2); val = symlink (str1, str2);
if (status != NULL) if (status != NULL)
*status = (val == 0) ? 0 : errno; *status = (val == 0) ? 0 : errno;
} }
iexport(symlnk_i8_sub); iexport(symlnk_i8_sub);
......
/* Implementation of the UNLINK intrinsic. /* Implementation of the UNLINK intrinsic.
Copyright (C) 2004 Free Software Foundation, Inc. Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Steven G. Kargl <kargls@comcast.net>. Contributed by Steven G. Kargl <kargls@comcast.net>.
This file is part of the GNU Fortran 95 runtime library (libgfortran). This file is part of the GNU Fortran 95 runtime library (libgfortran).
...@@ -51,7 +51,7 @@ iexport_proto(unlink_i4_sub); ...@@ -51,7 +51,7 @@ iexport_proto(unlink_i4_sub);
void void
unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len) unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len)
{ {
char *str, *s; char *str;
GFC_INTEGER_4 stat; GFC_INTEGER_4 stat;
/* Trim trailing spaces from name. */ /* Trim trailing spaces from name. */
...@@ -61,11 +61,11 @@ unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len) ...@@ -61,11 +61,11 @@ unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len)
/* Make a null terminated copy of the string. */ /* Make a null terminated copy of the string. */
str = gfc_alloca (name_len + 1); str = gfc_alloca (name_len + 1);
memcpy (str, name, name_len); memcpy (str, name, name_len);
str[name_len] = '\0'; str[name_len] = '\0';
stat = unlink (str); stat = unlink (str);
if (status != NULL) if (status != NULL)
*status = (stat == 0) ? stat : errno; *status = (stat == 0) ? stat : errno;
} }
iexport(unlink_i4_sub); iexport(unlink_i4_sub);
......
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. /* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Andy Vaught Contributed by Andy Vaught
This file is part of the GNU Fortran 95 runtime library (libgfortran). This file is part of the GNU Fortran 95 runtime library (libgfortran).
...@@ -288,7 +288,6 @@ is_internal_unit () ...@@ -288,7 +288,6 @@ is_internal_unit ()
void void
init_units (void) init_units (void)
{ {
gfc_offset m, n;
gfc_unit *u; gfc_unit *u;
int i; int i;
......
/* Copyright (C) 2002-2003 Free Software Foundation, Inc. /* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Paul Brook Contributed by Paul Brook
This file is part of the GNU Fortran 95 runtime library (libgfortran). This file is part of the GNU Fortran 95 runtime library (libgfortran).
...@@ -40,12 +40,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -40,12 +40,11 @@ Boston, MA 02111-1307, USA. */
static int static int
compare0 (const char *s1, int s1_len, const char *s2) compare0 (const char *s1, int s1_len, const char *s2)
{ {
int i;
int len; int len;
/* Strip trailing blanks from the Fortran string. */ /* Strip trailing blanks from the Fortran string. */
len = fstrlen(s1, s1_len); len = fstrlen (s1, s1_len);
return strncasecmp(s1,s2,len) == 0; return strncasecmp (s1, s2, len) == 0;
} }
......
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