OLD | NEW |
1 /* Helper function for repacking arrays. | 1 /* Helper function for repacking arrays. |
2 Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc. | 2 Copyright 2003, 2006, 2007, 2009 Free Software Foundation, Inc. |
3 Contributed by Paul Brook <paul@nowt.org> | 3 Contributed by Paul Brook <paul@nowt.org> |
4 | 4 |
5 This file is part of the GNU Fortran 95 runtime library (libgfortran). | 5 This file is part of the GNU Fortran 95 runtime library (libgfortran). |
6 | 6 |
7 Libgfortran is free software; you can redistribute it and/or | 7 Libgfortran is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU General Public | 8 modify it under the terms of the GNU General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 3 of the License, or (at your option) any later version. | 10 version 3 of the License, or (at your option) any later version. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 /* TODO: Investigate how we can figure out if this is a temporary | 51 /* TODO: Investigate how we can figure out if this is a temporary |
52 since the stride=0 thing has been removed from the frontend. */ | 52 since the stride=0 thing has been removed from the frontend. */ |
53 | 53 |
54 dim = GFC_DESCRIPTOR_RANK (source); | 54 dim = GFC_DESCRIPTOR_RANK (source); |
55 ssize = 1; | 55 ssize = 1; |
56 packed = 1; | 56 packed = 1; |
57 for (n = 0; n < dim; n++) | 57 for (n = 0; n < dim; n++) |
58 { | 58 { |
59 count[n] = 0; | 59 count[n] = 0; |
60 stride[n] = source->dim[n].stride; | 60 stride[n] = GFC_DESCRIPTOR_STRIDE(source,n); |
61 extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; | 61 extent[n] = GFC_DESCRIPTOR_EXTENT(source,n); |
62 if (extent[n] <= 0) | 62 if (extent[n] <= 0) |
63 { | 63 { |
64 /* Do nothing. */ | 64 /* Do nothing. */ |
65 packed = 1; | 65 packed = 1; |
66 break; | 66 break; |
67 } | 67 } |
68 | 68 |
69 if (ssize != stride[n]) | 69 if (ssize != stride[n]) |
70 packed = 0; | 70 packed = 0; |
71 | 71 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 count[n]++; | 110 count[n]++; |
111 src += stride[n]; | 111 src += stride[n]; |
112 } | 112 } |
113 } | 113 } |
114 } | 114 } |
115 return destptr; | 115 return destptr; |
116 } | 116 } |
117 | 117 |
118 #endif | 118 #endif |
119 | 119 |
OLD | NEW |