- Timestamp:
- Mar 2, 2011, 5:43:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c
r30621 r30775 1166 1166 } 1167 1167 1168 // sort by SN (descending) 1169 int pmSourceSortByParentSN (const void **a, const void **b) 1170 { 1171 pmSource *Ao = *(pmSource **)a; 1172 pmSource *Bo = *(pmSource **)b; 1173 pmSource *A = Ao->parent; 1174 pmSource *B = Bo->parent; 1175 1176 psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN; 1177 psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN; 1178 if (isnan (fA)) fA = 0; 1179 if (isnan (fB)) fB = 0; 1180 1181 psF32 diff = fA - fB; 1182 if (diff > FLT_EPSILON) return (-1); 1183 if (diff < FLT_EPSILON) return (+1); 1184 return (0); 1185 } 1186 1168 1187 // sort by Y (ascending) 1169 1188 int pmSourceSortByY (const void **a, const void **b) … … 1201 1220 pmSource *A = *(pmSource **)a; 1202 1221 pmSource *B = *(pmSource **)b; 1222 1223 int iA = A->seq; 1224 int iB = B->seq; 1225 1226 int diff = iA - iB; 1227 if (diff > 0) return (+1); 1228 if (diff < 0) return (-1); 1229 return (0); 1230 } 1231 1232 // sort by Seq (ascending) 1233 int pmSourceSortByParentSeq (const void **a, const void **b) 1234 { 1235 pmSource *Ao = *(pmSource **)a; 1236 pmSource *Bo = *(pmSource **)b; 1237 pmSource *A = Ao->parent; 1238 pmSource *B = Bo->parent; 1203 1239 1204 1240 int iA = A->seq;
Note:
See TracChangeset
for help on using the changeset viewer.
