From c366be8deb740c24d2131b43df134f54c39de3b3 Mon Sep 17 00:00:00 2001 From: Dongcan Jiang Date: Mon, 17 Aug 2015 23:44:01 +0800 Subject: [PATCH] fix bug on threading on different platform Signed-off-by: Dongcan Jiang --- src/colCounts.c | 6 +++--- src/colOrderStats.c | 6 +++--- src/colRanges.c | 6 +++--- src/rowCounts.c | 6 +++--- src/rowCumMinMaxs.c | 12 ++++++------ src/rowCumprods.c | 6 +++--- src/rowCumsums.c | 6 +++--- src/rowDiffs.c | 6 +++--- src/rowLogSumExp.c | 6 +++--- src/rowMads.c | 6 +++--- src/rowMedians.c | 6 +++--- src/rowOrderStats.c | 6 +++--- src/rowRanges.c | 6 +++--- src/rowRanksWithTies.c | 6 +++--- src/rowVars.c | 6 +++--- 15 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/colCounts.c b/src/colCounts.c index 89610983..f5540316 100644 --- a/src/colCounts.c +++ b/src/colCounts.c @@ -56,12 +56,12 @@ SEXP colCounts(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP value, SEXP what, SE void *ccols = validateIndices(cols, ncol, 0, &ncols, &colsType); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* R allocate an integer vector of length 'ncol' */ diff --git a/src/colOrderStats.c b/src/colOrderStats.c index 9ae9c909..2bcdefce 100644 --- a/src/colOrderStats.c +++ b/src/colOrderStats.c @@ -64,12 +64,12 @@ SEXP colOrderStats(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP which, SEXP core } #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* Double matrices are more common to use. */ diff --git a/src/colRanges.c b/src/colRanges.c index c36f8590..ca26650d 100644 --- a/src/colRanges.c +++ b/src/colRanges.c @@ -55,12 +55,12 @@ SEXP colRanges(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP what, SEXP naRm, SEX void *ccols = validateIndices(cols, ncol, 0, &ncols, &colsType); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif is_counted = (int *) R_alloc(ncols, sizeof(int)); diff --git a/src/rowCounts.c b/src/rowCounts.c index a1248da9..645c1924 100644 --- a/src/rowCounts.c +++ b/src/rowCounts.c @@ -56,12 +56,12 @@ SEXP rowCounts(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP value, SEXP what, SE void *ccols = validateIndices(cols, ncol, 0, &ncols, &colsType); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* R allocate a double vector of length 'nrow' */ diff --git a/src/rowCumMinMaxs.c b/src/rowCumMinMaxs.c index e6329c3c..2fcc4d49 100644 --- a/src/rowCumMinMaxs.c +++ b/src/rowCumMinMaxs.c @@ -42,12 +42,12 @@ SEXP rowCummins(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP byRow, SEXP cores) byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif int *oks = NULL; @@ -99,12 +99,12 @@ SEXP rowCummaxs(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP byRow, SEXP cores) byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif int *oks = NULL; diff --git a/src/rowCumprods.c b/src/rowCumprods.c index 82268785..4976d3f3 100644 --- a/src/rowCumprods.c +++ b/src/rowCumprods.c @@ -40,12 +40,12 @@ SEXP rowCumprods(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP byRow, SEXP cores) byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif int *oks = NULL; diff --git a/src/rowCumsums.c b/src/rowCumsums.c index c6a5b3c6..c87b4340 100644 --- a/src/rowCumsums.c +++ b/src/rowCumsums.c @@ -40,12 +40,12 @@ SEXP rowCumsums(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP byRow, SEXP cores) byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif int *oks = NULL; diff --git a/src/rowDiffs.c b/src/rowDiffs.c index e9f558ac..af4f8e39 100644 --- a/src/rowDiffs.c +++ b/src/rowDiffs.c @@ -54,12 +54,12 @@ SEXP rowDiffs(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP lag, SEXP differences byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* Dimension of result matrix */ diff --git a/src/rowLogSumExp.c b/src/rowLogSumExp.c index 3d28fd95..907d314a 100644 --- a/src/rowLogSumExp.c +++ b/src/rowLogSumExp.c @@ -45,12 +45,12 @@ SEXP rowLogSumExps(SEXP lx, SEXP dim, SEXP rows, SEXP cols, SEXP naRm, SEXP hasN byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif if (byrow) { diff --git a/src/rowMads.c b/src/rowMads.c index 16492afd..04956efc 100644 --- a/src/rowMads.c +++ b/src/rowMads.c @@ -53,12 +53,12 @@ SEXP rowMads(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP constant, SEXP naRm, S byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif if (!byrow) { diff --git a/src/rowMedians.c b/src/rowMedians.c index 3afcffac..fa889822 100644 --- a/src/rowMedians.c +++ b/src/rowMedians.c @@ -47,12 +47,12 @@ SEXP rowMedians(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP naRm, SEXP hasNA, S byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif if (!byrow) { diff --git a/src/rowOrderStats.c b/src/rowOrderStats.c index 89708cf9..19e72d97 100644 --- a/src/rowOrderStats.c +++ b/src/rowOrderStats.c @@ -64,12 +64,12 @@ SEXP rowOrderStats(SEXP x, SEXP dim,SEXP rows, SEXP cols, SEXP which, SEXP cores } #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* Double matrices are more common to use. */ diff --git a/src/rowRanges.c b/src/rowRanges.c index e09921d9..f8415f9b 100644 --- a/src/rowRanges.c +++ b/src/rowRanges.c @@ -55,12 +55,12 @@ SEXP rowRanges(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP what, SEXP naRm, SEX void *ccols = validateIndices(cols, ncol, 0, &ncols, &colsType); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif is_counted = (int *) R_alloc(nrows, sizeof(int)); diff --git a/src/rowRanksWithTies.c b/src/rowRanksWithTies.c index 08aa08c8..cf647e13 100644 --- a/src/rowRanksWithTies.c +++ b/src/rowRanksWithTies.c @@ -126,12 +126,12 @@ SEXP rowRanksWithTies(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP tiesMethod, S byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif /* Double matrices are more common to use. */ diff --git a/src/rowVars.c b/src/rowVars.c index 50259b12..ad971542 100644 --- a/src/rowVars.c +++ b/src/rowVars.c @@ -50,12 +50,12 @@ SEXP rowVars(SEXP x, SEXP dim, SEXP rows, SEXP cols, SEXP naRm, SEXP hasNA, SEXP byrow = asLogical(byRow); #ifdef _USE_PTHREAD_ - cores2 = 1; -#else /* Argument 'cores': */ cores2 = asInteger(cores); if (cores2 <= 0) - error("Argument 'cores' must be a positive value.") + error("Argument 'cores' must be a positive value."); +#else + cores2 = 1; #endif if (!byrow) {