Skip to content

Commit

Permalink
use memcpy instead of custom code
Browse files Browse the repository at this point in the history
  • Loading branch information
danicat committed May 7, 2024
1 parent f898c70 commit 702379f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ check: # run CRAN checks
wincheck: # run CRAN checks on Windows. Note: it uses a remote machine, check email for results
Rscript -e "devtools::check_win_devel()"

.PHONY: revdepcheck
revdepcheck: # reverse dependency checks
Rscript -e 'devtools::install_github("r-lib/revdepcheck")'
Rscript -e "usethis::use_revdep()"
.PHONY: revdep
revdep: # reverse dependency checks
Rscript -e "revdepcheck::revdep_check(num_workers = 4)"

.PHONY: generate
Expand All @@ -35,6 +33,8 @@ generate: # generate C to R interface code
setup: # install tools necessary for building the package
Rscript -e 'install.packages("devtools", repos="http://cran.us.r-project.org")'
Rscript -e 'install.packages("roxygen2", repos="http://cran.us.r-project.org")'
Rscript -e 'devtools::install_github("r-lib/revdepcheck")'
Rscript -e "usethis::use_revdep()"

.PHONY: document
document: # generate R docs from source code
Expand Down
6 changes: 3 additions & 3 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

|field |value |
|:--------|:---------------------------------|
|version |R version 4.3.0 (2023-04-21) |
|version |R version 4.4.0 (2024-04-24) |
|os |macOS Monterey 12.2.1 |
|system |aarch64, darwin20 |
|ui |X11 |
|system |aarch64, darwin21.6.0 |
|ui |unknown |
|language |(EN) |
|collate |en_GB.UTF-8 |
|ctype |en_GB.UTF-8 |
Expand Down
7 changes: 4 additions & 3 deletions src/blast.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* - Fix comparisons of differently signed integers
*/

#include <string.h>
#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
#include "blast.h" /* prototype for blast() */

Expand Down Expand Up @@ -358,9 +359,9 @@ static int decomp(struct state *s)
if (copy > len) copy = len;
len -= copy;
s->next += copy;
do {
*to++ = *from++;
} while (--copy);

memcpy(to, from, copy * sizeof(unsigned char));

if (s->next == MAXWIN) {
if (s->outfun(s->outhow, s->out, s->next)) return 1;
s->next = 0;
Expand Down

0 comments on commit 702379f

Please sign in to comment.