[H5r-commits] r17 - / inst man src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 30 02:14:37 CEST 2010


Author: extemporaneousb
Date: 2010-04-30 02:14:37 +0200 (Fri, 30 Apr 2010)
New Revision: 17

Removed:
   inst/.Rhistory
Modified:
   NAMESPACE
   man/H5Obj-class.Rd
   src/Makevars.in
   src/Makevars.win
   src/h5_wrap.c
Log:
Pass R CMD Check, -Wall

Modified: NAMESPACE
===================================================================
--- NAMESPACE	2010-04-29 16:30:54 UTC (rev 16)
+++ NAMESPACE	2010-04-30 00:14:37 UTC (rev 17)
@@ -4,4 +4,4 @@
 exportPattern("^[^\\.]")
 
 ## export the classes.
-exportClass("H5Obj", "H5File", "H5Group", "H5Dataset", "H5Attribute", "H5DataContainer")
+exportClasses(H5Obj, H5File, H5Group, H5Dataset, H5Attribute, H5DataContainer)

Deleted: inst/.Rhistory
===================================================================
--- inst/.Rhistory	2010-04-29 16:30:54 UTC (rev 16)
+++ inst/.Rhistory	2010-04-30 00:14:37 UTC (rev 17)
@@ -1,150 +0,0 @@
-d3 at .data
-d3 at .data$.data
-d3 at .data$datta
-d[]
-d3[]
-d3[,,]
-d3[,1,]
-d3[1,,]
-d3 at .data$.data
-dim(d3 at .data$.data)
-d3[,,]
-d3[1,,]
-n
-debug(.internalSlice)
-x
-i
-missing(i)
-missing(j)
-missing(...)
-missing(drop)
-n
-n
-n
-n
-n
-n
-dim(x)
-missing(i)
-missing(j)
-missing(...)
-missing(drop)
-drop
-dim(d)
-d[]
-d[i,j,...]
-d[i,j,]
-d[i,j,...,drop = TRUE]
-missing(...)
-d[i, j, drop = drop]
-d[i, j, ]
-d[i, j, , drop = drop]
-d[i, j, ..., drop = drop]
-missing(...)
-d
-d[i, j, ..., drop = drop]
-d[i, j, , drop = drop]
-?"..."
-help.search("...")
-?missing
-substitute(...)
-d[i,j,NULL]
-d[i,j,]
-d3
-d3[,,]
-dim(d3[,,])
-d3 at .data$.data
-dim(d3 at .data$.data)
-d3
-d3
-d3[,,]
-dim(d3[,,])
-dim(d3[1,,])
-d3[1,,]
-dim(d3[1,,])
-d3[1,,]
-d3[,,1]
-dim(d3)
-d3[1,,1]
-d3
-d3[]
-d3 at .data$.data
-d3 at .data$.data[]
-d3[]
-traceback()
-d3M[,,]
-?array
-?aperm
- d3
- d3[]
- d3[,,]
-aperm( d3[,,], rev(dim(d3)))
-aperm( d3[,,], perm = rev(dim(d3)))
-?aperm
-aperm( d3[,,] )
-d3[1,,]
-d3[,,1]
-aperm(d3[,,1])
-dim(d3[,,1])
-aperm(drop(d3[,,1]))
-drop(d3[,,1])
-dim(d[1:10,]
-)
-dim(d)
-dim(d)
-dim(d[1:10,])
-dim(d[1:10,1])
-dim(d[1:10,1:2])
-d at .data
-d at .data$.data
-dim(d at .data$.data)
-d[1:10, ]
-d[1:10, ] = d[1:10, 1:10]
-d[1:10, ] == d[1:10, 1:10]
-d3
-d2
-d2
-d2[]
-d3[,,]
-d3M[]
-d3 at .data$.data
-d3 at .data$.data[,,1]
-Internal
-internal
-?Internal
-?internal
-?copy
-.Internal
-?.Internal
-.Internal(rnorm(100))
-.Internal(rnorm)
-.Machine
-d3
-d3[]
-d3[,,]
-?missing
-d3
-d3[1,,,drop=TRUE]
-d3M
-id3[,1,1,drop=TRUE]
-d3M[,1,1,drop=TRUE]
-dim(id3)
-dim(d3M)
-c
-c
-c
-c
-n
-l
-Q
-c
-c
-c
-c
-n
-c
-c
-files
-f
-d3
-d2

Modified: man/H5Obj-class.Rd
===================================================================
--- man/H5Obj-class.Rd	2010-04-29 16:30:54 UTC (rev 16)
+++ man/H5Obj-class.Rd	2010-04-30 00:14:37 UTC (rev 17)
@@ -19,10 +19,11 @@
 \alias{getH5Type}
 \alias{nrow,H5DataContainer-method}
 \alias{ncol,H5DataContainer-method}
-\alias{[,H5DataContainer,ANY,ANY,ANY-method}
-\alias{[,H5DataContainer,ANY,missing,missing-method}
+\alias{[,H5DataContainer-method}
+\alias{[,H5Dataset-method}
 \alias{dim,H5DataContainer-method}
 \alias{length,H5DataContainer-method}
+\alias{readSlab}
 
 \title{Class "H5Obj"}
 \description{Classes for objects originating from HDF5 files.}

Modified: src/Makevars.in
===================================================================
--- src/Makevars.in	2010-04-29 16:30:54 UTC (rev 16)
+++ src/Makevars.in	2010-04-30 00:14:37 UTC (rev 17)
@@ -2,4 +2,4 @@
 OBJS = hdf5.o
 
 PKG_CPPFLAGS = @ZLIBCPPFLAGS@ @HDF5CPPFLAGS@
-PKG_LIBS = @HDF5LDFLAGS@ @ZLIBLDFLAGS@ -lhdf5 -lhdf5_hl -lz -lm
+PKG_LIBS = @HDF5LDFLAGS@ @ZLIBLDFLAGS@ -lhdf5 -lz -lm

Modified: src/Makevars.win
===================================================================
--- src/Makevars.win	2010-04-29 16:30:54 UTC (rev 16)
+++ src/Makevars.win	2010-04-30 00:14:37 UTC (rev 17)
@@ -1,2 +1,2 @@
 PKG_CPPFLAGS = -I$(HDF5)/include -D_HDF5USEDLL_
-PKG_LIBS = -L$(HDF5) -lhdf5 -lhdf5_hl
+PKG_LIBS = -L$(HDF5) -lhdf5

Modified: src/h5_wrap.c
===================================================================
--- src/h5_wrap.c	2010-04-29 16:30:54 UTC (rev 16)
+++ src/h5_wrap.c	2010-04-30 00:14:37 UTC (rev 17)
@@ -1,14 +1,8 @@
 /**
  * R/C Interface code for HDF5 file format. 
  *
- * 
- * 13/04/2010 (JHB) : more refactoring. added finalizer
- *
- * 10/04/2010 (JHB) : refactored interface to hide most of the type 
- *                    determination in C.
  */
 #include <hdf5.h>
-#include <hdf5_hl.h>
 #include <Rinternals.h>    
 #include <R.h>
 
@@ -59,8 +53,8 @@
 }
 
 SEXP h5R_get_type(SEXP h5_obj) {
-    SEXP dtype;
-    hid_t cls_id;
+    SEXP dtype = R_NilValue;
+    hid_t cls_id = -1;
 
     switch (H5Iget_type(HID(h5_obj))) {
     case H5I_DATASET:
@@ -81,7 +75,7 @@
 }
 
 hid_t _h5R_get_space(SEXP h5_obj) {
-    hid_t space;
+    hid_t space = -1;
 
     switch (H5Iget_type(HID(h5_obj))) {
     case H5I_DATASET:
@@ -93,6 +87,7 @@
     default:
 	error("Unknown object in _h5R_get_space.");
     }
+    return space;
 }
 
 int _h5R_get_ndims(SEXP h5_obj) {
@@ -141,7 +136,6 @@
     int i;
 
     SEXP res  = R_NilValue;
-    int ndims = _h5R_get_ndims(h5_obj);
     int nelts = _h5R_get_nelts(h5_obj);
 
     char** rdata  = (char **) Calloc(nelts, char*);
@@ -156,7 +150,7 @@
 	H5Aread(HID(h5_obj), memtype, rdata);
 	break;
     default:
-	error("Unkown object in _h5R_read_vlen_str");
+	error("Unsupported class in %s.\n", __func__);
     }
     
     PROTECT(res = allocVector(STRSXP, nelts));
@@ -173,9 +167,9 @@
 }
 
 SEXP h5R_read_dataset(SEXP h5_dataset) {
-    SEXP dta;
-    hid_t memtype;
-    void* buf; 
+    SEXP dta = R_NilValue;
+    hid_t memtype = -1;
+    void* buf = NULL; 
 
     switch (INTEGER(h5R_get_type(h5_dataset))[0]) {
     case H5T_INTEGER: 
@@ -191,7 +185,7 @@
     case H5T_STRING:
 	return _h5R_read_vlen_str(h5_dataset);
     default:
-	error("Unsupported class in h5R_read_dataset.");
+	error("Unsupported class in %s.\n", __func__);
     }
 
     H5Dread(HID(h5_dataset), memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); 
@@ -202,8 +196,8 @@
 
 SEXP h5R_read_slab(SEXP h5_dataset, SEXP _offsets, SEXP _counts) {
     SEXP dta = R_NilValue;
-    hid_t space, memspace, memtype;
-    void* buf; 
+    hid_t space = -1, memspace = -1, memtype = -1;
+    void* buf = NULL; 
     int i; 
 
     int* offsets  = INTEGER(_offsets);
@@ -247,6 +241,8 @@
     Free(_h_offsets);
     Free(_h_counts);
     H5Sclose(memspace);
+    H5Sclose(space);
+
     UNPROTECT(1);
     
     return dta;
@@ -259,12 +255,10 @@
  * complicated things like hyperslab selection.
  */
 SEXP h5R_read_attr(SEXP h5_attr) {
-    int up = 0;
+    SEXP dta = R_NilValue;
+    hid_t memtype = -1;
+    void* buf = NULL; 
 
-    SEXP dta;
-    hid_t memtype;
-    void* buf; 
-
     switch (INTEGER(h5R_get_type(h5_attr))[0]) {
     case H5T_INTEGER:
 	PROTECT(dta = allocVector(INTSXP, _h5R_get_nelts(h5_attr)));
@@ -279,7 +273,7 @@
     case H5T_STRING:
 	return _h5R_read_vlen_str(h5_attr);
     default:
-	error("Unsupported class in h5R_read_attr.");
+	error("Unsupported class in %s.\n", __func__);
     }
 
     H5Aread(HID(h5_attr), memtype, buf);
@@ -289,22 +283,4 @@
 }
 
 
-    /* int rank  = _h5R_get_ndims(h5_dataset); */
-    /* hsize_t* dims = Calloc(rank, hsize_t); */
-    /* hsize_t* odims = Calloc(rank, hsize_t); */
-
-    /* hid_t space    = _h5R_get_space(h5_dataset); */
-
-    /* H5Sget_simple_extent_dims(space, odims, NULL); */
-
-    /* int i; */
-    /* for (i = 0; i < rank; i++) { */
-    /* 	dims[rank - i - 1] = odims[i]; */
-    /* } */
-
-    /* hsize_t mmm[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; */
-
-    /* hid_t memspace = H5Screate_simple(rank, dims, mmm); */
    
-    /* for (i = 0; i < rank; i++)  */
-    /* 	Rprintf("original: %d, reversed: %d \n", odims[i], dims[i]); */



More information about the H5r-commits mailing list