diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-30 22:37:47 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-30 22:37:47 +0000 |
commit | 18ea6808085c377ed9663d30bbe842f87059567c (patch) | |
tree | 25af13e566ef745afd4c93c235445549fb0096a0 /libgfortran/intrinsics/iso_c_binding.c | |
parent | ec46af50162c7a3a7c3af7a28d687cfa49daad1d (diff) | |
download | ppe42-gcc-18ea6808085c377ed9663d30bbe842f87059567c.tar.gz ppe42-gcc-18ea6808085c377ed9663d30bbe842f87059567c.zip |
PR libfortran/41219 Fix build warnings
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics/iso_c_binding.c')
-rw-r--r-- | libgfortran/intrinsics/iso_c_binding.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libgfortran/intrinsics/iso_c_binding.c b/libgfortran/intrinsics/iso_c_binding.c index ea1bab39501..d0549b03dfa 100644 --- a/libgfortran/intrinsics/iso_c_binding.c +++ b/libgfortran/intrinsics/iso_c_binding.c @@ -94,11 +94,11 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in, if (shape != NULL) { - index_type source_stride; - index_type size, str; + index_type source_stride, size; + index_type str = 1; char *p; - f_ptr_out->offset = 0; + f_ptr_out->offset = str; shapeSize = 0; p = shape->data; size = GFC_DESCRIPTOR_SIZE(shape); @@ -145,12 +145,7 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in, } p += source_stride; - if (i == 0) - { - str = 1; - f_ptr_out->offset = str; - } - else + if (i != 0) { str = str * GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1); f_ptr_out->offset += str; |