Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Fixed "Rdevices.h" not found error related to R-2.8.x

- Fixed crashbug reported by Jeff Hamann. When a data frame had a factor
  column with a value in the first row, but NA in a subsequent row,
  a non-trapped R error would cause a segfault (PL/R's bug, not R)
- Corrected Makefile for use on Gentoo per Ian Stakenvicius
- Add facility to create pdf version of docs
  • Loading branch information...
commit 4412a32aab9ac2f8cceb9bec02b19b0d5b086022 1 parent 5f29d7e
jconway authored
Showing with 29 additions and 11 deletions.
  1. +4 −1 Makefile
  2. +2 −2 doc/pg_doc
  3. +18 −8 pg_conversion.c
  4. +5 −0 plr.h
View
5 Makefile
@@ -28,7 +28,10 @@ REGRESS := plr
EXTRA_CLEAN := doc/HTML.index expected/plr.out
ifdef USE_PGXS
-PGXS := $(shell pg_config --pgxs)
+ifndef PG_CONFIG
+PG_CONFIG := pg_config
+endif
+PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/plr
View
4 doc/pg_doc
@@ -1,5 +1,5 @@
#!/bin/bash
jade -c ${DOCBOOKSTYLE}/catalog -d ../../../doc/src/sgml/stylesheet.dsl -i output-html -t sgml $1
-
-
+openjade -D . -c ${DOCBOOKSTYLE}/catalog -d ../../../doc/src/sgml/stylesheet.dsl -t tex -V tex-backend -i output-print -V texpdf-output -V '%paper-type%'=USletter -o plr-US.tex-pdf $1
+pdfjadetex plr-US.tex-pdf
View
26 pg_conversion.c
@@ -1152,20 +1152,30 @@ get_frame_tuplestore(SEXP rval,
if(isFactor(dfcol))
{
SEXP t;
- for (t = ATTRIB(dfcol); t != R_NilValue; t = CDR(t))
+
+ /*
+ * a factor is a special type of integer
+ * but must check for NA value first
+ */
+ if (INTEGER_ELT(dfcol, i) != NA_INTEGER)
{
- if(TAG(t) == R_LevelsSymbol)
+ for (t = ATTRIB(dfcol); t != R_NilValue; t = CDR(t))
{
- SEXP obj;
- int idx = INTEGER(dfcol)[i] - 1;
+ if(TAG(t) == R_LevelsSymbol)
+ {
+ SEXP obj;
+ int idx = INTEGER(dfcol)[i] - 1;
- PROTECT(obj = CAR(t));
- values[j] = pstrdup(CHAR(STRING_ELT(obj, idx)));
- UNPROTECT(1);
+ PROTECT(obj = CAR(t));
+ values[j] = pstrdup(CHAR(STRING_ELT(obj, idx)));
+ UNPROTECT(1);
- break;
+ break;
+ }
}
}
+ else
+ values[j] = NULL;
}
else
{
View
5 plr.h
@@ -80,13 +80,18 @@
#endif
#include "Rinternals.h"
#include "Rdefines.h"
+#if (R_VERSION < 133120) /* R_VERSION >= 2.8.0 */
#include "Rdevices.h"
+#endif
/* starting in R-2.7.0 this defn was removed from Rdevices.h */
#ifndef KillAllDevices
#define KillAllDevices Rf_KillAllDevices
#endif
+/* for some reason this is not in any R header files, it is locally defined */
+#define INTEGER_ELT(x,__i__) INTEGER(x)[__i__]
+
#ifdef ERROR
#undef ERROR
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.