Unused variable cleanup

This commit is contained in:
Mark Watkins 2011-06-04 13:52:53 +10:00
parent 38820caa1a
commit 127b34e624
4 changed files with 21 additions and 51 deletions

View File

@ -7831,7 +7831,7 @@
1305881106 /home/mark/projects/git/sleepyhead/SleepyHeadApp.h 1305881106 /home/mark/projects/git/sleepyhead/SleepyHeadApp.h
<wx/app.h> <wx/app.h>
1307153810 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h 1307158795 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h
<wx/listbox.h> <wx/listbox.h>
<wx/treectrl.h> <wx/treectrl.h>
"SleepyHeadApp.h" "SleepyHeadApp.h"
@ -7839,7 +7839,7 @@
"sleeplib/machine.h" "sleeplib/machine.h"
"graphs/graph.h" "graphs/graph.h"
1307151648 /home/mark/projects/git/sleepyhead/libs/sleeplib/machine.h 1307158904 /home/mark/projects/git/sleepyhead/libs/sleeplib/machine.h
<wx/string.h> <wx/string.h>
<wx/variant.h> <wx/variant.h>
<wx/dir.h> <wx/dir.h>
@ -7877,7 +7877,7 @@
<sleeplib/machine.h> <sleeplib/machine.h>
<list> <list>
1307158621 /home/mark/projects/git/sleepyhead/version.h 1307159485 /home/mark/projects/git/sleepyhead/version.h
1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h 1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h
"machine.h" "machine.h"
@ -7894,7 +7894,7 @@
"preferences.h" "preferences.h"
"tinyxml/tinyxml.h" "tinyxml/tinyxml.h"
1307158620 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp 1307158870 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
"wx_pch.h" "wx_pch.h"
"version.h" "version.h"
<wx/app.h> <wx/app.h>
@ -7928,7 +7928,7 @@
<wx/ffile.h> <wx/ffile.h>
<wx/utils.h> <wx/utils.h>
1307156731 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/machine.cpp 1307159409 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/machine.cpp
<tr1/random> <tr1/random>
<wx/colour.h> <wx/colour.h>
<wx/log.h> <wx/log.h>
@ -7962,7 +7962,7 @@
"machine_loader.h" "machine_loader.h"
"tinyxml/tinyxml.h" "tinyxml/tinyxml.h"
1307083014 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp 1307159494 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
<wx/dir.h> <wx/dir.h>
<wx/filename.h> <wx/filename.h>
<wx/ffile.h> <wx/ffile.h>

View File

@ -399,8 +399,6 @@ EventDataType Day::summary_sum(MachineCode code)
EventDataType Day::summary_max(MachineCode code) EventDataType Day::summary_max(MachineCode code)
{ {
EventDataType val=0,tmp; EventDataType val=0,tmp;
bool fir=true;
// Cache this?
vector<Session *>::iterator s; vector<Session *>::iterator s;
for (s=sessions.begin();s!=sessions.end();s++) { for (s=sessions.begin();s!=sessions.end();s++) {
@ -437,8 +435,6 @@ EventDataType Day::summary_min(MachineCode code)
EventDataType Day::summary_avg(MachineCode code) EventDataType Day::summary_avg(MachineCode code)
{ {
EventDataType val=0,tmp=0; EventDataType val=0,tmp=0;
bool fir=true;
// Cache this?
int cnt=0; int cnt=0;
vector<Session *>::iterator s; vector<Session *>::iterator s;
@ -551,11 +547,8 @@ EventDataType Day::sum(MachineCode code,int field)
EventDataType Day::count(MachineCode code) EventDataType Day::count(MachineCode code)
{ {
EventDataType val=0; EventDataType val=0;
// Cache this?
vector<Session *>::iterator s;
// Don't assume sessions are in order. for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
for (s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
if (sess.events.find(code)!=sess.events.end()) { if (sess.events.find(code)!=sess.events.end()) {
val+=sess.count_events(code); val+=sess.count_events(code);
@ -565,12 +558,8 @@ EventDataType Day::count(MachineCode code)
} }
EventDataType Day::weighted_avg(MachineCode code,int field) EventDataType Day::weighted_avg(MachineCode code,int field)
{ {
double val=0;
vector<Session *>::iterator s;
double s0=0,s1=0,s2=0; double s0=0,s1=0,s2=0;
for (s=sessions.begin();s!=sessions.end();s++) { for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
if (sess.events.find(code)!=sess.events.end()) { if (sess.events.find(code)!=sess.events.end()) {
s0=sess.hours(); s0=sess.hours();
@ -583,29 +572,19 @@ EventDataType Day::weighted_avg(MachineCode code,int field)
} }
wxTimeSpan Day::total_time() wxTimeSpan Day::total_time()
{ {
//if (d_totaltime>wxTimeSpan::Seconds(0)) return d_totaltime;
vector<Session *>::iterator s;
d_totaltime=wxTimeSpan::Seconds(0); d_totaltime=wxTimeSpan::Seconds(0);
for (s=sessions.begin();s!=sessions.end();s++) { for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
d_totaltime+=sess.last()-sess.first(); d_totaltime+=sess.last()-sess.first();
if (d_totaltime>wxTimeSpan::Hours(15)) {
int c=1;
}
} }
return d_totaltime; return d_totaltime;
} }
EventDataType Day::percentile(MachineCode code,int field,double percent) EventDataType Day::percentile(MachineCode code,int field,double percent)
{ {
double val=0; double val=0;
// Cache this?
int cnt=0; int cnt=0;
vector<Session *>::iterator s;
// Don't assume sessions are in order. for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
for (s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
if (sess.events.find(code)!=sess.events.end()) { if (sess.events.find(code)!=sess.events.end()) {
val+=sess.percentile(code,field,percent); val+=sess.percentile(code,field,percent);
@ -622,11 +601,8 @@ const wxDateTime & Day::first(MachineCode code)
static wxDateTime date; static wxDateTime date;
wxDateTime tmp; wxDateTime tmp;
bool fir=true; bool fir=true;
// Cache this?
vector<Session *>::iterator s;
// Don't assume sessions are in order. for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
for (s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
if (sess.events.find(code)!=sess.events.end()) { if (sess.events.find(code)!=sess.events.end()) {
tmp=sess.events[code][0]->time(); tmp=sess.events[code][0]->time();
@ -643,17 +619,11 @@ const wxDateTime & Day::first(MachineCode code)
const wxDateTime & Day::last(MachineCode code) const wxDateTime & Day::last(MachineCode code)
{ {
size_t cnt;
static wxDateTime date; static wxDateTime date;
wxDateTime tmp; wxDateTime tmp;
bool fir=true; bool fir=true;
// Cache this?
// Don't assume sessions are in order. for (vector<Session *>::iterator s=sessions.begin();s!=sessions.end();s++) {
vector<Session *>::iterator s;
;
for (s=sessions.begin();s!=sessions.end();s++) {
Session & sess=*(*s); Session & sess=*(*s);
if (sess.events.find(code)!=sess.events.end()) { if (sess.events.find(code)!=sess.events.end()) {
vector<Event *>::reverse_iterator i=sess.events[code].rbegin(); vector<Event *>::reverse_iterator i=sess.events[code].rbegin();
@ -871,8 +841,8 @@ double Session::percentile(MachineCode mc,int field,double percent)
double a=array[j-1]; double a=array[j-1];
double b=array[j]; double b=array[j];
if (a==b) return a; if (a==b) return a;
double c=(b-a); //double c=(b-a);
double d=c*q; //double d=c*q;
return array[j]+q; return array[j]+q;
} }

View File

@ -101,7 +101,6 @@ bool PRS1Loader::Open(wxString & path,Profile *profile)
wxString filename; wxString filename;
bool cont=dir.GetFirst(&filename); bool cont=dir.GetFirst(&filename);
int c=0;
while (cont) { while (cont) {
if ((filename[0]=='P') && (isdigit(filename[1])) && (isdigit(filename[2]))) { if ((filename[0]=='P') && (isdigit(filename[1])) && (isdigit(filename[2]))) {
SerialNumbers.push_back(filename); SerialNumbers.push_back(filename);
@ -483,6 +482,7 @@ bool PRS1Loader::Parse002(Session *session,unsigned char *buffer,int size,time_t
int cnt=0; int cnt=0;
while (pos<size) { while (pos<size) {
char code=buffer[pos++]; char code=buffer[pos++];
assert(code<ncodes);
short size; short size;
if (code!=0x12) { if (code!=0x12) {
size=buffer[pos] | buffer[pos+1] << 8; size=buffer[pos] | buffer[pos+1] << 8;

View File

@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type //Standard Version Type
static const long MAJOR = 0; static const long MAJOR = 0;
static const long MINOR = 7; static const long MINOR = 7;
static const long BUILD = 3066; static const long BUILD = 3070;
static const long REVISION = 11342; static const long REVISION = 11358;
//Miscellaneous Version Types //Miscellaneous Version Types
static const long BUILDS_COUNT = 8995; static const long BUILDS_COUNT = 9005;
#define RC_FILEVERSION 0,7,3066,11342 #define RC_FILEVERSION 0,7,3070,11358
#define RC_FILEVERSION_STRING "0, 7, 3066, 11342\0" #define RC_FILEVERSION_STRING "0, 7, 3070, 11358\0"
static const char FULLVERSION_STRING[] = "0.7.3066.11342"; static const char FULLVERSION_STRING[] = "0.7.3070.11358";
//These values are to keep track of your versioning state, don't modify them. //These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 62; static const long BUILD_HISTORY = 62;