mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Code Cleanup: Compiler nits
.. fix further XCode semantic warning messages (still some left) .. WIN32 gcc builds
This commit is contained in:
@@ -876,8 +876,6 @@ int ANT::rawWrite(uint8_t *bytes, int size) // unix!!
|
||||
|
||||
int ANT::rawRead(uint8_t bytes[], int size)
|
||||
{
|
||||
int rc=0;
|
||||
|
||||
#ifdef WIN32
|
||||
switch (usbMode) {
|
||||
case USB1:
|
||||
@@ -887,7 +885,6 @@ int ANT::rawRead(uint8_t bytes[], int size)
|
||||
return usb2->read((char *)bytes, size);
|
||||
break;
|
||||
default:
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -904,13 +901,14 @@ int ANT::rawRead(uint8_t bytes[], int size)
|
||||
// read one byte at a time sleeping when no data ready
|
||||
// until we timeout waiting then return error
|
||||
for (i=0; i<size; i++) {
|
||||
rc = read(devicePort, &byte, 1);
|
||||
int rc = read(devicePort, &byte, 1);
|
||||
if (rc == -1 || rc == 0) return -1; // error!
|
||||
else bytes[i] = byte;
|
||||
}
|
||||
return i;
|
||||
|
||||
#endif
|
||||
return -1; // keep compiler happy.
|
||||
}
|
||||
|
||||
// convert 'p' 'c' etc into ANT values for device type
|
||||
|
||||
@@ -168,12 +168,12 @@ struct Bin2FileReaderState
|
||||
if (alt == 0x8000)
|
||||
alt = 0;
|
||||
|
||||
if (lat == -2147483648) //2147483648
|
||||
if ((long)lat == -2147483648L) //2147483648
|
||||
lat = 0;
|
||||
else
|
||||
lat = lat/10000000.0;
|
||||
|
||||
if (lng == -2147483648) //0x80000000
|
||||
if ((long)lng == -2147483648L) //0x80000000
|
||||
lng = 0;
|
||||
else
|
||||
lng = lng/10000000.0;
|
||||
|
||||
@@ -908,7 +908,7 @@ int Computrainer::openPort()
|
||||
|
||||
int Computrainer::rawWrite(uint8_t *bytes, int size) // unix!!
|
||||
{
|
||||
int rc=0,ibytes;
|
||||
int rc=0;
|
||||
|
||||
#ifdef WIN32
|
||||
DWORD cBytes;
|
||||
@@ -917,7 +917,7 @@ int Computrainer::rawWrite(uint8_t *bytes, int size) // unix!!
|
||||
return rc;
|
||||
|
||||
#else
|
||||
|
||||
int ibytes;
|
||||
ioctl(devicePort, FIONREAD, &ibytes);
|
||||
|
||||
// timeouts are less critical for writing, since vols are low
|
||||
|
||||
@@ -47,7 +47,7 @@ class NullController : public RealtimeController
|
||||
int pause();
|
||||
int restart();
|
||||
bool find();
|
||||
bool discover(char *) { return true; }
|
||||
bool discover(QString) { return true; }
|
||||
bool doesPush() { return false; }
|
||||
bool doesPull() { return true; }
|
||||
bool doesLoad() { return false; }
|
||||
|
||||
@@ -324,7 +324,7 @@ public:
|
||||
enum { WW_WorkoutTypePage, WW_AbsWattagePage, WW_RelWattagePage, WW_GradientPage, WW_ImportPage };
|
||||
|
||||
WorkoutWizard(QWidget *parent = NULL);
|
||||
int nextId();
|
||||
|
||||
// called at the end of the wizard...
|
||||
void accept();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user