[svn-r15901] undo some changes in the list of parameters of parse_command_line (forgot that this function is called both on serial and parallel)
tested: linux
This commit is contained in:
@@ -55,12 +55,21 @@ static struct long_options l_opts[] = {
|
||||
|
||||
void parse_command_line(int argc,
|
||||
const char* argv[],
|
||||
const char** fname1,
|
||||
const char** fname2,
|
||||
const char** objname1,
|
||||
const char** objname2,
|
||||
diff_opt_t* options)
|
||||
{
|
||||
|
||||
int opt;
|
||||
|
||||
|
||||
/* process the command-line */
|
||||
memset(options, 0, sizeof (diff_opt_t));
|
||||
|
||||
/* assume equal contents initially */
|
||||
options->contents = 1;
|
||||
|
||||
/* parse command line options */
|
||||
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
|
||||
{
|
||||
@@ -132,10 +141,29 @@ void parse_command_line(int argc,
|
||||
h5diff_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
*fname1 = argv[ opt_ind ];
|
||||
*fname2 = argv[ opt_ind + 1 ];
|
||||
*objname1 = argv[ opt_ind + 2 ];
|
||||
|
||||
if ( *objname1 == NULL )
|
||||
{
|
||||
*objname2 = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( argv[ opt_ind + 3 ] != NULL)
|
||||
{
|
||||
*objname2 = argv[ opt_ind + 3 ];
|
||||
}
|
||||
else
|
||||
{
|
||||
*objname2 = *objname1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: print_info
|
||||
*
|
||||
|
||||
@@ -17,7 +17,7 @@ extern unsigned char g_Parallel;
|
||||
extern int g_nTasks;
|
||||
|
||||
void usage(void);
|
||||
void parse_command_line(int argc, const char* argv[], diff_opt_t* options);
|
||||
void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options);
|
||||
void h5diff_exit(int status);
|
||||
void print_info(diff_opt_t* options);
|
||||
|
||||
|
||||
@@ -78,46 +78,12 @@ int main(int argc, const char *argv[])
|
||||
hsize_t nfound=0;
|
||||
diff_opt_t options;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* initialize options
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* zero defaults */
|
||||
memset(&options, 0, sizeof (diff_opt_t));
|
||||
|
||||
/* assume equal contents initially */
|
||||
options.contents = 1;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* process the command-line
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
parse_command_line(argc, argv, &options);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* file and object names
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
fname1 = argv[ opt_ind ];
|
||||
fname2 = argv[ opt_ind + 1 ];
|
||||
objname1 = argv[ opt_ind + 2 ];
|
||||
|
||||
if ( objname1 == NULL )
|
||||
{
|
||||
objname2 = NULL;
|
||||
}
|
||||
|
||||
if ( argv[ opt_ind + 3 ] != NULL)
|
||||
{
|
||||
objname2 = argv[ opt_ind + 3 ];
|
||||
}
|
||||
else
|
||||
{
|
||||
objname2 = objname1;
|
||||
}
|
||||
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* do the diff
|
||||
|
||||
Reference in New Issue
Block a user