Compilation fixes for gcc 4.4

This commit is contained in:
Nathan Jones 2009-07-10 20:09:11 -04:00 committed by John Wiegley
parent a5d69b6d07
commit 9592bac00d
3 changed files with 4 additions and 4 deletions

View file

@ -201,7 +201,7 @@ static amount_t convert_number(const std::string& number,
{
const char * num = number.c_str();
if (char * p = std::strchr(num, '/')) {
if (const char * p = std::strchr(num, '/')) {
std::string numer_str(num, p - num);
std::string denom_str(p + 1);

View file

@ -892,7 +892,7 @@ OPT_BEGIN(market, "V") {
namespace {
void parse_price_setting(const char * optarg)
{
char * equals = std::strchr(optarg, '=');
const char * equals = std::strchr(optarg, '=');
if (! equals)
return;

View file

@ -298,8 +298,8 @@ transaction_t * parse_transaction(char * line, account_t * account,
DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed a note '" << xact->note << "'");
if (char * b = std::strchr(xact->note.c_str(), '['))
if (char * e = std::strchr(xact->note.c_str(), ']')) {
if (const char * b = std::strchr(xact->note.c_str(), '['))
if (const char * e = std::strchr(xact->note.c_str(), ']')) {
char buf[256];
std::strncpy(buf, b + 1, e - b - 1);
buf[e - b - 1] = '\0';