* Compute products of array dimensions, ie, scale factors for subscripts * * We assume caller has validated dimensions, so overflow is impossible */
| 156 | * We assume caller has validated dimensions, so overflow is impossible |
| 157 | */ |
| 158 | void |
| 159 | mda_get_prod(int n, const int *range, int *prod) |
| 160 | { |
| 161 | int i; |
| 162 | |
| 163 | prod[n - 1] = 1; |
| 164 | for (i = n - 2; i >= 0; i--) |
| 165 | prod[i] = prod[i + 1] * range[i + 1]; |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | * From products of whole-array dimensions and spans of a sub-array, |
no outgoing calls
no test coverage detected