Skip to content

Commit 4e24369

Browse files
James BarbettiJames Barbetti
James Barbetti
authored and
James Barbetti
committed
AAvoiding some Xcode implicit conversion warnings (int needed to be size_t or intptr_t in a couple places).
1 parent 2695d2c commit 4e24369

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

rapidnj.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class BoundingMatrix: public SUPER
246246
#pragma omp parallel num_threads(threadCount)
247247
#endif
248248
{
249-
int threadNum = getThreadNumber();
249+
intptr_t threadNum = getThreadNumber();
250250
for (intptr_t r=threadNum; r<row_count; r+=threadCount) {
251251
sortRow(r,r,false,sorters[threadNum]);
252252
//copies the "left of the diagonal" portion of
@@ -311,7 +311,7 @@ class BoundingMatrix: public SUPER
311311
* to sort), that is "owned" by the current thread.
312312
* @note
313313
*/
314-
void sortRow(intptr_t r /*row index*/, int c /*upper bound on cluster index*/
314+
void sortRow(size_t r /*row index*/, size_t c /*upper bound on cluster index*/
315315
, bool parallel, Sorter& sorter) {
316316
//1. copy data from a row of the D matrix into the S matrix
317317
// (and write the cluster identifiers that correspond to
@@ -351,9 +351,9 @@ class BoundingMatrix: public SUPER
351351
* @param r the row number
352352
*/
353353
void purgeRow(intptr_t r /*row index*/) const {
354-
T* values = entriesSorted.rows[r];
355-
int* clusterIndices = entryToCluster.rows[r];
356-
int c = rowToCluster[r];
354+
T* values = entriesSorted.rows[r];
355+
int* clusterIndices = entryToCluster.rows[r];
356+
size_t c = rowToCluster[r];
357357
intptr_t w = 0;
358358
intptr_t i = 0;
359359
for (; i<row_count ; ++i ) {
@@ -781,9 +781,9 @@ class VectorizedBoundingMatrix: public SUPER
781781
//better min(Q).
782782

783783
Position<T> pos(row, 0, infiniteDistance, 0);
784-
const T* rowData = entriesSorted.rows[row];
785-
const int* toCluster = entryToCluster.rows[row];
786-
const int cluster = rowToCluster[row];
784+
const T* rowData = entriesSorted.rows[row];
785+
const int* toCluster = entryToCluster.rows[row];
786+
const size_t cluster = rowToCluster[row];
787787

788788
size_t partners = indexOfFirstGreater
789789
(rowData, clusterPartners[cluster], rowBound);

upgma.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ template <class T=NJFloat> class UPGMA_Matrix: public SquareMatrix<T> {
680680
if (row_b<row_a) {
681681
std::swap(row_a, row_b);
682682
}
683-
intptr_t cluster_x = rowToCluster[row_count-1];
683+
size_t cluster_x = rowToCluster[row_count-1];
684684
cluster(row_a, row_b);
685685
vc[i] = cluster_c;
686686
cluster_to_row.push_back(row_a);

0 commit comments

Comments
 (0)