Compile again, replace clib strXXX with std::string
This commit is contained in:
parent
e5abcb1d4e
commit
657cd883d7
2 changed files with 8 additions and 6 deletions
|
@ -66,7 +66,7 @@ bool FGEventSetting::Test()
|
||||||
|
|
||||||
static inline bool StartsWith( string & s, const char * cp )
|
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 )
|
FGInputEvent * FGInputEvent::NewObject( FGInputDevice * device, SGPropertyNode_ptr node )
|
||||||
|
@ -223,8 +223,8 @@ FGInputDevice::~FGInputDevice()
|
||||||
if( nasal ) {
|
if( nasal ) {
|
||||||
SGPropertyNode_ptr nasalClose = nasal->getNode("close");
|
SGPropertyNode_ptr nasalClose = nasal->getNode("close");
|
||||||
if (nasalClose) {
|
if (nasalClose) {
|
||||||
const char *s = nasalClose->getStringValue();
|
const string s = nasalClose->getStringValue();
|
||||||
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nas->deleteModule(nasalModule.c_str());
|
nas->deleteModule(nasalModule.c_str());
|
||||||
|
@ -253,10 +253,10 @@ void FGInputDevice::Configure( SGPropertyNode_ptr aDeviceNode )
|
||||||
if (nasal) {
|
if (nasal) {
|
||||||
SGPropertyNode_ptr open = nasal->getNode("open");
|
SGPropertyNode_ptr open = nasal->getNode("open");
|
||||||
if (open) {
|
if (open) {
|
||||||
const char *s = open->getStringValue();
|
const string s = open->getStringValue();
|
||||||
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
|
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
|
||||||
if (nas)
|
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
|
||||||
struct TypeCode {
|
struct TypeCode {
|
||||||
unsigned type;
|
unsigned type;
|
||||||
|
@ -238,7 +240,7 @@ static EventNameByType EVENT_NAME_BY_TYPE;
|
||||||
|
|
||||||
struct ltstr {
|
struct ltstr {
|
||||||
bool operator()(const char * s1, const char * s2 ) const {
|
bool operator()(const char * s1, const char * s2 ) const {
|
||||||
return strcmp( s1, s2 ) < 0;
|
return string(s1).compare( s2 ) < 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue