Changeset 42389 for trunk/Ohana/src/opihi/cmd.data/subset.c
- Timestamp:
- Feb 8, 2023, 12:17:35 PM (3 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/opihi/cmd.data/subset.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/opihi/cmd.data/subset.c
r42311 r42389 44 44 ResetVector (ovec, ivec->type, tvec[0].Nelements); 45 45 46 // we have four cases: (ivec == flt or int) and (tvec == flt or int)46 // we have size cases: (ivec == flt, int, str) and (tvec == flt or int) 47 47 if ((ivec->type == OPIHI_FLT) && (tvec->type == OPIHI_FLT)) { 48 48 opihi_flt *vi = ivec[0].elements.Flt; … … 81 81 } 82 82 } 83 // XXX if ivec is an existing vector, this step will 84 // leak (existing elements need to be freed if they 85 // have been allocated). 83 86 if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_FLT)) { 84 87 opihi_flt *vt = tvec[0].elements.Flt; 85 88 for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) { 86 89 if (!*vt) continue; 87 ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);90 ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]); 88 91 Npts++; 89 92 } … … 93 96 for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) { 94 97 if (!*vt) continue; 95 ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);98 ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]); 96 99 Npts++; 97 100 }
Note:
See TracChangeset
for help on using the changeset viewer.
