Skip to content

Commit

Permalink
Fix apple M1 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zeehio committed Mar 30, 2023
1 parent b086fa1 commit 23eb419
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: sgolay
Type: Package
Title: Efficient Savitzky-Golay Filtering
Version: 1.0.1
Date: 2022-09-27
Version: 1.0.2
Date: 2023-03-30
URL: https://github.com/zeehio/sgolay
BugReports: http://github.com/zeehio/sgolay/issues
Authors@R: c(
Expand Down Expand Up @@ -55,7 +55,7 @@ Imports: signal
License: GPL (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Suggests:
covr,
RUnit
5 changes: 5 additions & 0 deletions NEWS.md
@@ -1,3 +1,8 @@
# sgolay 1.0.2 (2023-03-30)

- Fix warning on bitwise comparison in my_isok() macro
- Fix lossy conversion on indices from long to int

# sgolay 1.0.1

Updated DESCRIPTION file to address CRAN reviewers' comments.
Expand Down
18 changes: 13 additions & 5 deletions src/stats_filter.c
@@ -1,6 +1,6 @@
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1999-2016 The R Core Team
* Copyright (C) 1999-2022 The R Core Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -17,8 +17,16 @@
* https://www.R-project.org/Licenses/.
*/

/* Trimmed down and modified by Sergio Oller <sergioller@gmail.com> on
* Sept 2022
/* Changes by Sergio Oller <sergioller@gmail.com>
*
* 2023-03-30:
* - Updated to commit 6556d7f844028e2b850cd0cf5683d8b6271341c8
* - Fix `int maxj` to `R_len_t maxj`
* - Fixed my_isok macro
*
* 2022-09:
* Trimmed down and modified from
* https://github.com/wch/r-source/commits/trunk/src/library/stats/src/filter.c
*/

#include <R.h>
Expand All @@ -30,7 +38,7 @@
#endif

// currently ISNAN includes NAs
#define my_isok(x) (!ISNA(x) & !ISNAN(x))
#define my_isok(x) (!ISNA(x) && !ISNAN(x))


/* Trimmed down version of cfilter */
Expand All @@ -49,7 +57,7 @@ SEXP filter(SEXP sx, SEXP sfilter)
for (i = 0; i < nf - 1; i++) {
out[i] = NA_REAL;
}
int maxj;
R_xlen_t maxj;
for(i = nf; i < nx; i++) {
z = 0;
maxj = min(nf, i+1);
Expand Down

0 comments on commit 23eb419

Please sign in to comment.