本文整理汇总了C++中debug_warn函数的典型用法代码示例。如果您正苦于以下问题:C++ debug_warn函数的具体用法?C++ debug_warn怎么用?C++ debug_warn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_warn函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadLibraryA
static void *ekg2_dlopen(const char *name) {
#ifdef NO_POSIX_SYSTEM
void *tmp = LoadLibraryA(name);
#else
/* RTLD_LAZY is bad flag, because code can SEGV on executing undefined symbols...
* it's better to fail earlier than later with SIGSEGV
*
* RTLD_GLOBAL is bad flag also, because we have no need to export symbols to another plugns
* we should do it by queries... Yeah, I know it was used for example in perl && irc plugin.
* But we cannot do it. Because if we load irc before sim plugin. Than we'll have unresolved symbols
* even if we load sim plugin later.
*/
/*
* RTLD_GLOBAL is required by perl and python plugins...
* need investigation. [XXX]
*/
void *tmp = dlopen(name, RTLD_NOW | RTLD_GLOBAL);
#endif
if (!tmp) {
debug_warn("[plugin] could not be loaded: %s %s\n", name, dlerror());
} else {
debug_ok("[plugin] loaded: %s\n", name);
}
return tmp;
}
开发者ID:dmilith,项目名称:ekg2-bsd,代码行数:25,代码来源:plugins.c
示例2: OSSemPend
void OSSemPend (uint8 dev,uint32 timeout,uint8 *perr)
{
int ret=0;
struct timespec outtime;
struct timeval now;
pthread_mutex_lock(&QueueMutex[dev]);
gettimeofday(&now,NULL);
//outtime.tv_sec = time(0)+timeout/1000;
//outtime.tv_nsec = (timeout%1000)*1000*1000;
outtime.tv_sec = now.tv_sec+timeout/1000;
//outtime.tv_nsec = now.tv_usec*1000 + (timeout%1000)*1000*1000;
outtime.tv_nsec = (timeout%1000)*1000*1000;
//printf("ossem timeout is right!\n ");
if(timeout == (uint32)NULL)
{
pthread_cond_wait(&QueueSems[dev],&QueueMutex[dev]);
}
else
{
ret=pthread_cond_timedwait(&QueueSems[dev],&QueueMutex[dev],&outtime);
if(ret != 0) {
debug_warn(gDebugModule[MSIC_MODULE],"[%s][%s][%d]pthread_cond_timedwait %s\n",FILE_LINE,strerror(ret));
}
}
*perr = (uint8)ret;
pthread_mutex_unlock(&QueueMutex[dev]);
}
开发者ID:freudshow,项目名称:ARM9Src,代码行数:29,代码来源:misc.c
示例3: catch
void CGUI::Destroy()
{
// We can use the map to delete all
// now we don't want to cancel all if one Destroy fails
for (const std::pair<CStr, IGUIObject*>& p : m_pAllObjects)
{
try
{
p.second->Destroy();
}
catch (PSERROR_GUI& e)
{
UNUSED2(e);
debug_warn(L"CGUI::Destroy error");
// TODO Gee: Handle
}
delete p.second;
}
m_pAllObjects.clear();
for (const std::pair<CStr, CGUISprite*>& p : m_Sprites)
delete p.second;
m_Sprites.clear();
m_Icons.clear();
}
开发者ID:2asoft,项目名称:0ad,代码行数:26,代码来源:CGUI.cpp
示例4: catch
void CGUI::Destroy()
{
// We can use the map to delete all
// now we don't want to cancel all if one Destroy fails
for (map_pObjects::iterator it = m_pAllObjects.begin(); it != m_pAllObjects.end(); ++it)
{
try
{
it->second->Destroy();
}
catch (PSERROR_GUI& e)
{
UNUSED2(e);
debug_warn(L"CGUI::Destroy error");
// TODO Gee: Handle
}
delete it->second;
}
// Clear all
m_pAllObjects.clear();
for(std::map<CStr, CGUISprite*>::iterator it = m_Sprites.begin(); it != m_Sprites.end(); ++it)
delete it->second;
m_Sprites.clear();
m_Icons.clear();
}
开发者ID:Valvador,项目名称:PyroSpaceFork,代码行数:27,代码来源:CGUI.cpp
示例5: sys_open_url
Status sys_open_url(const std::string& url)
{
pid_t pid = fork();
if (pid < 0)
{
debug_warn(L"Fork failed");
return ERR::FAIL;
}
else if (pid == 0)
{
// we are the child
execlp(URL_OPEN_COMMAND, URL_OPEN_COMMAND, url.c_str(), (const char*)NULL);
debug_printf(L"Failed to run '" URL_OPEN_COMMAND "' command\n");
// We can't call exit() because that'll try to free resources which were the parent's,
// so just abort here
abort();
}
else
{
// we are the parent
// TODO: maybe we should wait for the child and make sure it succeeded
return INFO::OK;
}
}
开发者ID:Marlinc,项目名称:0ad,代码行数:29,代码来源:unix.cpp
示例6: reconn_fun
static void* reconn_fun(void* arg){
conn_t* conn;
queue_t* q = &g_ctx.reconn_q;
rval_t rval;
int times = 1;
while(1){
conn = list_entry(deque(q), conn_t, reconn_link);
assert(conn->conn_state == CONNECTING);
assert(conn->conn_type == ACTIVE);
debug_info("start reconn conn[%d], fd[%d],%s \n",
conn->id, conn->sockfd, dump_addr(conn->addr));
rval = re_connect(conn);
if(success(rval)){
debug_info("reconn conn[%d], fd[%d] success! \n", conn->id, conn->sockfd);
set_conn_state(conn, CONNECTED);
add_event(conn);
}else{
debug_warn("reconn conn[%d], fd[%d] failed! errno[%d]\n",
conn->id, conn->sockfd, rval.err);
enque(q, &conn->reconn_link); //continue reconn
}
sleep(times);
}
}
开发者ID:Jack-chang,项目名称:myfs,代码行数:25,代码来源:reconn.c
示例7: switch
void IGUIObject::AddSetting(const EGUISettingType& Type, const CStr& Name)
{
// Is name already taken?
if (m_Settings.count(Name) >= 1)
return;
// Construct, and set type
m_Settings[Name].m_Type = Type;
switch (Type)
{
#define TYPE(type) \
case GUIST_##type: \
m_Settings[Name].m_pSetting = new type(); \
break;
// Construct the setting.
#include "GUItypes.h"
#undef TYPE
default:
debug_warn(L"IGUIObject::AddSetting failed, type not recognized!");
break;
}
}
开发者ID:Rektosauros,项目名称:0ad,代码行数:26,代码来源:IGUIObject.cpp
示例8: switch
CStr CStr::Pad(PS_TRIM_MODE Mode, size_t Length) const
{
size_t Left = 0, Right = 0;
if (Length <= length())
return *this;
// From here: Length-length() >= 1
switch (Mode)
{
case PS_TRIM_LEFT:
Left = Length - length();
break;
case PS_TRIM_RIGHT:
Right = Length - length();
break;
case PS_TRIM_BOTH:
Left = (Length - length() + 1)/2;
Right = (Length - length() - 1)/2; // cannot be negative
break;
default:
debug_warn(L"CStr::Trim: invalid Mode");
}
return std::tstring(Left, _T(' ')) + *this + std::tstring(Right, _T(' '));
}
开发者ID:Gallaecio,项目名称:0ad,代码行数:30,代码来源:CStr.cpp
示例9: attr_name
void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImageEffects &effects)
{
XMBAttributeList attributes = Element.GetAttributes();
for (int i=0; i<attributes.Count; ++i)
{
XMBAttribute attr = attributes.Item(i);
CStr attr_name (pFile->GetAttributeString(attr.Name));
CStrW attr_value (attr.Value.FromUTF8());
if (attr_name == "add_color")
{
CColor color;
if (!GUI<int>::ParseColor(attr_value, color, 0.f))
LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
else effects.m_AddColor = color;
}
else if (attr_name == "grayscale")
{
effects.m_Greyscale = true;
}
else
{
debug_warn(L"Invalid data - DTD shouldn't allow this");
}
}
}
开发者ID:Valvador,项目名称:PyroSpaceFork,代码行数:26,代码来源:CGUI.cpp
示例10: debug_warn
std::vector<std::pair<CStr, CConfigValueSet> > CConfigDB::GetValuesWithPrefix(EConfigNamespace ns, const CStr& prefix)
{
std::vector<std::pair<CStr, CConfigValueSet> > ret;
if (ns < 0 || ns >= CFG_LAST)
{
debug_warn(L"CConfigDB: Invalid ns value");
return ret;
}
for (TConfigMap::iterator it = m_Map[CFG_COMMAND].begin(); it != m_Map[CFG_COMMAND].end(); ++it)
{
if (boost::algorithm::starts_with(it->first, prefix))
ret.push_back(std::make_pair(it->first, it->second));
}
for (int search_ns = ns; search_ns >= 0; search_ns--)
{
for (TConfigMap::iterator it = m_Map[search_ns].begin(); it != m_Map[search_ns].end(); ++it)
{
if (boost::algorithm::starts_with(it->first, prefix))
ret.push_back(std::make_pair(it->first, it->second));
}
}
return ret;
}
开发者ID:Gallaecio,项目名称:0ad,代码行数:27,代码来源:ConfigDB.cpp
示例11: UNUSED2
JSBool JSI_IGUIObject::getComputedSize(JSContext* cx, uintN argc, jsval* vp)
{
UNUSED2(argc);
IGUIObject* e = (IGUIObject*)JS_GetInstancePrivate(cx, JS_THIS_OBJECT(cx, vp), &JSI_IGUIObject::JSI_class, NULL);
if (!e)
return JS_FALSE;
e->UpdateCachedSize();
CRect size = e->m_CachedActualSize;
JSObject* obj = JS_NewObject(cx, NULL, NULL, NULL);
try
{
g_ScriptingHost.SetObjectProperty_Double(obj, "left", size.left);
g_ScriptingHost.SetObjectProperty_Double(obj, "right", size.right);
g_ScriptingHost.SetObjectProperty_Double(obj, "top", size.top);
g_ScriptingHost.SetObjectProperty_Double(obj, "bottom", size.bottom);
}
catch (PSERROR_Scripting_ConversionFailed)
{
debug_warn(L"Error creating size object!");
return JS_FALSE;
}
JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));
return JS_TRUE;
}
开发者ID:Marlinc,项目名称:0ad,代码行数:28,代码来源:JSInterface_IGUIObject.cpp
示例12: root_name
/**
* @callgraph
*/
void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& Paths)
{
Paths.insert(Filename);
CXeromyces XeroFile;
if (XeroFile.Load(g_VFS, Filename, "gui") != PSRETURN_OK)
return;
XMBElement node = XeroFile.GetRoot();
CStr root_name(XeroFile.GetElementString(node.GetNodeName()));
try
{
if (root_name == "objects")
{
Xeromyces_ReadRootObjects(node, &XeroFile, Paths);
// Re-cache all values so these gets cached too.
//UpdateResolution();
}
else if (root_name == "sprites")
Xeromyces_ReadRootSprites(node, &XeroFile);
else if (root_name == "styles")
Xeromyces_ReadRootStyles(node, &XeroFile);
else if (root_name == "setup")
Xeromyces_ReadRootSetup(node, &XeroFile);
else
debug_warn(L"CGUI::LoadXmlFile error");
}
catch (PSERROR_GUI& e)
{
LOGERROR("Errors loading GUI file %s (%u)", Filename.string8(), e.getCode());
return;
}
}
开发者ID:2asoft,项目名称:0ad,代码行数:38,代码来源:CGUI.cpp
示例13: _VMClass_add_instance_primitive
void _VMClass_add_instance_primitive(void* _self, pVMPrimitive value, bool warn) {
pVMClass self = (pVMClass)_self;
if(SEND(self, add_instance_invokable, (pVMObject)value) && warn) {
pVMSymbol sym = TSEND(VMInvokable, value, get_signature);
debug_warn("Primitive %s is not in class definition for class %s.\n",
sym->chars,
self->name->chars);
}
}
开发者ID:SOM-st,项目名称:CSOM,代码行数:9,代码来源:VMClass.c
示例14: debug_warn
void CComponentManager::AddMockComponent(entity_id_t ent, InterfaceId iid, IComponent& component)
{
// Just add it into the by-interface map, not the by-component-type map,
// so it won't be considered for messages or deletion etc
boost::unordered_map<entity_id_t, IComponent*>& emap1 = m_ComponentsByInterface.at(iid);
if (emap1.find(ent) != emap1.end())
debug_warn(L"Multiple components for interface");
emap1.insert(std::make_pair(ent, &component));
}
开发者ID:nahumfarchi,项目名称:0ad,代码行数:10,代码来源:ComponentManager.cpp
示例15: m
ActorViewer::ActorViewer()
: m(*new ActorViewerImpl())
{
m.WalkEnabled = false;
m.GroundEnabled = true;
m.WaterEnabled = false;
m.ShadowsEnabled = g_Renderer.GetOptionBool(CRenderer::OPT_SHADOWS);
m.SelectionBoxEnabled = false;
m.AxesMarkerEnabled = false;
m.PropPointsMode = 0;
m.Background = SColor4ub(0, 0, 0, 255);
// Create a tiny empty piece of terrain, just so we can put shadows
// on it without having to think too hard
m.Terrain.Initialize(2, NULL);
CTerrainTextureEntry* tex = g_TexMan.FindTexture("whiteness");
if (tex)
{
for (ssize_t pi = 0; pi < m.Terrain.GetPatchesPerSide(); ++pi)
{
for (ssize_t pj = 0; pj < m.Terrain.GetPatchesPerSide(); ++pj)
{
CPatch* patch = m.Terrain.GetPatch(pi, pj);
for (ssize_t i = 0; i < PATCH_SIZE; ++i)
{
for (ssize_t j = 0; j < PATCH_SIZE; ++j)
{
CMiniPatch& mp = patch->m_MiniPatches[i][j];
mp.Tex = tex;
mp.Priority = 0;
}
}
}
}
}
else
{
debug_warn(L"Failed to load whiteness texture");
}
// Start the simulation
m.Simulation2.LoadDefaultScripts();
m.Simulation2.ResetState();
// Tell the simulation we've already loaded the terrain
CmpPtr<ICmpTerrain> cmpTerrain(m.Simulation2, SYSTEM_ENTITY);
if (cmpTerrain)
cmpTerrain->ReloadTerrain(false);
// Remove FOW since we're in Atlas
CmpPtr<ICmpRangeManager> cmpRangeManager(m.Simulation2, SYSTEM_ENTITY);
if (cmpRangeManager)
cmpRangeManager->SetLosRevealAll(-1, true);
}
开发者ID:2asoft,项目名称:0ad,代码行数:54,代码来源:ActorViewer.cpp
示例16: ekg_disconnect_by_outstream
void ekg_disconnect_by_outstream(GDataOutputStream *f) {
struct ekg_connection *c = get_connection_by_outstream(f);
if (!c) {
debug_warn("ekg_disconnect_by_outstream() - connection not found\n");
return;
}
debug_function("ekg_disconnect_by_outstream(%x)\n",c);
ekg_connection_remove(c);
}
开发者ID:AdKwiatkos,项目名称:ekg2,代码行数:12,代码来源:connections.c
示例17: NETTURN_LOG
void CNetTurnManager::AddCommand(int client, int player, JS::HandleValue data, u32 turn)
{
NETTURN_LOG((L"AddCommand(client=%d player=%d turn=%d)\n", client, player, turn));
if (!(m_CurrentTurn < turn && turn <= m_CurrentTurn + COMMAND_DELAY + 1))
{
debug_warn(L"Received command for invalid turn");
return;
}
m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(player, m_Simulation2.GetScriptInterface().GetContext(), data);
}
开发者ID:Epidilius,项目名称:0ad,代码行数:12,代码来源:NetTurnManager.cpp
示例18: LoadStyle
void IGUIObject::LoadStyle(CGUI& GUIinstance, const CStr& StyleName)
{
// Fetch style
if (GUIinstance.m_Styles.count(StyleName) == 1)
{
LoadStyle(GUIinstance.m_Styles[StyleName]);
}
else
{
debug_warn(L"IGUIObject::LoadStyle failed");
}
}
开发者ID:Rektosauros,项目名称:0ad,代码行数:12,代码来源:IGUIObject.cpp
注:本文中的debug_warn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论