From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/bin/dcmpnd.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'app/bin/dcmpnd.c') diff --git a/app/bin/dcmpnd.c b/app/bin/dcmpnd.c index 13f7c56..93e73ac 100644 --- a/app/bin/dcmpnd.c +++ b/app/bin/dcmpnd.c @@ -30,6 +30,7 @@ #include "i18n.h" #include "messages.h" #include "param.h" +#include "include/paramfile.h" #include "shrtpath.h" #include "track.h" #include "utility.h" @@ -290,6 +291,11 @@ static BOOL_T RefreshCompound1( xx->segCnt = to->segCnt; xx->segs = (trkSeg_p)MyMalloc( xx->segCnt * sizeof *(trkSeg_p)0 ); memcpy( xx->segs, to->segs, xx->segCnt * sizeof *(trkSeg_p)0 ); + MyFree( xx->paths); + xx->paths = (signed char*)MyMalloc( to->pathLen * sizeof *xx->paths ); + memcpy( xx->paths, to->paths, to->pathLen * sizeof *xx->paths ); + xx->pathLen = to->pathLen; + xx->pathCurr = xx->paths; if ( flip ) FlipSegs( xx->segCnt, xx->segs, zero, 90.0 ); ClrTrkBits( trk, TB_SELECTED ); @@ -594,3 +600,30 @@ EXPORT void CompoundCustMgmLoad( void ) } } } + +/***************************************************************************** + * + * Utitlies + * + */ + +wIndex_t FindListItemByContext( + wList_p listP, + void * context ) +{ + if ( listP == NULL ) + return -1; + if ( context == NULL ) + return -1; + for ( wIndex_t inx = 0; inx < wListGetCount( listP ); ++inx ) { + void * itemContext = wListGetItemContext( listP, inx ); + if ( itemContext != NULL ) { + if ( itemContext == context ) { + return inx; + } + } + } + return -1; +} + + -- cgit v1.2.3