diff options
author | Craig Silverstein <csilvers+gflags@google.com> | 2011-03-02 08:05:17 +0000 |
---|---|---|
committer | Craig Silverstein <csilvers+gflags@google.com> | 2011-03-02 08:05:17 +0000 |
commit | 71e1be97d82ef4d17929fbb5b486bc3465152c36 (patch) | |
tree | 21e60dcb18b6f36f0141f309a8e5ee1e4042ec73 /src | |
parent | 24b4c59e6939f45849fd36da083b92be5ec52ecf (diff) | |
download | gflags-71e1be97d82ef4d17929fbb5b486bc3465152c36.tar.gz gflags-71e1be97d82ef4d17929fbb5b486bc3465152c36.tar.bz2 gflags-71e1be97d82ef4d17929fbb5b486bc3465152c36.zip |
* Update acx_pthread.m4 for nostdlib (liujisi)
* Typo fix in docs (bogdand)
* Change ReparseCommandLineFlags to return void (csilvers)
git-svn-id: https://gflags.googlecode.com/svn/trunk@46 6586e3c6-dcc4-952a-343f-ff74eb82781d
Diffstat (limited to 'src')
-rw-r--r-- | src/gflags.cc | 6 | ||||
-rw-r--r-- | src/gflags/gflags.h.in | 4 | ||||
-rw-r--r-- | src/windows/gflags/gflags.h | 22 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/gflags.cc b/src/gflags.cc index 5f8dde3..298d514 100644 --- a/src/gflags.cc +++ b/src/gflags.cc @@ -1934,7 +1934,7 @@ void AllowCommandLineReparsing() { allow_command_line_reparsing = true; } -uint32 ReparseCommandLineNonHelpFlags() { +void ReparseCommandLineNonHelpFlags() { // We make a copy of argc and argv to pass in const vector<string>& argvs = GetArgvs(); int tmp_argc = static_cast<int>(argvs.size()); @@ -1942,13 +1942,11 @@ uint32 ReparseCommandLineNonHelpFlags() { for (int i = 0; i < tmp_argc; ++i) tmp_argv[i] = strdup(argvs[i].c_str()); // TODO(csilvers): don't dup - const int retval = ParseCommandLineNonHelpFlags(&tmp_argc, &tmp_argv, false); + ParseCommandLineNonHelpFlags(&tmp_argc, &tmp_argv, false); for (int i = 0; i < tmp_argc; ++i) free(tmp_argv[i]); delete[] tmp_argv; - - return retval; } void ShutDownCommandLineFlags() { diff --git a/src/gflags/gflags.h.in b/src/gflags/gflags.h.in index e70f026..bade86d 100644 --- a/src/gflags/gflags.h.in +++ b/src/gflags/gflags.h.in @@ -385,9 +385,7 @@ extern void AllowCommandLineReparsing(); // separate command line argument that follows the flag argument. // Intended for handling flags from dynamically loaded libraries, // since their flags are not registered until they are loaded. -// Returns the index (into the original argv) of the first non-flag -// argument. (If remove_flags is true, will always return 1.) -extern uint32 ReparseCommandLineNonHelpFlags(); +extern void ReparseCommandLineNonHelpFlags(); // Clean up memory allocated by flags. This is only needed to reduce // the quantity of "potentially leaked" reports emitted by memory diff --git a/src/windows/gflags/gflags.h b/src/windows/gflags/gflags.h index fdafe2a..f9ed0d9 100644 --- a/src/windows/gflags/gflags.h +++ b/src/windows/gflags/gflags.h @@ -370,7 +370,8 @@ extern GFLAGS_DLL_DECL void SetUsageMessage(const std::string& usage); // Looks for flags in argv and parses them. Rearranges argv to put // flags first, or removes them entirely if remove_flags is true. // If a flag is defined more than once in the command line or flag -// file, the last definition is used. +// file, the last definition is used. Returns the index (into argv) +// of the first non-flag argument. // See top-of-file for more details on this function. #ifndef SWIG // In swig, use ParseCommandLineFlagsScript() instead. extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, @@ -384,9 +385,10 @@ extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, // changing default values for some FLAGS (via // e.g. SetCommandLineOptionWithMode calls) between the time of // command line parsing and the time of dumping help information for -// the flags as a result of command line parsing. -// If a flag is defined more than once in the command line or flag -// file, the last definition is used. +// the flags as a result of command line parsing. If a flag is +// defined more than once in the command line or flag file, the last +// definition is used. Returns the index (into argv) of the first +// non-flag argument. (If remove_flags is true, will always return 1.) extern GFLAGS_DLL_DECL uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv, bool remove_flags); // This is actually defined in commandlineflags_reporting.cc. @@ -400,12 +402,14 @@ extern GFLAGS_DLL_DECL void HandleCommandLineHelpFlags(); // in commandlinefla // are spawned. extern GFLAGS_DLL_DECL void AllowCommandLineReparsing(); -// Reparse the flags that have not yet been recognized. -// Only flags registered since the last parse will be recognized. -// Any flag value must be provided as part of the argument using "=", -// not as a separate command line argument that follows the flag argument. +// Reparse the flags that have not yet been recognized. Only flags +// registered since the last parse will be recognized. Any flag value +// must be provided as part of the argument using "=", not as a +// separate command line argument that follows the flag argument. // Intended for handling flags from dynamically loaded libraries, // since their flags are not registered until they are loaded. +// Returns the index (into the original argv) of the first non-flag +// argument. (If remove_flags is true, will always return 1.) extern GFLAGS_DLL_DECL uint32 ReparseCommandLineNonHelpFlags(); // Clean up memory allocated by flags. This is only needed to reduce @@ -478,7 +482,7 @@ extern const char kStrippedFlagHelp[]; #if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0 // Need this construct to avoid the 'defined but not used' warning. -#define MAYBE_STRIPPED_HELP(txt) (false ? (txt) : kStrippedFlagHelp) +#define MAYBE_STRIPPED_HELP(txt) (false ? (txt) : ::google::kStrippedFlagHelp) #else #define MAYBE_STRIPPED_HELP(txt) txt #endif |