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:
2024-11-20 20:01:47 +03:00
parent 24112498ce
commit caa7880cc4
40 changed files with 415 additions and 320 deletions

View File

@@ -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;