More VC++2010 fixes

This commit is contained in:
Mark Watkins 2011-12-18 00:50:59 +10:00
parent 54da056efc
commit 25f1a3ce5a
5 changed files with 13 additions and 11 deletions

View File

@ -432,7 +432,7 @@ struct PRS1SummaryR5 {
quint32 flags;
} __attribute__((packed));
};// __attribute__((packed));
bool PRS1Loader::ParseSummary(Machine *mach, qint32 sequence, quint32 timestamp, unsigned char *data, quint16 size, char version)
{

View File

@ -36,7 +36,7 @@ struct EDFHeader {
char num_data_records[8];
char dur_data_records[8];
char num_signals[4];
} __attribute__ ((packed));
};// __attribute__ ((packed));
const int EDFHeaderSize=sizeof(EDFHeader);

View File

@ -10,8 +10,8 @@
#include <QDebug>
#include <QString>
#include <QObject>
#include <tr1/random>
#include <sys/time.h>
//#include <tr1/random>
//#include <sys/time.h>
#include "machine.h"
#include "profiles.h"
@ -44,12 +44,14 @@ Machine::Machine(Profile *p,MachineID id)
highest_sessionid=0;
profile=p;
if (!id) {
std::tr1::minstd_rand gen;
std::tr1::uniform_int<MachineID> unif(1, 0x7fffffff);
gen.seed((unsigned int) time(NULL));
srand(time(NULL));
//std::tr1::minstd_rand gen;
//std::tr1::uniform_int<MachineID> unif(1, 0x7fffffff);
//gen.seed((unsigned int) time(NULL));
MachineID temp;
do {
temp = unif(gen); //unif(gen) << 32 |
temp = rand();
//temp = unif(gen); //unif(gen) << 32 |
} while (profile->machlist.find(temp)!=profile->machlist.end());
m_id=temp;

View File

@ -676,7 +676,7 @@ void Daily::Load(QDate date)
} else {
GraphView->setEmptyText("No Data");
}
mode=(CPAPMode)cpap->settings_max(CPAP_Mode);
mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
modestr=schema::channel[CPAP_Mode].m_options[mode];
@ -705,7 +705,7 @@ void Daily::Load(QDate date)
if (PROFILE.Exists("ShowSerialNumbers") && PROFILE["ShowSerialNumbers"].toBool()) {
html+="<tr><td colspan=4 align=center>"+cpap->machine->properties["Serial"]+"</td></tr>\n";
}
CPAPMode mode=(CPAPMode)cpap->settings_max(CPAP_Mode);
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
html+="<tr><td colspan=4 align=center>Mode: ";
EventDataType min=cpap->settings_min(CPAP_PressureMin);

View File

@ -850,7 +850,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
if (cpap->machine->properties.find("SubModel")!=cpap->machine->properties.end())
submodel="\n"+cpap->machine->properties["SubModel"];
cpapinfo+=cpap->machine->properties["Brand"]+" "+cpap->machine->properties["Model"]+submodel;
CPAPMode mode=(CPAPMode)cpap->settings_max(CPAP_Mode);
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
cpapinfo+="\nMode: ";
EventDataType min=cpap->settings_min(CPAP_PressureMin);