use std::strlen not strlen from c

This commit is contained in:
Dane Springmeyer 2013-01-15 13:32:09 -08:00
parent 4bfc9f7cca
commit d718e95ed6
6 changed files with 17 additions and 11 deletions

View file

@ -1,6 +1,6 @@
#include "MapSource.h"
#include <gd.h>
#include <cstring>
void MapSource::process_cmd_line_args(int argc,char *argv[])
{
@ -15,7 +15,7 @@ void MapSource::process_cmd_line_args(int argc,char *argv[])
while(argc>0)
{
if(argv[0][0]=='-' && strlen(argv[0])>1)
if(argv[0][0]=='-' && std::strlen(argv[0])>1)
{
switch(argv[0][1])
{

View file

@ -47,6 +47,8 @@
#include <boost/lexical_cast.hpp>
#endif
#include <cstring>
namespace mapnik {
namespace util {
@ -80,7 +82,7 @@ struct bool_symbols : qi::symbols<char,bool>
bool string2bool(const char * value, bool & result)
{
using boost::spirit::qi::no_case;
size_t length = strlen(value);
size_t length = std::strlen(value);
if (length < 1 || value == NULL)
return false;
const char *iter = value;
@ -102,7 +104,7 @@ bool string2bool(std::string const& value, bool & result)
bool string2int(const char * value, int & result)
{
size_t length = strlen(value);
size_t length = std::strlen(value);
if (length < 1 || value == NULL)
return false;
const char *iter = value;
@ -124,7 +126,7 @@ bool string2int(std::string const& value, int & result)
#ifdef BIGINT
bool string2int(const char * value, mapnik::value_integer & result)
{
size_t length = strlen(value);
size_t length = std::strlen(value);
if (length < 1 || value == NULL)
return false;
const char *iter = value;
@ -156,7 +158,7 @@ bool string2double(std::string const& value, double & result)
bool string2double(const char * value, double & result)
{
size_t length = strlen(value);
size_t length = std::strlen(value);
if (length < 1 || value == NULL)
return false;
const char *iter = value;
@ -177,7 +179,7 @@ bool string2float(std::string const& value, float & result)
bool string2float(const char * value, float & result)
{
size_t length = strlen(value);
size_t length = std::strlen(value);
if (length < 1 || value == NULL)
return false;
const char *iter = value;

View file

@ -40,6 +40,7 @@
#include <string>
#include <stdexcept>
#include <vector>
#include <cstring>
namespace mapnik { namespace svg {
@ -86,7 +87,7 @@ double parse_double(const char* str)
{
using namespace boost::spirit::qi;
double val = 0.0;
parse(str, str+ strlen(str),double_,val);
parse(str, str + std::strlen(str),double_,val);
return val;
}
@ -102,7 +103,7 @@ double parse_double_optional_percent(const char* str, bool &percent)
double val = 0.0;
char unit='\0';
parse(str, str+ strlen(str),double_[ref(val)=_1] >> *char_('%')[ref(unit)=_1]);
parse(str, str + std::strlen(str),double_[ref(val)=_1] >> *char_('%')[ref(unit)=_1]);
if (unit =='%')
{
percent = true;
@ -120,7 +121,7 @@ bool parse_style (const char* str, pairs_type & v)
using namespace boost::spirit::qi;
typedef boost::spirit::ascii::space_type skip_type;
key_value_sequence_ordered<const char*, skip_type> kv_parser;
return phrase_parse(str, str + strlen(str), kv_parser, skip_type(), v);
return phrase_parse(str, str + std::strlen(str), kv_parser, skip_type(), v);
}
svg_parser::svg_parser(svg_converter<svg_path_adapter,
@ -458,7 +459,7 @@ void svg_parser::parse_path(xmlTextReaderPtr reader)
if (value)
{
// d="" (empty paths) are valid
if (strlen((const char*)value) < 1)
if (std::strlen((const char*)value) < 1)
{
xmlFree(value);
}

View file

@ -31,6 +31,7 @@
// stl
#include <string>
#include <cstring>
namespace mapnik { namespace svg {

View file

@ -26,6 +26,7 @@
#include <mapnik/svg/svg_converter.hpp>
// stl
#include <string>
#include <cstring>
namespace mapnik { namespace svg {

View file

@ -27,6 +27,7 @@
#include "agg_trans_affine.h"
// stl
#include <string>
#include <cstring>
namespace mapnik { namespace svg {