OSX compilation errors fixed

This commit is contained in:
bsongis
2014-06-05 07:45:34 +02:00
parent 001585a194
commit e9b28898d0
13 changed files with 49 additions and 47 deletions
+27 -27
View File
@@ -23,7 +23,7 @@
#include <algorithm>
#include "eeprominterface.h"
EFile::EFile():
RleFile::RleFile():
eeprom(NULL),
eeprom_size(0),
eeFs(NULL),
@@ -31,7 +31,7 @@ eeFsArm(NULL)
{
}
void EFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
this->eeprom_size = size;
@@ -92,7 +92,7 @@ void EFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
}
}
bool EFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
{
this->eeprom = eeprom;
this->eeprom_size = size;
@@ -137,29 +137,29 @@ bool EFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
}
}
void EFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
void RleFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
{
memcpy(pointer_ram, &eeprom[pointer_eeprom], size);
}
void EFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
void RleFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
{
memcpy(&eeprom[pointer_eeprom], pointer_ram, size);
}
uint8_t EFile::EeFsRead(unsigned int blk, unsigned int ofs)
uint8_t RleFile::EeFsRead(unsigned int blk, unsigned int ofs)
{
uint8_t ret;
eeprom_read_block(&ret, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
return ret;
}
void EFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
void RleFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
{
eeprom_write_block(&val, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
}
unsigned int EFile::EeFsGetLink(unsigned int blk)
unsigned int RleFile::EeFsGetLink(unsigned int blk)
{
if (IS_ARM(board)) {
int16_t ret;
@@ -171,7 +171,7 @@ unsigned int EFile::EeFsGetLink(unsigned int blk)
}
}
void EFile::EeFsSetLink(unsigned int blk, unsigned int val)
void RleFile::EeFsSetLink(unsigned int blk, unsigned int val)
{
if (IS_ARM(board)) {
int16_t s_link = val;
@@ -182,17 +182,17 @@ void EFile::EeFsSetLink(unsigned int blk, unsigned int val)
}
}
uint8_t EFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
uint8_t RleFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
{
return EeFsRead(blk, ofs+eeFsLinkSize);
}
void EFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
{
eeprom_write_block(buf, blk*eeFsBlockSize+ofs+eeFsLinkSize+eeFsBlocksOffset, len);
}
unsigned int EFile::EeFsGetFree()
unsigned int RleFile::EeFsGetFree()
{
unsigned int ret = 0;
unsigned int i;
@@ -211,7 +211,7 @@ unsigned int EFile::EeFsGetFree()
/*
* free one or more blocks
*/
void EFile::EeFsFree(unsigned int blk)
void RleFile::EeFsFree(unsigned int blk)
{
unsigned int i = blk;
while (EeFsGetLink(i)) i = EeFsGetLink(i);
@@ -228,7 +228,7 @@ void EFile::EeFsFree(unsigned int blk)
/*
* alloc one block from freelist
*/
unsigned int EFile::EeFsAlloc()
unsigned int RleFile::EeFsAlloc()
{
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
@@ -241,12 +241,12 @@ unsigned int EFile::EeFsAlloc()
return ret;
}
unsigned int EFile::size(unsigned int id)
unsigned int RleFile::size(unsigned int id)
{
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
}
unsigned int EFile::openRd(unsigned int i_fileId)
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_SKY9X(board)) {
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
@@ -268,7 +268,7 @@ unsigned int EFile::openRd(unsigned int i_fileId)
}
}
unsigned int EFile::read(uint8_t *buf, unsigned int i_len)
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
len -= m_pos;
@@ -288,7 +288,7 @@ unsigned int EFile::read(uint8_t *buf, unsigned int i_len)
}
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int EFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
memset(buf, 0, i_len);
@@ -344,12 +344,12 @@ unsigned int EFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
}
}
unsigned int EFile::write1(uint8_t b)
unsigned int RleFile::write1(uint8_t b)
{
return write(&b, 1);
}
unsigned int EFile::write(const uint8_t *buf, unsigned int i_len)
unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
{
unsigned int len = i_len;
if (!m_currBlk && m_pos==0)
@@ -386,7 +386,7 @@ unsigned int EFile::write(const uint8_t *buf, unsigned int i_len)
return i_len - len;
}
void EFile::create(unsigned int i_fileId, unsigned int typ)
void RleFile::create(unsigned int i_fileId, unsigned int typ)
{
openRd(i_fileId); //internal use
if (IS_ARM(board)) {
@@ -399,7 +399,7 @@ void EFile::create(unsigned int i_fileId, unsigned int typ)
}
}
void EFile::closeTrunc()
void RleFile::closeTrunc()
{
unsigned int fri=0;
if (IS_ARM(board))
@@ -410,7 +410,7 @@ void EFile::closeTrunc()
if(fri) EeFsFree( fri ); //chain in
}
unsigned int EFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
create(i_fileId, typ);
bool state0 = true;
@@ -456,7 +456,7 @@ unsigned int EFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uin
/*
* Write runlength (RLE) compressed bytes
*/
unsigned int EFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_SKY9X(board)) {
openRd(i_fileId);
@@ -520,7 +520,7 @@ unsigned int EFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uin
}
}
uint8_t EFile::byte_checksum( uint8_t *p, unsigned int size )
uint8_t RleFile::byte_checksum( uint8_t *p, unsigned int size )
{
uint32_t csum ;
@@ -533,7 +533,7 @@ uint8_t EFile::byte_checksum( uint8_t *p, unsigned int size )
return csum ;
}
uint32_t EFile::ee32_check_header( struct t_eeprom_header *hptr )
uint32_t RleFile::ee32_check_header( struct t_eeprom_header *hptr )
{
uint8_t csum ;
@@ -549,7 +549,7 @@ uint32_t EFile::ee32_check_header( struct t_eeprom_header *hptr )
// to see which is the most recent, the block_no of the most recent
// is returned, with the corresponding data size if required
// and the sequence number if required
uint32_t EFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
uint32_t RleFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
{
struct t_eeprom_header b0 ;
struct t_eeprom_header b1 ;
+2 -2
View File
@@ -61,7 +61,7 @@ struct t_eeprom_header
uint8_t hcsum ;
};
class EFile
class RleFile
{
uint8_t m_fileId; //index of file in directory = filename
unsigned int m_pos; //over all filepos
@@ -101,7 +101,7 @@ class EFile
public:
EFile();
RleFile();
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
@@ -29,7 +29,7 @@
Er9xInterface::Er9xInterface():
EEPROMInterface(BOARD_STOCK),
efile(new EFile())
efile(new RleFile())
{
}
+2 -2
View File
@@ -18,7 +18,7 @@
#include <QtXml>
#include "eeprominterface.h"
#include "er9xeeprom.h"
class EFile;
class RleFile;
class Er9xInterface : public EEPROMInterface
{
@@ -50,7 +50,7 @@ class Er9xInterface : public EEPROMInterface
protected:
EFile *efile;
RleFile *efile;
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
@@ -32,7 +32,7 @@
Ersky9xInterface::Ersky9xInterface():
EEPROMInterface(BOARD_SKY9X),
efile(new EFile())
efile(new RleFile())
{
}
@@ -18,7 +18,7 @@
#include <QtXml>
#include "eeprominterface.h"
#include "ersky9xeeprom.h"
class EFile;
class RleFile;
class Ersky9xInterface : public EEPROMInterface
{
@@ -50,7 +50,7 @@ class Ersky9xInterface : public EEPROMInterface
protected:
EFile *efile;
RleFile *efile;
private:
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
@@ -28,7 +28,7 @@
Gruvin9xInterface::Gruvin9xInterface(BoardEnum board):
EEPROMInterface(board),
efile(new EFile())
efile(new RleFile())
{
}
@@ -18,7 +18,7 @@
#include "eeprominterface.h"
class EFile;
class RleFile;
class Gruvin9xInterface : public EEPROMInterface
{
@@ -57,7 +57,7 @@ class Gruvin9xInterface : public EEPROMInterface
template <class T>
bool loadGeneral(GeneralSettings &settings, int version=2);
EFile *efile;
RleFile *efile;
};
@@ -45,7 +45,7 @@ size_t SizeOfArray( T(&)[ N ] )
OpenTxEepromInterface::OpenTxEepromInterface(BoardEnum board):
EEPROMInterface(board),
efile(new EFile())
efile(new RleFile())
{
}
@@ -21,7 +21,7 @@
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
class EFile;
class RleFile;
class OpenTxEepromInterface : public EEPROMInterface
{
@@ -74,7 +74,7 @@ class OpenTxEepromInterface : public EEPROMInterface
template <class T>
bool saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant);
EFile *efile;
RleFile *efile;
};
@@ -29,7 +29,7 @@
Th9xInterface::Th9xInterface():
EEPROMInterface(BOARD_STOCK),
efile(new EFile())
efile(new RleFile())
{
}
+2 -2
View File
@@ -18,7 +18,7 @@
#include "eeprominterface.h"
class EFile;
class RleFile;
class Th9xInterface : public EEPROMInterface
{
@@ -50,7 +50,7 @@ class Th9xInterface : public EEPROMInterface
protected:
EFile *efile;
RleFile *efile;
};
+5 -3
View File
@@ -352,7 +352,7 @@ void logsDialog::on_mapsButton_clicked() {
#ifdef __APPLE__
gePath = "/usr/bin/open";
parameters << "-a";
parameters << "Google\ Earth";
parameters << "Google\\ Earth";
#endif
parameters << geFilename;
QProcess *process = new QProcess(this);
@@ -525,7 +525,8 @@ void logsDialog::plotValue(int index, int plot, int numplots)
ui->customPlot->graph(0)->setScatterStyle(QCP::ssNone);
//ui->customPlot->graph()->setLineStyle((QCPGraph::LineStyle)(rand()%5+1));
ui->customPlot->graph(0)->setPen(graphPen);
} else {
}
else {
ui->customPlot->xAxis2->setRange(0, maxx-minx);
ui->customPlot->yAxis2->setTickLabels(true);
ui->customPlot->yAxis2->setRange(miny,maxy);
@@ -540,7 +541,8 @@ void logsDialog::plotValue(int index, int plot, int numplots)
//ui->customPlot->graph()->setLineStyle((QCPGraph::LineStyle)(rand()%5+1));
ui->customPlot->graph(1)->setPen(graphPen);
}
} else {
}
else {
ui->customPlot->yAxis->setTickLabels(false);
ui->customPlot->yAxis2->setTickLabels(false);
ui->customPlot->yAxis->setRange(-1100, 1100);