IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2023, 12:17:35 PM (3 years ago)
Author:
eugene
Message:

merge from eam_branches/ipp-20220316. fixes for more pendantic gcc; add opihi memory stats; string vector improvements; use named macros for fixed string lengths

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.data/subset.c

    r42311 r42389  
    4444  ResetVector (ovec, ivec->type, tvec[0].Nelements);
    4545
    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)
    4747  if ((ivec->type == OPIHI_FLT) && (tvec->type == OPIHI_FLT)) {
    4848    opihi_flt *vi = ivec[0].elements.Flt;
     
    8181    }
    8282  }
     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).
    8386  if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_FLT)) {
    8487    opihi_flt *vt = tvec[0].elements.Flt;
    8588    for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
    8689      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]);
    8891      Npts++;
    8992    }
     
    9396    for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
    9497      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]);
    9699      Npts++;
    97100    }
Note: See TracChangeset for help on using the changeset viewer.