summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-10 14:03:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-10 14:03:52 (GMT)
commit5c8ab3e88dbfaf0e379369d9e51444f418e55700 (patch)
treee5535ae519398d0c8561c6a1d07b70b8c715ce1a /tools
parent57ac6e674527a2b5b6d77f7a06b9dad2c572ef1b (diff)
downloadhdf5-5c8ab3e88dbfaf0e379369d9e51444f418e55700.zip
hdf5-5c8ab3e88dbfaf0e379369d9e51444f418e55700.tar.gz
hdf5-5c8ab3e88dbfaf0e379369d9e51444f418e55700.tar.bz2
[svn-r17983] Description:
Bring r17981 from trunk to 1.8 branch: Abstract "print header" code into separate routine. Tested on: Mac OS X/32 10.6.2 (amazon) w/debug (too minor to require h5committest)
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff_array.c97
1 files changed, 47 insertions, 50 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 77ee74a..aa03148 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -5810,6 +5810,51 @@ int print_data(diff_opt_t *options)
}
/*-------------------------------------------------------------------------
+ * Function: print_header
+ *
+ * Purpose: print header for difference
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static
+void print_header(int pp, /* print percentage */
+ int rank,
+ hsize_t *dims,
+ const char *obj1,
+ const char *obj2 )
+{
+ int i;
+
+ /* print header */
+ parallel_print("%-16s","size:");
+ print_dimensions (rank,dims);
+ parallel_print("%-11s","");
+ print_dimensions (rank,dims);
+ parallel_print("\n");
+
+ if (pp)
+ {
+ parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
+ "position",
+ (obj1!=NULL) ? obj1 : " ",
+ (obj2!=NULL) ? obj2 : " ",
+ "difference",
+ "relative");
+ parallel_print("------------------------------------------------------------------------\n");
+ }
+ else
+ {
+ parallel_print("%-15s %-15s %-15s %-20s\n",
+ "position",
+ (obj1!=NULL) ? obj1 : " ",
+ (obj2!=NULL) ? obj2 : " ",
+ "difference");
+ parallel_print("------------------------------------------------------------\n");
+ }
+}
+
+/*-------------------------------------------------------------------------
* Function: print_pos
*
* Purpose: print in matrix notation, converting from an array index position
@@ -5835,31 +5880,7 @@ void print_pos( int *ph, /* print header */
{
*ph=0;
- parallel_print("%-16s","size:");
- print_dimensions (rank,dims);
- parallel_print("%-11s","");
- print_dimensions (rank,dims);
- parallel_print("\n");
-
- if (pp)
- {
- parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
- "position",
- (obj1!=NULL) ? obj1 : " ",
- (obj2!=NULL) ? obj2 : " ",
- "difference",
- "relative");
- parallel_print("------------------------------------------------------------------------\n");
- }
- else
- {
- parallel_print("%-15s %-15s %-15s %-20s\n",
- "position",
- (obj1!=NULL) ? obj1 : " ",
- (obj2!=NULL) ? obj2 : " ",
- "difference");
- parallel_print("------------------------------------------------------------\n");
- }
+ print_header(pp, rank, dims, obj1, obj2);
} /* end print header */
for ( i = 0; i < rank; i++)
@@ -5912,31 +5933,7 @@ void print_char_pos( int *ph, /* print header */
{
*ph=0;
- parallel_print("%-16s","size:");
- print_dimensions (rank,dims);
- parallel_print("%-11s","");
- print_dimensions (rank,dims);
- parallel_print("\n");
-
- if (pp)
- {
- parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
- "position",
- (obj1!=NULL) ? obj1 : " ",
- (obj2!=NULL) ? obj2 : " ",
- "difference",
- "relative");
- parallel_print("------------------------------------------------------------------------\n");
- }
- else
- {
- parallel_print("%-15s %-15s %-15s %-20s\n",
- "position",
- (obj1!=NULL) ? obj1 : " ",
- (obj2!=NULL) ? obj2 : " ",
- "difference");
- parallel_print("------------------------------------------------------------\n");
- }
+ print_header(pp, rank, dims, obj1, obj2);
} /* end print header */
for ( i = 0; i < rank; i++)