changeset 2499:b29b6ad22382

* ported HDF calls to 1.8.x * Makefile.am: updated for minccmp
author rotor <rotor>
date Tue, 02 Mar 2010 12:23:14 +0000
parents 6d3e568bd2ba
children 4ba9edfb64ed
files Makefile.am NEWS libsrc/hdf_convenience.c libsrc/image_conversion.c libsrc/minc_basic.h libsrc/voxel_loop.c libsrc2/datatype.c libsrc2/grpattr.c libsrc2/m2util.c libsrc2/volprops.c libsrc2/volume.c progs/minccalc/gram.c
diffstat 12 files changed, 371 insertions(+), 210 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am
+++ b/Makefile.am
@@ -180,6 +180,7 @@
 	minc_modify_header \
 	mincaverage \
 	minccalc \
+	minccmp \
 	mincconcat \
 	minccopy \
 	mincexpand \
@@ -277,6 +278,8 @@
 
 minccopy_SOURCES = progs/minccopy/minccopy.c
 
+minccmp_SOURCES = progs/minccmp/minccmp.c
+
 mincexample1_SOURCES = progs/mincexample/mincexample1.c
 
 mincexample2_SOURCES = progs/mincexample/mincexample2.c
@@ -511,6 +514,7 @@
 	progs/mincaverage/mincaverage.man1 \
 	progs/minccalc/minccalc.man1 \
 	progs/mincconcat/mincconcat.man1 \
+	progs/minccmp/minccmp.man1 \
 	progs/minccopy/minccopy.man1 \
 	progs/mincdiff/mincdiff.man1 \
 	progs/mincedit/mincedit.man1 \
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
+
+New in Release 2.0.19
+---------------------
 * volume_io/Volumes/output_mnc.c: fix output buffers for a slice
   as only first buffer would be written out
-
+* ported HDF calls to 1.8.x
 * Fixed bug in multidim_array_is_alloced for correct check of
   memory allocation of image data. Return volume=NULL when memory
   allocation fails.
--- a/libsrc/hdf_convenience.c
+++ b/libsrc/hdf_convenience.c
@@ -80,7 +80,7 @@
 	new->nvars = 0;
 	new->ndims = 0;
 	new->link =_m2_list;
-        new->grp_id = H5Gopen(fd, MI2_GRPNAME);
+        new->grp_id = H5Gopen(fd, MI2_GRPNAME, H5P_DEFAULT);
         new->comp_type = MI2_COMP_UNKNOWN;
         new->comp_param = 0;
         new->chunk_type = MI2_CHUNK_UNKNOWN;
@@ -182,7 +182,7 @@
 	strncpy(new->name, name, NC_MAX_NAME - 1);
 	strncpy(new->path, path, NC_MAX_NAME - 1);
         new->is_cmpd = 0;
-        new->dset_id = H5Dopen(file->fd, path);
+        new->dset_id = H5Dopen1(file->fd, path);
         new->ftyp_id = H5Dget_type(new->dset_id);
         new->mtyp_id = H5Tget_native_type(new->ftyp_id, H5T_DIR_ASCEND);
         new->fspc_id = H5Dget_space(new->dset_id);
@@ -618,7 +618,7 @@
 
     spc_id = H5Screate(H5S_SCALAR);
 
-    att_id = H5Acreate(dst_id, MI2_DIMORDER, typ_id, spc_id, H5P_DEFAULT);
+    att_id = H5Acreate(dst_id, MI2_DIMORDER, typ_id, spc_id, H5P_DEFAULT, H5P_DEFAULT);
 
     if (att_id >= 0) {
 	H5Awrite(att_id, typ_id, str_buf);
@@ -925,7 +925,7 @@
         /* Create the attribute anew.
 	 */
         att_id = H5Acreate(dst_id, MI2_LENGTH, H5T_STD_U32LE, aspc_id, 
-                           H5P_DEFAULT);
+                           H5P_DEFAULT, H5P_DEFAULT);
       }  H5E_END_TRY;
         if (att_id >= 0) {
             H5Awrite(att_id, H5T_NATIVE_LONG, (void *) &length);
@@ -1102,12 +1102,12 @@
 
             new_plst_id = H5Dget_create_plist(var->dset_id);
 
-            new_dset_id = H5Dcreate(file->grp_id, temp, new_type_id, 
+            new_dset_id = H5Dcreate1(file->grp_id, temp, new_type_id, 
                                     var->fspc_id, new_plst_id);
 
             /* Iterate over all attributes, copying from old to new. */
             i = 0;
-            H5Aiterate(var->dset_id, &i, hdf_copy_attr, (void *) new_dset_id);
+            H5Aiterate1(var->dset_id, &i, hdf_copy_attr, (void *) new_dset_id);
 
             H5Dclose(var->dset_id);
             H5Tclose(var->ftyp_id);
@@ -1186,7 +1186,7 @@
 
         /* Create the attribute anew.
          */
-        att_id = H5Acreate(loc_id, attnm, ftyp_id, spc_id, H5P_DEFAULT);
+        att_id = H5Acreate2(loc_id, attnm, ftyp_id, spc_id, H5P_DEFAULT, H5P_DEFAULT);
     } H5E_END_TRY;
 
     if (att_id < 0)
@@ -1381,7 +1381,7 @@
     }
     
     H5E_BEGIN_TRY {
-        dst_id = H5Dcreate(fd, varpath, typ_id, spc_id, prp_id);
+        dst_id = H5Dcreate1(fd, varpath, typ_id, spc_id, prp_id);
     } H5E_END_TRY;
 
     if (dst_id < 0) {
@@ -1464,6 +1464,8 @@
   struct m2_file *file;
   struct m2_var *var;
 
+// fprintf(stderr, "HDF varget\n");
+
   /* Emulate the obsolete "rootvariable"
    */
   if (varid == MI_ROOTVARIABLE_ID) {
@@ -1531,8 +1533,15 @@
 
  cleanup:
 
+// fprintf(stderr, "cleanup - dst_id: %d  fspc_id: %d  mspc_id: %d\n", dst_id, fspc_id, mspc_id);
+ 
+ 
+// if(fspc_id >= 0)
+//    H5Sclose(fspc_id);
   if (mspc_id >= 0)
     H5Sclose(mspc_id);
+  
+fprintf(stderr, "cleanup - done\n");
   return (status);
 }
 
@@ -2057,7 +2066,7 @@
    if ((typ_id = H5Aget_type(inatt_id)) < 0)
      goto cleanup;
 
-   outatt_id = H5Acreate(out_id, attr_name, typ_id, spc_id, H5P_DEFAULT);
+   outatt_id = H5Acreate2(out_id, attr_name, typ_id, spc_id, H5P_DEFAULT, H5P_DEFAULT);
    if (outatt_id < 0) {
      /* This can happen if the attribute already exists.  If it does, we
       * don't overwrite the existing value.
@@ -2119,7 +2128,7 @@
 	    strcpy(tpath, cpath);
 	    strcat(tpath, temp);
 	    strcat(tpath, "/");
-	    new_id = H5Gopen(grp_id, temp);
+	    new_id = H5Gopen1(grp_id, temp);
 	    if (new_id >= 0) {
 		hdf_open_dsets(file, new_id, tpath, is_dim);
 		H5Gclose(new_id);
@@ -2130,7 +2139,7 @@
 	    H5Gget_objname_by_idx(grp_id, idx, temp, sizeof(temp));
 	    strcpy(tpath, cpath);
 	    strcat(tpath, temp);
-	    new_id = H5Dopen(grp_id, temp);
+	    new_id = H5Dopen1(grp_id, temp);
 	    if (new_id >= 0) {
 		hid_t spc_id;
 		spc_id = H5Dget_space(new_id);
@@ -2206,7 +2215,7 @@
     /* Open the image variables.
      */
     H5E_BEGIN_TRY {
-        dset_id = H5Dopen(fd, "/minc-2.0/image/0/image");
+        dset_id = H5Dopen1(fd, "/minc-2.0/image/0/image");
         if (dset_id >= 0) {
             hid_t type_id;
             int is_compound = 0;
@@ -2237,7 +2246,7 @@
             H5Dclose(dset_id);
         }
     
-        dset_id = H5Dopen(fd, "/minc-2.0/image/0/image-min");
+        dset_id = H5Dopen1(fd, "/minc-2.0/image/0/image-min");
         if (dset_id >= 0) {
             hdf_get_diminfo(dset_id, &ndims, dims);
             hdf_var_add(file, MIimagemin, "/minc-2.0/image/0/image-min", 
@@ -2245,7 +2254,7 @@
             H5Dclose(dset_id);
         }
 
-        dset_id = H5Dopen(fd, "/minc-2.0/image/0/image-max");
+        dset_id = H5Dopen1(fd, "/minc-2.0/image/0/image-max");
         if (dset_id >= 0) {
             hdf_get_diminfo(dset_id, &ndims, dims);
             hdf_var_add(file, MIimagemax, "/minc-2.0/image/0/image-max", 
@@ -2256,13 +2265,13 @@
 
     /* Open all of the datasets in the "dimensions" category.
      */
-    grp_id = H5Gopen(fd, "/minc-2.0/dimensions");
+    grp_id = H5Gopen2(fd, "/minc-2.0/dimensions", H5P_DEFAULT);
     hdf_open_dsets(file, grp_id, "/minc-2.0/dimensions/", 1);
     H5Gclose(grp_id);
 
     /* Open all of the datasets in the "info" category.
      */
-    grp_id = H5Gopen(fd, "/minc-2.0/info");
+    grp_id = H5Gopen2(fd, "/minc-2.0/info", H5P_DEFAULT);
     hdf_open_dsets(file, grp_id, "/minc-2.0/info/", 0);
     H5Gclose(grp_id);
     return (fd);
@@ -2296,26 +2305,26 @@
     /* Create the default groups.
      * Should we use a non-zero value for size_hint (parameter 3)???
      */
-    if ((grp_id = H5Gcreate(fd, MI2_GRPNAME, 0)) < 0) {
+    if ((grp_id = H5Gcreate1(fd, MI2_GRPNAME, 0)) < 0) {
 	return (MI_ERROR);
     }
 
-    if ((tmp_id = H5Gcreate(grp_id, "dimensions", 0)) < 0) {
+    if ((tmp_id = H5Gcreate1(grp_id, "dimensions", 0)) < 0) {
 	return (MI_ERROR);
     }
     H5Gclose(tmp_id);
 
-    if ((tmp_id = H5Gcreate(grp_id, "info", 0)) < 0) {
+    if ((tmp_id = H5Gcreate1(grp_id, "info", 0)) < 0) {
 	return (MI_ERROR);
     }
     H5Gclose(tmp_id);
 
-    if ((tmp_id = H5Gcreate(grp_id, "image", 0)) < 0) {
+    if ((tmp_id = H5Gcreate1(grp_id, "image", 0)) < 0) {
 	return (MI_ERROR);
     }
     H5Gclose(tmp_id);
 
-    if ((tmp_id = H5Gcreate(grp_id, "image/0", 0)) < 0) {
+    if ((tmp_id = H5Gcreate1(grp_id, "image/0", 0)) < 0) {
 	return (MI_ERROR);
     }
     H5Gclose(tmp_id);
--- a/libsrc/image_conversion.c
+++ b/libsrc/image_conversion.c
@@ -34,7 +34,11 @@
 @CREATED    : July 27, 1992. (Peter Neelin, Montreal Neurological Institute)
 @MODIFIED   : 
  * $Log: image_conversion.c,v $
- * Revision 6.16  2008-01-17 02:33:02  rotor
+ * Revision 6.17  2010-03-02 12:23:14  rotor
+ *  * ported HDF calls to 1.8.x
+ *  * Makefile.am: updated for minccmp
+ *
+ * Revision 6.16  2008/01/17 02:33:02  rotor
  *  * removed all rcsids
  *  * removed a bunch of ^L's that somehow crept in
  *  * removed old (and outdated) BUGS file
@@ -1412,6 +1416,8 @@
           }
       }
 
+// fprintf(stderr, "Getting values at %p\n", chunk_start);
+
       /* Get the values */
       if (MI_varaccess(operation, icvp->cdfid, icvp->varid,
                        chunk_start, chunk_count,
--- a/libsrc/minc_basic.h
+++ b/libsrc/minc_basic.h
@@ -14,7 +14,11 @@
 @CREATED    : August 28, 1992 (Peter Neelin)
 @MODIFIED   : 
  * $Log: minc_basic.h,v $
- * Revision 6.6  2008-04-11 05:15:00  rotor
+ * Revision 6.7  2010-03-02 12:23:14  rotor
+ *  * ported HDF calls to 1.8.x
+ *  * Makefile.am: updated for minccmp
+ *
+ * Revision 6.6  2008/04/11 05:15:00  rotor
  *  * rewrote error code  (Claude) to remove global defs that were
  *     causing build problems with DYLIB on OSX
  *
@@ -70,7 +74,7 @@
               make no representations about the suitability of this
               software for any purpose.  It is provided "as is" without
               express or implied warranty.
-@RCSID      : $Header: /private-cvsroot/minc/libsrc/minc_basic.h,v 6.6 2008-04-11 05:15:00 rotor Exp $ MINC (MNI)
+@RCSID      : $Header: /private-cvsroot/minc/libsrc/minc_basic.h,v 6.7 2010-03-02 12:23:14 rotor Exp $ MINC (MNI)
 ---------------------------------------------------------------------------- */
 
 #include <minc.h>
@@ -80,7 +84,7 @@
 /* Maximum buffer size for conversions. Should not be a power of 2 - this
    can cause poor performance on some systems (e.g. SGI) due to caching-
    related inefficiencies */
-#define MI_MAX_VAR_BUFFER_SIZE 1000000
+#define MI_MAX_VAR_BUFFER_SIZE 100000
 
 /* Possible values for sign of a value */
 #define MI_PRIV_DEFSIGN   0
--- a/libsrc/voxel_loop.c
+++ b/libsrc/voxel_loop.c
@@ -7,7 +7,11 @@
 @CREATED    : January 10, 1994 (Peter Neelin)
 @MODIFIED   : 
  * $Log: voxel_loop.c,v $
- * Revision 6.12  2008-01-17 02:33:02  rotor
+ * Revision 6.13  2010-03-02 12:23:14  rotor
+ *  * ported HDF calls to 1.8.x
+ *  * Makefile.am: updated for minccmp
+ *
+ * Revision 6.12  2008/01/17 02:33:02  rotor
  *  * removed all rcsids
  *  * removed a bunch of ^L's that somehow crept in
  *  * removed old (and outdated) BUGS file
--- a/libsrc2/datatype.c
+++ b/libsrc2/datatype.c
@@ -37,7 +37,7 @@
     if (grp_id < 0) {
 	return (MI_ERROR);
     }
-    dset_id = H5Dopen(grp_id, "image");
+    dset_id = H5Dopen1(grp_id, "image");
     if (dset_id < 0) {
 	return (MI_ERROR);
     }
--- a/libsrc2/grpattr.c
+++ b/libsrc2/grpattr.c
@@ -47,7 +47,7 @@
     
     strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
 
-    grp_id = H5Gopen(vol->hdf_id, fullpath);
+    grp_id = H5Gopen1(vol->hdf_id, fullpath);
     if (grp_id < 0) {
         return (MI_ERROR);
     }
@@ -118,7 +118,7 @@
       
                 frame->grp_idx = 0;
                 frame->att_idx = 0;
-                frame->grp_id = H5Gopen(data->frame_ptr->grp_id, tmp);
+                frame->grp_id = H5Gopen1(data->frame_ptr->grp_id, tmp);
 			
                 strcpy(frame->relpath, data->frame_ptr->relpath);
                 l = strlen(frame->relpath);
@@ -166,7 +166,7 @@
       
      
         H5E_BEGIN_TRY {
-            r = H5Aiterate(data->frame_ptr->grp_id, 
+            r = H5Aiterate1(data->frame_ptr->grp_id, 
                            &data->frame_ptr->att_idx, milist_attr_op, data);
         } H5E_END_TRY;
         if (r > 0) {
@@ -313,14 +313,14 @@
     H5E_BEGIN_TRY {
         /* See if the group already exists.  If so, just return.
          */
-        hdf_new_grp = H5Gopen(hdf_grp, name);
+        hdf_new_grp = H5Gopen1(hdf_grp, name);
         if (hdf_new_grp >= 0) {
             H5Gclose(hdf_new_grp);
             return (MI_NOERROR);
         }
         /* Actually create the requested group.
          */
-        hdf_new_grp = H5Gcreate(hdf_grp, name, 0);
+        hdf_new_grp = H5Gcreate1(hdf_grp, name, 0);
         if (hdf_new_grp < 0) {
             return (MI_ERROR);
         }
@@ -705,7 +705,7 @@
 	!strcmp(std_name,"study") )
       {
 	H5E_BEGIN_TRY {
-	  tmp_id = H5Dopen(hdf_file, fullpath);
+	  tmp_id = H5Dopen1(hdf_file, fullpath);
 	  if (tmp_id < 0) {
 	    create_standard_dataset(hdf_file,std_name);
 	  }
--- a/libsrc2/m2util.c
+++ b/libsrc2/m2util.c
@@ -215,12 +215,12 @@
      * automatic error reporting of HDF5.
      */
     H5E_BEGIN_TRY {
-        tmp_id = H5Dopen(file_id, path);
+        tmp_id = H5Dopen1(file_id, path);
 
         /* If the dataset open fails, try opening the object as a group.
          */
         if (tmp_id < 0) {
-            tmp_id = H5Gopen(file_id, path);
+            tmp_id = H5Gopen1(file_id, path);
         }
     } H5E_END_TRY;
     return (tmp_id);
@@ -303,7 +303,7 @@
         return (MI_ERROR);
     }
     
-    hdf_attr = H5Acreate(hdf_loc, name, ftyp_id, spc_id, H5P_DEFAULT);
+    hdf_attr = H5Acreate1(hdf_loc, name, ftyp_id, spc_id, H5P_DEFAULT);
     if (hdf_attr < 0) {
 	return (MI_ERROR);
     }
@@ -1253,7 +1253,7 @@
     }
 
     sprintf(path, "/minc-2.0/image/%d", grp);
-    grp_id = H5Gcreate(volume->hdf_id, path, 0);
+    grp_id = H5Gcreate1(volume->hdf_id, path, 0);
     if (grp_id < 0) {
         return (MI_ERROR);
     }
@@ -1488,7 +1488,7 @@
     /* Open the input path.
      */
     sprintf(path, "%d/image", igrp);
-    idst_id = H5Dopen(loc_id, path);
+    idst_id = H5Dopen1(loc_id, path);
     
     if (idst_id < 0) {
         return (MI_ERROR);
@@ -1524,10 +1524,10 @@
     sprintf(path, "%d/image", ogrp);
     
     H5E_BEGIN_TRY {
-        odst_id = H5Dcreate(loc_id, path, typ_id, ofspc_id, H5P_DEFAULT);
+        odst_id = H5Dcreate1(loc_id, path, typ_id, ofspc_id, H5P_DEFAULT);
     } H5E_END_TRY;
     if (odst_id < 0) {
-        odst_id = H5Dopen(loc_id, path);
+        odst_id = H5Dopen1(loc_id, path);
         if (odst_id < 0) {
             return (MI_ERROR);
         }
@@ -1547,20 +1547,20 @@
 
         sprintf(path, "%d/image-max", ogrp);
         H5E_BEGIN_TRY {
-            omax_id = H5Dcreate(loc_id, path, H5T_IEEE_F64LE, tfspc_id, 
+            omax_id = H5Dcreate1(loc_id, path, H5T_IEEE_F64LE, tfspc_id, 
                                 H5P_DEFAULT);
         } H5E_END_TRY;
         if (omax_id < 0) {
-            omax_id = H5Dopen(loc_id, path);
+            omax_id = H5Dopen1(loc_id, path);
         }
 
         sprintf(path, "%d/image-min", ogrp);
         H5E_BEGIN_TRY {
-            omin_id = H5Dcreate(loc_id, path, H5T_IEEE_F64LE, tfspc_id, 
+            omin_id = H5Dcreate1(loc_id, path, H5T_IEEE_F64LE, tfspc_id, 
                                 H5P_DEFAULT);
         } H5E_END_TRY;
         if (omin_id < 0) {
-            omin_id = H5Dopen(loc_id, path);
+            omin_id = H5Dopen1(loc_id, path);
         }
     }
     
@@ -1664,7 +1664,7 @@
     hsize_t i;
     char name[MI2_MAX_PATH];
   
-    grp_id = H5Gopen(volume->hdf_id, "/minc-2.0/image");
+    grp_id = H5Gopen1(volume->hdf_id, "/minc-2.0/image");
     if (grp_id < 0) {
         return (MI_ERROR);      /* Error opening group. */
     }
@@ -1735,7 +1735,7 @@
   hid_t grp_info;
   int result;
 
-  grp_info = H5Gopen(hdf_file, "/minc-2.0/info");
+  grp_info = H5Gopen1(hdf_file, "/minc-2.0/info");
   if (grp_info < 0) {
     return (MI_ERROR);
   }
@@ -1744,7 +1744,7 @@
     return (MI_ERROR);
   }
   
-  dataset_info = H5Dcreate(grp_info, name, 
+  dataset_info = H5Dcreate1(grp_info, name, 
 			   H5T_STD_I32LE, dataspace_info, H5P_DEFAULT);
   if (dataset_info < 0) {
     return (MI_ERROR);
@@ -1991,7 +1991,7 @@
     int result = MI_ERROR;
 
     H5E_BEGIN_TRY {
-        dset_id = H5Dopen(loc_id, path);
+        dset_id = H5Dopen1(loc_id, path);
     } H5E_END_TRY;
     if (dset_id >= 0) {
         spc_id = H5Dget_space(dset_id);
--- a/libsrc2/volprops.c
+++ b/libsrc2/volprops.c
@@ -142,7 +142,7 @@
       else {
 	for (i = 0; i < nfilters; i++) {
 	  cd_nelmts = MI2_MAX_CD_ELEMENTS;
-          fcode = H5Pget_filter(hdf_plist, i, &flags, &cd_nelmts,
+          fcode = H5Pget_filter1(hdf_plist, i, &flags, &cd_nelmts,
                                 cd_values, sizeof(fname), fname);
 	  switch (fcode) {
 	  case H5Z_FILTER_DEFLATE:
@@ -241,7 +241,7 @@
   if ( volume->hdf_id < 0 || depth > MI2_MAX_RESOLUTION_GROUP || depth < 0) {
     return (MI_ERROR);
   }
-  grp_id = H5Gopen(volume->hdf_id, "/minc-2.0/image");
+  grp_id = H5Gopen1(volume->hdf_id, "/minc-2.0/image");
   if (grp_id < 0) {
     return (MI_ERROR);
   }
@@ -263,20 +263,20 @@
       H5Dclose(volume->image_id);
   }
   sprintf(path, "%d/image", depth);
-  volume->image_id = H5Dopen(grp_id, path);
+  volume->image_id = H5Dopen1(grp_id, path);
 
   if (volume->volume_class == MI_CLASS_REAL) {
       if (volume->imax_id >= 0) {
           H5Dclose(volume->imax_id);
       }
       sprintf(path, "%d/image-max", depth);
-      volume->imax_id = H5Dopen(grp_id, path);
+      volume->imax_id = H5Dopen1(grp_id, path);
 
       if (volume->imin_id >= 0) {
           H5Dclose(volume->imin_id);
       }
       sprintf(path, "%d/image-min", depth);
-      volume->imin_id = H5Dopen(grp_id, path);
+      volume->imin_id = H5Dopen1(grp_id, path);
   }
   return (MI_NOERROR);
 }
--- a/libsrc2/volume.c
+++ b/libsrc2/volume.c
@@ -64,7 +64,7 @@
         return (MI_ERROR);
     }
     
-    dset_id = H5Dcreate(volume->hdf_id, "/minc-2.0/image/0/image", 
+    dset_id = H5Dcreate1(volume->hdf_id, "/minc-2.0/image/0/image", 
                         volume->ftype_id, 
                         dataspace_id, volume->plist_id);
     
@@ -125,7 +125,7 @@
         dtmp = 0.0;
         H5Pset_fill_value(dcpl_id, H5T_NATIVE_DOUBLE, &dtmp);
 
-        dset_id = H5Dcreate(volume->hdf_id, "/minc-2.0/image/0/image-min",
+        dset_id = H5Dcreate1(volume->hdf_id, "/minc-2.0/image/0/image-min",
                             H5T_IEEE_F64LE, dataspace_id, dcpl_id);
         if (ndims != 0) {
             miset_attr_at_loc(dset_id, "dimorder", MI_TYPE_STRING,
@@ -140,7 +140,7 @@
         dtmp = 1.0;
         H5Pset_fill_value(dcpl_id, H5T_NATIVE_DOUBLE, &dtmp);
 
-        dset_id = H5Dcreate(volume->hdf_id, "/minc-2.0/image/0/image-max",
+        dset_id = H5Dcreate1(volume->hdf_id, "/minc-2.0/image/0/image-max",
                             H5T_IEEE_F64LE, dataspace_id, dcpl_id);
         if (ndims != 0) {
             miset_attr_at_loc(dset_id, "dimorder", MI_TYPE_STRING,
@@ -448,7 +448,7 @@
 
   /* Try creating DIMENSIONS GROUP i.e. /minc-2.0/dimensions
    */
-  grp_id = H5Gopen(file_id, MI_FULLDIMENSIONS_PATH);
+  grp_id = H5Gopen1(file_id, MI_FULLDIMENSIONS_PATH);
   if (grp_id < 0) {
       return (MI_ERROR);
   }
@@ -473,7 +473,7 @@
     }
      
     /* Create a dataset(dimension variable name) in DIMENSIONS GROUP */
-    dataset_id = H5Dcreate(grp_id, dimensions[i]->name, 
+    dataset_id = H5Dcreate1(grp_id, dimensions[i]->name, 
                            H5T_IEEE_F64LE, dataspace_id, H5P_DEFAULT);
     
     /* Dimension variable for a regular dimension contains
@@ -516,7 +516,7 @@
 	strcat(name, "-width");
 
 	/* Create dataset dimension_name-width */
-	dataset_width = H5Dcreate(grp_id, name, H5T_IEEE_F64LE, 
+	dataset_width = H5Dcreate1(grp_id, name, H5T_IEEE_F64LE, 
                                   dataspace_id, H5P_DEFAULT);
 	/* Return an Id for the dataspace of the dataset dataset_width */
 	fspc_id = H5Dget_space(dataset_width);
@@ -795,7 +795,7 @@
     sprintf(path, "/minc-2.0/image/%d/image", volume->selected_resolution);
     /* Open the dataset with the specified path
      */
-    dset_id = H5Dopen(volume->hdf_id, path);
+    dset_id = H5Dopen1(volume->hdf_id, path);
     if (dset_id < 0) {
         return (MI_ERROR);
     }
@@ -1107,7 +1107,7 @@
     /* hdf5 macro can temporarily disable the automatic error printing */
     H5E_BEGIN_TRY {
          /* Open the dataset image-max at the specified path*/
-        dset_id = H5Dopen(file_id, "/minc-2.0/image/0/image-max");
+        dset_id = H5Dopen1(file_id, "/minc-2.0/image/0/image-max");
     } H5E_END_TRY;
     if (dset_id >= 0) {
         /* Get the Id of the copy of the dataspace of the dataset */
@@ -1140,7 +1140,7 @@
     miinvert_transform(handle->v2w_transform, handle->w2v_transform);
 
     /* Open the image dataset */
-    handle->image_id = H5Dopen(file_id, "/minc-2.0/image/0/image");
+    handle->image_id = H5Dopen1(file_id, "/minc-2.0/image/0/image");
     if (handle->image_id < 0) {
 	return (MI_ERROR);
     }
@@ -1188,8 +1188,8 @@
     /* hdf5 macro can temporarily disable the automatic error printing */
     H5E_BEGIN_TRY {
         /* Open both image-min and image-max datasets */
-        handle->imax_id = H5Dopen(file_id, "/minc-2.0/image/0/image-max");
-        handle->imin_id = H5Dopen(file_id, "/minc-2.0/image/0/image-min");
+        handle->imax_id = H5Dopen1(file_id, "/minc-2.0/image/0/image-max");
+        handle->imin_id = H5Dopen1(file_id, "/minc-2.0/image/0/image-min");
     } H5E_END_TRY;
 
     /* Convert the type to a MINC type.
--- a/progs/minccalc/gram.c
+++ b/progs/minccalc/gram.c
@@ -1,24 +1,23 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +28,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -47,7 +46,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.4.1"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -55,11 +54,57 @@
 /* Pure parsers.  */
 #define YYPURE 0
 
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
 
 
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 1 "gram.y"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <limits.h>
+#include <float.h>
+#include "node.h"
+
+#define INVALID_VALUE (-DBL_MAX)
+
+/* Avoid problems with conflicting declarations */
+void yyerror(const char *msg);
+
+
+/* Line 189 of yacc.c  */
+#line 88 "progs/minccalc/gram.c"
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -149,64 +194,34 @@
 
 
 
-/* Copy the first part of user declarations.  */
-#line 1 "gram.y"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-#include <float.h>
-#include "node.h"
-
-#define INVALID_VALUE (-DBL_MAX)
-
-/* Avoid problems with conflicting declarations */
-void yyerror(const char *msg);
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 1
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
+{
+
+/* Line 214 of yacc.c  */
 #line 15 "gram.y"
-{
+
 int      pos;
 node_t   node;
 double   real;
 ident_t  ident;
-}
-/* Line 187 of yacc.c.  */
-#line 197 "progs/minccalc/gram.c"
-	YYSTYPE;
+
+
+
+/* Line 214 of yacc.c  */
+#line 213 "progs/minccalc/gram.c"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
-
 /* Copy the second part of user declarations.  */
 
 
-/* Line 216 of yacc.c.  */
-#line 210 "progs/minccalc/gram.c"
+/* Line 264 of yacc.c  */
+#line 225 "progs/minccalc/gram.c"
 
 #ifdef short
 # undef short
@@ -281,14 +296,14 @@
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static int
-YYID (int i)
+YYID (int yyi)
 #else
 static int
-YYID (i)
-    int i;
+YYID (yyi)
+    int yyi;
 #endif
 {
-  return i;
+  return yyi;
 }
 #endif
 
@@ -369,9 +384,9 @@
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -405,12 +420,12 @@
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
     do									\
       {									\
 	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
@@ -1022,17 +1037,20 @@
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 #else
 static void
-yy_stack_print (bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
   YYFPRINTF (stderr, "\n");
 }
 
@@ -1066,11 +1084,11 @@
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 		       &(yyvsp[(yyi + 1) - (yynrhs)])
 		       		       );
-      fprintf (stderr, "\n");
+      YYFPRINTF (stderr, "\n");
     }
 }
 
@@ -1350,10 +1368,8 @@
 	break;
     }
 }
-
 
 /* Prevent warnings from -Wmissing-prototypes.  */
-
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
@@ -1369,11 +1385,10 @@
 #endif /* ! YYPARSE_PARAM */
 
 
-
-/* The look-ahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
-/* The semantic value of the look-ahead symbol.  */
+/* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
 /* Number of syntax errors so far.  */
@@ -1381,9 +1396,9 @@
 
 
 
-/*----------.
-| yyparse.  |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1407,14 +1422,39 @@
 #endif
 #endif
 {
-  
-  int yystate;
+
+
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
+
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    YYSIZE_T yystacksize;
+
   int yyn;
   int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
   char yymsgbuf[128];
@@ -1422,51 +1462,28 @@
   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
-
-
-
 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
 
@@ -1496,7 +1513,6 @@
 	YYSTYPE *yyvs1 = yyvs;
 	yytype_int16 *yyss1 = yyss;
 
-
 	/* Each stack pointer address is followed by the size of the
 	   data in use in that stack, in bytes.  This used to be a
 	   conditional around just the two extra args, but that might
@@ -1504,7 +1520,6 @@
 	yyoverflow (YY_("memory exhausted"),
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
-
 		    &yystacksize);
 
 	yyss = yyss1;
@@ -1527,9 +1542,8 @@
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
 	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
@@ -1540,7 +1554,6 @@
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
@@ -1550,6 +1563,9 @@
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
   goto yybackup;
 
 /*-----------.
@@ -1558,16 +1574,16 @@
 yybackup:
 
   /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
+     lookahead token if we need one and don't already have one.  */
 
-  /* First try to decide what to do without reference to look-ahead token.  */
+  /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-  /* Not known => get a look-ahead token if don't already have one.  */
+  /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -1599,20 +1615,16 @@
       goto yyreduce;
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   /* Count tokens shifted since error; after three, turn off error
      status.  */
   if (yyerrstatus)
     yyerrstatus--;
 
-  /* Shift the look-ahead token.  */
+  /* Shift the lookahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
 
   yystate = yyn;
   *++yyvsp = yylval;
@@ -1652,11 +1664,15 @@
   switch (yyn)
     {
         case 2:
+
+/* Line 1455 of yacc.c  */
 #line 54 "gram.y"
     { root = (yyvsp[(1) - (1)].node); }
     break;
 
   case 3:
+
+/* Line 1455 of yacc.c  */
 #line 58 "gram.y"
     { (yyval.node) = new_node(2, node_is_scalar((yyvsp[(3) - (3)].node)));
         (yyval.node)->type = NODETYPE_EXPRLIST;
@@ -1666,31 +1682,43 @@
     break;
 
   case 4:
+
+/* Line 1455 of yacc.c  */
 #line 65 "gram.y"
     { (yyval.node) = (yyvsp[(1) - (2)].node); }
     break;
 
   case 5:
+
+/* Line 1455 of yacc.c  */
 #line 68 "gram.y"
     { (yyval.node) = (yyvsp[(1) - (1)].node); }
     break;
 
   case 6:
+
+/* Line 1455 of yacc.c  */
 #line 72 "gram.y"
     { (yyval.node) = (yyvsp[(2) - (3)].node); }
     break;
 
   case 7:
+
+/* Line 1455 of yacc.c  */
 #line 75 "gram.y"
     { (yyval.node) = (yyvsp[(2) - (3)].node); }
     break;
 
   case 8:
+
+/* Line 1455 of yacc.c  */
 #line 78 "gram.y"
     { (yyval.node) = (yyvsp[(2) - (3)].node); }
     break;
 
   case 9:
+
+/* Line 1455 of yacc.c  */
 #line 81 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->type = NODETYPE_GEN;
@@ -1701,6 +1729,8 @@
     break;
 
   case 10:
+
+/* Line 1455 of yacc.c  */
 #line 89 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->type = NODETYPE_RANGE;
@@ -1711,6 +1741,8 @@
     break;
 
   case 11:
+
+/* Line 1455 of yacc.c  */
 #line 97 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->type = NODETYPE_RANGE;
@@ -1721,6 +1753,8 @@
     break;
 
   case 12:
+
+/* Line 1455 of yacc.c  */
 #line 105 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->type = NODETYPE_RANGE;
@@ -1731,6 +1765,8 @@
     break;
 
   case 13:
+
+/* Line 1455 of yacc.c  */
 #line 113 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->type = NODETYPE_RANGE;
@@ -1741,6 +1777,8 @@
     break;
 
   case 14:
+
+/* Line 1455 of yacc.c  */
 #line 121 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_ADD;
@@ -1751,6 +1789,8 @@
     break;
 
   case 15:
+
+/* Line 1455 of yacc.c  */
 #line 129 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_SUB;
@@ -1761,6 +1801,8 @@
     break;
 
   case 16:
+
+/* Line 1455 of yacc.c  */
 #line 137 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_SUB;
@@ -1773,6 +1815,8 @@
     break;
 
   case 17:
+
+/* Line 1455 of yacc.c  */
 #line 147 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->pos = (yyvsp[(2) - (3)].pos);
@@ -1783,6 +1827,8 @@
     break;
 
   case 18:
+
+/* Line 1455 of yacc.c  */
 #line 155 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->pos = (yyvsp[(2) - (3)].pos);
@@ -1793,6 +1839,8 @@
     break;
 
   case 19:
+
+/* Line 1455 of yacc.c  */
 #line 163 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->pos = (yyvsp[(2) - (3)].pos);
@@ -1803,6 +1851,8 @@
     break;
 
   case 20:
+
+/* Line 1455 of yacc.c  */
 #line 171 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_LT;
@@ -1813,6 +1863,8 @@
     break;
 
   case 21:
+
+/* Line 1455 of yacc.c  */
 #line 179 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_LE;
@@ -1823,6 +1875,8 @@
     break;
 
   case 22:
+
+/* Line 1455 of yacc.c  */
 #line 187 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_GT;
@@ -1833,6 +1887,8 @@
     break;
 
   case 23:
+
+/* Line 1455 of yacc.c  */
 #line 195 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_GE;
@@ -1843,6 +1899,8 @@
     break;
 
   case 24:
+
+/* Line 1455 of yacc.c  */
 #line 203 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_EQ;
@@ -1853,6 +1911,8 @@
     break;
 
   case 25:
+
+/* Line 1455 of yacc.c  */
 #line 211 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_NE;
@@ -1863,6 +1923,8 @@
     break;
 
   case 26:
+
+/* Line 1455 of yacc.c  */
 #line 219 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_AND;
@@ -1873,6 +1935,8 @@
     break;
 
   case 27:
+
+/* Line 1455 of yacc.c  */
 #line 227 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_OR;
@@ -1883,6 +1947,8 @@
     break;
 
   case 28:
+
+/* Line 1455 of yacc.c  */
 #line 235 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_INDEX;
@@ -1892,6 +1958,8 @@
     break;
 
   case 29:
+
+/* Line 1455 of yacc.c  */
 #line 242 "gram.y"
     { (yyval.node) = new_node(1, node_is_scalar((yyvsp[(3) - (3)].node)));
         (yyval.node)->type = NODETYPE_ASSIGN;
@@ -1901,11 +1969,15 @@
     break;
 
   case 30:
+
+/* Line 1455 of yacc.c  */
 #line 249 "gram.y"
     { (yyval.node) = (yyvsp[(2) - (2)].node); }
     break;
 
   case 31:
+
+/* Line 1455 of yacc.c  */
 #line 252 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1915,6 +1987,8 @@
     break;
 
   case 32:
+
+/* Line 1455 of yacc.c  */
 #line 259 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1923,6 +1997,8 @@
     break;
 
   case 33:
+
+/* Line 1455 of yacc.c  */
 #line 265 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1931,6 +2007,8 @@
     break;
 
   case 34:
+
+/* Line 1455 of yacc.c  */
 #line 271 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1939,6 +2017,8 @@
     break;
 
   case 35:
+
+/* Line 1455 of yacc.c  */
 #line 277 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1947,6 +2027,8 @@
     break;
 
   case 36:
+
+/* Line 1455 of yacc.c  */
 #line 283 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1955,6 +2037,8 @@
     break;
 
   case 37:
+
+/* Line 1455 of yacc.c  */
 #line 289 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1963,6 +2047,8 @@
     break;
 
   case 38:
+
+/* Line 1455 of yacc.c  */
 #line 295 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1972,6 +2058,8 @@
     break;
 
   case 39:
+
+/* Line 1455 of yacc.c  */
 #line 302 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1981,6 +2069,8 @@
     break;
 
   case 40:
+
+/* Line 1455 of yacc.c  */
 #line 309 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1990,6 +2080,8 @@
     break;
 
   case 41:
+
+/* Line 1455 of yacc.c  */
 #line 316 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -1999,6 +2091,8 @@
     break;
 
   case 42:
+
+/* Line 1455 of yacc.c  */
 #line 323 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2008,6 +2102,8 @@
     break;
 
   case 43:
+
+/* Line 1455 of yacc.c  */
 #line 330 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2017,6 +2113,8 @@
     break;
 
   case 44:
+
+/* Line 1455 of yacc.c  */
 #line 337 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2026,6 +2124,8 @@
     break;
 
   case 45:
+
+/* Line 1455 of yacc.c  */
 #line 344 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2035,6 +2135,8 @@
     break;
 
   case 46:
+
+/* Line 1455 of yacc.c  */
 #line 351 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2044,6 +2146,8 @@
     break;
 
   case 47:
+
+/* Line 1455 of yacc.c  */
 #line 358 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2053,6 +2157,8 @@
     break;
 
   case 48:
+
+/* Line 1455 of yacc.c  */
 #line 365 "gram.y"
     { (yyval.node) = new_scalar_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (2)].pos);
@@ -2062,6 +2168,8 @@
     break;
 
   case 49:
+
+/* Line 1455 of yacc.c  */
 #line 372 "gram.y"
     { (yyval.node) = new_scalar_node(3);
         (yyval.node)->pos = (yyvsp[(1) - (8)].pos);
@@ -2073,6 +2181,8 @@
     break;
 
   case 50:
+
+/* Line 1455 of yacc.c  */
 #line 381 "gram.y"
     { (yyval.node) = new_scalar_node(3);
         (yyval.node)->pos = (yyvsp[(1) - (8)].pos);
@@ -2084,6 +2194,8 @@
     break;
 
   case 51:
+
+/* Line 1455 of yacc.c  */
 #line 390 "gram.y"
     { (yyval.node) = new_node(3, node_is_scalar((yyvsp[(3) - (5)].node)));
         (yyval.node)->pos = (yyvsp[(2) - (5)].pos);
@@ -2094,6 +2206,8 @@
     break;
 
   case 52:
+
+/* Line 1455 of yacc.c  */
 #line 398 "gram.y"
     { (yyval.node) = new_node(3, node_is_scalar((yyvsp[(5) - (7)].node)));
         (yyval.node)->pos = (yyvsp[(1) - (7)].pos);
@@ -2104,6 +2218,8 @@
     break;
 
   case 53:
+
+/* Line 1455 of yacc.c  */
 #line 406 "gram.y"
     { (yyval.node) = new_node(2, node_is_scalar((yyvsp[(5) - (5)].node)));
         (yyval.node)->pos = (yyvsp[(1) - (5)].pos);
@@ -2113,6 +2229,8 @@
     break;
 
   case 54:
+
+/* Line 1455 of yacc.c  */
 #line 413 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->pos = (yyvsp[(1) - (7)].pos);
@@ -2123,6 +2241,8 @@
     break;
 
   case 55:
+
+/* Line 1455 of yacc.c  */
 #line 421 "gram.y"
     { (yyval.node) = new_node(0, ident_is_scalar((yyvsp[(1) - (1)].ident)));
         (yyval.node)->type = NODETYPE_IDENT;
@@ -2131,6 +2251,8 @@
     break;
 
   case 56:
+
+/* Line 1455 of yacc.c  */
 #line 427 "gram.y"
     { (yyval.node) = new_scalar_node(0);
         (yyval.node)->pos = -1;
@@ -2139,6 +2261,8 @@
     break;
 
   case 57:
+
+/* Line 1455 of yacc.c  */
 #line 433 "gram.y"
     { (yyval.node) = new_scalar_node(0);
         (yyval.node)->pos = -1;
@@ -2147,6 +2271,8 @@
     break;
 
   case 58:
+
+/* Line 1455 of yacc.c  */
 #line 442 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->type = NODETYPE_LET;
@@ -2157,6 +2283,8 @@
     break;
 
   case 59:
+
+/* Line 1455 of yacc.c  */
 #line 449 "gram.y"
     { (yyval.node) = new_scalar_node(2);
         (yyval.node)->pos = (yyvsp[(2) - (5)].pos);
@@ -2167,6 +2295,8 @@
     break;
 
   case 60:
+
+/* Line 1455 of yacc.c  */
 #line 458 "gram.y"
     { (yyval.node) = new_vector_node(1);
         (yyval.node)->pos = (yyvsp[(1) - (1)].node)->pos;
@@ -2175,6 +2305,8 @@
     break;
 
   case 61:
+
+/* Line 1455 of yacc.c  */
 #line 463 "gram.y"
     { (yyval.node) = new_vector_node(2);
         (yyval.node)->pos = (yyvsp[(2) - (3)].pos);
@@ -2184,8 +2316,9 @@
     break;
 
 
-/* Line 1267 of yacc.c.  */
-#line 2189 "progs/minccalc/gram.c"
+
+/* Line 1455 of yacc.c  */
+#line 2322 "progs/minccalc/gram.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2196,7 +2329,6 @@
 
   *++yyvsp = yyval;
 
-
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -2261,7 +2393,7 @@
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse look-ahead token after an
+      /* If just tried and failed to reuse lookahead token after an
 	 error, discard it.  */
 
       if (yychar <= YYEOF)
@@ -2278,7 +2410,7 @@
 	}
     }
 
-  /* Else will try to reuse look-ahead token after shifting the error
+  /* Else will try to reuse lookahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -2335,9 +2467,6 @@
       YY_STACK_PRINT (yyss, yyssp);
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   *++yyvsp = yylval;
 
 
@@ -2362,7 +2491,7 @@
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -2373,7 +2502,7 @@
 #endif
 
 yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
+  if (yychar != YYEMPTY)
      yydestruct ("Cleanup: discarding lookahead",
 		 yytoken, &yylval);
   /* Do not reclaim the symbols of the rule which action triggered
@@ -2399,6 +2528,8 @@
 }
 
 
+
+/* Line 1675 of yacc.c  */
 #line 470 "gram.y"