Backed out changeset: 7c8912b7d5c6

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-06 16:27:07 -05:00
parent b3de9cdff7
commit ec8367d253
6 changed files with 23 additions and 45 deletions

View File

@@ -1281,7 +1281,7 @@ void SocketHandler::CheckList(socket_v& ref,const std::string& listname)
}
if (!found)
{
DEB( fprintf(stderr, "CheckList failed for \"%s\": fd %d\n", listname.c_str(), s);)
fprintf(stderr, "CheckList failed for \"%s\": fd %d\n", listname.c_str(), s);
}
}
}

View File

@@ -38,11 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace SOCKETS_NAMESPACE {
#endif
//#ifdef _DEBUG
//#define DEB(x) x; fflush(stderr);
//#else
#define DEB(x)
//#endif
void StdoutLog::error(ISocketHandler *,Socket *sock,const std::string& call,int err,const std::string& sys_err,loglevel_t lvl)
@@ -73,22 +69,22 @@ void StdoutLog::error(ISocketHandler *,Socket *sock,const std::string& call,int
}
if (sock)
{
DEB( printf("%d-%02d-%02d %02d:%02d:%02d :: fd %d :: %s: %d %s (%s)\n",
printf("%d-%02d-%02d %02d:%02d:%02d :: fd %d :: %s: %d %s (%s)\n",
tp.tm_year + 1900,
tp.tm_mon + 1,
tp.tm_mday,
tp.tm_hour,tp.tm_min,tp.tm_sec,
sock -> GetSocket(),
call.c_str(),err,sys_err.c_str(),level.c_str()));
call.c_str(),err,sys_err.c_str(),level.c_str());
}
else
{
DEB( printf("%d-%02d-%02d %02d:%02d:%02d :: %s: %d %s (%s)\n",
printf("%d-%02d-%02d %02d:%02d:%02d :: %s: %d %s (%s)\n",
tp.tm_year + 1900,
tp.tm_mon + 1,
tp.tm_mday,
tp.tm_hour,tp.tm_min,tp.tm_sec,
call.c_str(),err,sys_err.c_str(),level.c_str()));
call.c_str(),err,sys_err.c_str(),level.c_str());
}
}

View File

@@ -1012,7 +1012,7 @@ void TcpSocket::Sendf(const char *format, ...)
#ifdef _WIN32
vsprintf(slask, format, ap);
#else
DEB(vsnprintf(slask, 5000, format, ap);)
vsnprintf(slask, 5000, format, ap);
#endif
va_end(ap);
Send( slask );

View File

@@ -22,12 +22,6 @@
#include <string.h>
//#ifdef _DEBUG
//#define DEB(x) x
//#else
#define DEB(x)
//#endif
using namespace G3D;
namespace VMAP
@@ -92,15 +86,15 @@ namespace VMAP
//============================================================
bool CoordModelMapping::readCoordinateMapping(const std::string& pDirectoryFileName)
{
DEB( FILE *f = fopen(pDirectoryFileName.c_str(), "rb");)
FILE *f = fopen(pDirectoryFileName.c_str(), "rb");
bool result = false;
char buffer[500+1];
DEB( if(f))
if(f)
{
result = true;
CMappingEntry* cMappingEntry;
DEB( while(fgets(buffer, 500, f)))
while(fgets(buffer, 500, f))
{
//char namebuffer[500];
char positionbuffer[500];
@@ -121,8 +115,8 @@ DEB( while(fgets(buffer, 500, f)))
nameEnd += findPosChar(&buffer[nameEnd], ' ', 1);
buffer[nameEnd] = 0; // terminate the name
DEB( sscanf(buffer, "%d %d", &xpos, &ypos);)
DEB( sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);)
sscanf(buffer, "%d %d", &xpos, &ypos);
sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);
unsigned int mapId = getMapIdFromFilename(std::string(&buffer[nameStart]));
if(!iMapIds.contains(mapId))
{
@@ -142,12 +136,12 @@ DEB( sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scal
addCMappingEntry(cMappingEntry);
}
char namebuffer2[500];
DEB( sprintf(namebuffer2, "%d %s#%s_%f", noVec, &buffer[nameStart], positionbuffer, scale);)
sprintf(namebuffer2, "%d %s#%s_%f", noVec, &buffer[nameStart], positionbuffer, scale);
cMappingEntry->addFilename(namebuffer2);
//break;
}
}
DEB( fclose(f);)
fclose(f);
}
return result;
}
@@ -171,10 +165,10 @@ DEB( fclose(f);)
int noVerc;
int startName = findPosChar(rawNames[pos].c_str(), ' ', 1) + 1;
int endName = (int) rawNames[pos].length();
DEB( sscanf(rawNames[pos].c_str(), "%d", &noVerc);)
sscanf(rawNames[pos].c_str(), "%d", &noVerc);
memcpy(namebuffer, &rawNames[pos].c_str()[startName], endName-startName);
namebuffer[endName-startName] = 0;
DEB( sscanf(rawNames[pos].c_str(), "%d", &noVerc);)
sscanf(rawNames[pos].c_str(), "%d", &noVerc);
std::string modelPosFileName = std::string(namebuffer);
if(noVerc > MIN_VERTICES_FOR_OWN_CONTAINER_FILE)
{

View File

@@ -24,12 +24,6 @@
#include <G3D/Table.h>
#include <G3D/Array.h>
//#ifdef _DEBUG
//#define DEB(x) x
//#else
#define DEB(x)
//#endif
/**
This Class is a helper Class to convert the raw vector data into BSP-Trees.
We read the directory file of the raw data output and build logical groups.
@@ -83,7 +77,7 @@ namespace VMAP
static const std::string getKeyString(unsigned int pMapId, int pXPos, int pYPos)
{
char b[100];
DEB( sprintf(b,"%03u_%d_%d", pMapId, pXPos, pYPos);)
sprintf(b,"%03u_%d_%d", pMapId, pXPos, pYPos);
return(std::string(b));
}

View File

@@ -20,12 +20,6 @@
#include "DebugCmdLogger.h"
//#ifdef _DEBUG
//#define DEB(x) x
//#else
#define DEB(x)
//#endif
using namespace G3D;
namespace VMAP
@@ -103,25 +97,25 @@ namespace VMAP
bool CommandFileRW::getNewCommands(Array<Command>& pCmdArray)
{
bool result = false;
DEB( FILE* f = fopen(iFileName.c_str(), "rb");)
DEB( if(f))
FILE* f = fopen(iFileName.c_str(), "rb");
if(f)
{
Command cmd;
DEB( if(fseek(f, iLastPos, SEEK_SET) == 0) { result = true; })
if(fseek(f, iLastPos, SEEK_SET) == 0) { result = true; }
while(result)
{
DEB( if(fread(&cmd, sizeof(Command), 1, f) != 1))
if(fread(&cmd, sizeof(Command), 1, f) != 1)
{
result = false;
}
DEB( iLastPos = ftell(f);)
iLastPos = ftell(f);
if(cmd.getType() == STOP)
{
break;
}
pCmdArray.append(cmd);
}
DEB( fclose(f);)
fclose(f);
}
if(result)
{