Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
coshcage authored Apr 18, 2024
1 parent eebc3f7 commit 966dc69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
15 changes: 9 additions & 6 deletions src/sitable.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,15 @@ BOOL siDeleteFromTable(P_TRANS ptrans, P_TABLE ptbl, SICBF_TBLAUG cbfta, size_t
siDeleteCell((P_CELL *)strGetValueMatrix(NULL, &ptbl->tbldata, ln, i, sizeof(P_CELL)));
}

memmove
(
&ptbl->tbldata.arrz.pdata[ln * sizeof(P_CELL) * ptbl->tbldata.col],
&ptbl->tbldata.arrz.pdata[(ln + 1) * sizeof(P_CELL) * ptbl->tbldata.col],
(ptbl->curln - 1 - ln) * sizeof(P_CELL) * ptbl->tbldata.col
);
if (ln + 1 != ptbl->curln)
{
memmove
(
&ptbl->tbldata.arrz.pdata[ln * sizeof(P_CELL) * ptbl->tbldata.col],
&ptbl->tbldata.arrz.pdata[(ptbl->curln - 1) * sizeof(P_CELL) * ptbl->tbldata.col],
sizeof(P_CELL) * ptbl->tbldata.col
);
}

--ptbl->curln;

Expand Down
13 changes: 7 additions & 6 deletions src/sitrans.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@ void siRollbackTransaction(P_ARRAY_Z * pparr, P_TRANS ptrans)

++da.ptbl->curln;

memmove
(
&da.ptbl->tbldata.arrz.pdata[(da.data.datpl.sizln + 1) * sizeof(P_CELL) * da.ptbl->tbldata.col],
&da.ptbl->tbldata.arrz.pdata[da.data.datpl.sizln * sizeof(P_CELL) * da.ptbl->tbldata.col],
(da.ptbl->curln - 1 - da.data.datpl.sizln) * sizeof(P_CELL) * da.ptbl->tbldata.col
);
if (da.data.datpl.sizln + 1 != da.ptbl->curln)
memmove
(
&da.ptbl->tbldata.arrz.pdata[(da.ptbl->curln - 1) * sizeof(P_CELL) * da.ptbl->tbldata.col],
&da.ptbl->tbldata.arrz.pdata[da.data.datpl.sizln * sizeof(P_CELL) * da.ptbl->tbldata.col],
sizeof(P_CELL) * da.ptbl->tbldata.col
);

memcpy(&da.ptbl->tbldata.arrz.pdata[da.data.datpl.sizln * sizeof(P_CELL) * da.ptbl->tbldata.col], ppc, sizeof(P_CELL) * da.ptbl->tbldata.col);
free(ppc);
Expand Down

0 comments on commit 966dc69

Please sign in to comment.