Merge pull request #35 from lioncash/videocommons-kill-xchg-in-statistics
[VideoCommon] Eliminate the function Xchg in Statistics.cpp. std::swap does the same thing.
This commit is contained in:
commit
59e2179172
|
@ -3,20 +3,13 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "Statistics.h"
|
#include "Statistics.h"
|
||||||
#include "VertexLoaderManager.h"
|
#include "VertexLoaderManager.h"
|
||||||
|
|
||||||
Statistics stats;
|
Statistics stats;
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void Xchg(T& a, T&b)
|
|
||||||
{
|
|
||||||
T c = a;
|
|
||||||
a = b;
|
|
||||||
b = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Statistics::ResetFrame()
|
void Statistics::ResetFrame()
|
||||||
{
|
{
|
||||||
memset(&thisFrame, 0, sizeof(ThisFrame));
|
memset(&thisFrame, 0, sizeof(ThisFrame));
|
||||||
|
@ -24,10 +17,10 @@ void Statistics::ResetFrame()
|
||||||
|
|
||||||
void Statistics::SwapDL()
|
void Statistics::SwapDL()
|
||||||
{
|
{
|
||||||
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
std::swap(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
|
||||||
Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
std::swap(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads);
|
||||||
Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
std::swap(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads);
|
||||||
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
std::swap(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *Statistics::ToString(char *ptr)
|
char *Statistics::ToString(char *ptr)
|
||||||
|
|
Loading…
Reference in New Issue