From 25f1a3ce5a895287e638997b3ee03750e53ecdcf Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 18 Dec 2011 00:50:59 +1000 Subject: [PATCH] More VC++2010 fixes --- SleepLib/loader_plugins/prs1_loader.cpp | 2 +- SleepLib/loader_plugins/resmed_loader.h | 2 +- SleepLib/machine.cpp | 14 ++++++++------ daily.cpp | 4 ++-- mainwindow.cpp | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/SleepLib/loader_plugins/prs1_loader.cpp b/SleepLib/loader_plugins/prs1_loader.cpp index 00ed967d..eedf884e 100644 --- a/SleepLib/loader_plugins/prs1_loader.cpp +++ b/SleepLib/loader_plugins/prs1_loader.cpp @@ -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) { diff --git a/SleepLib/loader_plugins/resmed_loader.h b/SleepLib/loader_plugins/resmed_loader.h index 31e9ca13..cbf41212 100644 --- a/SleepLib/loader_plugins/resmed_loader.h +++ b/SleepLib/loader_plugins/resmed_loader.h @@ -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); diff --git a/SleepLib/machine.cpp b/SleepLib/machine.cpp index 1c6c749c..8d6ac753 100644 --- a/SleepLib/machine.cpp +++ b/SleepLib/machine.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +//#include +//#include #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 unif(1, 0x7fffffff); - gen.seed((unsigned int) time(NULL)); + srand(time(NULL)); + //std::tr1::minstd_rand gen; + //std::tr1::uniform_int 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; diff --git a/daily.cpp b/daily.cpp index 300e1714..96b91546 100644 --- a/daily.cpp +++ b/daily.cpp @@ -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+=""+cpap->machine->properties["Serial"]+"\n"; } - CPAPMode mode=(CPAPMode)cpap->settings_max(CPAP_Mode); + CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode); html+="Mode: "; EventDataType min=cpap->settings_min(CPAP_PressureMin); diff --git a/mainwindow.cpp b/mainwindow.cpp index bba69560..0b1f014f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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);