[SCM] ruby-hdfeos5 branch, master, updated. upstream/1.0-11-gf742e1f

Youhei SASAKI uwabami at gfd-dennou.org
Sun May 1 22:19:20 UTC 2011


The following commit has been merged in the master branch:
commit f742e1ff1b51433a9eda37296bca20d5114fce36
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Wed Apr 27 12:52:37 2011 +0900

    update for RubyInWheezy
    
    * Bump Standard Version: 3.9.2
    * Update with files generated by dh-make-ruby:
      - debian/rules
      - debian/watch
    * Updating the package as for the new Ruby practices
      - Renaming binary package: ruby-hdfeos5
      - Migrate to gem2deb
        - removed build dependency on cdbs and ruby-pkg-tools
      - Added XS-Ruby-Versions field to debian/control
    * debian/source/format: using '3.0 (quilt)'
    * Added transitional packages in debian/control to allow smooth upgrades
      from Squeeze.
      - ruby-hdfeos5 Provides, Replaces and Conflicts with
        libhdfeos5-ruby, libhdfeos5-ruby1.8, libhdfeos5-ruby1.9.1
    
    Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>

diff --git a/debian/changelog b/debian/changelog
index 1452fb7..cf28354 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,29 @@
+ruby-hdfeos5 (1.1-1) unstable; urgency=low
+
+  [ Francesco Paolo Lovergine ]
+  * Minor typos fix.
+
+  [ Youhei SASAKI ]
+  * New Upstream release: 1.1
+  * Bump Standard Version: 3.9.2
+  * Update with files generated by dh-make-ruby:
+    - debian/rules
+    - debian/watch
+  * Updating the package as for the new Ruby practices
+    - Renaming binary package: ruby-hdfeos5
+    - Migrate to gem2deb
+      - removed build dependency on cdbs and ruby-pkg-tools
+    - Added XS-Ruby-Versions field to debian/control
+  * debian/source/format: using '3.0 (quilt)'
+  * Added transitional packages in debian/control to allow smooth upgrades
+    from Squeeze.
+    - ruby-hdfeos5 Provides, Replaces and Conflicts with
+      libhdfeos5-ruby, libhdfeos5-ruby1.8, libhdfeos5-ruby1.9.1
+
+ -- Youhei SASAKI <uwabami at gfd-dennou.org>  Mon, 25 Apr 2011 12:32:40 +0900
+
 ruby-hdfeos5 (1.0-1) unstable; urgency=low
 
-  * Initial release (Closes: #574423) 
+  * Initial release (Closes: #574423)
 
  -- Youhei SASAKI <uwabami at gfd-dennou.org>  Tue, 14 Dec 2010 04:22:48 +0900
diff --git a/debian/control b/debian/control
index eda390d..e93ca0b 100644
--- a/debian/control
+++ b/debian/control
@@ -4,80 +4,86 @@ Priority: optional
 Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Youhei SASAKI <uwabami at gfd-dennou.org>
 DM-Upload-Allowed: yes
-Build-Depends: cdbs, debhelper (>= 7.0.50~), quilt,
-  ruby-pkg-tools, graphviz,
-  ruby1.8, ruby1.8-dev, libnarray-ruby1.8, libnarray-miss-ruby1.8, 
-  ruby1.9.1, ruby1.9.1-dev, libnarray-ruby1.9.1, libnarray-miss-ruby1.9.1,
+Build-Depends: debhelper (>= 7.0.50~), gem2deb,
+  libnarray-ruby1.8 | ruby-narray, libnarray-ruby1.9.1 | ruby-narray,
+  libnarray-miss-ruby1.8 | ruby-narray-miss,
+  libnarray-miss-ruby1.9.1 | ruby-narray-miss,
   libhe5-hdfeos-dev, libgctp-dev, libhdf5-serial-dev
-Standards-Version: 3.9.1
+Standards-Version: 3.9.2
+XS-Ruby-Versions: all
 Vcs-Git: git://git.debian.org/git/pkg-grass/ruby-hdfeos5.git
 Vcs-Browser: http://git.debian.org/?p=pkg-grass/ruby-hdfeos5.git
 Homepage: http://ruby.gfd-dennou.org/products/ruby-hdfeos5/
 
-Package: libhdfeos5-ruby
-Architecture: all
-Depends: libhdfeos5-ruby1.8, ${misc:Depends}
-Description: Ruby interface to the HDF-EOS5 library
- Ruby interface to the HDF-EOS5 library built on the NArray library,
- which is an efficient multi-dimensional numeric array class for Ruby.
- .
- This is a dependency package which depends on Debian's default Ruby
- version (currently 1.8.x).
-
-Package: libhdfeos5-ruby1.8
+Package: ruby-hdfeos5
 Architecture: any
-Depends: ruby1.8, libnarray-miss-ruby1.8, ${shlibs:Depends}, ${misc:Depends}
-Suggests: libhdfeos5-ruby-doc
+Depends: ${shlibs:Depends}, ${misc:Depends}, ruby-interpreter | ruby
+Replaces: libhdfeos5-ruby (<< 1.1-1~), libhdfeos5-ruby1.8 (<< 1.1-1~), libhdfeos5-ruby1.9.1 (<< 1.1-1~)
+Conflicts: libhdfeos5-ruby (<< 1.1-1~), libhdfeos5-ruby1.8 (<< 1.1-1~), libhdfeos5-ruby1.9.1 (<< 1.1-1~)
+Provides: libhdfeos5-ruby, libhdfeos5-ruby1.8, libhdfeos5-ruby1.9.1
 Description: Ruby interface to the HDF-EOS5 library
  Ruby interface to the HDF-EOS5 library built on the NArray library,
  which is an efficient multi-dimensional numeric array class for Ruby.
- .
- This package is built for Ruby 1.8.
 
-Package: libhdfeos5-ruby1.8-dbg
+Package: ruby-hdfeos5-dbg
 Section: debug
 Priority: extra
 Architecture: any
-Depends: libhdfeos5-ruby1.8 (=${binary:Version}), ${misc:Depends}
-Description: Ruby interface to the HDF-EOS5 library 
+Depends: ruby-hdfeos5 (=${binary:Version}), ${misc:Depends}
+Description: Ruby interface to the HDF-EOS5 library (debug symbol)
  Ruby interface to the HDF-EOS5 library built on the NArray library,
  which is an efficient multi-dimensional numeric array class for Ruby.
  .
- This package is build for Ruby 1.8, and provide primarily to provide
- a backtrace with names in a debugger, this make it somewhat easier to
- interpret core dumps. Most people will not need this package.
+ This package is primarily to provide a backtrace with names in a
+ debugger, this make it somewhat easier to interpret core dumps. Most
+ people will not need this package.
 
 
-Package: libhdfeos5-ruby1.9.1
+Package: libhdfeos5-ruby
+Section: oldlibs
+Architecture: all
+Depends: ${misc:Depends}, ruby-hdfeos5
+Description: Transitional package for ruby-hdfeos5
+ This is a transitional package to ease upgrades to the ruby-hdfeos5
+ package. It can safely be removed.
+
+Package: libhdfeos5-ruby1.8
 Architecture: any
-Depends: ruby1.9.1, libnarray-miss-ruby1.9.1, ${shlibs:Depends}, ${misc:Depends}
-Suggests: libhdfeos5-ruby-doc
-Description: Ruby interface to the HDF-EOS5 library
- Ruby interface to the HDF-EOS5 library built on the NArray library,
- which is an efficient multi-dimensional numeric array class for Ruby.
- .
- This package is built for Ruby 1.9.1.
+Depends: ${misc:Depends}, ruby-hdfeos5
+Description: Transitional package for ruby-hdfeos5
+ This is a transitional package to ease upgrades to the ruby-hdfeos5
+ package. It can safely be removed.
+
+Package: libhdfeos5-ruby1.8-dbg
+Section: oldlibs
+Priority: extra
+Architecture: all
+Depends: ${misc:Depends}, ruby-hdfeos5-dbg
+Description: Transitional package for ruby-hdfeos5-dbg
+ This is a transitional package to ease upgrades to the ruby-hdfeos5-dbg
+ package. It can safely be removed.
+
+Package: libhdfeos5-ruby1.9.1
+Section: oldlibs
+Architecture: all
+Depends: ${misc:Depends}, ruby-hdfeos5
+Description: Transitional package for ruby-hdfeos5
+ This is a transitional package to ease upgrades to the ruby-hdfeos5
+ package. It can safely be removed.
 
 Package: libhdfeos5-ruby1.9.1-dbg
-Section: debug
+Section: oldlibs
 Priority: extra
-Architecture: any
-Depends: libhdfeos5-ruby1.9.1 (=${binary:Version}), ${misc:Depends}
-Description: Ruby interface to the HDF-EOS5 library
- Ruby interface to the HDF-EOS5 library built on the NArray library,
- which is an efficient multi-dimensional numeric array class for Ruby.
- .
- This package is build for Ruby 1.9.1, and provide primarily to
- provide a backtrace with names in a debugger, this make it somewhat
- easier to interpret core dumps. Most people will not need this
- package.
+Architecture: all
+Depends: ${misc:Depends}, ruby-hdfeos5-dbg
+Description: Transitional package for ruby-hdfeos5-dbg
+ This is a transitional package to ease upgrades to the ruby-hdfeos5-dbg
+ package. It can safely be removed.
 
 Package: libhdfeos5-ruby-doc
-Section: doc
+Section: oldlibs
 Architecture: all
-Depends: ${misc:Depends}
-Description: Ruby HDF-EOS library API documents 
- Ruby interface to the HDF-EOS5 library built on the NArray library,
- which is an efficient multi-dimensional numeric array class for Ruby.
- .
- This package provides all API Documents.
+Depends: ${misc:Depends}, ruby-hdfeos5
+Description: Transitional package for ruby-hdfeos5
+ This is a transitional package to ease upgrades to the ruby-hdfeos5
+ package. It can safely be removed.
diff --git a/debian/patches/0001-Ruby-1.9-compatibility.patch b/debian/patches/0001-Ruby-1.9-compatibility.patch
deleted file mode 100644
index fb6435c..0000000
--- a/debian/patches/0001-Ruby-1.9-compatibility.patch
+++ /dev/null
@@ -1,1805 +0,0 @@
-From 54adb596095f9e4ff70be290a4734813e2078951 Mon Sep 17 00:00:00 2001
-From: koshiro <koshiro>
-Date: Mon, 5 Apr 2010 06:55:14 +0000
-Subject: [PATCH 1/4] * Ruby 1.9 compatibility
-
----
- hdfeos5_chkdatatype.c |    3 +-
- hdfeos5_obj2cary.c    |   37 ++++++++----
- hdfeos5gd_wrap.c      |  153 +++++++++++++++++++++++++-----------------------
- hdfeos5main_wrap.c    |    2 +-
- hdfeos5pt_wrap.c      |    3 +-
- hdfeos5sw_wrap.c      |  153 +++++++++++++++++++++++++-----------------------
- hdfeos5za_wrap.c      |  153 +++++++++++++++++++++++++-----------------------
- 7 files changed, 269 insertions(+), 235 deletions(-)
-
-diff --git a/hdfeos5_chkdatatype.c b/hdfeos5_chkdatatype.c
-index 3fe2fac..5639c15 100644
---- a/hdfeos5_chkdatatype.c
-+++ b/hdfeos5_chkdatatype.c
-@@ -5,8 +5,9 @@
- #include "narray.h"
- #include<string.h>
- 
-+/* for compatibility with ruby 1.6 */
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- static VALUE rb_eHE5Error;
-diff --git a/hdfeos5_obj2cary.c b/hdfeos5_obj2cary.c
-index 51bced1..c6688ef 100644
---- a/hdfeos5_obj2cary.c
-+++ b/hdfeos5_obj2cary.c
-@@ -2,6 +2,17 @@
- #include "ruby.h"
- #include "narray.h"
- 
-+/* for compatibility with ruby 1.6 */
-+#ifndef RARRAY_PTR
-+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
-+#endif
-+#ifndef RARRAY_LEN
-+#define RARRAY_LEN(a) (RARRAY(a)->len)
-+#endif
-+#ifndef RFLOAT_VALUE
-+#define RFLOAT_VALUE(v) (RFLOAT(v)->value)
-+#endif
-+
- VALUE mHE5=0;
- 
- /*  functions  */
-@@ -35,7 +46,7 @@ static unsigned long long *na2cunsint64ary(VALUE);
- /*  defines  */
- #define BE_INTEGER(x) ((int)(NUM2INT(rb_Integer(x))))
- #define BE_LONG(x)    ((long)(NUM2INT(rb_Integer(x))))
--#define BE_FLOAT(x)   ((RFLOAT(rb_Float(x))->value))
-+#define BE_FLOAT(x)   (RFLOAT_VALUE(rb_Float(x)))
- 
- /*
-  * hdfeos5_obj2cxxxary() : convert ruby object to c xxx type array
-@@ -271,8 +282,8 @@ ary2ccharary(VALUE src,int size,int charlen)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(char, size);
-     memset(rtn, '\0', size);
-@@ -293,8 +304,8 @@ ary2cintary(VALUE src)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(int, len);
- 
-@@ -314,8 +325,8 @@ ary2clongary(VALUE src)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(long, len);
- 
-@@ -335,8 +346,8 @@ ary2csint64ary(VALUE src)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(signed long long, len);
- 
-@@ -356,8 +367,8 @@ ary2cunsint64ary(VALUE src)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(unsigned long long, len);
- 
-@@ -377,8 +388,8 @@ ary2cfloatary(VALUE src)
- 
-     Check_Type(src, T_ARRAY);
- 
--    len = RARRAY(src)->len;
--    ptr = RARRAY(src)->ptr;
-+    len = RARRAY_LEN(src);
-+    ptr = RARRAY_PTR(src);
- 
-     rtn = ALLOC_N(float , len);
- 
-diff --git a/hdfeos5gd_wrap.c b/hdfeos5gd_wrap.c
-index e440f9f..6e2a0b7 100644
---- a/hdfeos5gd_wrap.c
-+++ b/hdfeos5gd_wrap.c
-@@ -5,8 +5,15 @@
- #include "narray.h"
- #include<string.h>
- 
-+/* for compatibility with ruby 1.6 */
-+#ifndef RARRAY_PTR
-+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
-+#endif
-+#ifndef RARRAY_LEN
-+#define RARRAY_LEN(a) (RARRAY(a)->len)
-+#endif
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- extern int   check_numbertype(char *);
-@@ -2267,12 +2274,12 @@ hdfeos5_gdwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2287,11 +2294,11 @@ hdfeos5_gdwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2309,11 +2316,11 @@ hdfeos5_gdwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2363,12 +2370,12 @@ hdfeos5_gdwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2383,11 +2390,11 @@ hdfeos5_gdwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2405,11 +2412,11 @@ hdfeos5_gdwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -2459,12 +2466,12 @@ hdfeos5_gdwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2479,11 +2486,11 @@ hdfeos5_gdwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2501,11 +2508,11 @@ hdfeos5_gdwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2555,12 +2562,12 @@ hdfeos5_gdwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2575,11 +2582,11 @@ hdfeos5_gdwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2597,11 +2604,11 @@ hdfeos5_gdwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2651,12 +2658,12 @@ hdfeos5_gdwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2671,11 +2678,11 @@ hdfeos5_gdwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2693,11 +2700,11 @@ hdfeos5_gdwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2747,12 +2754,12 @@ hdfeos5_gdwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2767,11 +2774,11 @@ hdfeos5_gdwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2789,11 +2796,11 @@ hdfeos5_gdwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2841,13 +2848,13 @@ hdfeos5_gdreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2872,12 +2879,12 @@ hdfeos5_gdreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -2902,11 +2909,11 @@ hdfeos5_gdreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -2955,13 +2962,13 @@ hdfeos5_gdreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -2986,12 +2993,12 @@ hdfeos5_gdreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -3016,11 +3023,11 @@ hdfeos5_gdreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -3069,13 +3076,13 @@ hdfeos5_gdreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -3100,12 +3107,12 @@ hdfeos5_gdreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -3130,11 +3137,11 @@ hdfeos5_gdreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -3183,13 +3190,13 @@ hdfeos5_gdreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -3214,12 +3221,12 @@ hdfeos5_gdreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -3244,11 +3251,11 @@ hdfeos5_gdreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -3297,13 +3304,13 @@ hdfeos5_gdreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -3328,12 +3335,12 @@ hdfeos5_gdreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -3358,11 +3365,11 @@ hdfeos5_gdreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-@@ -3411,13 +3418,13 @@ hdfeos5_gdreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_GDfieldinfo(i_gridid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
-            __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
-     l_start += hs_dims[i];
-       }
-@@ -3442,12 +3449,12 @@ hdfeos5_gdreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
-            __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--    c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+    c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
-     if(c_stride[i]==0) {
-       rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
-     }
-@@ -3472,11 +3479,11 @@ hdfeos5_gdreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
-       l_edge +=hs_dims[i];
-         }
-diff --git a/hdfeos5main_wrap.c b/hdfeos5main_wrap.c
-index 9cd352d..76a2a76 100644
---- a/hdfeos5main_wrap.c
-+++ b/hdfeos5main_wrap.c
-@@ -6,7 +6,7 @@
- #include<string.h>
- 
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- VALUE rb_eHE5Error;
-diff --git a/hdfeos5pt_wrap.c b/hdfeos5pt_wrap.c
-index 603fc74..1e5664d 100644
---- a/hdfeos5pt_wrap.c
-+++ b/hdfeos5pt_wrap.c
-@@ -5,8 +5,9 @@
- #include "narray.h"
- #include<string.h>
- 
-+/* for compatibility with ruby 1.6 */
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- extern int   check_numbertype(char *);
-diff --git a/hdfeos5sw_wrap.c b/hdfeos5sw_wrap.c
-index e0fc6b1..846fd72 100644
---- a/hdfeos5sw_wrap.c
-+++ b/hdfeos5sw_wrap.c
-@@ -5,8 +5,15 @@
- #include "narray.h"
- #include<string.h>
- 
-+/* for compatibility with ruby 1.6 */
-+#ifndef RARRAY_PTR
-+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
-+#endif
-+#ifndef RARRAY_LEN
-+#define RARRAY_LEN(a) (RARRAY(a)->len)
-+#endif
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- extern int   check_numbertype(char *);
-@@ -2936,12 +2943,12 @@ hdfeos5_swwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2956,11 +2963,11 @@ hdfeos5_swwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2978,11 +2985,11 @@ hdfeos5_swwritefield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3032,12 +3039,12 @@ hdfeos5_swwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3052,11 +3059,11 @@ hdfeos5_swwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3074,11 +3081,11 @@ hdfeos5_swwritefield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3128,12 +3135,12 @@ hdfeos5_swwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3148,11 +3155,11 @@ hdfeos5_swwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3170,11 +3177,11 @@ hdfeos5_swwritefield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3224,12 +3231,12 @@ hdfeos5_swwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3244,11 +3251,11 @@ hdfeos5_swwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3266,11 +3273,11 @@ hdfeos5_swwritefield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALU
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3320,12 +3327,12 @@ hdfeos5_swwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3340,11 +3347,11 @@ hdfeos5_swwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3362,11 +3369,11 @@ hdfeos5_swwritefield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge, VAL
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3416,12 +3423,12 @@ hdfeos5_swwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3436,11 +3443,11 @@ hdfeos5_swwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3458,11 +3465,11 @@ hdfeos5_swwritefield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge, VA
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3511,13 +3518,13 @@ hdfeos5_swreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3542,12 +3549,12 @@ hdfeos5_swreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3572,11 +3579,11 @@ hdfeos5_swreadfield_char(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3625,13 +3632,13 @@ hdfeos5_swreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3656,12 +3663,12 @@ hdfeos5_swreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3686,11 +3693,11 @@ hdfeos5_swreadfield_short(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3739,13 +3746,13 @@ hdfeos5_swreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3770,12 +3777,12 @@ hdfeos5_swreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3800,11 +3807,11 @@ hdfeos5_swreadfield_int(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3853,13 +3860,13 @@ hdfeos5_swreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3884,12 +3891,12 @@ hdfeos5_swreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3914,11 +3921,11 @@ hdfeos5_swreadfield_long(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -3967,13 +3974,13 @@ hdfeos5_swreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3998,12 +4005,12 @@ hdfeos5_swreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -4028,11 +4035,11 @@ hdfeos5_swreadfield_float(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-@@ -4081,13 +4088,13 @@ hdfeos5_swreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-     status = HE5_SWfieldinfo(i_swathid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -4112,12 +4119,12 @@ hdfeos5_swreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -4142,11 +4149,11 @@ hdfeos5_swreadfield_double(VALUE mod, VALUE start, VALUE stride, VALUE edge)
-       break;
-     default:
-       Check_Type(edge,T_ARRAY);
--      if(RARRAY(edge)->len <i_rank) {
-+      if(RARRAY_LEN(edge) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_edge= NUM2INT(RARRAY(edge)->ptr[i_rank-1-i]);
-+        l_edge= NUM2INT(RARRAY_PTR(edge)[i_rank-1-i]);
-         if(l_edge < 0) {
- 	  l_edge +=hs_dims[i];
-         }
-diff --git a/hdfeos5za_wrap.c b/hdfeos5za_wrap.c
-index adf9261..a49725f 100644
---- a/hdfeos5za_wrap.c
-+++ b/hdfeos5za_wrap.c
-@@ -5,8 +5,15 @@
- #include "narray.h"
- #include<string.h>
- 
-+/* for compatibility with ruby 1.6 */
-+#ifndef RARRAY_PTR
-+#define RARRAY_PTR(a) (RARRAY(a)->ptr)
-+#endif
-+#ifndef RARRAY_LEN
-+#define RARRAY_LEN(a) (RARRAY(a)->len)
-+#endif
- #ifndef RSTRING_PTR
--#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
-+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
- 
- extern int   check_numbertype(char *);
-@@ -1826,12 +1833,12 @@ hdfeos5_zawrite_char(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -1846,11 +1853,11 @@ hdfeos5_zawrite_char(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -1868,11 +1875,11 @@ hdfeos5_zawrite_char(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -1922,12 +1929,12 @@ hdfeos5_zawrite_short(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -1942,11 +1949,11 @@ hdfeos5_zawrite_short(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -1964,11 +1971,11 @@ hdfeos5_zawrite_short(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2018,12 +2025,12 @@ hdfeos5_zawrite_int(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE dat
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2038,11 +2045,11 @@ hdfeos5_zawrite_int(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE dat
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2060,11 +2067,11 @@ hdfeos5_zawrite_int(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE dat
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2114,12 +2121,12 @@ hdfeos5_zawrite_long(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2134,11 +2141,11 @@ hdfeos5_zawrite_long(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2156,11 +2163,11 @@ hdfeos5_zawrite_long(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE da
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2210,12 +2217,12 @@ hdfeos5_zawrite_float(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2230,11 +2237,11 @@ hdfeos5_zawrite_float(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2252,11 +2259,11 @@ hdfeos5_zawrite_float(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE d
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2306,12 +2313,12 @@ hdfeos5_zawrite_double(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, o_dimlist, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",__FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i]);    
-+      l_start=NUM2INT(RARRAY_PTR(start)[i]);    
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2326,11 +2333,11 @@ hdfeos5_zawrite_double(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2348,11 +2355,11 @@ hdfeos5_zawrite_double(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2401,13 +2408,13 @@ hdfeos5_zaread_char(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2432,12 +2439,12 @@ hdfeos5_zaread_char(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2462,11 +2469,11 @@ hdfeos5_zaread_char(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2515,13 +2522,13 @@ hdfeos5_zaread_short(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2546,12 +2553,12 @@ hdfeos5_zaread_short(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2576,11 +2583,11 @@ hdfeos5_zaread_short(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2629,13 +2636,13 @@ hdfeos5_zaread_int(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2660,12 +2667,12 @@ hdfeos5_zaread_int(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2690,11 +2697,11 @@ hdfeos5_zaread_int(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2743,13 +2750,13 @@ hdfeos5_zaread_long(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2774,12 +2781,12 @@ hdfeos5_zaread_long(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2804,11 +2811,11 @@ hdfeos5_zaread_long(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2857,13 +2864,13 @@ hdfeos5_zaread_float(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -2888,12 +2895,12 @@ hdfeos5_zaread_float(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -2918,11 +2925,11 @@ hdfeos5_zaread_float(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
-@@ -2971,13 +2978,13 @@ hdfeos5_zaread_double(VALUE mod, VALUE start, VALUE stride, VALUE count)
-     status = HE5_ZAinfo(i_zaid, i_fldname, &i_rank, hs_dims, &i_ntype, NULL, NULL);
- 
-     Check_Type(start,T_ARRAY);
--    if(RARRAY(start)->len < i_rank) {
-+    if(RARRAY_LEN(start) < i_rank) {
-       rb_raise(rb_eHE5Error, "Length of 'start' is too short [%s:%d]",
- 	       __FILE__,__LINE__);
-     }
-     c_start=ALLOCA_N(signed long long,i_rank);
-     for(i=0; i<i_rank; i++){
--      l_start=NUM2INT(RARRAY(start)->ptr[i_rank-1-i]);
-+      l_start=NUM2INT(RARRAY_PTR(start)[i_rank-1-i]);
-       if(l_start < 0) {
- 	l_start += hs_dims[i];
-       }
-@@ -3002,12 +3009,12 @@ hdfeos5_zaread_double(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(stride,T_ARRAY);
--      if(RARRAY(stride)->len < i_rank) {
-+      if(RARRAY_LEN(stride) < i_rank) {
- 	  rb_raise(rb_eHE5Error, "Length of 'stride' is too short [%s:%d]",
- 		   __FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--	c_stride[i]=NUM2INT(RARRAY(stride)->ptr[i_rank-1-i]);
-+	c_stride[i]=NUM2INT(RARRAY_PTR(stride)[i_rank-1-i]);
- 	if(c_stride[i]==0) {
- 	  rb_raise(rb_eHE5Error, "stride cannot be zero [%s:%d]",__FILE__,__LINE__);
- 	}
-@@ -3032,11 +3039,11 @@ hdfeos5_zaread_double(VALUE mod, VALUE start, VALUE stride, VALUE count)
-       break;
-     default:
-       Check_Type(count,T_ARRAY);
--      if(RARRAY(count)->len <i_rank) {
-+      if(RARRAY_LEN(count) < i_rank) {
-         rb_raise(rb_eHE5Error, "Length of 'end' is too short [%s:%d]",__FILE__,__LINE__);
-       }
-       for(i=0; i<i_rank; i++){
--        l_count= NUM2INT(RARRAY(count)->ptr[i_rank-1-i]);
-+        l_count= NUM2INT(RARRAY_PTR(count)[i_rank-1-i]);
-         if(l_count < 0) {
- 	  l_count +=hs_dims[i];
-         }
--- 
-1.7.2.3
-
diff --git a/debian/patches/0002-update-ChangeLog.patch b/debian/patches/0002-update-ChangeLog.patch
deleted file mode 100644
index 7c0c04f..0000000
--- a/debian/patches/0002-update-ChangeLog.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 818c5d8e62da3eed23ac1ebfe0a6ec49b141e9ff Mon Sep 17 00:00:00 2001
-From: koshiro <koshiro>
-Date: Mon, 5 Apr 2010 06:58:57 +0000
-Subject: [PATCH 2/4] * update ChangeLog
-
----
- ChangeLog |   62 ++++++++++++++++++++++++++++++++++++++++++++++--------------
- 1 files changed, 47 insertions(+), 15 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 4bf9862..16dc8be 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -6,18 +6,47 @@ This file is generated automatically by
-  This script is available from  http://www.red-bean.com/cvs2cl/
- 
- 
-+2010-04-05 Monday 15:55  koshiro
-+
-+	* hdfeos5_chkdatatype.c (1.4), hdfeos5_obj2cary.c (1.4),
-+	  hdfeos5gd_wrap.c (1.5), hdfeos5main_wrap.c (1.3),
-+	  hdfeos5pt_wrap.c (1.3), hdfeos5sw_wrap.c (1.12), hdfeos5za_wrap.c
-+	  (1.6):
-+
-+	  * Ruby 1.9 compatibility
-+
-+2010-04-05 Monday 15:28  koshiro
-+
-+	* extconf.rb (1.2):
-+
-+	  * extconf.rb: bug fix.
-+
-+2009-07-03 Friday 19:42  horikawa
-+
-+	* lib/hdfeos5.rb (1.21, ruby-hdfeos5-1_0):
-+	   bugfix
-+
-+2009-04-24 Friday 16:20  horikawa
-+
-+	* ChangeLog (1.8, ruby-hdfeos5-1_0), hdfeos5za_wrap.c (1.5,
-+	  ruby-hdfeos5-1_0), lib/hdfeos5.rb (1.20), test/test_za.rb (1.3,
-+	  ruby-hdfeos5-1_0): changed  info() to  fieldinfo()
-+
- 2009-04-22 Wednesday 13:54  horikawa
- 
--	* ChangeLog (1.7), hdfeos5pt_wrap.c (1.2), test/test_pt.rb (1.2):
--	  supported linkage point (point wrapper)
-+	* ChangeLog (1.7), hdfeos5pt_wrap.c (1.2, ruby-hdfeos5-1_0),
-+	  test/test_pt.rb (1.2, ruby-hdfeos5-1_0): supported linkage point
-+	  (point wrapper)
- 
- 2009-04-20 Monday 13:11  horikawa
- 
--	* ChangeLog (1.6), hdfeos5_chkdatatype.c (1.3), hdfeos5_obj2cary.c
--	  (1.3), hdfeos5gd_wrap.c (1.4), hdfeos5main_wrap.c (1.2),
--	  hdfeos5pt_wrap.c (1.1), hdfeos5sw_wrap.c (1.11), hdfeos5za_wrap.c
--	  (1.4), lib/hdfeos5.rb (1.19), test/test_gd.rb (1.2),
--	  test/test_pt.rb (1.1), test/test_sw.rb (1.2), test/test_za.rb
-+	* ChangeLog (1.6), hdfeos5_chkdatatype.c (1.3, ruby-hdfeos5-1_0),
-+	  hdfeos5_obj2cary.c (1.3, ruby-hdfeos5-1_0), hdfeos5gd_wrap.c
-+	  (1.4, ruby-hdfeos5-1_0), hdfeos5main_wrap.c (1.2,
-+	  ruby-hdfeos5-1_0), hdfeos5pt_wrap.c (1.1), hdfeos5sw_wrap.c
-+	  (1.11, ruby-hdfeos5-1_0), hdfeos5za_wrap.c (1.4), lib/hdfeos5.rb
-+	  (1.19), test/test_gd.rb (1.2, ruby-hdfeos5-1_0), test/test_pt.rb
-+	  (1.1), test/test_sw.rb (1.2, ruby-hdfeos5-1_0), test/test_za.rb
- 	  (1.2): modified simple_put and put_with_miss modified the
- 	  readfield function ( swath / grid / zonal ) modified
- 	  HE5Wrap_store_NArray1D_or_str added point wrapper ( support only
-@@ -53,10 +82,13 @@ This file is generated automatically by
- 
- 2009-03-06 Friday 11:40  horikawa
- 
--	* test/: MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5 (1.1),
-+	* test/: MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5 (1.1,
-+	  ruby-hdfeos5-1_0),
- 	  OMI-Aura_L2-OMAERO_2008m0229t0011-o19277_v003-2008m0229t061514.he5
--	  (1.1), OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5
--	  (1.1), test_gd.rb (1.1), test_sw.rb (1.1), test_za.rb (1.1):
-+	  (1.1, ruby-hdfeos5-1_0),
-+	  OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5 (1.1,
-+	  ruby-hdfeos5-1_0), test_gd.rb (1.1), test_sw.rb (1.1), test_za.rb
-+	  (1.1):
- 	  * Set up testfile(test_sw,test_gd,test_za) and
- 	  testdata(AIRS,MLS,OMI).
- 
-@@ -214,7 +246,7 @@ This file is generated automatically by
- 
- 2008-06-09 Monday 15:03  horinout
- 
--	* Makefile (1.2), Makefile_CL (1.1):
-+	* Makefile (1.2), Makefile_CL (1.1, ruby-hdfeos5-1_0):
- 	  * Renamed Makefile to create ChangeLog to Makefile_CL
- 
- 2008-06-09 Monday 14:52  horinout
-@@ -247,8 +279,8 @@ This file is generated automatically by
- 
- 2008-06-05 Thursday 18:17  horikawa
- 
--	* SWapi.c (1.1.1.1), extconf.rb (1.1.1.1), hdfeos5_cary2obj.c
--	  (1.1.1.1), hdfeos5_obj2cary.c (1.1.1.1), lib/numru/hdfeos5.rb
--	  (1.1.1.1) (utags: Initial): initial import of ruby-hdfeos5 into
--	  CVS
-+	* SWapi.c (1.1.1.1), extconf.rb (1.1.1.1, ruby-hdfeos5-1_0),
-+	  hdfeos5_cary2obj.c (1.1.1.1, ruby-hdfeos5-1_0),
-+	  hdfeos5_obj2cary.c (1.1.1.1), lib/numru/hdfeos5.rb (1.1.1.1)
-+	  (utags: Initial): initial import of ruby-hdfeos5 into CVS
- 
--- 
-1.7.2.3
-
diff --git a/debian/patches/0003-Ruby-1.9.2-compatibility.patch b/debian/patches/0003-Ruby-1.9.2-compatibility.patch
deleted file mode 100644
index eee8bed..0000000
--- a/debian/patches/0003-Ruby-1.9.2-compatibility.patch
+++ /dev/null
@@ -1,1673 +0,0 @@
-From 0ba642940f79760ab8143c43eb1a25c5d085e771 Mon Sep 17 00:00:00 2001
-From: koshiro <koshiro>
-Date: Tue, 28 Dec 2010 01:36:19 +0000
-Subject: [PATCH 3/4] * Ruby 1.9.2 compatibility
-
----
- hdfeos5_chkdatatype.c |    5 +-
- hdfeos5_obj2cary.c    |    9 ++-
- hdfeos5gd_wrap.c      |  101 +++++++++++++++--------------
- hdfeos5main_wrap.c    |    7 ++-
- hdfeos5pt_wrap.c      |   53 ++++++++-------
- hdfeos5sw_wrap.c      |  171 +++++++++++++++++++++++++------------------------
- hdfeos5za_wrap.c      |  101 +++++++++++++++--------------
- 7 files changed, 235 insertions(+), 212 deletions(-)
-
-diff --git a/hdfeos5_chkdatatype.c b/hdfeos5_chkdatatype.c
-index 5639c15..e01a12b 100644
---- a/hdfeos5_chkdatatype.c
-+++ b/hdfeos5_chkdatatype.c
-@@ -9,6 +9,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- static VALUE rb_eHE5Error;
- 
-@@ -79,7 +82,7 @@ HE5Wrap_store_NArray1D_or_str(int ntype, VALUE obj, void **ptr){
-     case  HE5T_CHARSTRING:
-         switch (TYPE(obj)){
-         case T_STRING:
--          Check_SafeStr(obj);
-+          SafeStringValue(obj);
-           *ptr = (char *) RSTRING_PTR(obj);
-           break;
-         case T_ARRAY:
-diff --git a/hdfeos5_obj2cary.c b/hdfeos5_obj2cary.c
-index c6688ef..513fcc6 100644
---- a/hdfeos5_obj2cary.c
-+++ b/hdfeos5_obj2cary.c
-@@ -12,6 +12,9 @@
- #ifndef RFLOAT_VALUE
- #define RFLOAT_VALUE(v) (RFLOAT(v)->value)
- #endif
-+#ifndef StringValueCStr
-+#define StringValueCStr(s) STR2CSTR(s)
-+#endif
- 
- VALUE mHE5=0;
- 
-@@ -174,13 +177,15 @@ hdfeos5_obj2cfloatary(VALUE src)
-     VALUE chk;
-     float *rtn;
-     char *klass;
-+    VALUE klass_tmp;
-     VALUE rmiss;
- 
- 
-     switch (TYPE(src)){
-     case T_OBJECT:
--	klass = STR2CSTR( rb_funcall(rb_funcall(src, rb_intern("class"),0),
--				     rb_intern("to_s"),0) );
-+	klass_tmp = rb_funcall(rb_funcall(src, rb_intern("class"),0),
-+				     rb_intern("to_s"),0);
-+	klass = StringValueCStr(klass_tmp);
- 	if (strncmp(klass,"NArrayMiss",10) != 0) {
- 	    rb_raise(rb_eTypeError, "a numeric array expected");
- 	}
-diff --git a/hdfeos5gd_wrap.c b/hdfeos5gd_wrap.c
-index 6e2a0b7..069c3ba 100644
---- a/hdfeos5gd_wrap.c
-+++ b/hdfeos5gd_wrap.c
-@@ -15,6 +15,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- extern int   check_numbertype(char *);
- extern int   change_numbertype(char *);
-@@ -284,7 +287,7 @@ gdnentries_count(hid_t i_gridid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_GDnentries(i_gridid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -300,7 +303,7 @@ gdnentries_strbuf(hid_t i_gridid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_GDnentries(i_gridid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -329,7 +332,7 @@ hdfeos5_gdcreate(VALUE mod, VALUE gridname, VALUE xdimsize, VALUE ydimsize, VALU
-     file=he5file->name;
- 
-     Check_Type(gridname,T_STRING);
--    Check_SafeStr(gridname);
-+    SafeStringValue(gridname);
-     i_gridname = RSTRING_PTR(gridname);
-     Check_Type(xdimsize,T_FIXNUM);
-     i_xdimsize = NUM2INT(xdimsize);
-@@ -369,7 +372,7 @@ hdfeos5_gdattach(VALUE mod, VALUE gridname)
-     i_fname=he5file->name;
- 
-     Check_Type(gridname,T_STRING);
--    Check_SafeStr(gridname);
-+    SafeStringValue(gridname);
-     i_gridname = RSTRING_PTR(gridname);
- 
-     gdid = HE5_GDattach(i_fid, i_gridname);
-@@ -394,7 +397,7 @@ hdfeos5_gddefdim(VALUE mod, VALUE dimname, VALUE dim)
-     Data_Get_Struct(mod, struct HE5Gd, he5grid);
-     i_gridid=he5grid->gdid;
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     Check_Type(dim,T_FIXNUM);
-     i_dimname = RSTRING_PTR(dimname);
-     i_dim = NUM2LONG(dim);
-@@ -419,7 +422,7 @@ hdfeos5_gddefproj(VALUE mod, VALUE projcode, VALUE zonecode, VALUE spherecode, V
-     Data_Get_Struct(mod, struct HE5Gd, he5grid);
-     i_gridid=he5grid->gdid;
-     Check_Type(projcode,T_STRING);
--    Check_SafeStr(projcode);
-+    SafeStringValue(projcode);
-     Check_Type(zonecode,T_FIXNUM);
-     Check_Type(spherecode,T_FIXNUM);
-     if (TYPE(projparm) == T_FLOAT) {
-@@ -449,7 +452,7 @@ hdfeos5_gdblksomoffset(VALUE mod, VALUE offset, VALUE count, VALUE code)
-     Data_Get_Struct(mod, struct HE5Gd, he5grid);
-     i_gridid=he5grid->gdid;
-     Check_Type(code,T_STRING);
--    Check_SafeStr(code);
-+    SafeStringValue(code);
-     Check_Type(offset,T_FIXNUM);
-     Check_Type(count,T_FIXNUM);
-     i_code = RSTRING_PTR(code);
-@@ -482,7 +485,7 @@ hdfeos5_gddefcomp(VALUE mod, VALUE compcode, VALUE compparm)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -511,7 +514,7 @@ hdfeos5_gddeftile(VALUE mod, VALUE tilecode, VALUE tilerank, VALUE tiledims)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(tilecode,T_STRING);
--    Check_SafeStr(tilecode);
-+    SafeStringValue(tilecode);
-     i_tilecode = change_tilingcode(RSTRING_PTR(tilecode));
- 
-     Check_Type(tilerank,T_FIXNUM);
-@@ -544,7 +547,7 @@ hdfeos5_gddefcomtile(VALUE mod, VALUE compcode, VALUE compparm, VALUE tilerank,
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -579,7 +582,7 @@ hdfeos5_gddeforigin(VALUE mod, VALUE origincode)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(origincode,T_STRING);
--    Check_SafeStr(origincode);
-+    SafeStringValue(origincode);
-     i_origincode = change_gridorigincode(RSTRING_PTR(origincode));
- 
-     o_rtn_val = HE5_GDdeforigin(i_gridid, i_origincode);
-@@ -601,7 +604,7 @@ hdfeos5_gddefpixreg(VALUE mod, VALUE pixregcode)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(pixregcode,T_STRING);
--    Check_SafeStr(pixregcode);
-+    SafeStringValue(pixregcode);
-     i_pixregcode = change_pixelregistcode(RSTRING_PTR(pixregcode));
- 
-     o_rtn_val = HE5_GDdefpixreg(i_gridid, i_pixregcode);
-@@ -623,7 +626,7 @@ hdfeos5_gddiminfo(VALUE mod, VALUE dimname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     i_dimname = RSTRING_PTR(dimname);
- 
-     o_ndim = HE5_GDdiminfo(i_gridid, i_dimname);
-@@ -845,13 +848,13 @@ hdfeos5_gddeffield(VALUE file, VALUE fieldname, VALUE dimlist, VALUE maxdimlist,
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(maxdimlist,T_STRING);
--    Check_SafeStr(maxdimlist);
-+    SafeStringValue(maxdimlist);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     Check_Type(merge,T_FIXNUM);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-@@ -885,9 +888,9 @@ hdfeos5_gdwritefieldmeta(VALUE mod, VALUE dimlist, VALUE numbertype)
-     i_gridid=he5field->gdid;
- 
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
- 
-     i_dimlist = RSTRING_PTR(dimlist);
-     i_numbertype = change_numbertype(RSTRING_PTR(numbertype));
-@@ -902,7 +905,7 @@ hdfeos5_gdwritefield(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE dat
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -953,7 +956,7 @@ hdfeos5_gdreadfield(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE ntyp
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1017,9 +1020,9 @@ hdfeos5_gdwriteattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count, VA
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1051,7 +1054,7 @@ hdfeos5_gd_get_att(VALUE mod, VALUE attrname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_GDattrinfo(i_gridid, i_attrname, &o_ntype, &o_count);
-@@ -1107,9 +1110,9 @@ hdfeos5_gdsetfillvalue(VALUE mod, VALUE fieldname, VALUE numbertype, VALUE fillv
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_numbertype = change_numbertype(RSTRING_PTR(numbertype));
- 
-@@ -1119,7 +1122,7 @@ hdfeos5_gdsetfillvalue(VALUE mod, VALUE fieldname, VALUE numbertype, VALUE fillv
-     }
-     if (TYPE(fillval) == T_STRING) {
-       Check_Type(fillval,T_STRING);
--      Check_SafeStr(fillval);
-+      SafeStringValue(fillval);
-       i_fillval = RSTRING_PTR(fillval);
-     }
- 
-@@ -1145,7 +1148,7 @@ hdfeos5_gdgetfillvalue(VALUE mod,VALUE fieldname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_fillval = (void*)malloc(HE5_BLKSIZE);
-@@ -1178,11 +1181,11 @@ hdfeos5_gdinqdatatype(VALUE mod, VALUE fieldname, VALUE attrname, VALUE group)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(group,T_STRING);
--    Check_SafeStr(group);
-+    SafeStringValue(group);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1214,7 +1217,7 @@ hdfeos5_gdnentries(VALUE mod, VALUE entrycode)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     i_entrycode = change_entrycode(RSTRING_PTR(entrycode));
- 
-     o_count = HE5_GDnentries(i_gridid, i_entrycode, &o_strbufsize);
-@@ -1374,7 +1377,7 @@ hdfeos5_gdrs2ll(VALUE mod, VALUE projcode, VALUE projparm, VALUE xdimsize, VALUE
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(projcode,T_STRING);
--    Check_SafeStr(projcode);
-+    SafeStringValue(projcode);
-     i_projcode = change_projcode(RSTRING_PTR(projcode));
-     Check_Type(xdimsize,T_FIXNUM);
-     i_xdimsize = NUM2INT(xdimsize);
-@@ -1555,7 +1558,7 @@ hdfeos5_gddefvrtregion(VALUE mod, VALUE regionid, VALUE vertobj, VALUE range)
- 
-     Check_Type(regionid,T_FIXNUM);
-     Check_Type(vertobj,T_STRING);
--    Check_SafeStr(vertobj);
-+    SafeStringValue(vertobj);
-     if (TYPE(range) == T_FLOAT) {
-       range = rb_Array(range);
-     }
-@@ -1734,9 +1737,9 @@ hdfeos5_gdwritelocattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_gridid=he5field->gdid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1769,7 +1772,7 @@ hdfeos5_gdfield_get_att(VALUE mod,VALUE  attrname)
-     i_fieldname=he5field->name;
-     i_gridid=he5field->gdid;
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_GDlocattrinfo(i_gridid, i_fieldname, i_attrname, 
-@@ -1832,9 +1835,9 @@ hdfeos5_gdwritegrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1867,7 +1870,7 @@ hdfeos5_gd_get_grpatt(VALUE mod, VALUE attrname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_GDgrpattrinfo(i_gridid, i_attrname, &o_ntype, &o_count);
-@@ -1894,7 +1897,7 @@ hdfeos5_gdsetextdata(VALUE mod, VALUE filelist, VALUE offset, VALUE size)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(filelist,T_STRING);
--    Check_SafeStr(filelist);
-+    SafeStringValue(filelist);
-     if ((TYPE(offset) == T_BIGNUM) || (TYPE(offset) == T_FIXNUM)) {
-       offset = rb_Array(offset);
-     }
-@@ -1934,7 +1937,7 @@ hdfeos5_gdgetextdata(VALUE mod, VALUE fieldname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-@@ -1964,7 +1967,7 @@ hdfeos5_gdsetalias(VALUE mod, VALUE fieldname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_rtn_val = HE5_GDsetalias(i_gridid, i_fieldname, o_aliaslist);
-@@ -1988,9 +1991,9 @@ hdfeos5_gddropalias(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -2019,9 +2022,9 @@ hdfeos5_gdaliasinfo(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -2078,7 +2081,7 @@ hdfeos5_gdgetaliaslist(VALUE mod, VALUE fldgroup)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
- 
-     o_nalias = HE5_GDgetaliaslist(i_gridid, i_fldgroup, o_aliaslist, &o_strbufsize);
-@@ -2142,7 +2145,7 @@ hdfeos5_gdsetfield(VALUE mod,VALUE fieldname)
-     i_gridid=he5grid->gdid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
-     
-     he5field = HE5GdField_init(i_fieldname, i_gridid, mod);
-diff --git a/hdfeos5main_wrap.c b/hdfeos5main_wrap.c
-index 76a2a76..e943aef 100644
---- a/hdfeos5main_wrap.c
-+++ b/hdfeos5main_wrap.c
-@@ -8,6 +8,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- VALUE rb_eHE5Error;
- VALUE cHE5;
-@@ -72,9 +75,9 @@ hdfeos5_ehopen(VALUE mod, VALUE filename, VALUE flags)
-     struct HE5 *he5file;
- 
-     Check_Type(filename,T_STRING);
--    Check_SafeStr(filename);
-+    SafeStringValue(filename);
-     Check_Type(flags,T_STRING);
--    Check_SafeStr(flags);
-+    SafeStringValue(flags);
- 
-     i_filename  = RSTRING_PTR(filename);
-     i_flags     = RSTRING_PTR(flags);
-diff --git a/hdfeos5pt_wrap.c b/hdfeos5pt_wrap.c
-index 1e5664d..d052663 100644
---- a/hdfeos5pt_wrap.c
-+++ b/hdfeos5pt_wrap.c
-@@ -9,6 +9,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- extern int   check_numbertype(char *);
- extern int   change_numbertype(char *);
-@@ -542,7 +545,7 @@ hdfeos5_ptcreate(VALUE mod, VALUE pointname)
-     file=he5file->name;
- 
-     Check_Type(pointname,T_STRING);
--    Check_SafeStr(pointname);
-+    SafeStringValue(pointname);
-     i_pointname = RSTRING_PTR(pointname);
- 
-     ptid = HE5_PTcreate(i_fid, i_pointname);
-@@ -568,7 +571,7 @@ hdfeos5_ptattach(VALUE mod, VALUE pointname)
-     i_fname=he5file->name;
- 
-     Check_Type(pointname,T_STRING);
--    Check_SafeStr(pointname);
-+    SafeStringValue(pointname);
-     i_pointname = RSTRING_PTR(pointname);
- 
-     ptid = HE5_PTattach(i_fid, i_pointname);
-@@ -754,7 +757,7 @@ hdfeos5_ptdeflevel(VALUE file, VALUE levelname, VALUE nfields, VALUE rank, VALUE
- 
-     i_nfields=NUM2INT(nfields);
-     Check_Type(levelname,T_STRING);
--    Check_SafeStr(levelname);
-+    SafeStringValue(levelname);
-     i_levelname = RSTRING_PTR(levelname);
- 
-     i_rank=ALLOCA_N(int,i_nfields*sizeof(int));
-@@ -762,14 +765,14 @@ hdfeos5_ptdeflevel(VALUE file, VALUE levelname, VALUE nfields, VALUE rank, VALUE
-     i_rank = hdfeos5_obj2cintary(rank);
- 
-     Check_Type(fieldlist,T_STRING);
--    Check_SafeStr(fieldlist);
-+    SafeStringValue(fieldlist);
-     i_fieldlist = RSTRING_PTR(fieldlist);
- 
-     dimlist = rb_Array(dimlist);
-     i_dimlist = hdfeos5_obj2clongary(dimlist);
- 
-     Check_Type(datatype,T_STRING);
--    Check_SafeStr(datatype);
-+    SafeStringValue(datatype);
-     i_datatype = RSTRING_PTR(datatype);
-     nn = HE5_EHparsestr(i_datatype, ',', pntr, slen);
-     i_array = ALLOCA_N(int, i_nfields);
-@@ -807,13 +810,13 @@ hdfeos5_ptdeflinkage(VALUE file, VALUE parent_level, VALUE child_level,VALUE lin
-     i_ptid=he5point->ptid;
- 
-     Check_Type(parent_level,T_STRING);
--    Check_SafeStr(parent_level);
-+    SafeStringValue(parent_level);
-     i_parent_level = RSTRING_PTR(parent_level);
-     Check_Type(child_level,T_STRING);
--    Check_SafeStr(child_level);
-+    SafeStringValue(child_level);
-     i_child_level = RSTRING_PTR(child_level);
-     Check_Type(linklevel,T_STRING);
--    Check_SafeStr(linklevel);
-+    SafeStringValue(linklevel);
-     i_linklevel = RSTRING_PTR(linklevel);
- 
-     o_rtn_val = HE5_PTdeflinkage(i_ptid, i_parent_level, i_child_level, i_linklevel);
-@@ -826,7 +829,7 @@ hdfeos5_ptwritelevel(VALUE mod, VALUE count, VALUE data, VALUE ntype)
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -890,9 +893,9 @@ hdfeos5_ptwriteattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count, VA
-     i_ptid=he5point->ptid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -924,7 +927,7 @@ hdfeos5_pt_get_att(VALUE mod, VALUE attrname)
-     i_ptid=he5point->ptid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_PTattrinfo(i_ptid, i_attrname, &o_ntype, &o_count);
-@@ -997,7 +1000,7 @@ hdfeos5_ptreadlevel(VALUE mod, VALUE ntype)
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1065,9 +1068,9 @@ hdfeos5_ptinqdatatype(VALUE mod, VALUE levelname, VALUE attrname, VALUE group)
-     i_ptid=he5point->ptid;
- 
-     Check_Type(levelname,T_STRING);
--    Check_SafeStr(levelname);
-+    SafeStringValue(levelname);
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
- 
-     i_levelname = RSTRING_PTR(levelname);
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1159,9 +1162,9 @@ hdfeos5_ptwritegrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_ptid=he5point->ptid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1193,7 +1196,7 @@ hdfeos5_pt_get_grpatt(VALUE mod, VALUE attrname)
-     i_ptid=he5point->ptid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_PTgrpattrinfo(i_ptid, i_attrname, &o_ntype, &o_count);
-@@ -1252,9 +1255,9 @@ hdfeos5_ptwritelocattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_ptid=he5point->ptid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1287,7 +1290,7 @@ hdfeos5_ptfield_get_att(VALUE mod,VALUE  attrname)
-     i_levelname=he5point->levelname;
-     i_ptid=he5point->ptid;
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_PTlocattrinfo(i_ptid, i_levelname, i_attrname, 
-@@ -1407,7 +1410,7 @@ hdfeos5_ptupdatelevel(VALUE mod, VALUE nrec, VALUE recs, VALUE data, VALUE ntype
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1511,7 +1514,7 @@ hdfeos5_ptchkfieldname(VALUE mod,VALUE levelname)
-     i_ptid=he5pt->ptid;
- 
-     Check_Type(levelname,T_STRING);
--    Check_SafeStr(levelname);
-+    SafeStringValue(levelname);
-     i_levelname = RSTRING_PTR(levelname);
- 
-     o_level=HE5_PTlevelindx(i_ptid, i_levelname);
-@@ -1542,7 +1545,7 @@ hdfeos5_ptsetfield(VALUE mod,VALUE fieldname)
-     i_ptid=he5pt->ptid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_strbufsize = search_levelsize(i_ptid,i_fieldname);
-@@ -1567,7 +1570,7 @@ hdfeos5_ptsetfield_level(VALUE mod,VALUE fieldname,VALUE levelname)
-     i_ptid=he5pt->ptid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_levelname = RSTRING_PTR(levelname);
- 
-diff --git a/hdfeos5sw_wrap.c b/hdfeos5sw_wrap.c
-index 846fd72..55473d6 100644
---- a/hdfeos5sw_wrap.c
-+++ b/hdfeos5sw_wrap.c
-@@ -15,6 +15,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- extern int   check_numbertype(char *);
- extern int   change_numbertype(char *);
-@@ -277,7 +280,7 @@ swnentries_count(hid_t i_swathid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_SWnentries(i_swathid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -293,7 +296,7 @@ swnentries_strbuf(hid_t i_swathid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_SWnentries(i_swathid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -318,7 +321,7 @@ hdfeos5_swcreate(VALUE mod, VALUE swathname)
-     file=he5file->name;
- 
-     Check_Type(swathname,T_STRING);
--    Check_SafeStr(swathname);
-+    SafeStringValue(swathname);
-     i_swathname = RSTRING_PTR(swathname);
- 
-     swid = HE5_SWcreate(i_fid, i_swathname);
-@@ -344,7 +347,7 @@ hdfeos5_swattach(VALUE mod, VALUE swathname)
-     i_fname=he5file->name;
- 
-     Check_Type(swathname,T_STRING);
--    Check_SafeStr(swathname);
-+    SafeStringValue(swathname);
-     i_swathname = RSTRING_PTR(swathname);
- 
-     swid = HE5_SWattach(i_fid, i_swathname);
-@@ -369,7 +372,7 @@ hdfeos5_swdefdim(VALUE mod, VALUE dimname, VALUE dim)
-     Data_Get_Struct(mod, struct HE5Sw, he5swath);
-     i_swathid=he5swath->swid;
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     Check_Type(dim,T_FIXNUM);
-     i_dimname = RSTRING_PTR(dimname);
-     i_dim = NUM2LONG(dim);
-@@ -392,7 +395,7 @@ hdfeos5_swdiminfo(VALUE mod, VALUE dimname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     i_dimname = RSTRING_PTR(dimname);
- 
-     o_ndim = HE5_SWdiminfo(i_swathid, i_dimname);
-@@ -418,9 +421,9 @@ hdfeos5_swmapinfo(VALUE mod, VALUE geodim, VALUE datadim)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(geodim,T_STRING);
--    Check_SafeStr(geodim);
-+    SafeStringValue(geodim);
-     Check_Type(datadim,T_STRING);
--    Check_SafeStr(datadim);
-+    SafeStringValue(datadim);
- 
-     i_geodim = RSTRING_PTR(geodim);
-     i_datadim = RSTRING_PTR(datadim);
-@@ -453,9 +456,9 @@ hdfeos5_swidxmapinfo(VALUE mod, VALUE geodim, VALUE datadim)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(geodim,T_STRING);
--    Check_SafeStr(geodim);
-+    SafeStringValue(geodim);
-     Check_Type(datadim,T_STRING);
--    Check_SafeStr(datadim);
-+    SafeStringValue(datadim);
-     dimsize = hdfeos5_swdiminfo(mod, geodim);
-     size    = NUM2INT(dimsize);
- 
-@@ -548,7 +551,7 @@ hdfeos5_swchunkinfo(VALUE mod, VALUE fldname)
-     Data_Get_Struct(mod, struct HE5Sw, he5swath);
-     i_swathid=he5swath->swid;
-     Check_Type(fldname,T_STRING);
--    Check_SafeStr(fldname);
-+    SafeStringValue(fldname);
-     i_fldname = RSTRING_PTR(fldname);
- 
-     o_rtn_val = HE5_SWchunkinfo(i_swathid, i_fldname, &o_chunk_rank, NULL);
-@@ -580,9 +583,9 @@ hdfeos5_swdefdimmap(VALUE mod, VALUE geodim, VALUE datadim, VALUE offset, VALUE
-     i_swathid=he5swath->swid;
- 
-     Check_Type(geodim,T_STRING);
--    Check_SafeStr(geodim);
-+    SafeStringValue(geodim);
-     Check_Type(datadim,T_STRING);
--    Check_SafeStr(datadim);
-+    SafeStringValue(datadim);
-     Check_Type(offset,T_FIXNUM);
-     Check_Type(increment,T_FIXNUM);
- 
-@@ -612,9 +615,9 @@ hdfeos5_swdefidxmap(VALUE mod, VALUE geodim, VALUE datadim, VALUE index)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(geodim,T_STRING);
--    Check_SafeStr(geodim);
-+    SafeStringValue(geodim);
-     Check_Type(datadim,T_STRING);
--    Check_SafeStr(datadim);
-+    SafeStringValue(datadim);
-     if ((TYPE(index) == T_BIGNUM) || (TYPE(index) == T_FIXNUM)) {
-       index = rb_Array(index);
-     }
-@@ -671,7 +674,7 @@ hdfeos5_swdefcomp(VALUE mod, VALUE compcode, VALUE compparm)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -701,7 +704,7 @@ hdfeos5_swdefcomchunk(VALUE mod, VALUE compcode, VALUE compparm, VALUE rank, VAL
-     i_swathid=he5swath->swid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -741,13 +744,13 @@ hdfeos5_swdefgeofield(VALUE file, VALUE fieldname, VALUE dimlist, VALUE maxdimli
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(maxdimlist,T_STRING);
--    Check_SafeStr(maxdimlist);
-+    SafeStringValue(maxdimlist);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     Check_Type(merge,T_FIXNUM);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-@@ -783,13 +786,13 @@ hdfeos5_swdefdatafield(VALUE file, VALUE fieldname, VALUE dimlist, VALUE maxdiml
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(maxdimlist,T_STRING);
--    Check_SafeStr(maxdimlist);
-+    SafeStringValue(maxdimlist);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     Check_Type(merge,T_FIXNUM);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-@@ -823,7 +826,7 @@ hdfeos5_swwritedatameta(VALUE mod, VALUE dimlist, VALUE mvalue)
-     i_swathid=he5field->swid;
- 
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(mvalue,T_FIXNUM);
- 
-     i_dimlist = RSTRING_PTR(dimlist);
-@@ -852,7 +855,7 @@ hdfeos5_swwritegeometa(VALUE mod, VALUE dimlist, VALUE mvalue)
-     i_swathid=he5field->swid;
- 
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(mvalue,T_FIXNUM);
- 
-     i_dimlist = RSTRING_PTR(dimlist);
-@@ -881,9 +884,9 @@ hdfeos5_swwriteattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count, VA
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -915,7 +918,7 @@ hdfeos5_sw_get_att(VALUE mod, VALUE attrname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_SWattrinfo(i_swathid, i_attrname, &o_ntype, &o_count);
-@@ -1163,11 +1166,11 @@ hdfeos5_swinqdatatype(VALUE mod, VALUE fieldname, VALUE attrname, VALUE group)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(group,T_STRING);
--    Check_SafeStr(group);
-+    SafeStringValue(group);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1199,7 +1202,7 @@ hdfeos5_swnentries(VALUE mod, VALUE entrycode)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     i_entrycode = change_entrycode(RSTRING_PTR(entrycode));
- 
-     o_count = HE5_SWnentries(i_swathid, i_entrycode, &o_strbufsize);
-@@ -1244,7 +1247,7 @@ hdfeos5_swwritefield(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE dat
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1295,7 +1298,7 @@ hdfeos5_swreadfield(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE ntyp
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1417,7 +1420,7 @@ hdfeos5_swdefboxregion(VALUE mod, VALUE cornerlon, VALUE cornerlat, VALUE mode)
-       cornerlat = rb_Array(cornerlat);
-     }
-     Check_Type(mode,T_STRING);
--    Check_SafeStr(mode);
-+    SafeStringValue(mode);
-     i_mode = change_subsetmode(RSTRING_PTR(mode));
-     i_cornerlon = hdfeos5_obj2cfloatary(cornerlon);
-     i_cornerlat = hdfeos5_obj2cfloatary(cornerlat);
-@@ -1455,7 +1458,7 @@ hdfeos5_swregionindex(VALUE mod, VALUE cornerlon, VALUE cornerlat, VALUE mode)
-       cornerlat = rb_Array(cornerlat);
-     }
-     Check_Type(mode,T_STRING);
--    Check_SafeStr(mode);
-+    SafeStringValue(mode);
-     i_mode = change_subsetmode(RSTRING_PTR(mode));
- 
-     i_cornerlon = hdfeos5_obj2cfloatary(cornerlon);
-@@ -1494,7 +1497,7 @@ hdfeos5_swdeftimeperiod(VALUE mod, VALUE starttime, VALUE stoptime, VALUE mode)
-       stoptime = rb_funcall(stoptime, rb_intern("to_f"), 0);
-     }
-     Check_Type(mode,T_STRING);
--    Check_SafeStr(mode);
-+    SafeStringValue(mode);
-     i_mode = change_subsetmode(RSTRING_PTR(mode));
- 
-     i_starttime = (double)NUM2DBL(starttime);
-@@ -1524,7 +1527,7 @@ hdfeos5_swextractregion(VALUE mod, VALUE regionid, VALUE externalflag)
- 
-     Check_Type(regionid,T_FIXNUM);
-     Check_Type(externalflag,T_STRING);
--    Check_SafeStr(externalflag);
-+    SafeStringValue(externalflag);
- 
-     i_regionid = NUM2INT(regionid);
-     i_externalflag = change_subsetmode(RSTRING_PTR(externalflag));
-@@ -1557,7 +1560,7 @@ hdfeos5_swextractperiod(VALUE mod, VALUE periodid, VALUE externalflag)
- 
-     Check_Type(periodid,T_FIXNUM);
-     Check_Type(externalflag,T_STRING);
--    Check_SafeStr(externalflag);
-+    SafeStringValue(externalflag);
- 
-     i_periodid = NUM2INT(periodid);
-     i_externalflag = change_subsetmode(RSTRING_PTR(externalflag));
-@@ -1600,7 +1603,7 @@ hdfeos5_swdefvrtregion(VALUE mod, VALUE regionid, VALUE vertobj, VALUE range)
- 
-     Check_Type(regionid,T_FIXNUM);
-     Check_Type(vertobj,T_STRING);
--    Check_SafeStr(vertobj);
-+    SafeStringValue(vertobj);
-     if (TYPE(range) == T_FLOAT) {
-       range = rb_Array(range);
-     }
-@@ -1631,9 +1634,9 @@ hdfeos5_swsetfillvalue(VALUE mod, VALUE fieldname,VALUE numbertype, VALUE fillva
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_numbertype = change_numbertype(RSTRING_PTR(numbertype));
- 
-@@ -1643,7 +1646,7 @@ hdfeos5_swsetfillvalue(VALUE mod, VALUE fieldname,VALUE numbertype, VALUE fillva
-     }
-     if (TYPE(fillval) == T_STRING) {
-       Check_Type(fillval,T_STRING);
--      Check_SafeStr(fillval);
-+      SafeStringValue(fillval);
-       i_fillval = RSTRING_PTR(fillval);
-     }
- 
-@@ -1669,7 +1672,7 @@ hdfeos5_swgetfillvalue(VALUE mod,VALUE fieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_fillval = (void*)malloc(HE5_BLKSIZE);
-@@ -1823,7 +1826,7 @@ hdfeos5_swgeomapinfo(VALUE mod, VALUE geodim)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(geodim,T_STRING);
--    Check_SafeStr(geodim);
-+    SafeStringValue(geodim);
-     i_geodim = RSTRING_PTR(geodim);
- 
-     o_rtn_val = HE5_SWgeomapinfo(i_swathid, i_geodim);
-@@ -1850,9 +1853,9 @@ hdfeos5_swwritegrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1884,7 +1887,7 @@ hdfeos5_sw_get_grpatt(VALUE mod, VALUE attrname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_SWgrpattrinfo(i_swathid, i_attrname, &o_ntype, &o_count);
-@@ -1940,9 +1943,9 @@ hdfeos5_swwritegeogrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE cou
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
-     if (TYPE(datbuf) == T_FLOAT) {
-       datbuf = rb_Array(datbuf);
-@@ -1976,7 +1979,7 @@ hdfeos5_sw_get_geogrpatt(VALUE mod, VALUE attrname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_SWgeogrpattrinfo(i_swathid, i_attrname, &o_ntype, &o_count);
-@@ -2035,9 +2038,9 @@ hdfeos5_swwritelocattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_swathid=he5field->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -2070,7 +2073,7 @@ hdfeos5_swfield_get_att(VALUE mod,VALUE  attrname)
-     i_fieldname=he5field->name;
-     i_swathid=he5field->swid;
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_SWlocattrinfo(i_swathid, i_fieldname, i_attrname, 
-@@ -2132,13 +2135,13 @@ hdfeos5_prdefine(VALUE mod, VALUE profilename, VALUE dimlist, VALUE maxdimlist,
-     i_swathid=he5swath->swid;
- 
-     Check_Type(profilename,T_STRING);
--    Check_SafeStr(profilename);
-+    SafeStringValue(profilename);
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(maxdimlist,T_STRING);
--    Check_SafeStr(maxdimlist);
-+    SafeStringValue(maxdimlist);
-     Check_Type(datatype_id,T_STRING);
--    Check_SafeStr(datatype_id);
-+    SafeStringValue(datatype_id);
- 
-     i_profilename = RSTRING_PTR(profilename);
-     i_dimlist = RSTRING_PTR(dimlist);
-@@ -2170,7 +2173,7 @@ hdfeos5_prwrite(VALUE mod, VALUE profilename, VALUE start, VALUE stride, VALUE e
-     i_swathid=he5swath->swid;
- 
-     Check_Type(profilename,T_STRING);
--    Check_SafeStr(profilename);
-+    SafeStringValue(profilename);
-     start = rb_Array(start);
-     stride = rb_Array(stride);
-     edge = rb_Array(edge);
-@@ -2212,7 +2215,7 @@ hdfeos5_prread(VALUE mod, VALUE profilename, VALUE start, VALUE stride, VALUE ed
-     i_swathid=he5swath->swid;
- 
-     Check_Type(profilename,T_STRING);
--    Check_SafeStr(profilename);
-+    SafeStringValue(profilename);
-     start = rb_Array(start);
-     stride = rb_Array(stride);
-     edge = rb_Array(edge);
-@@ -2247,7 +2250,7 @@ hdfeos5_prreclaimspace(VALUE mod, VALUE profilename)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(profilename,T_STRING);
--    Check_SafeStr(profilename);
-+    SafeStringValue(profilename);
-     i_profilename = RSTRING_PTR(profilename);
- 
-     o_buffer = (void*)malloc(HE5_BLKSIZE);
-@@ -2308,7 +2311,7 @@ hdfeos5_prinfo(VALUE mod, VALUE profilename)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(profilename,T_STRING);
--    Check_SafeStr(profilename);
-+    SafeStringValue(profilename);
-     i_profilename = RSTRING_PTR(profilename);
- 
-     o_rtn_val = HE5_PRinfo(i_swathid, i_profilename, &o_rank, &o_dims, &o_maxdims, &o_ntype, o_dimlist, NULL);
-@@ -2338,9 +2341,9 @@ hdfeos5_prwritegrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
-     if (TYPE(datbuf) == T_FLOAT) {
-       datbuf = rb_Array(datbuf);
-@@ -2374,7 +2377,7 @@ hdfeos5_pr_get_grpatt(VALUE mod, VALUE attrname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_PRgrpattrinfo(i_swathid, i_attrname, &o_ntype, &o_count);
-@@ -2428,7 +2431,7 @@ hdfeos5_swsetalias(VALUE mod, VALUE fieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_rtn_val = HE5_SWsetalias(i_swathid, i_fieldname, o_aliaslist);
-@@ -2452,9 +2455,9 @@ hdfeos5_swdropalias(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -2506,9 +2509,9 @@ hdfeos5_swaliasinfo(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -2538,7 +2541,7 @@ hdfeos5_swgetaliaslist(VALUE mod, VALUE fldgroup)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
- 
-     o_rtn_val = HE5_SWgetaliaslist(i_swathid, i_fldgroup, o_aliaslist, &o_strbufsize);
-@@ -2563,10 +2566,10 @@ hdfeos5_swfldrename(VALUE mod, VALUE oldfieldname,VALUE newfieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(oldfieldname,T_STRING);
--    Check_SafeStr(oldfieldname);
-+    SafeStringValue(oldfieldname);
-     i_oldfieldname = RSTRING_PTR(oldfieldname);
-     Check_Type(newfieldname,T_STRING);
--    Check_SafeStr(newfieldname);
-+    SafeStringValue(newfieldname);
-     i_newfieldname = RSTRING_PTR(newfieldname);
- 
- 
-@@ -2591,9 +2594,9 @@ hdfeos5_swmountexternal(VALUE mod, VALUE fldgroup, VALUE extfilename)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(extfilename,T_STRING);
--    Check_SafeStr(extfilename);
-+    SafeStringValue(extfilename);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_extfilename = RSTRING_PTR(extfilename);
-@@ -2618,7 +2621,7 @@ hdfeos5_swunmount(VALUE mod, VALUE fldgroup, VALUE fileid)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(fileid,T_FIXNUM);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-@@ -2645,9 +2648,9 @@ hdfeos5_swreadexternal(VALUE mod, VALUE fldgroup, VALUE fieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-@@ -2674,7 +2677,7 @@ hdfeos5_swsetextdata(VALUE mod, VALUE filelist, VALUE offset, VALUE size)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(filelist,T_STRING);
--    Check_SafeStr(filelist);
-+    SafeStringValue(filelist);
-     if ((TYPE(offset) == T_BIGNUM) || (TYPE(offset) == T_FIXNUM)) {
-       offset = rb_Array(offset);
-     }
-@@ -2714,7 +2717,7 @@ hdfeos5_swgetextdata(VALUE mod, VALUE fieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-@@ -2744,7 +2747,7 @@ hdfeos5_swindexinfo(VALUE mod, VALUE regionid, VALUE object)
- 
-     Check_Type(regionid,T_FIXNUM);
-     Check_Type(object,T_STRING);
--    Check_SafeStr(object);
-+    SafeStringValue(object);
- 
-     i_regionid = NUM2INT(regionid);
-     i_object = RSTRING_PTR(object);
-@@ -2811,7 +2814,7 @@ hdfeos5_swsetfield(VALUE mod,VALUE fieldname)
-     i_swathid=he5swath->swid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
-     
-     he5field = HE5SwField_init(i_fieldname, i_swathid, mod);
-diff --git a/hdfeos5za_wrap.c b/hdfeos5za_wrap.c
-index a49725f..f26a809 100644
---- a/hdfeos5za_wrap.c
-+++ b/hdfeos5za_wrap.c
-@@ -15,6 +15,9 @@
- #ifndef RSTRING_PTR
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
- #endif
-+#ifndef SafeStringValue
-+#define SafeStringValue(s) Check_SafeStr(s)
-+#endif
- 
- extern int   check_numbertype(char *);
- extern int   change_numbertype(char *);
-@@ -275,7 +278,7 @@ zanentries_count(hid_t i_zaid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_ZAnentries(i_zaid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -291,7 +294,7 @@ zanentries_strbuf(hid_t i_zaid, VALUE entrycode)
-     long o_count;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     c_entrycode = RSTRING_PTR(entrycode);
- 
-     o_count = HE5_ZAnentries(i_zaid, change_entrycode(c_entrycode), &o_strbufsize);
-@@ -316,7 +319,7 @@ hdfeos5_zacreate(VALUE mod, VALUE zaname)
-     file=he5file->name;
- 
-     Check_Type(zaname,T_STRING);
--    Check_SafeStr(zaname);
-+    SafeStringValue(zaname);
-     i_zaname = RSTRING_PTR(zaname);
- 
-     zaid = HE5_ZAcreate(i_fid, i_zaname);
-@@ -342,7 +345,7 @@ hdfeos5_zaattach(VALUE mod, VALUE zaname)
-     i_fname=he5file->name;
- 
-     Check_Type(zaname,T_STRING);
--    Check_SafeStr(zaname);
-+    SafeStringValue(zaname);
-     i_zaname = RSTRING_PTR(zaname);
- 
-     zaid = HE5_ZAattach(i_fid, i_zaname);
-@@ -367,7 +370,7 @@ hdfeos5_zadefdim(VALUE mod, VALUE dimname, VALUE dim)
-     Data_Get_Struct(mod, struct HE5Za, he5za);
-     i_zaid=he5za->zaid;
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     Check_Type(dim,T_FIXNUM);
-     i_dimname = RSTRING_PTR(dimname);
-     i_dim = NUM2LONG(dim);
-@@ -390,7 +393,7 @@ hdfeos5_zadiminfo(VALUE mod, VALUE dimname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(dimname,T_STRING);
--    Check_SafeStr(dimname);
-+    SafeStringValue(dimname);
-     i_dimname = RSTRING_PTR(dimname);
- 
-     o_ndim = HE5_ZAdiminfo(i_zaid, i_dimname);
-@@ -501,7 +504,7 @@ hdfeos5_zadefcomp(VALUE mod, VALUE compcode, VALUE compparm)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -531,7 +534,7 @@ hdfeos5_zadefcomchunk(VALUE mod, VALUE compcode, VALUE compparm, VALUE rank, VAL
-     i_zaid=he5za->zaid;
- 
-     Check_Type(compcode,T_STRING);
--    Check_SafeStr(compcode);
-+    SafeStringValue(compcode);
-     if ((TYPE(compparm) == T_BIGNUM) || (TYPE(compparm) == T_FIXNUM)) {
-       compparm = rb_Array(compparm);
-     }
-@@ -570,13 +573,13 @@ hdfeos5_zadefine(VALUE file, VALUE fieldname, VALUE dimlist, VALUE maxdimlist, V
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(maxdimlist,T_STRING);
--    Check_SafeStr(maxdimlist);
-+    SafeStringValue(maxdimlist);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_dimlist = RSTRING_PTR(dimlist);
-@@ -608,7 +611,7 @@ hdfeos5_zawritedatameta(VALUE mod, VALUE dimlist, VALUE mvalue)
-     i_zaid=he5field->zaid;
- 
-     Check_Type(dimlist,T_STRING);
--    Check_SafeStr(dimlist);
-+    SafeStringValue(dimlist);
-     Check_Type(mvalue,T_FIXNUM);
- 
-     i_dimlist = RSTRING_PTR(dimlist);
-@@ -638,9 +641,9 @@ hdfeos5_zawriteattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count, VA
-     i_zaid=he5za->zaid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -672,7 +675,7 @@ hdfeos5_za_get_att(VALUE mod, VALUE attrname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_ZAattrinfo(i_zaid, i_attrname, &o_ntype, &o_count);
-@@ -809,11 +812,11 @@ hdfeos5_zainqdatatype(VALUE mod, VALUE fieldname, VALUE attrname, VALUE group)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(group,T_STRING);
--    Check_SafeStr(group);
-+    SafeStringValue(group);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_attrname = RSTRING_PTR(attrname);
-@@ -845,7 +848,7 @@ hdfeos5_zachunkinfo(VALUE mod, VALUE fldname)
-     Data_Get_Struct(mod, struct HE5Za, he5za);
-     i_zaid=he5za->zaid;
-     Check_Type(fldname,T_STRING);
--    Check_SafeStr(fldname);
-+    SafeStringValue(fldname);
-     i_fldname = RSTRING_PTR(fldname);
- 
-     o_rtn_val = HE5_ZAchunkinfo(i_zaid, i_fldname, &o_chunk_rank, NULL);
-@@ -876,7 +879,7 @@ hdfeos5_zanentries(VALUE mod, VALUE entrycode)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(entrycode,T_STRING);
--    Check_SafeStr(entrycode);
-+    SafeStringValue(entrycode);
-     i_entrycode = change_entrycode(RSTRING_PTR(entrycode));
- 
-     o_count = HE5_ZAnentries(i_zaid, i_entrycode, &o_strbufsize);
-@@ -921,7 +924,7 @@ hdfeos5_zawrite(VALUE mod, VALUE start, VALUE stride, VALUE count, VALUE data, V
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -972,7 +975,7 @@ hdfeos5_zaread(VALUE mod, VALUE start, VALUE stride, VALUE edge, VALUE ntype)
- {
-     char *chk_ntype;
-     Check_Type(ntype,T_STRING);
--    Check_SafeStr(ntype);
-+    SafeStringValue(ntype);
-     chk_ntype = RSTRING_PTR(ntype);
- 
-     switch (check_numbertype(chk_ntype)){
-@@ -1088,9 +1091,9 @@ hdfeos5_zasetfillvalue(VALUE mod, VALUE fieldname,VALUE numbertype, VALUE fillva
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     i_fieldname = RSTRING_PTR(fieldname);
-     i_numbertype = change_numbertype(RSTRING_PTR(numbertype));
- 
-@@ -1100,7 +1103,7 @@ hdfeos5_zasetfillvalue(VALUE mod, VALUE fieldname,VALUE numbertype, VALUE fillva
-     }
-     if (TYPE(fillval) == T_STRING) {
-       Check_Type(fillval,T_STRING);
--      Check_SafeStr(fillval);
-+      SafeStringValue(fillval);
-       i_fillval = RSTRING_PTR(fillval);
-     }
- 
-@@ -1126,7 +1129,7 @@ hdfeos5_zagetfillvalue(VALUE mod,VALUE fieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_fillval = (void*)malloc(HE5_BLKSIZE);
-@@ -1155,9 +1158,9 @@ hdfeos5_zawritegrpattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_zaid=he5za->zaid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1189,7 +1192,7 @@ hdfeos5_za_get_grpatt(VALUE mod, VALUE attrname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_ZAgrpattrinfo(i_zaid, i_attrname, &o_ntype, &o_count);
-@@ -1248,9 +1251,9 @@ hdfeos5_zawritelocattr(VALUE mod, VALUE attrname, VALUE numbertype, VALUE count,
-     i_zaid=he5field->zaid;
- 
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     Check_Type(numbertype,T_STRING);
--    Check_SafeStr(numbertype);
-+    SafeStringValue(numbertype);
-     count = rb_Array(count);
- 
-     i_attrname = RSTRING_PTR(attrname);
-@@ -1284,7 +1287,7 @@ hdfeos5_zafield_get_att(VALUE mod,VALUE  attrname)
-     i_fieldname=he5field->name;
-     i_zaid=he5field->zaid;
-     Check_Type(attrname,T_STRING);
--    Check_SafeStr(attrname);
-+    SafeStringValue(attrname);
-     i_attrname = RSTRING_PTR(attrname);
- 
-     o_rtn_val = HE5_ZAlocattrinfo(i_zaid, i_fieldname, i_attrname, 
-@@ -1344,7 +1347,7 @@ hdfeos5_zasetalias(VALUE mod, VALUE fieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-     o_rtn_val = HE5_ZAsetalias(i_zaid, i_fieldname, o_aliaslist);
-@@ -1368,9 +1371,9 @@ hdfeos5_zadropalias(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -1423,9 +1426,9 @@ hdfeos5_zaaliasinfo(VALUE mod, VALUE fldgroup, VALUE aliasname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(aliasname,T_STRING);
--    Check_SafeStr(aliasname);
-+    SafeStringValue(aliasname);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_aliasname = RSTRING_PTR(aliasname);
-@@ -1456,7 +1459,7 @@ hdfeos5_zagetaliaslist(VALUE mod, VALUE fldgroup)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
- 
-     o_rtn_val = HE5_ZAgetaliaslist(i_zaid, i_fldgroup, o_aliaslist, &o_strbufsize);
-@@ -1481,10 +1484,10 @@ hdfeos5_zafldrename(VALUE mod, VALUE oldfieldname,VALUE newfieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(oldfieldname,T_STRING);
--    Check_SafeStr(oldfieldname);
-+    SafeStringValue(oldfieldname);
-     i_oldfieldname = RSTRING_PTR(oldfieldname);
-     Check_Type(newfieldname,T_STRING);
--    Check_SafeStr(newfieldname);
-+    SafeStringValue(newfieldname);
-     i_newfieldname = RSTRING_PTR(newfieldname);
- 
- 
-@@ -1509,9 +1512,9 @@ hdfeos5_zamountexternal(VALUE mod, VALUE fldgroup, VALUE extfilename)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(extfilename,T_STRING);
--    Check_SafeStr(extfilename);
-+    SafeStringValue(extfilename);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_extfilename = RSTRING_PTR(extfilename);
-@@ -1536,7 +1539,7 @@ hdfeos5_zaunmount(VALUE mod, VALUE fldgroup, VALUE fileid)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(fileid,T_FIXNUM);
- 
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-@@ -1563,9 +1566,9 @@ hdfeos5_zareadexternal(VALUE mod, VALUE fldgroup, VALUE fieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fldgroup,T_STRING);
--    Check_SafeStr(fldgroup);
-+    SafeStringValue(fldgroup);
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fldgroup = change_groupcode(RSTRING_PTR(fldgroup));
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-@@ -1592,7 +1595,7 @@ hdfeos5_zasetextdata(VALUE mod, VALUE filelist, VALUE offset, VALUE size)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(filelist,T_STRING);
--    Check_SafeStr(filelist);
-+    SafeStringValue(filelist);
-     if ((TYPE(offset) == T_BIGNUM) || (TYPE(offset) == T_FIXNUM)) {
-       offset = rb_Array(offset);
-     }
-@@ -1632,7 +1635,7 @@ hdfeos5_zagetextdata(VALUE mod, VALUE fieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
- 
-     i_fieldname = RSTRING_PTR(fieldname);
- 
-@@ -1701,7 +1704,7 @@ hdfeos5_zasetfield(VALUE mod,VALUE fieldname)
-     i_zaid=he5za->zaid;
- 
-     Check_Type(fieldname,T_STRING);
--    Check_SafeStr(fieldname);
-+    SafeStringValue(fieldname);
-     i_fieldname = RSTRING_PTR(fieldname);
-     
-     he5field = HE5ZaField_init(i_fieldname, i_zaid, mod);
--- 
-1.7.2.3
-
diff --git a/debian/patches/0004-update-ChangeLog.patch b/debian/patches/0004-update-ChangeLog.patch
deleted file mode 100644
index ef52163..0000000
--- a/debian/patches/0004-update-ChangeLog.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 2dc89d15f057c4e64d812964defca138eca48ffe Mon Sep 17 00:00:00 2001
-From: koshiro <koshiro>
-Date: Tue, 28 Dec 2010 01:44:05 +0000
-Subject: [PATCH 4/4] * update ChangeLog
-
----
- ChangeLog |   13 +++++++++++++
- 1 files changed, 13 insertions(+), 0 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 16dc8be..273579f 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -6,6 +6,19 @@ This file is generated automatically by
-  This script is available from  http://www.red-bean.com/cvs2cl/
- 
- 
-+2010-12-28 Tuesday 10:36  koshiro
-+
-+	* hdfeos5_chkdatatype.c (1.5), hdfeos5_obj2cary.c (1.5),
-+	  hdfeos5gd_wrap.c (1.6), hdfeos5main_wrap.c (1.4),
-+	  hdfeos5pt_wrap.c (1.4), hdfeos5sw_wrap.c (1.13), hdfeos5za_wrap.c
-+	  (1.7):
-+	  * Ruby 1.9.2 compatibility
-+
-+2010-04-05 Monday 15:58  koshiro
-+
-+	* ChangeLog (1.9):
-+	  * update ChangeLog
-+
- 2010-04-05 Monday 15:55  koshiro
- 
- 	* hdfeos5_chkdatatype.c (1.4), hdfeos5_obj2cary.c (1.4),
--- 
-1.7.2.3
-
diff --git a/debian/patches/0005-Added-comments-to-the-lines-that-cause-error-messagi.patch b/debian/patches/0005-Added-comments-to-the-lines-that-cause-error-messagi.patch
deleted file mode 100644
index df43c15..0000000
--- a/debian/patches/0005-Added-comments-to-the-lines-that-cause-error-messagi.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 0977bce67d77317acced1e845036d39fcfe4f39f Mon Sep 17 00:00:00 2001
-From: horinout <horinout>
-Date: Fri, 18 Feb 2011 08:32:29 +0000
-Subject: [PATCH] * Added comments to the lines that cause error messaging, which is not
-   due to actual errors.
-
----
- test/test_pt.rb |   14 +++++++-------
- 1 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/test/test_pt.rb b/test/test_pt.rb
-index e8793af..cfaa6ab 100644
---- a/test/test_pt.rb
-+++ b/test/test_pt.rb
-@@ -121,9 +121,9 @@ time= [100,110,120,130,140]
- dname1.writelevel(count, time,"float")
- 
- dname1=point8.var("Latitude")
--count =[5]
--time = NArray.float(6)
--time = [10,10,20,30,40]
-+count =[3]
-+#time = NArray.float(6)
-+time = [10,10,20]
- dname1.writelevel(count, time,"float")
- 
- dname1=point8.var("DeployDate")
-@@ -198,7 +198,7 @@ p file4.has_point?()
- point8=file4.point("FixedBuoy point")
- p point8.getlevelname()
- dname1=point8.var("Temperature")
--p dname1.get_vars_float()
-+p dname1.get_vars_float()  # error message is shown but it's normal
- dname1=point8.var("Latitude")
- p dname1.get_vars_double()
- dname1=point8.var("DeployDate")
-@@ -211,7 +211,7 @@ p dname1.natts
- p dname1.fieldinfo()
- p dname1.get
- p dname1.fwdlink
--p dname1.bcklink
-+#p dname1.bcklink
- point8.detach
- 
- point8=file4.point("FixedBuoy point")
-@@ -233,8 +233,8 @@ p dname1.ndims
- p dname1.dim_names
- p dname1.natts
- p dname1.fieldinfo()
--p dname1.get
--p dname1.get_vars_double()
-+p dname1.get                # error message is shown but it's normal
-+p dname1.get_vars_double()  # error message is shown but it's normal
- point9.detach                         
- file4.close
- 
--- 
-1.7.4.1
-
diff --git a/debian/patches/FixLibraryPath b/debian/patches/FixLibraryPath
new file mode 100644
index 0000000..dae5cf7
--- /dev/null
+++ b/debian/patches/FixLibraryPath
@@ -0,0 +1,49 @@
+--- ruby-hdfeos5.orig/extconf.rb
++++ ruby-hdfeos5/extconf.rb
+@@ -1,6 +1,6 @@
+ require "mkmf"
+ 
+-dir_config('narray',$sitearchdir,$sitearchdir)
++dir_config('narray',$archdir,$archdir)
+ 
+ if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
+ print <<EOS
+@@ -14,7 +14,15 @@
+    exit(-1)
+ end
+ 
+-dir_config('hdf5',$sitearchdir,$sitearchdir)
++dir_config('gctp', $archdir, $archdir)
++if ( ! have_library("gctp") ) then
++  print <<-EOS
++  ** configure error **
++  EOS
++  exit(-1)
++end
++
++dir_config('hdf5',$archdir,$archdir)
+ 
+ if ( ! ( have_header("hdf5.h") && have_library("hdf5")  ) )then
+   print <<-EOS
+@@ -32,9 +40,9 @@
+   exit(-1)
+ end
+ 
+-dir_config('hdfeos5',$sitearchdir,$sitearchdir)
++dir_config('hdfeos5',"/usr/include/hdf-eos5",$archdir)
+ 
+-if ( ! ( have_header("HE5_HdfEosDef.h") && have_library("Gctp") && have_library("he5_hdfeos")  ) )then
++if ( ! ( have_header("HE5_HdfEosDef.h") && have_library("he5_hdfeos")  ) )then
+   print <<-EOS
+     ** configure error **  
+        Header hdfeos5.h or the compiled hdfeos5 library is not found. 
+@@ -68,8 +76,7 @@
+    when /^all:/
+       newmkfl.puts(line)
+       newmkfl.puts("")         
+-      newmkfl.puts("test: all")            # insert the "test" target
+-      newmkfl.puts("\t\t at cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..") 
++      newmkfl.puts("\t\t-@( [ ! -d test-lib/numru ] && ( mkdir -p test-lib/numru && cd test-lib/numru && ln -s ../../hdfeos5raw.so hdfeos5raw.so && ln -s ../../lib/hdfeos5.rb hdfeos5.rb )) ")
+    else
+       newmkfl.puts(line)
+    end
diff --git a/debian/patches/FixTestPath b/debian/patches/FixTestPath
new file mode 100644
index 0000000..074842b
--- /dev/null
+++ b/debian/patches/FixTestPath
@@ -0,0 +1,44 @@
+--- ruby-hdfeos5.orig/test/test_za.rb
++++ ruby-hdfeos5/test/test_za.rb
+@@ -7,7 +7,7 @@
+ ############################################################################### OK
+ ##### he5_za_setup.c
+ ############################################################################### OK
+-filename1 = "test_za.he5"
++filename1 = "test/test_za.he5"
+ print "creating ",filename1,"...\n"
+ file1=HE5.open(filename1,"w")
+ za1=file1.zacreate("za1")
+--- ruby-hdfeos5.orig/test/test_pt.rb
++++ ruby-hdfeos5/test/test_pt.rb
+@@ -9,7 +9,7 @@
+ ############################################################################### OK
+ # sample 1
+ ############################################################################### OK
+-filename1 = "test_pt.he5"
++filename1 = "test/test_pt.he5"
+ print "creating ",filename1,"...\n"
+ file1=HE5.open(filename1,"w")
+ point1=file1.ptcreate("Simple point")
+--- ruby-hdfeos5.orig/test/test_gd.rb
++++ ruby-hdfeos5/test/test_gd.rb
+@@ -5,7 +5,7 @@
+ ############################################################################### OK
+ ##### OMI ƒf[ƒ^‚ð“ǂݍž‚ñ‚ōì‹Æ‚ª‚Å‚«‚é‚悤‚É‚·‚é
+ ############################################################################### OK
+-filename1 = "OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5"
++filename1 = "test/OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5"
+ print "reading ",filename1,"...\n"
+ file1=HE5.open(filename1,"r")
+ p file1.has_swath?()
+--- ruby-hdfeos5.orig/test/test_sw.rb
++++ ruby-hdfeos5/test/test_sw.rb
+@@ -5,7 +5,7 @@
+ ############################################################################### OK
+ ##### MLS ƒf[ƒ^‚ð“ǂݍž‚ñ‚ōì‹Æ‚ª‚Å‚«‚é‚悤‚É‚·‚é
+ ############################################################################### OK
+-filename1 = "MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5"
++filename1 = "test/MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5"
+ print "reading ",filename1,"...\n"
+ file1=HE5.open(filename1,"r")
+ p file1.has_swath?()
diff --git a/debian/patches/add-test-target.patch b/debian/patches/add-test-target.patch
deleted file mode 100644
index 748f025..0000000
--- a/debian/patches/add-test-target.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- ruby-hdfeos5.orig/extconf.rb
-+++ ruby-hdfeos5/extconf.rb
-@@ -59,8 +59,11 @@
-    when /^all:/
-       newmkfl.puts(line)
-       newmkfl.puts("")
--      newmkfl.puts("test: all")            # insert the "test" target
--      newmkfl.puts("\t\t at cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..")
-+      newmkfl.puts("\t\t-@( [ ! -d lib/numru ] && ( mkdir -p lib/numru && cd lib/numru && ln -s ../../hdfeos5raw.so hdfeos5raw.so && ln -s ../hdfeos5.rb hdfeos5.rb )) ")
-+      newmkfl.puts("\t\tcd test && /usr/bin/ruby$(CDBS_RUBY_VER) -I../lib test_pt.rb 1>/dev/null && cd ..")
-+      newmkfl.puts("\t\tcd test && /usr/bin/ruby$(CDBS_RUBY_VER) -I../lib test_sw.rb 1>/dev/null && cd ..")
-+      newmkfl.puts("\t\tcd test && /usr/bin/ruby$(CDBS_RUBY_VER) -I../lib test_za.rb 1>/dev/null && cd ..")
-+      newmkfl.puts("\t\t-@( [ -d lib/numru ] && ( rm -rf lib/numru ))")
-    else
-       newmkfl.puts(line)
-    end
diff --git a/debian/patches/fix-extconf-rb.patch b/debian/patches/fix-extconf-rb.patch
deleted file mode 100644
index 59b10a7..0000000
--- a/debian/patches/fix-extconf-rb.patch
+++ /dev/null
@@ -1,54 +0,0 @@
---- ruby-hdfeos5.orig/extconf.rb
-+++ ruby-hdfeos5/extconf.rb
-@@ -1,11 +1,11 @@
- require "mkmf"
- 
--dir_config('narray',$sitearchdir,$sitearchdir)
-+dir_config('narray',$archdir,$archdir)
- 
- if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
- print <<EOS
--** configure error **  
--   Header narray.h or narray_config.h is not found. If you have these files in 
-+** configure error **
-+   Header narray.h or narray_config.h is not found. If you have these files in
-    /narraydir/include, try the following:
- 
-    % ruby extconf.rb --with-narray-include=/narraydir/include
-@@ -14,12 +14,21 @@
-    exit(-1)
- end
- 
--dir_config('hdfeos5',$sitearchdir,$sitearchdir)
-+dir_config('gctp', $archdir, $archdir)
-+if ( ! have_library("gctp") ) then
-+  print <<-EOS
-+  ** configure error **
-+  debian specific!
-+  EOS
-+  exit(-1)
-+end
-+
-+dir_config('hdfeos5',$archdir,$archdir)
- 
- if ( ! ( have_header("hdf5.h") && have_header("HE5_HdfEosDef.h") && have_library("he5_hdfeos") && have_library("hdf5")  ) )then
-   print <<-EOS
--    ** configure error **  
--       Header hdfeos5.h or the compiled hdfeos5 library is not found. 
-+    ** configure error **
-+       Header hdfeos5.h or the compiled hdfeos5 library is not found.
-        If you have the library installed under /hdfeos5dir (that is, hdfeos5.h is
-        in /hdfeos5dir/include and the library in /hdfeos5dir/lib/),
-        try the following:
-@@ -49,9 +58,9 @@
-       newmkfl.puts("\t\t@$(RM) *.he5  Makefile.orig")
-    when /^all:/
-       newmkfl.puts(line)
--      newmkfl.puts("")         
-+      newmkfl.puts("")
-       newmkfl.puts("test: all")            # insert the "test" target
--      newmkfl.puts("\t\t at cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..") 
-+      newmkfl.puts("\t\t at cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..")
-    else
-       newmkfl.puts(line)
-    end
diff --git a/debian/patches/series b/debian/patches/series
index a8cd349..105a54e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,2 @@
-0001-Ruby-1.9-compatibility.patch
-0002-update-ChangeLog.patch
-0003-Ruby-1.9.2-compatibility.patch
-0004-update-ChangeLog.patch
-0005-Added-comments-to-the-lines-that-cause-error-messagi.patch
-fix-extconf-rb.patch
-add-test-target.patch
+FixLibraryPath
+FixTestPath
diff --git a/debian/ruby-tests.rb b/debian/ruby-tests.rb
new file mode 100644
index 0000000..a0c34c2
--- /dev/null
+++ b/debian/ruby-tests.rb
@@ -0,0 +1 @@
+system("#{ENV['RUBY_TEST_BIN']} -Itest-lib test/test_*.rb") or raise
diff --git a/debian/rules b/debian/rules
index 513966b..730e55e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,32 +1,12 @@
 #!/usr/bin/make -f
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/ruby-pkg-tools/1/class/ruby-common.mk
-include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+%:
+	dh $@ --with ruby --buildsystem ruby
 
-HDFEOS5_RUBY_VERSIONS = 1.8 1.9.1
-LIB_PACKAGE_FILTER = %-ruby $(patsubst %,\%-ruby%,$(HDFEOS5_RUBY_VERSIONS))
-DEB_AUTO_CLEANUP_RCS := yes
-DEB_RUBY_SETUP_CMD = extconf.rb
-DEB_RUBY_SETUP_ARGS := \
-	--with-hdfeos5-dir=/usr/lib \
-	--with-hdfeos5-include=/usr/include/hdf-eos5
-cdbs_pkgdir = $(CURDIR)/debian/$(cdbs_curpkg)
-cdbs_ruby_libdir_ver = $(cdbs_pkgdir)$(DEB_RUBY_LIBDIR)
-cdbs_ruby_archdir_ver = $(cdbs_pkgdir)$(DEB_RUBY_ARCHDIR)
-DEB_RUBY_INSTALL_ARGS = DESTDIR=$(cdbs_pkgdir) \
-	sitelibdir=$(cdbs_ruby_libdir_ver) \
-        sitearchdir=$(cdbs_ruby_archdir_ver)
+override_dh_strip:
+	dh_strip --dbg-package=ruby-hdfeos5-dbg
 
-$(patsubst %,install/%,$(DEB_RUBY_REAL_LIB_PACKAGES)) :: install/% :
-	cd $(DEB_SRCDIR) 
-	[ ! -f Makefile ] || $(MAKE) distclean
-	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_RUBY_ARGS) $(DEB_RUBY_SETUP_CMD) $(DEB_RUBY_SETUP_ARGS)
-	CDBS_RUBY_VER=$(cdbs_ruby_ver) $(MAKE)
-	$(MAKE) install $(DEB_RUBY_INSTALL_ARGS)
-
-clean::
-	-[ ! -f Makefile ] || $(MAKE) distclean
-	-[ ! -d lib/numru ] || rm -rf lib/numru
-	rm -f debian/*.log
-	rm -f test/test*.he5
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -f *.he5
+	rm -rf test-lib
diff --git a/extconf.rb b/extconf.rb
index 7cceae4..10a8e65 100644
--- a/extconf.rb
+++ b/extconf.rb
@@ -1,6 +1,6 @@
 require "mkmf"
 
-dir_config('narray',$sitearchdir,$sitearchdir)
+dir_config('narray',$archdir,$archdir)
 
 if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
 print <<EOS
@@ -14,7 +14,15 @@ EOS
    exit(-1)
 end
 
-dir_config('hdf5',$sitearchdir,$sitearchdir)
+dir_config('gctp', $archdir, $archdir)
+if ( ! have_library("gctp") ) then
+  print <<-EOS
+  ** configure error **
+  EOS
+  exit(-1)
+end
+
+dir_config('hdf5',$archdir,$archdir)
 
 if ( ! ( have_header("hdf5.h") && have_library("hdf5")  ) )then
   print <<-EOS
@@ -32,9 +40,9 @@ if ( ! ( have_header("hdf5.h") && have_library("hdf5")  ) )then
   exit(-1)
 end
 
-dir_config('hdfeos5',$sitearchdir,$sitearchdir)
+dir_config('hdfeos5',"/usr/include/hdf-eos5",$archdir)
 
-if ( ! ( have_header("HE5_HdfEosDef.h") && have_library("Gctp") && have_library("he5_hdfeos")  ) )then
+if ( ! ( have_header("HE5_HdfEosDef.h") && have_library("he5_hdfeos")  ) )then
   print <<-EOS
     ** configure error **  
        Header hdfeos5.h or the compiled hdfeos5 library is not found. 
@@ -68,8 +76,7 @@ oldmkfl.each_line{ |line|
    when /^all:/
       newmkfl.puts(line)
       newmkfl.puts("")         
-      newmkfl.puts("test: all")            # insert the "test" target
-      newmkfl.puts("\t\t at cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..") 
+      newmkfl.puts("\t\t-@( [ ! -d test-lib/numru ] && ( mkdir -p test-lib/numru && cd test-lib/numru && ln -s ../../hdfeos5raw.so hdfeos5raw.so && ln -s ../../lib/hdfeos5.rb hdfeos5.rb )) ")
    else
       newmkfl.puts(line)
    end
diff --git a/test/test_gd.rb b/test/test_gd.rb
index d120d41..b797dc8 100644
--- a/test/test_gd.rb
+++ b/test/test_gd.rb
@@ -5,7 +5,7 @@ include NumRu
 ############################################################################### OK
 ##### OMI ƒf[ƒ^‚ð“ǂݍž‚ñ‚ōì‹Æ‚ª‚Å‚«‚é‚悤‚É‚·‚é
 ############################################################################### OK
-filename1 = "OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5"
+filename1 = "test/OMI-Aura_L3-OMAEROe_2008m0101_v003-2009m0114t114202.he5"
 print "reading ",filename1,"...\n"
 file1=HE5.open(filename1,"r")
 p file1.has_swath?()
diff --git a/test/test_pt.rb b/test/test_pt.rb
index cfaa6ab..9ff9fdc 100644
--- a/test/test_pt.rb
+++ b/test/test_pt.rb
@@ -9,7 +9,7 @@ include NumRu
 ############################################################################### OK
 # sample 1
 ############################################################################### OK
-filename1 = "test_pt.he5"
+filename1 = "test/test_pt.he5"
 print "creating ",filename1,"...\n"
 file1=HE5.open(filename1,"w")
 point1=file1.ptcreate("Simple point")
diff --git a/test/test_sw.rb b/test/test_sw.rb
index 9e3c459..246bd9a 100644
--- a/test/test_sw.rb
+++ b/test/test_sw.rb
@@ -5,7 +5,7 @@ include NumRu
 ############################################################################### OK
 ##### MLS ƒf[ƒ^‚ð“ǂݍž‚ñ‚ōì‹Æ‚ª‚Å‚«‚é‚悤‚É‚·‚é
 ############################################################################### OK
-filename1 = "MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5"
+filename1 = "test/MLS-Aura_L2GP-O3_v02-21-c01_2007d059.he5"
 print "reading ",filename1,"...\n"
 file1=HE5.open(filename1,"r")
 p file1.has_swath?()
diff --git a/test/test_za.rb b/test/test_za.rb
index 05850ba..183d5b7 100644
--- a/test/test_za.rb
+++ b/test/test_za.rb
@@ -7,7 +7,7 @@ include NumRu
 ############################################################################### OK
 ##### he5_za_setup.c
 ############################################################################### OK
-filename1 = "test_za.he5"
+filename1 = "test/test_za.he5"
 print "creating ",filename1,"...\n"
 file1=HE5.open(filename1,"w")
 za1=file1.zacreate("za1")

-- 
Ruby interface of HDF-EOS5 library



More information about the Pkg-grass-devel mailing list