piminsleep bug and PIIODevice splitFullPath optimization
This commit is contained in:
@@ -387,12 +387,12 @@
|
|||||||
//! \~\brief
|
//! \~\brief
|
||||||
//! \~english Macro used for infinite wait
|
//! \~english Macro used for infinite wait
|
||||||
//! \~russian Макрос для бесконечного ожидания
|
//! \~russian Макрос для бесконечного ожидания
|
||||||
#define FOREVER_WAIT FOREVER piMinSleep;
|
#define FOREVER_WAIT FOREVER piMinSleep();
|
||||||
|
|
||||||
//! \~\brief
|
//! \~\brief
|
||||||
//! \~english Macro used for infinite wait
|
//! \~english Macro used for infinite wait
|
||||||
//! \~russian Макрос для бесконечного ожидания
|
//! \~russian Макрос для бесконечного ожидания
|
||||||
#define WAIT_FOREVER FOREVER piMinSleep;
|
#define WAIT_FOREVER FOREVER piMinSleep();
|
||||||
|
|
||||||
|
|
||||||
//! \~\brief
|
//! \~\brief
|
||||||
|
|||||||
@@ -462,23 +462,23 @@ void PIIODevice::configureFromVariant(const PIVariantTypes::IODevice & d) {
|
|||||||
void PIIODevice::splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * mode, DeviceOptions * opts) {
|
void PIIODevice::splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * mode, DeviceOptions * opts) {
|
||||||
int dm = 0;
|
int dm = 0;
|
||||||
DeviceOptions op = 0;
|
DeviceOptions op = 0;
|
||||||
if (fpwm.find("(") > 0 && fpwm.find(")") > 0) {
|
if (fpwm.find('(') > 0 && fpwm.find(')') > 0) {
|
||||||
PIString dms(fpwm.right(fpwm.length() - fpwm.findLast("(")).takeRange("(", ")").trim().toLowerCase().removeAll(' '));
|
PIString dms(fpwm.right(fpwm.length() - fpwm.findLast('(')).takeRange('(', ')').trim().toLowerCase().removeAll(' '));
|
||||||
PIStringList opts(dms.split(","));
|
PIStringList opts(dms.split(","));
|
||||||
piForeachC (PIString & o, opts) {
|
piForeachC (PIString & o, opts) {
|
||||||
//piCout << dms;
|
//piCout << dms;
|
||||||
if (o == "r" || o == "ro" || o == "read" || o == "readonly")
|
if (o == PIStringAscii("r") || o == PIStringAscii("ro") || o == PIStringAscii("read") || o == PIStringAscii("readonly"))
|
||||||
dm |= ReadOnly;
|
dm |= ReadOnly;
|
||||||
if (o == "w" || o == "wo" || o == "write" || o == "writeonly")
|
if (o == PIStringAscii("w") || o == PIStringAscii("wo") || o == PIStringAscii("write") || o == PIStringAscii("writeonly"))
|
||||||
dm |= WriteOnly;
|
dm |= WriteOnly;
|
||||||
if (o == "br" || o == "blockr" || o == "blockread" || o == "blockingread")
|
if (o == PIStringAscii("br") || o == PIStringAscii("blockr") || o == PIStringAscii("blockread") || o == PIStringAscii("blockingread"))
|
||||||
op |= BlockingRead;
|
op |= BlockingRead;
|
||||||
if (o == "bw" || o == "blockw" || o == "blockwrite" || o == "blockingwrite")
|
if (o == PIStringAscii("bw") || o == PIStringAscii("blockw") || o == PIStringAscii("blockwrite") || o == PIStringAscii("blockingwrite"))
|
||||||
op |= BlockingWrite;
|
op |= BlockingWrite;
|
||||||
if (o == "brw" || o == "bwr" || o == "blockrw" || o == "blockwr" || o == "blockreadrite" || o == "blockingreadwrite")
|
if (o == PIStringAscii("brw") || o == PIStringAscii("bwr") || o == PIStringAscii("blockrw") || o == PIStringAscii("blockwr") || o == PIStringAscii("blockreadrite") || o == PIStringAscii("blockingreadwrite"))
|
||||||
op |= BlockingRead | BlockingWrite;
|
op |= BlockingRead | BlockingWrite;
|
||||||
}
|
}
|
||||||
fpwm.cutRight(fpwm.length() - fpwm.findLast("(")).trim();
|
fpwm.cutRight(fpwm.length() - fpwm.findLast('(')).trim();
|
||||||
}
|
}
|
||||||
if (dm == 0) dm = ReadWrite;
|
if (dm == 0) dm = ReadWrite;
|
||||||
if (full_path) *full_path = fpwm;
|
if (full_path) *full_path = fpwm;
|
||||||
|
|||||||
Reference in New Issue
Block a user