Cosmetic: Multiple cosmetic changes

- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
This commit is contained in:
Spp
2011-09-29 12:43:05 +02:00
parent 8b820baa73
commit b16d2245bb
390 changed files with 1545 additions and 1545 deletions
@@ -86,7 +86,7 @@ class BIH
template< class T, class BoundsFunc >
void build(const std::vector<T> &primitives, BoundsFunc &getBounds, uint32 leafSize = 3, bool printStats=false)
{
if(primitives.empty())
if (primitives.empty())
return;
buildData dat;
dat.maxPrims = leafSize;
@@ -156,7 +156,7 @@ class BIH
uint32 offsetBack3[3];
// compute custom offsets from direction sign bit
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
{
offsetFront[i] = floatToRawIntBits(dir[i]) >> 31;
offsetBack[i] = offsetFront[i] ^ 1;
@@ -218,7 +218,7 @@ class BIH
int n = tree[node + 1];
while (n > 0) {
bool hit = intersectCallback(r, objects[offset], maxDist, stopAtFirst);
if(stopAtFirst && hit) return;
if (stopAtFirst && hit) return;
--n;
++offset;
}
@@ -376,7 +376,7 @@ class BIH
maxObjects(0xFFFFFFFF), sumDepth(0), minDepth(0x0FFFFFFF),
maxDepth(0xFFFFFFFF), numBVH2(0)
{
for(int i=0; i<6; ++i) numLeavesN[i] = 0;
for (int i=0; i<6; ++i) numLeavesN[i] = 0;
}
void updateInner() { numNodes++; }
+13 -13
View File
@@ -27,10 +27,10 @@ namespace VMAP
{
void chompAndTrim(std::string& str)
{
while(str.length() >0)
while (str.length() >0)
{
char lc = str[str.length()-1];
if(lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
if (lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(0, str.length()-1);
}
@@ -39,10 +39,10 @@ namespace VMAP
break;
}
}
while(str.length() >0)
while (str.length() >0)
{
char lc = str[0];
if(lc == ' ' || lc == '"' || lc == '\'')
if (lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(1, str.length()-1);
}
@@ -54,7 +54,7 @@ namespace VMAP
}
IVMapManager* gVMapManager = 0;
Table<unsigned int , bool>* iIgnoreSpellIds=0;
Table<unsigned int, bool>* iIgnoreSpellIds=0;
//===============================================
// result false, if no more id are found
@@ -63,14 +63,14 @@ namespace VMAP
{
bool result = false;
unsigned int i;
for(i=pStartPos;i<pString.size(); ++i)
for (i=pStartPos;i<pString.size(); ++i)
{
if(pString[i] == ',')
if (pString[i] == ',')
{
break;
}
}
if(i>pStartPos)
if (i>pStartPos)
{
std::string idString = pString.substr(pStartPos, i-pStartPos);
pStartPos = i+1;
@@ -88,15 +88,15 @@ namespace VMAP
void VMapFactory::preventSpellsFromBeingTestedForLoS(const char* pSpellIdString)
{
if(!iIgnoreSpellIds)
iIgnoreSpellIds = new Table<unsigned int , bool>();
if(pSpellIdString != NULL)
if (!iIgnoreSpellIds)
iIgnoreSpellIds = new Table<unsigned int, bool>();
if (pSpellIdString != NULL)
{
unsigned int pos =0;
unsigned int id;
std::string confString(pSpellIdString);
chompAndTrim(confString);
while(getNextId(confString, pos, id))
while (getNextId(confString, pos, id))
{
iIgnoreSpellIds->set(id, true);
}
@@ -114,7 +114,7 @@ namespace VMAP
// just return the instance
IVMapManager* VMapFactory::createOrGetVMapManager()
{
if(gVMapManager == 0)
if (gVMapManager == 0)
gVMapManager= new VMapManager2(); // should be taken from config ... Please change if you like :-)
return gVMapManager;
}
+6 -6
View File
@@ -265,13 +265,13 @@ namespace VMAP
int readOperation = 1;
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
// only use this for array deletes
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); }readOperation++;
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
#define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
READ_OR_RETURN(&ident, 8);
@@ -377,11 +377,11 @@ namespace VMAP
int readOperation = 1;
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); }readOperation++;
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
#define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
READ_OR_RETURN(&ident, 8);
@@ -57,7 +57,7 @@ namespace VMAP
Ray modRay(p, iInvRot * pRay.direction());
float distance = pMaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, pStopAtFirstHit);
if(hit)
if (hit)
{
distance *= iScale;
pMaxDist = distance;
+3 -3
View File
@@ -161,7 +161,7 @@ namespace VMAP
if ((iFlags[tx + ty*iTilesX] & 0x0F) == 0x0F)
return false;
// (dx, dy) coordinates inside tile, in [0,1]^2
// (dx, dy) coordinates inside tile, in [0, 1]^2
float dx = tx_f - (float)tx;
float dy = ty_f - (float)ty;
@@ -169,7 +169,7 @@ namespace VMAP
^ dy
|
1 x---------x (1,1)
1 x---------x (1, 1)
| (b) / |
| / |
| / |
@@ -442,7 +442,7 @@ namespace VMAP
{
float group_Z;
//float pVol = prims[entry].GetBound().volume();
//if(pVol < minVol)
//if (pVol < minVol)
//{
/* if (prims[entry].iBound.contains(point)) */
if (prims[entry].IsInsideObject(point, zVec, group_Z))