Skip to content

Commit

Permalink
fixes for R_NO_REMAP
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmohamed committed Nov 27, 2024
1 parent 271cd7a commit b338534
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 164 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check-bioc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: 'devel', bioc: '3.20', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: ubuntu-latest, r: '4.4', bioc: '3.19', cont: "bioconductor/bioconductor_docker:RELEASE_3_19", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: macOS-latest, r: '4.4', bioc: '3.19'}
- { os: windows-latest, r: '4.4', bioc: '3.19'}
- { os: ubuntu-latest, r: 'devel', bioc: '3.21', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: ubuntu-latest, r: '4.4', bioc: '3.20', cont: "bioconductor/bioconductor_docker:RELEASE_3_20", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: macOS-latest, r: '4.4', bioc: '3.20'}
- { os: windows-latest, r: '4.4', bioc: '3.20'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: NetPathMiner
Version: 1.43.0
Version: 1.43.1
Date: 2014 onwards
Title: NetPathMiner for Biological Network Construction, Path Mining
and Visualization
Expand Down
8 changes: 4 additions & 4 deletions src/handlesegfault.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#ifndef WIN_COMPILE
#ifdef HAVE_XML
void segfault_KGML(int signal, siginfo_t *si, void *arg){
EVAL(lang2(install("registerMemoryErr"), mkString("KGML2igraph")));
error("Critical memory error in KGML2igraph. Please save your work and restart R.");
EVAL(Rf_lang2(Rf_install("registerMemoryErr"), Rf_mkString("KGML2igraph")));
Rf_error("Critical memory error in KGML2igraph. Please save your work and restart R.");
}
#endif
#ifdef HAVE_SBML
void segfault_SBML(int signal, siginfo_t *si, void *arg){
EVAL(lang2(install("registerMemoryErr"), mkString("SBML2igraph")));
error("Critical memory error in SBML2igraph. Please save your work and restart R.");
EVAL(Rf_lang2(Rf_install("registerMemoryErr"), Rf_mkString("SBML2igraph")));
Rf_error("Critical memory error in SBML2igraph. Please save your work and restart R.");
}
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/hme3m.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# define FCONE
#endif

#define oops(s) { perror((s)); error("Failed to allocate memory"); }
#define oops(s) { perror((s)); Rf_error("Failed to allocate memory"); }
#define MALLOC(s,t) if(((s) = malloc(t)) == NULL) { oops("error: malloc() "); }

void hme3m(double * y,
Expand Down
4 changes: 4 additions & 0 deletions src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
using namespace std;
#endif //__cplusplus

#ifndef R_NO_REMAP
#define R_NO_REMAP
#endif

#include <R.h>
#include <Rmath.h>
#include <Rdefines.h>
Expand Down
174 changes: 87 additions & 87 deletions src/kgml_interface.cpp

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ SEXP expand_complexes(SEXP ATTR_LS, SEXP EL, SEXP V, SEXP EXPAND, SEXP MISSING){
PROTECT( PARENTS = NEW_LIST(parents.size()) );

for(size_t i=0; i<vertices.size(); i++)
SET_STRING_ELT(VERTICES, i, mkChar( vertices[i].c_str() ));
SET_STRING_ELT(VERTICES, i, Rf_mkChar( vertices[i].c_str() ));

for(size_t i=0; i<edges.size(); i++)
INTEGER(EDGES)[i] = edges[i]+1;
Expand All @@ -198,13 +198,13 @@ SEXP expand_complexes(SEXP ATTR_LS, SEXP EL, SEXP V, SEXP EXPAND, SEXP MISSING){

PROTECT( OUT = NEW_LIST(5));
PROTECT( NAMES = NEW_STRING(5));
SET_VECTOR_ELT(OUT, 0, VERTICES); SET_STRING_ELT(NAMES, 0, mkChar("vertices"));
SET_VECTOR_ELT(OUT, 1, EDGES); SET_STRING_ELT(NAMES, 1, mkChar("edges"));
SET_VECTOR_ELT(OUT, 2, RECONNECT); SET_STRING_ELT(NAMES, 2, mkChar("reconnect"));
SET_VECTOR_ELT(OUT, 3, PARENTS); SET_STRING_ELT(NAMES, 3, mkChar("parents"));
SET_VECTOR_ELT(OUT, 4, E_PARENTS); SET_STRING_ELT(NAMES, 4, mkChar("e.parents"));
SET_VECTOR_ELT(OUT, 0, VERTICES); SET_STRING_ELT(NAMES, 0, Rf_mkChar("vertices"));
SET_VECTOR_ELT(OUT, 1, EDGES); SET_STRING_ELT(NAMES, 1, Rf_mkChar("edges"));
SET_VECTOR_ELT(OUT, 2, RECONNECT); SET_STRING_ELT(NAMES, 2, Rf_mkChar("reconnect"));
SET_VECTOR_ELT(OUT, 3, PARENTS); SET_STRING_ELT(NAMES, 3, Rf_mkChar("parents"));
SET_VECTOR_ELT(OUT, 4, E_PARENTS); SET_STRING_ELT(NAMES, 4, Rf_mkChar("e.parents"));

setAttrib(OUT,R_NamesSymbol,NAMES);
Rf_setAttrib(OUT,R_NamesSymbol,NAMES);
UNPROTECT(7);
return(OUT);
}
Loading

0 comments on commit b338534

Please sign in to comment.