mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-22 11:13:09 +02:00
- Changes necessary for a clean build on Fedora9.
This commit is contained in:
parent
e392b8a95e
commit
cb4f86e9f1
8 changed files with 50 additions and 40 deletions
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
@ -13,7 +14,7 @@
|
|||
#include "T.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static char* colors[] =
|
||||
static const char* colors[] =
|
||||
{
|
||||
"bold",
|
||||
"underline",
|
||||
|
@ -75,7 +76,7 @@ static char* colors[] =
|
|||
"",
|
||||
};
|
||||
|
||||
static char* attributes[] =
|
||||
static const char* attributes[] =
|
||||
{
|
||||
"project",
|
||||
"priority",
|
||||
|
@ -88,7 +89,7 @@ static char* attributes[] =
|
|||
"",
|
||||
};
|
||||
|
||||
static char* commands[] =
|
||||
static const char* commands[] =
|
||||
{
|
||||
"active",
|
||||
"add",
|
||||
|
@ -115,7 +116,7 @@ static char* commands[] =
|
|||
"",
|
||||
};
|
||||
|
||||
void guess (const std::string& type, char** list, std::string& candidate)
|
||||
void guess (const std::string& type, const char** list, std::string& candidate)
|
||||
{
|
||||
std::vector <std::string> options;
|
||||
for (int i = 0; list[i][0]; ++i)
|
||||
|
@ -136,7 +137,7 @@ void guess (const std::string& type, char** list, std::string& candidate)
|
|||
error += " '";
|
||||
error += candidate;
|
||||
error += "' - could be either of ";
|
||||
for (unsigned int i = 0; i < matches.size (); ++i)
|
||||
for (size_t i = 0; i < matches.size (); ++i)
|
||||
{
|
||||
if (i)
|
||||
error += ", ";
|
||||
|
@ -165,8 +166,8 @@ static bool isCommand (const std::string& candidate)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool validDate (std::string& date)
|
||||
{
|
||||
unsigned int firstSlash = date.find ("/");
|
||||
unsigned int secondSlash = date.find ("/", firstSlash + 1);
|
||||
size_t firstSlash = date.find ("/");
|
||||
size_t secondSlash = date.find ("/", firstSlash + 1);
|
||||
if (firstSlash != std::string::npos &&
|
||||
secondSlash != std::string::npos)
|
||||
{
|
||||
|
@ -236,7 +237,7 @@ static bool validAttribute (std::string& name, std::string& value)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
static bool validId (const std::string& input)
|
||||
{
|
||||
for (unsigned int i = 0; i < input.length (); ++i)
|
||||
for (size_t i = 0; i < input.length (); ++i)
|
||||
if (!::isdigit (input[i]))
|
||||
return false;
|
||||
|
||||
|
@ -275,13 +276,13 @@ static bool validSubstitution (
|
|||
std::string& from,
|
||||
std::string& to)
|
||||
{
|
||||
unsigned int first = input.find ('/');
|
||||
size_t first = input.find ('/');
|
||||
if (first != std::string::npos)
|
||||
{
|
||||
unsigned int second = input.find ('/', first + 1);
|
||||
size_t second = input.find ('/', first + 1);
|
||||
if (second != std::string::npos)
|
||||
{
|
||||
unsigned int third = input.find ('/', second + 1);
|
||||
size_t third = input.find ('/', second + 1);
|
||||
if (third != std::string::npos)
|
||||
{
|
||||
if (first == 0 &&
|
||||
|
@ -318,10 +319,10 @@ void parse (
|
|||
command = "";
|
||||
|
||||
std::string descCandidate = "";
|
||||
for (unsigned int i = 0; i < args.size (); ++i)
|
||||
for (size_t i = 0; i < args.size (); ++i)
|
||||
{
|
||||
std::string arg (args[i]);
|
||||
unsigned int colon; // Pointer to colon in argument.
|
||||
size_t colon; // Pointer to colon in argument.
|
||||
std::string from;
|
||||
std::string to;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue