Skip to content

Commit 54d1508

Browse files
committed
Replace shared_str operator* by c_str() for xrAICore and xrScriptEngine
1 parent 7b342ee commit 54d1508

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

src/xrAICore/Navigation/PatrolPath/patrol_path_params.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Fvector& CPatrolPathParams::point(u32 index) const
4141
if (!m_path->vertex(index))
4242
{
4343
GEnv.ScriptEngine->script_log(LuaMessageType::Error,
44-
"Can't get information about patrol point number %d in the patrol way %s", index, *m_path_name);
44+
"Can't get information about patrol point number %d in the patrol way %s", index, m_path_name.c_str());
4545
index = (*m_path->vertices().begin()).second->vertex_id();
4646
}
4747
VERIFY(m_path->vertex(index));
@@ -83,7 +83,7 @@ Flags32 CPatrolPathParams::flags(u32 index) const
8383
LPCSTR CPatrolPathParams::name(u32 index) const
8484
{
8585
VERIFY(m_path->vertex(index));
86-
return (*m_path->vertex(index)->data().name());
86+
return (m_path->vertex(index)->data().name().c_str());
8787
}
8888

8989
bool CPatrolPathParams::terminal(u32 index) const

src/xrAICore/Navigation/PatrolPath/patrol_path_storage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void CPatrolPathStorage::load_raw(
3232
shared_str patrol_name;
3333
sub_chunk->r_stringZ(patrol_name);
3434
const_iterator I = m_registry.find(patrol_name);
35-
VERIFY3(I == m_registry.end(), "Duplicated patrol path found", *patrol_name);
35+
VERIFY3(I == m_registry.end(), "Duplicated patrol path found", patrol_name.c_str());
3636
m_registry.insert(std::make_pair(
3737
patrol_name, &(new CPatrolPath(patrol_name))->load_raw(level_graph, cross, game_graph, *sub_chunk)));
3838
}
@@ -70,7 +70,7 @@ void CPatrolPathStorage::load(IReader& stream)
7070
chunk1->close();
7171

7272
const_iterator I = m_registry.find(pair.first);
73-
VERIFY3(I == m_registry.end(), "Duplicated patrol path found ", *pair.first);
73+
VERIFY3(I == m_registry.end(), "Duplicated patrol path found ", pair.first.c_str());
7474

7575
#ifdef DEBUG
7676
pair.second->name(pair.first);

src/xrAICore/Navigation/PatrolPath/patrol_path_storage_inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ IC const CPatrolPath* CPatrolPathStorage::path(shared_str patrol_name, bool no_a
1515
const_iterator I = patrol_paths().find(patrol_name);
1616
if (I == patrol_paths().end())
1717
{
18-
THROW3(no_assert, "There is no patrol path", *patrol_name);
18+
THROW3(no_assert, "There is no patrol path", patrol_name.c_str());
1919
return (0);
2020
}
2121
return ((*I).second);

src/xrAICore/Navigation/PatrolPath/patrol_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void CPatrolPoint::verify_vertex_id(
4141

4242
VERIFY(m_path);
4343
string1024 temp;
44-
xr_sprintf(temp, "\n! Patrol point %s in path %s is not on the level graph vertex!", *m_name, *m_path->m_name);
44+
xr_sprintf(temp, "\n! Patrol point %s in path %s is not on the level graph vertex!", m_name.c_str(), m_path->m_name.c_str());
4545
THROW2(level_graph->valid_vertex_id(m_level_vertex_id), temp);
4646
}
4747
#endif

src/xrScriptEngine/script_debugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ bool CScriptDebugger::HasBreakPoint(const char* fileName, s32 lineNum)
378378
for (u32 i = 0; i < m_breakPoints.size(); i++)
379379
{
380380
SBreakPoint bp(m_breakPoints[i]);
381-
if (bp.nLine == lineNum && xr_strlen(bp.fileName) == xr_strlen(sFileName) && !_stricmp(*bp.fileName, sFileName))
381+
if (bp.nLine == lineNum && xr_strlen(bp.fileName) == xr_strlen(sFileName) && !_stricmp(bp.fileName.c_str(), sFileName))
382382
return true;
383383
}
384384
return false;

src/xrScriptEngine/script_debugger_threads.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ u32 CDbgScriptThreads::FillFrom(CScriptProcess* sp)
3030
th.lua = scriptThread->lua();
3131
th.scriptID = scriptThread->thread_reference();
3232
th.active = scriptThread->active();
33-
xr_strcat(th.name, *scriptThread->script_name());
34-
xr_strcat(th.process, *sp->name());
33+
xr_strcat(th.name, scriptThread->script_name().c_str());
34+
xr_strcat(th.process, sp->name().c_str());
3535
m_threads.push_back(th);
3636
}
3737
return m_threads.size();

src/xrScriptEngine/script_engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ CScriptThread* CScriptEngine::CreateScriptThread(LPCSTR caNamespaceName, bool do
12581258
void CScriptEngine::DestroyScriptThread(const CScriptThread* thread)
12591259
{
12601260
#ifdef DEBUG
1261-
Msg("* Destroying script thread %s", *thread->script_name());
1261+
Msg("* Destroying script thread %s", thread->script_name().c_str());
12621262
#endif
12631263
try
12641264
{

src/xrScriptEngine/script_process.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ CScriptProcess::CScriptProcess(CScriptEngine* scriptEngine, shared_str name, sha
1919
this->scriptEngine = scriptEngine;
2020
m_name = name;
2121
#ifdef DEBUG
22-
Msg("* Initializing %s script process", *m_name);
22+
Msg("* Initializing %s script process", m_name.c_str());
2323
#endif
2424
string256 I;
25-
for (u32 i = 0, n = _GetItemCount(*scripts); i < n; i++)
26-
add_script(_GetItem(*scripts, i, I), false, false);
25+
for (u32 i = 0, n = _GetItemCount(scripts.c_str()); i < n; i++)
26+
add_script(_GetItem(scripts.c_str(), i, I), false, false);
2727
m_iterator = 0;
2828
}
2929

src/xrScriptEngine/script_thread.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ CScriptThread::CScriptThread(CScriptEngine* scriptEngine, LPCSTR caNamespaceName
5656
l_iErrorCode = lua_pcall(engineLua, 0, 0, 0);
5757
if (l_iErrorCode)
5858
{
59-
CScriptEngine::print_output(engineLua, *m_script_name, l_iErrorCode);
59+
CScriptEngine::print_output(engineLua, m_script_name.c_str(), l_iErrorCode);
6060
CScriptEngine::on_error(engineLua);
6161
return;
6262
}
6363
}
6464
else
6565
{
66-
CScriptEngine::print_output(engineLua, *m_script_name, l_iErrorCode);
66+
CScriptEngine::print_output(engineLua, m_script_name.c_str(), l_iErrorCode);
6767
CScriptEngine::on_error(engineLua);
6868
return;
6969
}
@@ -107,7 +107,7 @@ bool CScriptThread::update()
107107
int l_iErrorCode = lua_resume(lua(), 0);
108108
if (l_iErrorCode && l_iErrorCode != LUA_YIELD)
109109
{
110-
CScriptEngine::print_output(lua(), *script_name(), l_iErrorCode);
110+
CScriptEngine::print_output(lua(), script_name().c_str(), l_iErrorCode);
111111
CScriptEngine::on_error(scriptEngine->lua());
112112
#ifdef DEBUG
113113
print_stack(lua());
@@ -121,14 +121,14 @@ bool CScriptThread::update()
121121
#ifdef DEBUG
122122
if (m_current_stack_level)
123123
{
124-
CScriptEngine::print_output(lua(), *script_name(), l_iErrorCode);
124+
CScriptEngine::print_output(lua(), script_name().c_str(), l_iErrorCode);
125125
CScriptEngine::on_error(scriptEngine->lua());
126126
// print_stack(lua());
127127
}
128128
#endif
129129
m_active = false;
130130
#ifdef DEBUG
131-
scriptEngine->script_log(LuaMessageType::Info, "Script %s is finished!", *m_script_name);
131+
scriptEngine->script_log(LuaMessageType::Info, "Script %s is finished!", m_script_name.c_str());
132132
#endif
133133
}
134134
else

0 commit comments

Comments
 (0)