Skip to content

Commit

Permalink
Bug fix in das2c_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiker committed Mar 16, 2020
1 parent eac6bc0 commit 834f2b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/das2c_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static IDL_VPTR das2c_api_data(int argc, IDL_VPTR* argv)
*/

size_t I = 0;
size_t uSlowestBytes = 0;
size_t uFastestBytes = 0;

if(nDsRank == nVarRank){
memcpy(pDest, pSrc, uBytes);
Expand All @@ -325,12 +325,12 @@ static IDL_VPTR das2c_api_data(int argc, IDL_VPTR* argv)

if(aVarShape[0] != aDsShape[0]) das2c_IdlMsgExit("Logic error 3 in das2c_data()");

uSlowestBytes = aDsShape[0] * uValSz;
uFastestBytes = aDsShape[1] * uValSz;

/* for each I, fill with a single I value J times */
for(I = 0; I < aDsShape[0]; ++I)
das2c_memset(
(byte*)(pDest + (I*uSlowestBytes)), pSrc + I*uValSz, uValSz, aDsShape[1]
(byte*)(pDest + (I*uFastestBytes)), pSrc + I*uValSz, uValSz, aDsShape[1]
);

}
Expand Down
12 changes: 7 additions & 5 deletions test/das2c_test.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ v_freq
v_amp = das2c_vars(pd_amp, 'center')
v_amp

;aTimes = das2c_data(v_time, {i:0, j:'*'} ) ; TODO
aTimes = das2c_data(v_time)
;aFreqs = das2c_data(v_freq, {i:'*', j:0 } ) ; TODO
aFreqs = das2c_data(v_freq)

aAmp = das2c_data(v_amp)

das2c_props(ds, 'title')

das2c_props(pd_time, 'label')
Expand All @@ -36,11 +43,6 @@ das2c_props(pd_amp)
das2c_free(query)
exit

aTimes = das2c_data(v_time, {i:0, j:'*'} )
aFreqs = das2c_data(v_freq, {i:'*', j:0 } )
aAmp = das2c_data(v_amp)


; Next interation, for waveforms
exit
v_start = das2c_vars(pd_time, 'reference')
Expand Down

0 comments on commit 834f2b8

Please sign in to comment.