Pass the info strings directly to commandline_early_options().

Just pass them directly as arguments, don't stuff them into a structure.

Change-Id: Iac84226f54898bc953011bca64795e9049762905
Reviewed-on: https://code.wireshark.org/review/16022
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-06-19 14:12:30 -07:00
parent 85c805d60e
commit 234d8eacec
4 changed files with 17 additions and 25 deletions

View File

@ -199,7 +199,8 @@ static void print_no_capture_support_error(void)
}
#endif
void commandline_early_options(int argc, char *argv[], commandline_capture_param_info_t* param_info)
void commandline_early_options(int argc, char *argv[],
GString *comp_info_str, GString *runtime_info_str)
{
int opt;
#ifdef HAVE_LIBPCAP
@ -302,7 +303,7 @@ void commandline_early_options(int argc, char *argv[], commandline_capture_param
#ifdef _WIN32
create_console();
#endif
show_version("Wireshark", param_info->comp_info_str, param_info->runtime_info_str);
show_version("Wireshark", comp_info_str, runtime_info_str);
#ifdef _WIN32
destroy_console();
#endif

View File

@ -29,13 +29,8 @@ extern "C" {
extern void commandline_print_usage(gboolean for_help_option);
typedef struct commandline_capture_param_info
{
GString *comp_info_str;
GString *runtime_info_str;
} commandline_capture_param_info_t;
extern void commandline_early_options(int argc, char *argv[], commandline_capture_param_info_t* param_info);
extern void commandline_early_options(int argc, char *argv[],
GString *comp_info_str, GString *runtime_info_str);
/* Command-line options that don't have direct API calls to handle the data */
typedef struct commandline_param_info

View File

@ -2085,12 +2085,10 @@ main(int argc, char *argv[])
#ifdef HAVE_GTKOSXAPPLICATION
GtkosxApplication *theApp;
#endif
commandline_capture_param_info_t capture_param_info;
GString *comp_info_str = NULL;
GString *runtime_info_str = NULL;
commandline_param_info_t commandline_info;
/* Initialize the capture arguments */
memset(&capture_param_info, 0, sizeof(capture_param_info));
#ifdef HAVE_GDK_GRESOURCE
main_register_resource();
#endif
@ -2173,11 +2171,11 @@ main(int argc, char *argv[])
#endif /* _WIN32 */
/* Get the compile-time version information string */
capture_param_info.comp_info_str = get_compiled_version_info(get_wireshark_gtk_compiled_info,
comp_info_str = get_compiled_version_info(get_wireshark_gtk_compiled_info,
get_gui_compiled_info);
/* Get the run-time version information string */
capture_param_info.runtime_info_str = get_runtime_version_info(get_wireshark_runtime_info);
runtime_info_str = get_runtime_version_info(get_wireshark_runtime_info);
/* Add it to the information to be reported on a crash. */
ws_add_crash_info("Wireshark %s\n"
@ -2185,7 +2183,7 @@ main(int argc, char *argv[])
"%s"
"\n"
"%s",
get_ws_vcs_version_info(), capture_param_info.comp_info_str->str, capture_param_info.runtime_info_str->str);
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
#ifdef _WIN32
/* Start windows sockets */
@ -2203,7 +2201,7 @@ main(int argc, char *argv[])
rf_path, g_strerror(rf_open_errno));
}
commandline_early_options(argc, argv, &capture_param_info);
commandline_early_options(argc, argv, comp_info_str, runtime_info_str);
/* Init the "Open file" dialog directory */
/* (do this after the path settings are processed) */

View File

@ -336,14 +336,12 @@ int main(int argc, char *argv[])
#endif
#endif
#endif
commandline_capture_param_info_t capture_param_info;
GString *comp_info_str = NULL;
GString *runtime_info_str = NULL;
commandline_param_info_t commandline_info;
QString dfilter, read_filter;
/* Initialize the capture arguments */
memset(&capture_param_info, 0, sizeof(capture_param_info));
cmdarg_err_init(wireshark_cmdarg_err, wireshark_cmdarg_err_cont);
// In Qt 5, C strings are treated always as UTF-8 when converted to
@ -436,11 +434,11 @@ int main(int argc, char *argv[])
#endif /* _WIN32 */
/* Get the compile-time version information string */
capture_param_info.comp_info_str = get_compiled_version_info(get_wireshark_qt_compiled_info,
comp_info_str = get_compiled_version_info(get_wireshark_qt_compiled_info,
get_gui_compiled_info);
/* Assemble the run-time version information string */
capture_param_info.runtime_info_str = get_runtime_version_info(get_wireshark_runtime_info);
runtime_info_str = get_runtime_version_info(get_wireshark_runtime_info);
profile_store_persconffiles(TRUE);
@ -453,7 +451,7 @@ int main(int argc, char *argv[])
g_free(rf_path);
}
commandline_early_options(argc, ws_argv, &capture_param_info);
commandline_early_options(argc, ws_argv, comp_info_str, runtime_info_str);
#ifdef _WIN32
reset_library_path();
@ -478,7 +476,7 @@ int main(int argc, char *argv[])
"%s"
"\n"
"%s",
get_ws_vcs_version_info(), capture_param_info.comp_info_str->str, capture_param_info.runtime_info_str->str);
get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str);
#ifdef _WIN32
/* Start windows sockets */