get rid of piForeach
apply some code analyzer recommendations ICU flag now check if libicu exists prepare for more accurate growth of containers (limited PoT, then constantly increase size)
This commit is contained in:
@@ -685,7 +685,7 @@ bool PISerial::openDevice() {
|
||||
if (!pl.startsWith("/") && !pl.startsWith("com")) {
|
||||
p.clear();
|
||||
PIVector<DeviceInfo> devs = availableDevicesInfo();
|
||||
piForeachC(DeviceInfo & d, devs) {
|
||||
for (const auto & d: devs) {
|
||||
if (d.id() == pl) {
|
||||
p = d.path;
|
||||
break;
|
||||
@@ -1011,7 +1011,7 @@ PIPropertyStorage PISerial::constructVariantDevice() const {
|
||||
PIVariantTypes::Enum e;
|
||||
|
||||
PIVector<int> as = availableSpeeds();
|
||||
piForeachC(int s, as) {
|
||||
for (const auto s: as) {
|
||||
e << PIVariantTypes::Enumerator(s, PIString::fromNumber(s));
|
||||
}
|
||||
e.selectValue((int)inSpeed());
|
||||
@@ -1073,7 +1073,7 @@ PIVector<int> PISerial::availableSpeeds() {
|
||||
PIStringList PISerial::availableDevices(bool test) {
|
||||
PIVector<DeviceInfo> devs = availableDevicesInfo(test);
|
||||
PIStringList ret;
|
||||
piForeachC(DeviceInfo & d, devs)
|
||||
for (const auto & d: devs)
|
||||
ret << d.path;
|
||||
return ret;
|
||||
}
|
||||
@@ -1232,8 +1232,8 @@ PIVector<PISerial::DeviceInfo> PISerial::availableDevicesInfo(bool test) {
|
||||
# ifdef LINUX
|
||||
char linkbuf[1024];
|
||||
# endif
|
||||
piForeachC(PIFile::FileInfo & e, de) { // TODO changes in FileInfo
|
||||
piForeachC(PIString & p, prefixes) {
|
||||
for (const auto & e: de) { // TODO changes in FileInfo
|
||||
for (const auto & p: prefixes) {
|
||||
if (e.name().startsWith(p)) {
|
||||
di = DeviceInfo();
|
||||
di.path = e.path;
|
||||
|
||||
Reference in New Issue
Block a user