*Backout "Fix compile for gcc 4.4." because it causes uninitilized variables and may cause crash.
--HG-- branch : trunk
This commit is contained in:
@@ -1281,7 +1281,7 @@ void SocketHandler::CheckList(socket_v& ref,const std::string& listname)
|
|||||||
}
|
}
|
||||||
if (!found)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,11 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||||||
namespace SOCKETS_NAMESPACE {
|
namespace SOCKETS_NAMESPACE {
|
||||||
#endif
|
#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)
|
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)
|
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_year + 1900,
|
||||||
tp.tm_mon + 1,
|
tp.tm_mon + 1,
|
||||||
tp.tm_mday,
|
tp.tm_mday,
|
||||||
tp.tm_hour,tp.tm_min,tp.tm_sec,
|
tp.tm_hour,tp.tm_min,tp.tm_sec,
|
||||||
sock -> GetSocket(),
|
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
|
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_year + 1900,
|
||||||
tp.tm_mon + 1,
|
tp.tm_mon + 1,
|
||||||
tp.tm_mday,
|
tp.tm_mday,
|
||||||
tp.tm_hour,tp.tm_min,tp.tm_sec,
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ void TcpSocket::Sendf(const char *format, ...)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
vsprintf(slask, format, ap);
|
vsprintf(slask, format, ap);
|
||||||
#else
|
#else
|
||||||
DEB(vsnprintf(slask, 5000, format, ap);)
|
vsnprintf(slask, 5000, format, ap);
|
||||||
#endif
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
Send( slask );
|
Send( slask );
|
||||||
|
|||||||
@@ -22,12 +22,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
//#ifdef _DEBUG
|
|
||||||
//#define DEB(x) x
|
|
||||||
//#else
|
|
||||||
#define DEB(x)
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
using namespace G3D;
|
using namespace G3D;
|
||||||
|
|
||||||
namespace VMAP
|
namespace VMAP
|
||||||
@@ -92,15 +86,15 @@ namespace VMAP
|
|||||||
//============================================================
|
//============================================================
|
||||||
bool CoordModelMapping::readCoordinateMapping(const std::string& pDirectoryFileName)
|
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;
|
bool result = false;
|
||||||
char buffer[500+1];
|
char buffer[500+1];
|
||||||
|
|
||||||
DEB( if(f))
|
if(f)
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
CMappingEntry* cMappingEntry;
|
CMappingEntry* cMappingEntry;
|
||||||
DEB( while(fgets(buffer, 500, f)))
|
while(fgets(buffer, 500, f))
|
||||||
{
|
{
|
||||||
//char namebuffer[500];
|
//char namebuffer[500];
|
||||||
char positionbuffer[500];
|
char positionbuffer[500];
|
||||||
@@ -121,8 +115,8 @@ DEB( while(fgets(buffer, 500, f)))
|
|||||||
nameEnd += findPosChar(&buffer[nameEnd], ' ', 1);
|
nameEnd += findPosChar(&buffer[nameEnd], ' ', 1);
|
||||||
buffer[nameEnd] = 0; // terminate the name
|
buffer[nameEnd] = 0; // terminate the name
|
||||||
|
|
||||||
DEB( sscanf(buffer, "%d %d", &xpos, &ypos);)
|
sscanf(buffer, "%d %d", &xpos, &ypos);
|
||||||
DEB( sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);)
|
sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);
|
||||||
unsigned int mapId = getMapIdFromFilename(std::string(&buffer[nameStart]));
|
unsigned int mapId = getMapIdFromFilename(std::string(&buffer[nameStart]));
|
||||||
if(!iMapIds.contains(mapId))
|
if(!iMapIds.contains(mapId))
|
||||||
{
|
{
|
||||||
@@ -142,12 +136,12 @@ DEB( sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scal
|
|||||||
addCMappingEntry(cMappingEntry);
|
addCMappingEntry(cMappingEntry);
|
||||||
}
|
}
|
||||||
char namebuffer2[500];
|
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);
|
cMappingEntry->addFilename(namebuffer2);
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEB( fclose(f);)
|
fclose(f);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -171,10 +165,10 @@ DEB( fclose(f);)
|
|||||||
int noVerc;
|
int noVerc;
|
||||||
int startName = findPosChar(rawNames[pos].c_str(), ' ', 1) + 1;
|
int startName = findPosChar(rawNames[pos].c_str(), ' ', 1) + 1;
|
||||||
int endName = (int) rawNames[pos].length();
|
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);
|
memcpy(namebuffer, &rawNames[pos].c_str()[startName], endName-startName);
|
||||||
namebuffer[endName-startName] = 0;
|
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);
|
std::string modelPosFileName = std::string(namebuffer);
|
||||||
if(noVerc > MIN_VERTICES_FOR_OWN_CONTAINER_FILE)
|
if(noVerc > MIN_VERTICES_FOR_OWN_CONTAINER_FILE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,12 +24,6 @@
|
|||||||
#include <G3D/Table.h>
|
#include <G3D/Table.h>
|
||||||
#include <G3D/Array.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.
|
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.
|
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)
|
static const std::string getKeyString(unsigned int pMapId, int pXPos, int pYPos)
|
||||||
{
|
{
|
||||||
char b[100];
|
char b[100];
|
||||||
DEB( sprintf(b,"%03u_%d_%d", pMapId, pXPos, pYPos);)
|
sprintf(b,"%03u_%d_%d", pMapId, pXPos, pYPos);
|
||||||
return(std::string(b));
|
return(std::string(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,6 @@
|
|||||||
|
|
||||||
#include "DebugCmdLogger.h"
|
#include "DebugCmdLogger.h"
|
||||||
|
|
||||||
//#ifdef _DEBUG
|
|
||||||
//#define DEB(x) x
|
|
||||||
//#else
|
|
||||||
#define DEB(x)
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
using namespace G3D;
|
using namespace G3D;
|
||||||
|
|
||||||
namespace VMAP
|
namespace VMAP
|
||||||
@@ -103,25 +97,25 @@ namespace VMAP
|
|||||||
bool CommandFileRW::getNewCommands(Array<Command>& pCmdArray)
|
bool CommandFileRW::getNewCommands(Array<Command>& pCmdArray)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
DEB( FILE* f = fopen(iFileName.c_str(), "rb");)
|
FILE* f = fopen(iFileName.c_str(), "rb");
|
||||||
DEB( if(f))
|
if(f)
|
||||||
{
|
{
|
||||||
Command cmd;
|
Command cmd;
|
||||||
DEB( if(fseek(f, iLastPos, SEEK_SET) == 0) { result = true; })
|
if(fseek(f, iLastPos, SEEK_SET) == 0) { result = true; }
|
||||||
while(result)
|
while(result)
|
||||||
{
|
{
|
||||||
DEB( if(fread(&cmd, sizeof(Command), 1, f) != 1))
|
if(fread(&cmd, sizeof(Command), 1, f) != 1)
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
DEB( iLastPos = ftell(f);)
|
iLastPos = ftell(f);
|
||||||
if(cmd.getType() == STOP)
|
if(cmd.getType() == STOP)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pCmdArray.append(cmd);
|
pCmdArray.append(cmd);
|
||||||
}
|
}
|
||||||
DEB( fclose(f);)
|
fclose(f);
|
||||||
}
|
}
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user