summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-10 13:43:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-10 13:43:25 (GMT)
commit037dac69970f5c52f61bc89b752f90d7fab11421 (patch)
tree62982243d6e19a08b30357f1410d0d047de12d28 /tools/lib
parent34d14bdf89d63023dfeb5ff471b71e5b591faa31 (diff)
downloadhdf5-037dac69970f5c52f61bc89b752f90d7fab11421.zip
hdf5-037dac69970f5c52f61bc89b752f90d7fab11421.tar.gz
hdf5-037dac69970f5c52f61bc89b752f90d7fab11421.tar.bz2
[svn-r17981] Description:
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/lib')
-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 848ba90..91acb10 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++)