Skip to content

Commit 505e99a

Browse files
authored
Merge pull request #1527 from ckhroulev/NCDISPATCH_initialize_indexing
Fix NC_coord_zero indexing in NCDISPATCH_initialize()
2 parents 108e938 + 91d3a89 commit 505e99a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

libdispatch/ddispatch.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See LICENSE.txt for license information.
2626
#include <curl/curl.h>
2727
#endif
2828

29-
/* Define vectors of zeros and ones for use with various nc_get_varX function*/
29+
/* Define vectors of zeros and ones for use with various nc_get_varX functions */
3030
size_t NC_coord_zero[NC_MAX_VAR_DIMS] = {0};
3131
size_t NC_coord_one[NC_MAX_VAR_DIMS] = {1};
3232
ptrdiff_t NC_stride_one[NC_MAX_VAR_DIMS] = {1};
@@ -46,15 +46,10 @@ NCDISPATCH_initialize(void)
4646
int i;
4747
NCRCglobalstate* globalstate = NULL;
4848

49-
{
50-
size_t* c0 = (size_t*)NC_coord_zero;
51-
size_t* c1 = (size_t*)NC_coord_one;
52-
ptrdiff_t* s1 = (ptrdiff_t*)NC_stride_one;
53-
for(i=0;i<NC_MAX_VAR_DIMS;i++) {
54-
c0[0] = 0;
55-
c1[i] = 1;
56-
s1[i] = 1;
57-
}
49+
for(i=0;i<NC_MAX_VAR_DIMS;i++) {
50+
NC_coord_zero[i] = 0;
51+
NC_coord_one[i] = 1;
52+
NC_stride_one[i] = 1;
5853
}
5954

6055
globalstate = ncrc_getglobalstate(); /* will allocate and clear */

0 commit comments

Comments
 (0)