Skip to content

Commit

Permalink
Use _add_SxS_ instead of ++
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyAaldering committed Feb 3, 2025
1 parent 09ae1e0 commit 66a1ae9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/structures/ArrayFormat.xsac
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,12 @@ char[olen] formatrow(int[vlen] wid, int[vlen] arr)

// Can't use WL because widths may differ
sink = 0;
for (i = 0; i < vlen; i++) {
for (i = 0; i < vlen; i = _add_SxS_(i, 1)) {
w = [wid[i], 1];
curz = format(arr[i], w);
lim = shape(curz)[0];

for (src = 0; src < lim; src++) {
for (src = 0; src < lim; src = _add_SxS_(src, 1)) {
res = modarray(res, src + sink, curz[src]);
}

Expand Down Expand Up @@ -512,7 +512,7 @@ char[zcols] alignrow(char[.,.] fry, int i, int[cols] widths,
res = genarray([zcols], ' ');

zci = 0;
for (ci = 0; ci < cols; ci++) {
for (ci = 0; ci < cols; ci = _add_SxS_(ci, 1)) {
fi = ci + cols * i; // Source item index
sc = lodp[fi] - lodpmax[ci]; // Shift count to align decimal
sefe = thCharsTo([' ', ' '], fry[fi]);
Expand Down Expand Up @@ -554,7 +554,7 @@ int thCharsTo(char[n] ch, char[lim] fry)
| n > 1
{
res = lim;
for (i = 0; i < lim; i++) {
for (i = 0; i < lim; i = _add_SxS_(i, 1)) {
if (fry[i] == ch[0] || fry[i] == ch[1]) {
res = i;
i = lim;
Expand All @@ -575,9 +575,9 @@ inline
char[d], int thrnAppend(char[d] vec, int sink, char[n] arr)
{
res = vec;
for (src = 0; src < n; src++) {
for (src = 0; src < n; src = _add_SxS_(src, 1)) {
res[sink] = arr[src];
sink++;
sink = _add_SxS_(sink, 1);
}

return (res, sink);
Expand Down Expand Up @@ -612,7 +612,7 @@ char[.] killPlusSign(char[n] arr)
{
res = arr;
sink = 1;
for (src = 1; src < n; src++) {
for (src = 1; src < n; src = _add_SxS_(src, 1)) {
res[sink] = arr[src];
sink += toi(res[sink] != '+');
}
Expand Down

0 comments on commit 66a1ae9

Please sign in to comment.