Reverted change and introduced another change

Reverted the change that changed the type of variable chars_left to size_t and
instead casted the chars_left variable to size_t in the assertion causing a
warning in gflags_reporting.cc
This commit is contained in:
Aaryaman Sagar 2016-08-24 12:01:33 -04:00
parent 3b185f2882
commit e66e30256f

View file

@ -122,11 +122,12 @@ string DescribeOneFlag(const CommandLineFlagInfo& flag) {
flag.name.c_str(),
flag.description.c_str());
const char* c_string = main_part.c_str();
size_t chars_left = main_part.length();
int chars_left = main_part.length();
string final_string = "";
int chars_in_line = 0; // how many chars in current line so far?
while (1) {
assert(chars_left == strlen(c_string)); // Unless there's a \0 in there?
assert(static_cast<size_t>(chars_left)
== strlen(c_string)); // Unless there's a \0 in there?
const char* newline = strchr(c_string, '\n');
if (newline == NULL && chars_in_line+chars_left < kLineLength) {
// The whole remainder of the string fits on this line