Commit graph

139 commits

Author SHA1 Message Date
Vertexwahn
82793e3f38 Fix spelling 2024-06-09 22:08:02 +01:00
Andrew Gasparovic
f7388c6655 Simplify found_question_marks tests 2020-06-16 22:11:03 +01:00
Andrew Gasparovic
84968c6bb2 Remove fallthrough switch case
GCC gives an implicit-fallthrough warning (included in -Wextra). C++17 has the [[fallthrough]] attribute, and GCC7+ has __attribute__ ((fallthrough)), but I didn't want to require either so I refactored the switch into if statements.
2020-06-16 22:11:03 +01:00
Andrew Gasparovic
ef8e134d48 Remove unreachable code
INFO: From Compiling external/com_github_gflags_gflags/src/gflags_completions.cc:
external/com_github_gflags_gflags/src/gflags_completions.cc:459:16: warning: code will never be executed [-Wunreachable-code]
      DVLOG(3) << "Result: most-common match";
               ^~
1 warning generated.
2020-06-13 00:41:51 +01:00
Trevor Hickey
2e227c3daa remove attribute where it does not apply
```
gflags.h(226): warning: attribute "visibility" does not apply here
```

The visibility attribute applies to symbols like functions and variables. A definition of an enumeration type that doesn't contain a variable name doesn't create any symbols.
2020-01-16 00:49:58 +00:00
Jacky Wu
d9b184bd00 Avoid no-match message in case STRIP_FLAG_HELP been set
If the workaround in issue #43 is used along with the define of
STRIP_FLAG_HELP to 1, there would be a wrong "No modules matched"
message been print at end of the usage message.

That's because we continue the loop if we see strip flag help value and
never set the `found_match` flag to true even if we found a match.

By moving the set statement above the continue, we can avoid this wrong
message.
2019-11-13 14:07:30 +00:00
Rosen Penev
6c8f50b567 [clang-tidy] Remove redundant initialization of strings
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-01 09:26:51 +00:00
Rosen Penev
6d224d34b6 [clang-tidy] Replace deprecated C headers
Deprecated with C++14.

Found with modernize-deprecated-headers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-01 09:26:51 +00:00
Andreas Schuh
4c0bbc0604 fix: Use 'default' visibility for GCC 2018-11-11 20:35:02 +00:00
Andreas Schuh
0c7012d647 fix: Build with MinGW version after Nov 2016 2018-11-09 16:38:57 +00:00
Andreas Schuh
b051bace27 fix: Build with _UNICODE support on Windows 2018-11-09 16:16:24 +00:00
Andreas Schuh
7e70988188 fix: PVS Studio warnings 2018-10-15 02:15:17 -07:00
Andreas Schuh
754d3329a6 fix: No extern template declaration for MSVC <12.0 2018-10-15 00:50:48 -07:00
Andreas Schuh
82456f220f fix: Declare FlagRegisterer c’tor explicit template instanations as extern in header 2018-10-15 00:50:48 -07:00
Andreas Schuh
3e2e349307 fix: Declare FALGS_no##name variables as static 2018-10-14 00:16:13 -07:00
Andreas Schuh
04c8ce76e2 fix: Indentation, use spaces instead of real tabs 2018-09-28 16:00:51 +01:00
wuchenghui
48677f930d fix missing-field-initializers warnings on gcc 2018-09-28 14:50:39 +01:00
drillsar
6e536553ef Fix V728 excessive check 2018-09-28 14:49:19 +01:00
Matt Hargett
2c49763b73 Fix build on some clang variants
Some platforms' yval.h defines restrict as a macro when using clang, which causes this file to not compile.
2018-09-28 13:21:24 +01:00
Sumit Gupta
23348465a0 Removed unused functions. 2017-10-08 10:52:46 +01:00
Yi Wang
60784b53e3 Remove using ::fLS::clstring; 2017-09-01 11:12:50 +02:00
Andreas Schuh
57ceb0ecc8 enh: Move CMake defines to separate header, unused by Bazel
This change avoids having to configure a private .h.in file during the Bazel build such that these files are not available to dependent projects in the GENDIR of the external gflags project.
2017-09-01 11:10:03 +02:00
Andreas Schuh
aa2d0f7b4e fix: Remove obsolete and unused CleanFileName code 2017-07-13 16:28:54 +01:00
Andreas Schuh
74603f5ed3 fix: Static code analyzer error regarding strncmp with empty kRootDir string 2017-07-11 14:47:40 +01:00
Ben Vanik
4a694e8736 Use inttypes.h on VC++ 2013 and up
Warnings will spit out on newer compilers due to PRI* being redefined.
Tested with VC++ 2015 and 2017. [Blog post](https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/) describing the defines being added in 2013.
2017-05-16 11:37:59 +01:00
Mmanu Chaturvedi
95ffb27c9c Fix static initialization order fiasco caused by global registry lock (#215) 2017-05-12 22:11:28 +01:00
Arkady Shapkin
652651b421 Fix statically linked gflags library with MSVC
Fix #211
2017-05-06 01:47:54 +01:00
Dan Minor
9314597d4b Mark single argument constructors in mutex.h as explicit. 2017-03-29 13:01:34 +01:00
Andreas Schuh
ac6834e979 fix: Remove unused program_name variable 2016-11-26 21:25:02 +00:00
Andreas Schuh
37e2867335 enh: Refactored Bazel BUILD rules 2016-11-25 17:18:01 +00:00
Andreas Schuh
8f2c22a03f Revert "enh: Rename private sources, include public headers with rel path" 2016-11-25 13:53:24 +00:00
Andreas Schuh
ea6144e243 enh: Rename private sources, include public headers with rel path 2016-11-25 12:38:54 +00:00
Andreas Schuh
3e7ef74a07 enh: Set GFLAGS_IS_A_DLL in INTERFACE_COMPILE_DEFINITIONS 2016-11-25 08:30:21 +00:00
Todd Lipcon
14c0e93755 Convert dashes to underscores for unknown flags (#177) 2016-11-22 00:11:14 +00:00
David Lam
cce68f0c9c Fix error messages to not truncate to 255 characters (#175) 2016-10-05 08:25:50 +01:00
Andreas Schuh
f4eace1331 fix: Validate modified flags only once (#173) 2016-09-17 17:17:24 +01:00
田欧
408061b469 fix make error for lacking namespace (#170) 2016-08-31 06:39:41 +01:00
Aaryaman Sagar
7d31c02de8 Fix unsigned comparison error in gflags_reporting.cc (#168) 2016-08-24 18:03:08 +01:00
Dreamer
a69b2544d6 Fix Windows linker errors and warnings. (#166) 2016-08-03 08:25:38 +01:00
dreamer.dead
7ba9921866 Fix wrong type comparison and outdated OfType() usage. 2016-08-01 16:45:49 +03:00
dreamer.dead
30519426c3 Fix indentation and remove outdated assert. 2016-08-01 15:47:46 +03:00
dreamer.dead
3c0ad4fc9e Extract common code from FlagRegisterer to reduce size. 2016-08-01 14:52:26 +03:00
dreamer.dead
a1e461d61d Change template FlagValue::OfType() to Type() getter. 2016-08-01 14:51:11 +03:00
dreamer.dead
46ea10f071 Do not pass flag type as a char literal when registering a new flag.
It is possible to create a type-safe version of FlagRegisterer
ctor (as well as some internal gflags classes), that will deduce
type of the new flag automatically.

This results in removing quite a few calls to strcmp() when new
flag is created.

No existing behavior change.
2016-07-29 21:02:29 +03:00
Andreas Schuh
fe57e5af4d Merge pull request #156 from dreamer-dead/fix-flag-value-typename
Fix incorrect flag value typename for uint32.
2016-07-20 10:24:14 +01:00
dreamer.dead
5ef4c3c076 Fix uint32 type name. 2016-07-20 12:16:34 +03:00
dreamer.dead
3e946c9ebc Add missing reference symbol to a function parameter. 2016-07-18 18:44:20 +03:00
liuchang0812
0c17f1ee02 fix bug about LRLF 2016-06-28 17:57:02 +08:00
Allan L. Bazinet
81d8a9234b Correct FV_MAX_INDEX 2016-04-05 10:56:57 -07:00
Allan L. Bazinet
eaf05340dc Support uint32 as flag type
From #99, “Given that there is an unsigned flag type for 64-bit
integers, it is probably reasonable to request/expect the same for
32-bit integers.”
2016-04-05 10:50:21 -07:00