MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / compare_trace_v_offsets

Method compare_trace_v_offsets

DSView/pv/view/view.cpp:411–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411bool View::compare_trace_v_offsets(const Trace *a, const Trace *b)
412{
413 assert(a);
414 assert(b);
415
416 Trace *a1 = const_cast<Trace*>(a);
417 Trace *b1 = const_cast<Trace*>(b);
418 int v1 = 0;
419 int v2 = 0;
420
421 if (a1->get_type() != b1->get_type()){
422 v1 = a1->get_type();
423 v2 = b1->get_type();
424 }
425 else if (a1->get_type() == SR_CHANNEL_DSO || a1->get_type() == SR_CHANNEL_ANALOG){
426 v1 = a1->get_index();
427 v2 = b1->get_index();
428 }
429 else{
430 v1 = a1->get_v_offset();
431 v2 = b1->get_v_offset();
432 }
433 return v1 < v2;
434}
435
436bool View::compare_trace_view_index(const Trace *a, const Trace *b)
437{

Callers

nothing calls this directly

Calls 3

get_v_offsetMethod · 0.80
get_typeMethod · 0.45
get_indexMethod · 0.45

Tested by

no test coverage detected