Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
44720bef
Commit
44720bef
authored
Apr 12, 2011
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup memsize types
From-SVN: r172340
parent
99ee0251
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
176 additions
and
116 deletions
+176
-116
libgfortran/ChangeLog
+15
-0
libgfortran/config.h.in
+11
-0
libgfortran/configure
+83
-22
libgfortran/configure.ac
+5
-4
libgfortran/generated/cshift0_c10.c
+2
-2
libgfortran/generated/cshift0_c16.c
+2
-2
libgfortran/generated/cshift0_c4.c
+2
-2
libgfortran/generated/cshift0_c8.c
+2
-2
libgfortran/generated/cshift0_i1.c
+2
-2
libgfortran/generated/cshift0_i16.c
+2
-2
libgfortran/generated/cshift0_i2.c
+2
-2
libgfortran/generated/cshift0_i4.c
+2
-2
libgfortran/generated/cshift0_i8.c
+2
-2
libgfortran/generated/cshift0_r10.c
+2
-2
libgfortran/generated/cshift0_r16.c
+2
-2
libgfortran/generated/cshift0_r4.c
+2
-2
libgfortran/generated/cshift0_r8.c
+2
-2
libgfortran/intrinsics/cshift0.c
+2
-2
libgfortran/io/io.h
+5
-6
libgfortran/io/list_read.c
+9
-9
libgfortran/io/write.c
+1
-1
libgfortran/libgfortran.h
+17
-44
libgfortran/m4/cshift0.m4
+2
-2
No files found.
libgfortran/ChangeLog
View file @
44720bef
2011-04-12 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Use AC_TYPE_* to make sure we have (u)intptr_t,
check for ptrdiff_t.
* libgfortran.h: Remove (u)intptr_t definitions, use ptrdiff_t for
index_type, change cshift0* prototypes.
* config.h.in: Regenerated.
* configure: Regenerated.
* intrinsics/cshift0.c (cshift0): Use ptrdiff_t instead of ssize_t.
* io/io.h (array_loop_spec): Use index_type instead of ssize_t.
* io/list_read.c (nml_parse_qualifier): Likewise.
* io/write.c (nml_write_obj): Likewise.
* m4/cshift0.c (cshift0_'rtype_code`): Likewise.
* generated/cshift0_*.c: Regenerated.
2011-04-12 Janne Blomqvist <jb@gcc.gnu.org>
* Makefile.am: Remove _GNU_SOURCE from AM_CPPFLAGS.
* Makefile.in: Regenerated.
...
...
libgfortran/config.h.in
View file @
44720bef
...
...
@@ -630,6 +630,9 @@
/* libm includes powl */
#undef HAVE_POWL
/* Define to 1 if the system has the type `ptrdiff_t'. */
#undef HAVE_PTRDIFF_T
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
...
...
@@ -945,5 +948,13 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define to the type of a signed integer type wide enough to hold a pointer,
if such a type exists, and if the system does not define it. */
#undef intptr_t
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to the type of an unsigned integer type wide enough to hold a
pointer, if such a type exists, and if the system does not define it. */
#undef uintptr_t
libgfortran/configure
View file @
44720bef
...
...
@@ -15634,6 +15634,8 @@ rm -rf conftest*
fi
fi
# Types
ac_fn_c_check_type
"
$LINENO
"
"off_t"
"ac_cv_type_off_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_off_t
"
=
x
""
yes
;
then
:
...
...
@@ -15646,6 +15648,87 @@ _ACEOF
fi
ac_fn_c_check_type
"
$LINENO
"
"intptr_t"
"ac_cv_type_intptr_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_intptr_t
"
=
x
""
yes
;
then
:
$as_echo
"#define HAVE_INTPTR_T 1"
>>
confdefs.h
else
for
ac_type
in
'int'
'long int'
'long long int'
;
do
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (
$ac_type
))];
test_array [0] = 0
;
return 0;
}
_ACEOF
if
ac_fn_c_try_compile
"
$LINENO
"
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define intptr_t
$ac_type
_ACEOF
ac_type
=
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
test
-z
"
$ac_type
"
&&
break
done
fi
ac_fn_c_check_type
"
$LINENO
"
"uintptr_t"
"ac_cv_type_uintptr_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_uintptr_t
"
=
x
""
yes
;
then
:
$as_echo
"#define HAVE_UINTPTR_T 1"
>>
confdefs.h
else
for
ac_type
in
'unsigned int'
'unsigned long int'
\
'unsigned long long int'
;
do
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (
$ac_type
))];
test_array [0] = 0
;
return 0;
}
_ACEOF
if
ac_fn_c_try_compile
"
$LINENO
"
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define uintptr_t
$ac_type
_ACEOF
ac_type
=
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
test
-z
"
$ac_type
"
&&
break
done
fi
ac_fn_c_check_type
"
$LINENO
"
"ptrdiff_t"
"ac_cv_type_ptrdiff_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_ptrdiff_t
"
=
x
""
yes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_PTRDIFF_T 1
_ACEOF
fi
# check header files
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for ANSI C header files"
>
&5
$as_echo_n
"checking for ANSI C header files... "
>
&6
;
}
...
...
@@ -16404,28 +16487,6 @@ fi
done
# Check for types
ac_fn_c_check_type
"
$LINENO
"
"intptr_t"
"ac_cv_type_intptr_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_intptr_t
"
=
x
""
yes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_INTPTR_T 1
_ACEOF
fi
ac_fn_c_check_type
"
$LINENO
"
"uintptr_t"
"ac_cv_type_uintptr_t"
"
$ac_includes_default
"
if
test
"x
$ac_cv_type_uintptr_t
"
=
x
""
yes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_UINTPTR_T 1
_ACEOF
fi
# Check libc for getgid, getpid, getuid
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for getgid in -lc"
>
&5
$as_echo_n
"checking for getgid in -lc... "
>
&6
;
}
...
...
libgfortran/configure.ac
View file @
44720bef
...
...
@@ -236,7 +236,12 @@ AC_SUBST(extra_ldflags_libgfortran)
LIBGFOR_WORKING_GFORTRAN
AC_SYS_LARGEFILE
# Types
AC_TYPE_OFF_T
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T
AC_CHECK_TYPES([ptrdiff_t])
# check header files
AC_STDC_HEADERS
...
...
@@ -264,10 +269,6 @@ AC_CHECK_FUNCS(clock_gettime strftime)
# Check for glibc backtrace functions
AC_CHECK_FUNCS(backtrace backtrace_symbols)
# Check for types
AC_CHECK_TYPES([intptr_t])
AC_CHECK_TYPES([uintptr_t])
# Check libc for getgid, getpid, getuid
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
AC_CHECK_LIB([c],[getpid],[AC_DEFINE([HAVE_GETPID],[1],[libc includes getpid])])
...
...
libgfortran/generated/cshift0_c10.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_COMPLEX_10)
void
cshift0_c10
(
gfc_array_c10
*
ret
,
const
gfc_array_c10
*
array
,
ssize
_t
shift
,
cshift0_c10
(
gfc_array_c10
*
ret
,
const
gfc_array_c10
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_c16.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_COMPLEX_16)
void
cshift0_c16
(
gfc_array_c16
*
ret
,
const
gfc_array_c16
*
array
,
ssize
_t
shift
,
cshift0_c16
(
gfc_array_c16
*
ret
,
const
gfc_array_c16
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_c4.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_COMPLEX_4)
void
cshift0_c4
(
gfc_array_c4
*
ret
,
const
gfc_array_c4
*
array
,
ssize
_t
shift
,
cshift0_c4
(
gfc_array_c4
*
ret
,
const
gfc_array_c4
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_c8.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_COMPLEX_8)
void
cshift0_c8
(
gfc_array_c8
*
ret
,
const
gfc_array_c8
*
array
,
ssize
_t
shift
,
cshift0_c8
(
gfc_array_c8
*
ret
,
const
gfc_array_c8
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_i1.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_INTEGER_1)
void
cshift0_i1
(
gfc_array_i1
*
ret
,
const
gfc_array_i1
*
array
,
ssize
_t
shift
,
cshift0_i1
(
gfc_array_i1
*
ret
,
const
gfc_array_i1
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_i16.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_INTEGER_16)
void
cshift0_i16
(
gfc_array_i16
*
ret
,
const
gfc_array_i16
*
array
,
ssize
_t
shift
,
cshift0_i16
(
gfc_array_i16
*
ret
,
const
gfc_array_i16
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_i2.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_INTEGER_2)
void
cshift0_i2
(
gfc_array_i2
*
ret
,
const
gfc_array_i2
*
array
,
ssize
_t
shift
,
cshift0_i2
(
gfc_array_i2
*
ret
,
const
gfc_array_i2
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_i4.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_INTEGER_4)
void
cshift0_i4
(
gfc_array_i4
*
ret
,
const
gfc_array_i4
*
array
,
ssize
_t
shift
,
cshift0_i4
(
gfc_array_i4
*
ret
,
const
gfc_array_i4
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_i8.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_INTEGER_8)
void
cshift0_i8
(
gfc_array_i8
*
ret
,
const
gfc_array_i8
*
array
,
ssize
_t
shift
,
cshift0_i8
(
gfc_array_i8
*
ret
,
const
gfc_array_i8
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_r10.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_REAL_10)
void
cshift0_r10
(
gfc_array_r10
*
ret
,
const
gfc_array_r10
*
array
,
ssize
_t
shift
,
cshift0_r10
(
gfc_array_r10
*
ret
,
const
gfc_array_r10
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_r16.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_REAL_16)
void
cshift0_r16
(
gfc_array_r16
*
ret
,
const
gfc_array_r16
*
array
,
ssize
_t
shift
,
cshift0_r16
(
gfc_array_r16
*
ret
,
const
gfc_array_r16
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_r4.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_REAL_4)
void
cshift0_r4
(
gfc_array_r4
*
ret
,
const
gfc_array_r4
*
array
,
ssize
_t
shift
,
cshift0_r4
(
gfc_array_r4
*
ret
,
const
gfc_array_r4
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/generated/cshift0_r8.c
View file @
44720bef
...
...
@@ -32,7 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined (HAVE_GFC_REAL_8)
void
cshift0_r8
(
gfc_array_r8
*
ret
,
const
gfc_array_r8
*
array
,
ssize
_t
shift
,
cshift0_r8
(
gfc_array_r8
*
ret
,
const
gfc_array_r8
*
array
,
ptrdiff
_t
shift
,
int
which
)
{
/* r.* indicates the return array. */
...
...
@@ -97,7 +97,7 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ssize_t shift,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/intrinsics/cshift0.c
View file @
44720bef
...
...
@@ -30,7 +30,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
static
void
cshift0
(
gfc_array_char
*
ret
,
const
gfc_array_char
*
array
,
ssize
_t
shift
,
int
which
,
index_type
size
)
ptrdiff
_t
shift
,
int
which
,
index_type
size
)
{
/* r.* indicates the return array. */
index_type
rstride
[
GFC_MAX_DIMENSIONS
];
...
...
@@ -328,7 +328,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
rptr
=
ret
->
data
;
sptr
=
array
->
data
;
shift
=
len
==
0
?
0
:
shift
%
(
ssize
_t
)
len
;
shift
=
len
==
0
?
0
:
shift
%
(
ptrdiff
_t
)
len
;
if
(
shift
<
0
)
shift
+=
len
;
...
...
libgfortran/io/io.h
View file @
44720bef
...
...
@@ -53,22 +53,21 @@ struct gfc_unit;
#define is_char4_unit(dtp) ((dtp)->u.p.unit_is_internal && (dtp)->common.unit)
/* The array_loop_spec contains the variables for the loops over index ranges
that are encountered. Since the variables can be negative, ssize_t
is used. */
that are encountered. */
typedef
struct
array_loop_spec
{
/* Index counter for this dimension. */
ssize_t
idx
;
index_type
idx
;
/* Start for the index counter. */
ssize_t
start
;
index_type
start
;
/* End for the index counter. */
ssize_t
end
;
index_type
end
;
/* Step for the index counter. */
ssize_t
step
;
index_type
step
;
}
array_loop_spec
;
...
...
libgfortran/io/list_read.c
View file @
44720bef
...
...
@@ -2172,7 +2172,7 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
}
/* Now read the index. */
if
(
convert_integer
(
dtp
,
sizeof
(
ssize_t
),
neg
))
if
(
convert_integer
(
dtp
,
sizeof
(
index_type
),
neg
))
{
if
(
is_char
)
sprintf
(
parse_err_msg
,
"Bad integer substring qualifier"
);
...
...
@@ -2187,11 +2187,11 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
if
(
!
null_flag
)
{
if
(
indx
==
0
)
memcpy
(
&
ls
[
dim
].
start
,
dtp
->
u
.
p
.
value
,
sizeof
(
ssize_t
));
memcpy
(
&
ls
[
dim
].
start
,
dtp
->
u
.
p
.
value
,
sizeof
(
index_type
));
if
(
indx
==
1
)
memcpy
(
&
ls
[
dim
].
end
,
dtp
->
u
.
p
.
value
,
sizeof
(
ssize_t
));
memcpy
(
&
ls
[
dim
].
end
,
dtp
->
u
.
p
.
value
,
sizeof
(
index_type
));
if
(
indx
==
2
)
memcpy
(
&
ls
[
dim
].
step
,
dtp
->
u
.
p
.
value
,
sizeof
(
ssize_t
));
memcpy
(
&
ls
[
dim
].
step
,
dtp
->
u
.
p
.
value
,
sizeof
(
index_type
));
}
/* Singlet or doublet indices. */
...
...
@@ -2199,7 +2199,7 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
{
if
(
indx
==
0
)
{
memcpy
(
&
ls
[
dim
].
start
,
dtp
->
u
.
p
.
value
,
sizeof
(
ssize_t
));
memcpy
(
&
ls
[
dim
].
start
,
dtp
->
u
.
p
.
value
,
sizeof
(
index_type
));
/* If -std=f95/2003 or an array section is specified,
do not allow excess data to be processed. */
...
...
@@ -2229,10 +2229,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
}
/* Check the values of the triplet indices. */
if
((
ls
[
dim
].
start
>
(
ssize_t
)
GFC_DIMENSION_UBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
start
<
(
ssize_t
)
GFC_DIMENSION_LBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
end
>
(
ssize_t
)
GFC_DIMENSION_UBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
end
<
(
ssize_t
)
GFC_DIMENSION_LBOUND
(
ad
[
dim
])))
if
((
ls
[
dim
].
start
>
GFC_DIMENSION_UBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
start
<
GFC_DIMENSION_LBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
end
>
GFC_DIMENSION_UBOUND
(
ad
[
dim
]))
||
(
ls
[
dim
].
end
<
GFC_DIMENSION_LBOUND
(
ad
[
dim
])))
{
if
(
is_char
)
sprintf
(
parse_err_msg
,
"Substring out of range"
);
...
...
libgfortran/io/write.c
View file @
44720bef
...
...
@@ -1932,7 +1932,7 @@ obj_loop:
{
obj
->
ls
[
dim_i
].
idx
+=
nml_carry
;
nml_carry
=
0
;
if
(
obj
->
ls
[
dim_i
].
idx
>
(
ssize_t
)
GFC_DESCRIPTOR_UBOUND
(
obj
,
dim_i
))
if
(
obj
->
ls
[
dim_i
].
idx
>
GFC_DESCRIPTOR_UBOUND
(
obj
,
dim_i
))
{
obj
->
ls
[
dim_i
].
idx
=
GFC_DESCRIPTOR_LBOUND
(
obj
,
dim_i
);
nml_carry
=
1
;
...
...
libgfortran/libgfortran.h
View file @
44720bef
...
...
@@ -106,38 +106,11 @@ typedef off_t gfc_offset;
#endif
/* We use intptr_t and uintptr_t, which may not be always defined in
system headers. */
#ifndef HAVE_INTPTR_T
#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
#define intptr_t long
#elif __SIZEOF_POINTER__ == __SIZEOF_LONG_LONG__
#define intptr_t long long
#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
#define intptr_t int
#elif __SIZEOF_POINTER__ == __SIZEOF_SHORT__
#define intptr_t short
#else
#error "Pointer type with unexpected size"
#endif
/* Make sure we have ptrdiff_t. */
#ifndef HAVE_PTRDIFF_T
typedef
intptr_t
ptrdiff_t
;
#endif
#ifndef HAVE_UINTPTR_T
#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
#define uintptr_t unsigned long
#elif __SIZEOF_POINTER__ == __SIZEOF_LONG_LONG__
#define uintptr_t unsigned long long
#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
#define uintptr_t unsigned int
#elif __SIZEOF_POINTER__ == __SIZEOF_SHORT__
#define uintptr_t unsigned short
#else
#error "Pointer type with unexpected size"
#endif
#endif
/* On mingw, work around the buggy Windows snprintf() by using the one
mingw provides, __mingw_snprintf(). We also provide a prototype for
__mingw_snprintf(), because the mingw headers currently don't have one. */
...
...
@@ -269,7 +242,7 @@ typedef GFC_INTEGER_4 GFC_IO_INT;
/* The following two definitions must be consistent with the types used
by the compiler. */
/* The type used of array indices, amongst other things. */
typedef
ssize
_t
index_type
;
typedef
ptrdiff
_t
index_type
;
/* The type used for the lengths of character variables. */
typedef
GFC_INTEGER_4
gfc_charlen_type
;
...
...
@@ -1323,52 +1296,52 @@ internal_proto(count_0);
/* Internal auxiliary functions for cshift */
void
cshift0_i1
(
gfc_array_i1
*
,
const
gfc_array_i1
*
,
ssize
_t
,
int
);
void
cshift0_i1
(
gfc_array_i1
*
,
const
gfc_array_i1
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_i1
);
void
cshift0_i2
(
gfc_array_i2
*
,
const
gfc_array_i2
*
,
ssize
_t
,
int
);
void
cshift0_i2
(
gfc_array_i2
*
,
const
gfc_array_i2
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_i2
);
void
cshift0_i4
(
gfc_array_i4
*
,
const
gfc_array_i4
*
,
ssize
_t
,
int
);
void
cshift0_i4
(
gfc_array_i4
*
,
const
gfc_array_i4
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_i4
);
void
cshift0_i8
(
gfc_array_i8
*
,
const
gfc_array_i8
*
,
ssize
_t
,
int
);
void
cshift0_i8
(
gfc_array_i8
*
,
const
gfc_array_i8
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_i8
);
#ifdef HAVE_GFC_INTEGER_16
void
cshift0_i16
(
gfc_array_i16
*
,
const
gfc_array_i16
*
,
ssize
_t
,
int
);
void
cshift0_i16
(
gfc_array_i16
*
,
const
gfc_array_i16
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_i16
);
#endif
void
cshift0_r4
(
gfc_array_r4
*
,
const
gfc_array_r4
*
,
ssize
_t
,
int
);
void
cshift0_r4
(
gfc_array_r4
*
,
const
gfc_array_r4
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_r4
);
void
cshift0_r8
(
gfc_array_r8
*
,
const
gfc_array_r8
*
,
ssize
_t
,
int
);
void
cshift0_r8
(
gfc_array_r8
*
,
const
gfc_array_r8
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_r8
);
#ifdef HAVE_GFC_REAL_10
void
cshift0_r10
(
gfc_array_r10
*
,
const
gfc_array_r10
*
,
ssize
_t
,
int
);
void
cshift0_r10
(
gfc_array_r10
*
,
const
gfc_array_r10
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_r10
);
#endif
#ifdef HAVE_GFC_REAL_16
void
cshift0_r16
(
gfc_array_r16
*
,
const
gfc_array_r16
*
,
ssize
_t
,
int
);
void
cshift0_r16
(
gfc_array_r16
*
,
const
gfc_array_r16
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_r16
);
#endif
void
cshift0_c4
(
gfc_array_c4
*
,
const
gfc_array_c4
*
,
ssize
_t
,
int
);
void
cshift0_c4
(
gfc_array_c4
*
,
const
gfc_array_c4
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_c4
);
void
cshift0_c8
(
gfc_array_c8
*
,
const
gfc_array_c8
*
,
ssize
_t
,
int
);
void
cshift0_c8
(
gfc_array_c8
*
,
const
gfc_array_c8
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_c8
);
#ifdef HAVE_GFC_COMPLEX_10
void
cshift0_c10
(
gfc_array_c10
*
,
const
gfc_array_c10
*
,
ssize
_t
,
int
);
void
cshift0_c10
(
gfc_array_c10
*
,
const
gfc_array_c10
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_c10
);
#endif
#ifdef HAVE_GFC_COMPLEX_16
void
cshift0_c16
(
gfc_array_c16
*
,
const
gfc_array_c16
*
,
ssize
_t
,
int
);
void
cshift0_c16
(
gfc_array_c16
*
,
const
gfc_array_c16
*
,
ptrdiff
_t
,
int
);
internal_proto
(
cshift0_c16
);
#endif
...
...
libgfortran/m4/cshift0.m4
View file @
44720bef
...
...
@@ -33,7 +33,7 @@ include(iparm.m4)dnl
`#if defined (HAVE_'rtype_name`)
void
cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array,
ssize
_t shift,
cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array,
ptrdiff
_t shift,
int which)
{
/* r.* indicates the return array. */
...
...
@@ -98,7 +98,7 @@ cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ssize_t shift,
rptr = ret->data;
sptr = array->data;
shift = len == 0 ? 0 : shift % (
ssize
_t)len;
shift = len == 0 ? 0 : shift % (
ptrdiff
_t)len;
if (shift < 0)
shift += len;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment