From: Braden M. <br...@us...> - 2007-02-05 09:01:27
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27775/src/openvrml-xembed Modified Files: main.cpp Log Message: Moved global variables used for option parsing inside main. Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 5 Feb 2007 07:08:43 -0000 1.3 --- main.cpp 5 Feb 2007 09:00:04 -0000 1.4 *************** *** 176,213 **** namespace { - gboolean version, initial_stream; - gchar ** args; - - GOptionEntry options[] = { - { - "version", - 'v', - 0, - G_OPTION_ARG_NONE, - &version, - "Print the version information and exit", - 0 - }, - { - "initial-stream", - 'i', - 0, - G_OPTION_ARG_NONE, - &initial_stream, - "Expect an initial stream", - 0 - }, - { - G_OPTION_REMAINING, - '\0', - 0, - G_OPTION_ARG_STRING_ARRAY, - &args, - "the embedder's window ID", - "XID" - }, - { 0, '\0', 0, G_OPTION_ARG_NONE, 0, 0, 0 } - }; - struct initial_stream_reader { initial_stream_reader( --- 176,179 ---- *************** *** 355,358 **** --- 321,357 ---- gtk_gl_init(&argc, &argv); + gboolean version = false, initial_stream = false; + gchar ** args = 0; + GOptionEntry options[] = { + { + "version", + 'v', + 0, + G_OPTION_ARG_NONE, + &version, + "Print the version information and exit", + 0 + }, + { + "initial-stream", + 'i', + 0, + G_OPTION_ARG_NONE, + &initial_stream, + "Expect an initial stream", + 0 + }, + { + G_OPTION_REMAINING, + '\0', + 0, + G_OPTION_ARG_STRING_ARRAY, + &args, + "the embedder's window ID", + "XID" + }, + { 0, '\0', 0, G_OPTION_ARG_NONE, 0, 0, 0 } + }; + GError * error = 0; scope_guard error_guard = make_guard(g_error_free, ref(error)); *************** *** 375,379 **** } ! if (!::args) { cerr << argv[0] << ": missing required XID argument" << endl; error_guard.dismiss(); --- 374,378 ---- } ! if (!args) { cerr << argv[0] << ": missing required XID argument" << endl; error_guard.dismiss(); *************** *** 383,387 **** GdkNativeWindow socket_id; try { ! socket_id = boost::lexical_cast<GdkNativeWindow>(::args[0]); } catch (const boost::bad_lexical_cast & ex) { cerr << argv[0] << ": expected integer value for XID argument" << endl; --- 382,386 ---- GdkNativeWindow socket_id; try { ! socket_id = boost::lexical_cast<GdkNativeWindow>(args[0]); } catch (const boost::bad_lexical_cast & ex) { cerr << argv[0] << ": expected integer value for XID argument" << endl; *************** *** 437,441 **** threads.create_thread(command_channel_loop_func); ! if (::initial_stream) { const shared_ptr<plugin_streambuf> initial_stream( new plugin_streambuf(::initial_stream_uri)); --- 436,440 ---- threads.create_thread(command_channel_loop_func); ! if (initial_stream) { const shared_ptr<plugin_streambuf> initial_stream( new plugin_streambuf(::initial_stream_uri)); |