1
0
Fork 0

Compile again, replace clib strXXX with std::string

This commit is contained in:
Torsten Dreyer 2010-10-25 14:48:56 +02:00
parent e5abcb1d4e
commit 657cd883d7
2 changed files with 8 additions and 6 deletions

View file

@ -66,7 +66,7 @@ bool FGEventSetting::Test()
static inline bool StartsWith( string & s, const char * cp )
{
return s.compare( 0, strlen(cp), cp ) == 0;
return s.find( cp ) == 0;
}
FGInputEvent * FGInputEvent::NewObject( FGInputDevice * device, SGPropertyNode_ptr node )
@ -223,8 +223,8 @@ FGInputDevice::~FGInputDevice()
if( nasal ) {
SGPropertyNode_ptr nasalClose = nasal->getNode("close");
if (nasalClose) {
const char *s = nasalClose->getStringValue();
nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s, strlen(s), deviceNode );
const string s = nasalClose->getStringValue();
nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s.c_str(), s.length(), deviceNode );
}
}
nas->deleteModule(nasalModule.c_str());
@ -253,10 +253,10 @@ void FGInputDevice::Configure( SGPropertyNode_ptr aDeviceNode )
if (nasal) {
SGPropertyNode_ptr open = nasal->getNode("open");
if (open) {
const char *s = open->getStringValue();
const string s = open->getStringValue();
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
if (nas)
nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s, strlen(s), deviceNode );
nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s.c_str(), s.length(), deviceNode );
}
}

View file

@ -29,6 +29,8 @@
#include <poll.h>
#include <linux/input.h>
#include <dbus/dbus.h>
#include <fcntl.h>
struct TypeCode {
unsigned type;
@ -238,7 +240,7 @@ static EventNameByType EVENT_NAME_BY_TYPE;
struct ltstr {
bool operator()(const char * s1, const char * s2 ) const {
return strcmp( s1, s2 ) < 0;
return string(s1).compare( s2 ) < 0;
}
};