1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 herr_t
 ss_array_target(ss_array_t *array,              /* Array whose datatype is to be modified. */
                 hid_t ftype                     /* Datatype of the array elements as stored in the file. */
                 )
 {
     SS_ENTER(ss_array_target, herr_t);

     if (!array) SS_ERROR_FMT(USAGE, ("no ss_array_t supplied"));
     if (ftype<=0 || H5Tequal(ftype, ss_pers_tf)) ftype = 0;

     if ((!ftype && array->ftype) ||
         (ftype && !array->ftype) ||
         (ftype && !H5Tequal(ftype, array->ftype))) {
         /* New type is different than old type */
         if (array->nelmts>0) SS_ERROR_FMT(USAGE, ("cannot retarget a non-empty array"));
         if (array->ftype>0) H5Tclose(array->ftype);
         array->ftype = ftype ? H5Tcopy(ftype) : 0;
         array->dirty = TRUE; /*because array->ftype is newer than array->enc_ftype*/
     }

 SS_CLEANUP:
     SS_LEAVE(0);
 }