[Kstars-devel] KDE/kdeedu/kstars/kstars/indi
Alexey Khudyakov
alexey.skladnoy at gmail.com
Thu Aug 27 00:09:03 CEST 2009
SVN commit 1016062 by khudyakov:
Replace hardcoded array size with macro
Small refactoring in indidriver.cpp
CCMAIL: kstars-devel at kde.org
M +5 -13 indidriver.cpp
--- trunk/KDE/kdeedu/kstars/kstars/indi/indidriver.cpp #1016061:1016062
@@ -537,15 +537,10 @@
bool INDIDriver::isDeviceRunning(const QString &deviceLabel)
{
- foreach (IDevice *dev, devices)
- if (deviceLabel == dev->tree_label)
- {
- if (dev->state == IDevice::DEV_START)
- return true;
- else
- return false;
+ foreach(IDevice *dev, devices) {
+ if (deviceLabel == dev->tree_label)
+ return dev->state == IDevice::DEV_START;
}
-
return false;
}
@@ -619,15 +614,12 @@
return;
}
- char errmsg[1024];
+ char errmsg[ERRMSG_SIZE];
char c;
LilXML *xmlParser = newLilXML();
XMLEle *root = NULL;
- if (driverName.endsWith("drivers.xml"))
- primary_xml = true;
- else
- primary_xml = false;
+ primary_xml = driverName.endsWith("drivers.xml");
while ( file.getChar(&c))
{
More information about the Kstars-devel
mailing list