OSDN Git Service
(root)
/
peercast-im
/
PeerCastIM.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c59752
)
転送量カウンタのオーバーフロー修正
IM0027-5-2
author
eru
<eru01@users.sourceforge.jp>
Sat, 28 Jun 2008 13:51:59 +0000
(13:51 +0000)
committer
eru
<eru01@users.sourceforge.jp>
Sat, 28 Jun 2008 13:51:59 +0000
(13:51 +0000)
PeerCast.root/PeerCast/core/common/stats.cpp
patch
|
blob
|
history
PeerCast.root/PeerCast/core/common/stats.h
patch
|
blob
|
history
PeerCast.root/PeerCast/core/common/version2.h
patch
|
blob
|
history
PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
patch
|
blob
|
history
c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
patch
|
blob
|
history
c:/Git/PeerCast.root/PeerCast/core/common/stats.h
patch
|
blob
|
history
c:/Git/PeerCast.root/PeerCast/core/common/version2.h
patch
|
blob
|
history
c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
patch
|
blob
|
history
diff --git
a/PeerCast.root/PeerCast/core/common/stats.cpp
b/PeerCast.root/PeerCast/core/common/stats.cpp
index
46e0a44
..
0a18198
100644
(file)
--- a/
PeerCast.root/PeerCast/core/common/stats.cpp
+++ b/
PeerCast.root/PeerCast/core/common/stats.cpp
@@
-52,7
+52,7
@@
void Stats::update()
for(int i=0; i<Stats::MAX; i++)
{
for(int i=0; i<Stats::MAX; i++)
{
- perSec[i] = (current[i]-last[i])/diff;
+ perSec[i] = (
unsigned)(
current[i]-last[i])/diff;
last[i] = current[i];
}
last[i] = current[i];
}
diff --git
a/PeerCast.root/PeerCast/core/common/stats.h
b/PeerCast.root/PeerCast/core/common/stats.h
index
9c52717
..
1d635c1
100644
(file)
--- a/
PeerCast.root/PeerCast/core/common/stats.h
+++ b/
PeerCast.root/PeerCast/core/common/stats.h
@@
-74,9
+74,10
@@
public:
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
- unsigned int getCurrent(STAT s) {return current[s];}
+ unsigned
long long
int getCurrent(STAT s) {return current[s];}
- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
+ unsigned int perSec[Stats::MAX];
unsigned int lastUpdate;
};
unsigned int lastUpdate;
};
diff --git
a/PeerCast.root/PeerCast/core/common/version2.h
b/PeerCast.root/PeerCast/core/common/version2.h
index
6dec935
..
d354394
100644
(file)
--- a/
PeerCast.root/PeerCast/core/common/version2.h
+++ b/
PeerCast.root/PeerCast/core/common/version2.h
@@
-45,8
+45,8
@@
extern int version_ex; // PP
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5
-2
)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5
-2
)";
#endif
// ------------------------------------------------
#endif
// ------------------------------------------------
diff --git
a/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
b/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
index
d7b4fd4
..
d777ed1
100644
(file)
--- a/
PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/
PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@
-1564,8
+1564,8
@@
LRESULT CALLBACK TrafficDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
+ unsigned
long long
int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
+ unsigned
long long
int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
// up
for (int i=GB; i>0; --i)
// up
for (int i=GB; i>0; --i)
diff --git
a/c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
b/c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
index
46e0a44
..
0a18198
100644
(file)
--- a/
c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
+++ b/
c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
@@
-52,7
+52,7
@@
void Stats::update()
for(int i=0; i<Stats::MAX; i++)
{
for(int i=0; i<Stats::MAX; i++)
{
- perSec[i] = (current[i]-last[i])/diff;
+ perSec[i] = (
unsigned)(
current[i]-last[i])/diff;
last[i] = current[i];
}
last[i] = current[i];
}
diff --git
a/c:/Git/PeerCast.root/PeerCast/core/common/stats.h
b/c:/Git/PeerCast.root/PeerCast/core/common/stats.h
index
9c52717
..
1d635c1
100644
(file)
--- a/
c:/Git/PeerCast.root/PeerCast/core/common/stats.h
+++ b/
c:/Git/PeerCast.root/PeerCast/core/common/stats.h
@@
-74,9
+74,10
@@
public:
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
- unsigned int getCurrent(STAT s) {return current[s];}
+ unsigned
long long
int getCurrent(STAT s) {return current[s];}
- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
+ unsigned int perSec[Stats::MAX];
unsigned int lastUpdate;
};
unsigned int lastUpdate;
};
diff --git
a/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
b/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
index
6dec935
..
d354394
100644
(file)
--- a/
c:/Git/PeerCast.root/PeerCast/core/common/version2.h
+++ b/
c:/Git/PeerCast.root/PeerCast/core/common/version2.h
@@
-45,8
+45,8
@@
extern int version_ex; // PP
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5
-2
)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5
-2
)";
#endif
// ------------------------------------------------
#endif
// ------------------------------------------------
diff --git
a/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
b/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
index
d7b4fd4
..
d777ed1
100644
(file)
--- a/
c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/
c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@
-1564,8
+1564,8
@@
LRESULT CALLBACK TrafficDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
+ unsigned
long long
int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
+ unsigned
long long
int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
// up
for (int i=GB; i>0; --i)
// up
for (int i=GB; i>0; --i)