Merge branch '2.4.3' of ssh://git.tasktools.org/tm/task into 2.4.3

This commit is contained in:
Paul Beckingham 2015-03-29 17:30:06 -04:00
commit 73f4f55e0a
9 changed files with 34 additions and 31 deletions

View file

@ -68,6 +68,8 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (CMAKE_CXX_FLAGS "${_CXX11_FLAGS} ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "-Wall -Wsign-compare -Wreturn-type ${CMAKE_CXX_FLAGS}")
if (NETBSD)
# Since readline, etc likely to be in /usr/pkg/lib, not standard library
# Otherwise will remove links during install

View file

@ -443,7 +443,7 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */)
// For propagation.
_strict = strict;
for (int i = 0; i < _original_args.size (); ++i)
for (unsigned int i = 0; i < _original_args.size (); ++i)
{
std::string raw = _original_args[i];
A a ("arg", raw);
@ -2362,7 +2362,7 @@ bool CLI::isName (const std::string& raw) const
{
if (raw != "")
{
for (int i = 0; i < raw.length (); ++i)
for (unsigned int i = 0; i < raw.length (); ++i)
{
if (i == 0 && ! Lexer::isIdentifierStart (raw[i]))
return false;

View file

@ -319,6 +319,7 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
start = original_start + n.cursor ();
// Linear lookup - should be logarithmic.
double seconds = 1;
for (unsigned int i = 0; i < NUM_DURATIONS; i++)
{
if (durations[i].unit == unit &&

View file

@ -446,7 +446,7 @@ void Eval::evaluatePostfixStack (
void Eval::infixParse (
std::vector <std::pair <std::string, Lexer::Type> >& infix) const
{
int i = 0;
unsigned int i = 0;
parseLogical (infix, i);
}
@ -454,7 +454,7 @@ void Eval::infixParse (
// Logical --> Regex {( "and" | "or" | "xor" ) Regex}
bool Eval::parseLogical (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseRegex (infix, i))
@ -480,7 +480,7 @@ bool Eval::parseLogical (
// Regex --> Equality {( "~" | "!~" ) Equality}
bool Eval::parseRegex (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseEquality (infix, i))
@ -505,7 +505,7 @@ bool Eval::parseRegex (
// Equality --> Comparative {( "==" | "=" | "!==" | "!=" ) Comparative}
bool Eval::parseEquality (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseComparative (infix, i))
@ -532,7 +532,7 @@ bool Eval::parseEquality (
// Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic}
bool Eval::parseComparative (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseArithmetic (infix, i))
@ -559,7 +559,7 @@ bool Eval::parseComparative (
// Arithmetic --> Geometric {( "+" | "-" ) Geometric}
bool Eval::parseArithmetic (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseGeometric (infix, i))
@ -584,7 +584,7 @@ bool Eval::parseArithmetic (
// Geometric --> Tag {( "*" | "/" | "%" ) Tag}
bool Eval::parseGeometric (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseTag (infix, i))
@ -610,7 +610,7 @@ bool Eval::parseGeometric (
// Tag --> Unary {( "_hastag_" | "_notag_" ) Unary}
bool Eval::parseTag (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size () &&
parseUnary (infix, i))
@ -635,7 +635,7 @@ bool Eval::parseTag (
// Unary --> [( "-" | "+" | "!" )] Exponent
bool Eval::parseUnary (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size ())
{
@ -662,7 +662,7 @@ bool Eval::parseUnary (
// Exponent --> Primitive ["^" Primitive]
bool Eval::parseExponent (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int& i) const
{
if (i < infix.size () &&
parsePrimitive (infix, i))
@ -686,7 +686,7 @@ bool Eval::parseExponent (
// Primitive --> "(" Logical ")" | Variant
bool Eval::parsePrimitive (
std::vector <std::pair <std::string, Lexer::Type> >& infix,
int &i) const
unsigned int &i) const
{
if (i < infix.size ())
{
@ -781,7 +781,7 @@ void Eval::infixToPostfix (
// Operator characteristics.
char type;
int precedence;
unsigned int precedence;
char associativity;
std::vector <std::pair <std::string, Lexer::Type> >::iterator token;
@ -811,7 +811,7 @@ void Eval::infixToPostfix (
identifyOperator (token->first, type, precedence, associativity))
{
char type2;
int precedence2;
unsigned int precedence2;
char associativity2;
while (op_stack.size () > 0 &&
identifyOperator (op_stack.back ().first, type2, precedence2, associativity2) &&
@ -847,7 +847,7 @@ void Eval::infixToPostfix (
bool Eval::identifyOperator (
const std::string& op,
char& type,
int& precedence,
unsigned int& precedence,
char& associativity) const
{
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)

View file

@ -56,17 +56,17 @@ private:
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer::Type> >&, Variant&) const;
void infixToPostfix (std::vector <std::pair <std::string, Lexer::Type> >&) const;
void infixParse (std::vector <std::pair <std::string, Lexer::Type> >&) const;
bool parseLogical (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseRegex (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseEquality (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseComparative (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseArithmetic (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseGeometric (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseTag (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseUnary (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parseExponent (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool parsePrimitive (std::vector <std::pair <std::string, Lexer::Type> >&, int &) const;
bool identifyOperator (const std::string&, char&, int&, char&) const;
bool parseLogical (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseRegex (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseEquality (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseComparative (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseArithmetic (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseGeometric (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseTag (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseUnary (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parseExponent (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool parsePrimitive (std::vector <std::pair <std::string, Lexer::Type> >&, unsigned int &) const;
bool identifyOperator (const std::string&, char&, unsigned int&, char&) const;
std::string dump (std::vector <std::pair <std::string, Lexer::Type> >&) const;

View file

@ -466,7 +466,7 @@ void Hooks::assertValidJSON (const std::vector <std::string>& input) const
}
////////////////////////////////////////////////////////////////////////////////
void Hooks::assertNTasks (const std::vector <std::string>& input, int n) const
void Hooks::assertNTasks (const std::vector <std::string>& input, unsigned int n) const
{
if (input.size () != n)
{

View file

@ -54,7 +54,7 @@ private:
void separateOutput (const std::vector <std::string>&, std::vector <std::string>&, std::vector <std::string>&) const;
bool isJSON (const std::string&) const;
void assertValidJSON (const std::vector <std::string>&) const;
void assertNTasks (const std::vector <std::string>&, int) const;
void assertNTasks (const std::vector <std::string>&, unsigned int) const;
void assertSameTask (const std::vector <std::string>&, const Task&) const;
void assertFeedback (const std::vector <std::string>&) const;
int callHookScript (const std::string&, const std::vector <std::string>&, std::vector <std::string>&);

View file

@ -102,7 +102,7 @@ bool TF2::get (int id, Task& task)
// pending.data file, the task in question cannot appear earlier than line
// (id - 1) in the file. It can, however, appear significantly later because
// it is not known how recent a GC operation was run.
for (int i = id - 1; i < _tasks.size (); ++i)
for (unsigned int i = id - 1; i < _tasks.size (); ++i)
{
if (_tasks[i].id == id)
{

View file

@ -956,7 +956,7 @@ std::string rightJustify (const int input, const int width)
std::string rightJustify (const std::string& input, const int width)
{
unsigned int len = utf8_text_width (input);
return ((width > len)
return (((unsigned int) width > len)
? std::string (width - len, ' ')
: "")
+ input;