Add OpenBSD compile support

Thanks to Claus Assmann for the fixups;
- RideNavigator double foreach loops used same name for iterator
- N_TTY line discipline is not defined on OpenBSD (possibly)

Would be nice to have a better fix for the line discipline
stuff, but 0 is usually the TTY line discipline. Bit of a
hack, but ok for now.
This commit is contained in:
Mark Liversedge
2012-11-20 06:08:47 +00:00
parent 0a12f3c68c
commit a658bea81f
3 changed files with 9 additions and 3 deletions

View File

@@ -63,6 +63,9 @@
#include <termios.h> // unix!!
#include <unistd.h> // unix!!
#include <sys/ioctl.h>
#ifndef N_TTY // for OpenBSD, this is a hack XXX
#define N_TTY 0
#endif
#endif
#if defined GC_HAVE_LIBUSB

View File

@@ -47,6 +47,9 @@
#include <termios.h> // unix!!
#include <unistd.h> // unix!!
#include <sys/ioctl.h>
#ifndef N_TTY // for OpenBSD, this is a hack XXX
#define N_TTY 0
#endif
#endif
#include <stdio.h>

View File

@@ -685,12 +685,12 @@ QString
GroupByModel::groupFromValue(QString headingName, QString value, double rank, double count) const
{
// Check for predefined thresholds / zones / bands for this metric/column
foreach (groupRange range, groupRanges) {
if (range.column == headingName) {
foreach (groupRange orange, groupRanges) {
if (orange.column == headingName) {
double number = value.toDouble();
// use thresholds defined for this column/metric
foreach(groupRange::range range, range.ranges) {
foreach(groupRange::range range, orange.ranges) {
// 0-x is lower, x-0 is upper, 0-0 is no data and x-x is a range
if (range.low == 0.0 && range.high == 0.0 && number == 0.0) return range.name;