Skip to content

Commit 548f0cf

Browse files
committed
Remove unused argument from CPROD macro
1 parent 3be8a78 commit 548f0cf

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

jsrc/conjunctions/cr.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#define STATEANOTEMPTYX 17 // set if a arg has atoms
1717
#define STATEANOTEMPTY ((I)1 << STATEANOTEMPTYX)
1818
#define STATEAWNOTEMPTYX 18 // set if a and w args both have atoms
19-
#define STATEAWNOTEMPTY ((I)1 << STATEAWNOTEMPTYX)
2019
// These bits start where they do to avoid overlap with AFPRISTINE. Also, they are above where rank significance is
2120
#define STATEOUTERREPEATAX 22
2221
#define STATEOUTERREPEATA (((I)1) << STATEOUTERREPEATAX)
@@ -64,7 +63,7 @@ jtrank1ex(J jt, AD *RESTRICT w, A fs, I rr, AF f1) {
6463
// multiple cells. Loop through them.
6564
// Get size of each argument cell in atoms. If this overflows, there must be a 0 in the frame, & we will have
6665
// gone through the fill path (& caught the overflow)
67-
CPROD(AN(w), mn, wf, AS(w));
66+
CPROD(mn, wf, AS(w));
6867
PROD(wcn, rr, AS(w) + wf); // number of cells, number of atoms in a cell
6968
// ?cn=number of atoms in a cell, ?k=#bytes in a cell
7069
wk = wcn << bplg(AT(w));
@@ -389,9 +388,8 @@ jtrank2ex(J jt, AD *RESTRICT a, AD *RESTRICT w, A fs, UI lrrrlcrrcr, AF f2) {
389388
los = aof - wof < 0 ? AS(w) : los;
390389
state |= (aof - wof) & STATEOUTERREPEATA;
391390
ASSERTAGREE(AS(a), AS(w), sof) // prefixes must agree
392-
CPROD(state & STATEAWNOTEMPTY, outerframect, sof, los);
393-
CPROD(
394-
state & STATEAWNOTEMPTY, outerrptct, lof - sof, los + sof); // get # cells in frame, and in unmatched frame
391+
CPROD(outerframect, sof, los);
392+
CPROD(outerrptct, lof - sof, los + sof); // get # cells in frame, and in unmatched frame
395393
}
396394

397395
// Now work on inner frames. Compare frame lengths after discarding outer frames
@@ -410,8 +408,8 @@ jtrank2ex(J jt, AD *RESTRICT a, AD *RESTRICT w, A fs, UI lrrrlcrrcr, AF f2) {
410408
state |=
411409
(ew - ea) & STATEINNERREPEATW; // make lis the shape pointer for longer; if a is longer, indicate repeating w
412410
}
413-
CPROD(state & STATEAWNOTEMPTY, innerrptct, lif - sif, lis + sif); // number of repetitions per matched-frame cell
414-
CPROD(state & STATEAWNOTEMPTY, innerframect, sif, lis); // number of cells in matched frame
411+
CPROD(innerrptct, lif - sif, lis + sif); // number of repetitions per matched-frame cell
412+
CPROD(innerframect, sif, lis); // number of cells in matched frame
415413

416414
// Migrate loops with count=1 toward the inner to reduce overhead. We choose not to promote the outer to the inner
417415
// if both innerframect & innerrptct are 1, on grounds of rarity

jsrc/j.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@
877877
}
878878
// CPROD is to be used to create a test testing #atoms. Because empty arrays can have cells that have too many atoms,
879879
// we can't use PROD if we don't know that the array isn't empty or will be checked later
880-
#define CPROD(t, z, x, a) PRODX(z, x, a, 1)
880+
#define CPROD(z, x, a) PRODX(z, x, a, 1)
881881
// PROLOG/EPILOG are the main means of memory allocation/free. jt->tstack contains a pointer to every block that is
882882
// allocated by GATV(i. e. all blocks). GA causes a pointer to the block to be pushed onto tstack. PROLOG saves a copy
883883
// of the stack pointer in _ttop, a local variable in its function. Later, jttpop(jt,_ttop) can be executed to free

jsrc/verbs/v.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jtravel(J jt, A w) {
4343
if (r == 1)
4444
return w; // if we are enfiling 1-cells, there's nothing to do, return the input (note: AN of sparse array
4545
// is always 1)
46-
CPROD(AN(w), m, r, f + AS(w)); // m=#atoms in cell
46+
CPROD(m, r, f + AS(w)); // m=#atoms in cell
4747
if (ASGNINPLACESGN(SGNIF((I)jtinplace, JTINPLACEWX) & (-r), w) &&
4848
!(AFLAG(w) & AFUNINCORPABLE)) { // inplace allowed, rank not 0 (so shape will fit), usecount is right
4949
// operation is loosely inplaceable. Just shorten the shape to frame,(#atoms in cell). We do this here

jsrc/verbs/ve.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ jtbase1(J jt, A w) {
587587
ASSERT(t & DENSE, EVNONCE);
588588
if (((c - BW) & SGNIF(t, B01X)) >= 0)
589589
return jtpdt(jt, w, jtweight(jt, jtsc(jt, c), t & RAT + XNUM ? jtcvt(jt, XNUM, num(2)) : num(2))); //
590-
CPROD(n, m, r - 1, s);
590+
CPROD(m, r - 1, s);
591591
GATV(z, INT, m, r ? r - 1 : 0, s);
592592
x = AV(z);
593593
v = BAV(w);

jsrc/verbs/vf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,9 @@ jtreshape(J jt, A a, A w) {
533533
u = AV(a); // r=length of a u->values of a
534534
if ((SPARSE & AT(w)) != 0) { return reshapesp(a, w, wf, wcr); }
535535
wn = AN(w);
536-
PRODX(m, r, u, 1) CPROD(wn, c, wf, ws);
537-
CPROD(wn, n, wcr, wf + ws); // m=*/a (#atoms in result) c=#cells of w n=#atoms/cell of w
536+
PRODX(m, r, u, 1)
537+
CPROD(c, wf, ws);
538+
CPROD(n, wcr, wf + ws); // m=*/a (#atoms in result) c=#cells of w n=#atoms/cell of w
538539
ASSERT(n || !m || jt->fill, EVLENGTH); // error if attempt to extend array of no items to some items without fill
539540
t = AT(w);
540541
filling = 0;

jsrc/verbs/viix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ jticap2(J jt, A a, A w) {
230230
ASSERTAGREE(as + ar - r, ws + wr - r, r)
231231
ASSERT((POSIFHOMO(at, wt) & -AN(a) & -AN(w)) >= 0, EVDOMAIN);
232232
ASSERT(!((at | wt) & SPARSE), EVNONCE); // if no empties, verify agreement & non-sparse
233-
CPROD(AN(w), m, wr - r, ws);
234-
CPROD(AN(w), c, r, ws + wr - r); // m=#atoms in result c=# atoms in a cell of w
233+
CPROD(m, wr - r, ws);
234+
CPROD(c, r, ws + wr - r); // m=#atoms in result c=# atoms in a cell of w
235235
GATV(z, INT, m, wr - r, ws);
236236
zv = AV(z);
237237
if (((m - 1) | (n - 1) | (c - 1)) < 0) {

jsrc/verbs/vo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jtbox(J jt, A w) {
6666
} else {
6767
// <"r
6868
ws = AS(w);
69-
CPROD(AN(w), n, f, ws);
70-
CPROD(AN(w), m, r, f + ws);
69+
CPROD(n, f, ws);
70+
CPROD(m, r, f + ws);
7171
k = m << bplg(wt);
7272
wv = CAV(w);
7373
// Since we are allocating the new boxes, the result will ipso facto be PRIVATE, as long as w is DIRECT. If w

0 commit comments

Comments
 (0)