本文整理汇总了C++中DebugError函数的典型用法代码示例。如果您正苦于以下问题:C++ DebugError函数的具体用法?C++ DebugError怎么用?C++ DebugError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DebugError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DebugInfo
bool CPlayer::CanKillNow()
{
DebugInfo("CanKillNow Start Socket=%d PID=%d",reinterpret_cast<int>(m_pClientSocket),m_PID);
if ( m_pRoom )
{
if ( m_RoomID == m_pRoom->GetRoomID() )
{
if ( m_pTable )
{
if ( m_TableID == m_pTable->GetTableID() )
{
if ( m_pTable->GetTableState()==TABLE_ST_PLAYING && this->IsPlaying() )
{
return false;
}
}
else
{
DebugError("CPlayer::CanKillNow PID=%d,TableID=%d",m_PID,m_TableID);
}
}
}
else
{
DebugError("CPlayer::CanKillNow PID=%d,RoomID=%d",m_PID,m_RoomID);
}
}
DebugInfo("CanKillNow End Socket=%d PID=%d",reinterpret_cast<int>(m_pClientSocket),m_PID);
return true;
}
示例2: if
Eigen::Matrix4f MatrixFactory::createOrthoOffCenter
(
float left,
float right,
float bottom,
float top,
float near_plane,
float far_plane,
Handedness handedness
) const
{
if (handedness == Handedness::RightHanded)
{
}
else if (handedness == Handedness::LeftHanded)
{
}
else
{
DebugError("Not implemented.");
}
DebugError("Not implemented.");
return Eigen::Matrix4f::Identity();
}
示例3: DebugError
VOID
CVfrCompiler::UpdateInfoForDynamicOpcode (
VOID
)
{
SIfrRecord *pRecord;
if (!gNeedAdjustOpcode) {
return;
}
//
// Base on the original offset info to update the record list.
//
if (!gCIfrRecordInfoDB.IfrAdjustDynamicOpcodeInRecords()) {
DebugError (NULL, 0, 1001, "Error parsing vfr file", "Can find the offset in the record.");
}
//
// Base on the opcode binary length to recalculate the offset for each opcode.
//
gCIfrRecordInfoDB.IfrAdjustOffsetForRecord();
//
// Base on the offset to find the binary address.
//
pRecord = gCIfrRecordInfoDB.GetRecordInfoFromOffset(gAdjustOpcodeOffset);
while (pRecord != NULL) {
pRecord->mIfrBinBuf = gCFormPkg.GetBufAddrBaseOnOffset(pRecord->mOffset);
if (pRecord->mIfrBinBuf == NULL) {
DebugError (NULL, 0, 0001, "Error parsing vfr file", " 0x%X. offset not allocated.", pRecord->mOffset);
}
pRecord = pRecord->mNext;
}
}
示例4: DebugError
VOID
CVfrCompiler::Compile (
VOID
)
{
FILE *pInFile = NULL;
CHAR8 *InFileName = NULL;
INPUT_INFO_TO_SYNTAX InputInfo;
if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {
goto Fail;
}
InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;
gCVfrErrorHandle.SetInputFile (InFileName);
gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError);
if ((pInFile = fopen (LongFilePath (InFileName), "r")) == NULL) {
DebugError (NULL, 0, 0001, "Error opening the input file", "%s", InFileName);
goto Fail;
}
InputInfo.CompatibleMode = mOptions.CompatibleMode;
if (mOptions.HasOverrideClassGuid) {
InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;
} else {
InputInfo.OverrideClassGuid = NULL;
}
if (VfrParserStart (pInFile, &InputInfo) != 0) {
goto Fail;
}
fclose (pInFile);
pInFile = NULL;
if (gCFormPkg.HavePendingUnassigned () == TRUE) {
gCFormPkg.PendingAssignPrintAll ();
goto Fail;
}
SET_RUN_STATUS (STATUS_COMPILEED);
return;
Fail:
if (!IS_RUN_STATUS(STATUS_DEAD)) {
DebugError (NULL, 0, 0003, "Error parsing", "compile error in file %s", InFileName);
SET_RUN_STATUS (STATUS_FAILED);
}
if (pInFile != NULL) {
fclose (pInFile);
}
}
示例5: _InitializeGlobals
static void _InitializeGlobals(int argc, char *argv[]) {
char fileName[255];
_processArgs(argc, argv);
MSetAllocFailFunction(_AllocFailed);
if(gUseStartingNet) {
gPriorNet = BNReadBIF(gStartingNetFile);
if(gPriorNet == 0) {
DebugError(1, "couldn't read net specified by -startFrom\n");
}
gEs = BNGetExampleSpec(gPriorNet);
} else {
sprintf(fileName, "%s/%s.names", gSourceDirectory, gFileStem);
gEs = ExampleSpecRead(fileName);
DebugError(gEs == 0, "Unable to open the .names file");
gPriorNet = BNNewFromSpec(gEs);
}
gInitialParameterCount = BNGetNumParameters(gPriorNet);
gBranchFactor = BNGetNumNodes(gPriorNet) * BNGetNumNodes(gPriorNet);
if(gLimitBytes != -1) {
gMaxBytesPerModel = gLimitBytes / BNGetNumNodes(gPriorNet);
//gMaxBytesPerModel = gLimitBytes / gBranchFactor;
DebugMessage(1, 2, "Limit models to %.4lf megs\n",
gMaxBytesPerModel / (1024.0 * 1024.0));
}
gCurrentNet = BNClone(gPriorNet);
BNZeroCPTs(gCurrentNet);
RandomInit();
/* seed */
if(gSeed != -1) {
RandomSeed(gSeed);
} else {
gSeed = RandomRange(1, 30000);
RandomSeed(gSeed);
}
DebugMessage(1, 1, "running with seed %d\n", gSeed);
DebugMessage(1, 1, "allocation %ld\n", MGetTotalAllocation());
DebugMessage(1, 1, "initial parameters %ld\n", gInitialParameterCount);
}
示例6: strlen
VOID
CVfrCompiler::AppendIncludePath (
IN CHAR8 *PathStr
)
{
UINT32 Len = 0;
CHAR8 *IncludePaths = NULL;
Len = strlen (" -I ") + strlen (PathStr) + 1;
if (mOptions.IncludePaths != NULL) {
Len += strlen (mOptions.IncludePaths);
}
IncludePaths = new CHAR8[Len];
if (IncludePaths == NULL) {
DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NULL);
return;
}
IncludePaths[0] = '\0';
if (mOptions.IncludePaths != NULL) {
strcat (IncludePaths, mOptions.IncludePaths);
}
strcat (IncludePaths, " -I ");
strcat (IncludePaths, PathStr);
if (mOptions.IncludePaths != NULL) {
delete mOptions.IncludePaths;
}
mOptions.IncludePaths = IncludePaths;
}
示例7: locker
void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg)
{
QMutexLocker locker(&mutex);
QList<unsigned int> lines;
QStringList files;
for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator tok = msg._callStack.begin();
tok != msg._callStack.end();
++tok)
{
files << QString((*tok).getfile(false).c_str());
lines << (*tok).line;
}
ErrorItem item;
item.file = QString(callStackToString(msg._callStack).c_str());
item.files = files;
item.id = QString(msg._id.c_str());
item.lines = lines;
item.summary = QString::fromStdString(msg.shortMessage());
item.message = QString::fromStdString(msg.verboseMessage());
item.severity = msg._severity;
item.inconclusive = msg._inconclusive;
if (msg._severity != Severity::debug)
emit Error(item);
else
emit DebugError(item);
}
示例8: My_Sys_SetModuleOffset
void __cdecl My_Sys_SetModuleOffset(char* moduleName, void* offset) {
// We should be getting qagame, but check just in case.
if (!strcmp(moduleName, "qagame")) {
// Despite the name, it's not the actual module, but vmMain.
// We use dlinfo to get the base of the module so we can properly
// initialize all the pointers relative to the base.
qagame_dllentry = offset;
Dl_info dlinfo;
int res = dladdr(offset, &dlinfo);
if (!res) {
DebugError("dladdr() failed.\n", __FILE__, __LINE__, __func__);
qagame = NULL;
}
else {
qagame = dlinfo.dli_fbase;
}
DebugPrint("Got qagame: %#010x\n", qagame);
}
else
DebugPrint("Unknown module: %s\n", moduleName);
Sys_SetModuleOffset(moduleName, offset);
if (common_initialized) {
SearchVmFunctions();
HookVm();
InitializeVm();
}
}
示例9: Besseli
CReal Besseli(const CReal rNu, const CReal rZ)
{
const CReal rEp = (CReal) 10e-9; /* Define accuracy */
const CReal rY = rZ / (CReal) 2.0;
CReal rReturn = (CReal) 1.0;
CReal rD = (CReal) 1.0;
CReal rS = (CReal) 1.0;
#ifdef _DEBUG_
/* Only nu = 0 is supported right now! */
if (rNu != (CReal) 0.0)
{
DebugError("MatLibr: Besseli function", "The nu = ", rNu, \
" is not supported, only nu = ", 0);
}
#endif
for (int i = 1; i <= 25 && rReturn * rEp <= rS; i++)
{
rD *= rY / i;
rS = rD * rD;
rReturn += rS;
}
return rReturn;
}
示例10: main
int main(int argc, char *argv[]) {
BeliefNet bn, cbn;
FILE *dataFile;
ExamplePtr e;
long numSeen = 0;
double llSum = 0;
_processArgs(argc, argv);
bn = _readBN(gBeliefNetFile);
if(gDoSmooth) {
BNSetPriorStrength(bn, gPriorStrength);
BNSmoothProbabilities(bn, 1);
if(DebugGetMessageLevel() > 2) {
BNWriteBIF(bn, stdout);
}
}
if(gCompareToNet) {
cbn = _readBN(gCompareNetFile);
if(gDoSmooth) {
BNSetPriorStrength(cbn, gPriorStrength);
BNSmoothProbabilities(cbn, 1);
}
DebugMessage(1, 0, "Structural Difference: %d\n",
_GetStructuralDifference(bn, cbn));
} else {
if(gStdin) {
dataFile = stdin;
} else {
dataFile = fopen(gDataFile, "r");
DebugError(dataFile == 0, "Unable to open datafile.");
}
e = ExampleRead(dataFile, BNGetExampleSpec(bn));
while(e != 0) {
numSeen++;
llSum += BNGetLogLikelihood(bn, e);
ExampleFree(e);
e = ExampleRead(dataFile, BNGetExampleSpec(bn));
}
DebugMessage(1, 1, "Average Log Likelihood of %s on %s is: ",
gBeliefNetFile, gDataFile);
DebugMessage(1, 0, "%lf\n", llSum / (double)numSeen);
if(!gStdin) {
fclose(dataFile);
}
}
return 0;
}
示例11: tan
Eigen::Matrix4f MatrixFactory::createPerspectiveFov
(
float near_plane,
float far_plane,
float aspect_ratio,
float fov_vertical,
Handedness handedness
) const
{
if (handedness == Handedness::RightHanded)
{
float h = 1.0f / tan(fov_vertical / 2.0f);
float w = h / aspect_ratio;
// z device coordinates [0, 1]
float _33 = far_plane / (near_plane - far_plane);
float _34 = near_plane * _33;
// z device coordinates [-1, 1]
//float _33 = (near_plane + far_plane) / (near_plane - far_plane);
//float _34 = (2 * near_plane * far_plane) / (near_plane - far_plane);
Eigen::Matrix4f matrix;
matrix << w, 0, 0, 0,
0, h, 0, 0,
0, 0, _33, _34,
0, 0, -1, 0;
return matrix;
}
else if (handedness == Handedness::LeftHanded)
{
float h = 1.0f / tan(fov_vertical / 2.0f);
float w = h / aspect_ratio;
// z device coordinates [0, 1]
float _33 = far_plane / (far_plane - near_plane);
float _34 = -near_plane * _33;
// z device coordinates [-1, 1]
//float _33 = (near_plane + far_plane) / (far_plane - near_plane);
//float _34 = -(2 * near_plane * far_plane) / (far_plane - near_plane);
Eigen::Matrix4f matrix;
matrix << w, 0, 0, 0,
0, h, 0, 0,
0, 0, _33, _34,
0, 0, 1, 0;
return matrix;
}
else
{
DebugError("Not implemented.");
return Eigen::Matrix4f::Identity();
}
}
示例12: DebugError
VOID
CVfrCompiler::Compile (
VOID
)
{
FILE *pInFile = NULL;
CHAR8 *InFileName = NULL;
if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {
goto Fail;
}
InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;
gCVfrErrorHandle.SetInputFile (InFileName);
if ((pInFile = fopen (InFileName, "r")) == NULL) {
DebugError (NULL, 0, 0001, "Error opening the input file", InFileName);
goto Fail;
}
if (VfrParserStart (pInFile, mOptions.CompatibleMode) != 0) {
goto Fail;
}
fclose (pInFile);
if (gCFormPkg.HavePendingUnassigned () == TRUE) {
gCFormPkg.PendingAssignPrintAll ();
goto Fail;
}
SET_RUN_STATUS (STATUS_COMPILEED);
return;
Fail:
if (!IS_RUN_STATUS(STATUS_DEAD)) {
DebugError (NULL, 0, 0003, "Error parsing", "compile error in file %s", InFileName);
SET_RUN_STATUS (STATUS_FAILED);
}
if (pInFile != NULL) {
fclose (pInFile);
}
}
示例13: DebugError
void CPlayer::AddMoGuiMoney(INT32 nMoney)
{
if ( nMoney>=0 && m_nMoGuiMoney+nMoney>=0 )
{
m_nMoGuiMoney += nMoney;
}
else
{
DebugError("AddMoGuiMoney PID=%-10d m_nMoGuiMoney=%d nMoney=%d",m_PID,m_nMoGuiMoney,nMoney );
}
}
示例14: DebugError
void chunk::create(){
pblocks = new block[4096];
pbrightness = new brightness[4096];
//memset(pblocks, 0, sizeof(pblocks));
//memset(pbrightness, 0, sizeof(pbrightness));
#ifdef NEWORLD_DEBUG_CONSOLE_OUTPUT
if (pblocks == nullptr || pbrightness == nullptr){
DebugError("Allocate memory failed!");
}
#endif
}
示例15: init
void init(string ip, unsigned short _port) {
Net::startup();
try {
socketClient.connectIPv4(ip, _port);
}
catch (...) {
DebugError("Cannot connect to the server!");
return;
}
threadRun = true;
mutex = MutexCreate();
t = ThreadCreate(networkThread, NULL);
}