Skip to content

Commit 3f065c4

Browse files
author
Roberto De Ioris
authored
Merge pull request 20tab#413 from slartibaartfast/master
Apply (char *) to static strings, exclude TSharedRef<IPlugin>plugin f…
2 parents 3ed2937 + c2b5373 commit 3f065c4

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

Source/PythonAutomation/Private/PythonAutomationModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ IMPLEMENT_MODULE(FPythonAutomationModule, PythonAutomation);
99

1010
void FPythonAutomationModule::StartupModule()
1111
{
12-
PyObject *py_automation_module = ue_py_register_module("unreal_engine.automation");
12+
PyObject *py_automation_module = ue_py_register_module((char *)"unreal_engine.automation");
1313
ue_python_init_fautomation_editor_common_utils(py_automation_module);
1414
}
1515

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,9 @@ void unreal_engine_init_py_module()
15521552

15531553
ue_python_init_ivoice_capture(new_unreal_engine_module);
15541554

1555-
ue_py_register_magic_module("unreal_engine.classes", py_ue_new_uclassesimporter);
1556-
ue_py_register_magic_module("unreal_engine.enums", py_ue_new_enumsimporter);
1557-
ue_py_register_magic_module("unreal_engine.structs", py_ue_new_ustructsimporter);
1555+
ue_py_register_magic_module((char *)"unreal_engine.classes", py_ue_new_uclassesimporter);
1556+
ue_py_register_magic_module((char *)"unreal_engine.enums", py_ue_new_enumsimporter);
1557+
ue_py_register_magic_module((char *)"unreal_engine.structs", py_ue_new_ustructsimporter);
15581558

15591559

15601560
PyDict_SetItemString(unreal_engine_dict, "ENGINE_MAJOR_VERSION", PyLong_FromLong(ENGINE_MAJOR_VERSION));

Source/UnrealEnginePython/Private/UnrealEnginePython.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ void FUnrealEnginePythonModule::StartupModule()
300300
ScriptsPaths.Add(ProjectScriptsPath);
301301
}
302302

303+
#if WITH_EDITOR
303304
for (TSharedRef<IPlugin>plugin : IPluginManager::Get().GetEnabledPlugins())
304305
{
305306
FString PluginScriptsPath = FPaths::Combine(plugin->GetContentDir(), UTF8_TO_TCHAR("Scripts"));
@@ -308,6 +309,7 @@ void FUnrealEnginePythonModule::StartupModule()
308309
ScriptsPaths.Add(PluginScriptsPath);
309310
}
310311
}
312+
#endif
311313

312314
if (ZipPath.IsEmpty())
313315
{
@@ -461,7 +463,7 @@ FString FUnrealEnginePythonModule::Pep8ize(FString Code)
461463
return NewCode;
462464
}
463465

464-
// run a python string in a new sub interpreter
466+
// run a python string in a new sub interpreter
465467
void FUnrealEnginePythonModule::RunStringSandboxed(char *str)
466468
{
467469
FScopePythonGIL gil;
@@ -684,4 +686,3 @@ PyObject *ue_py_register_module(char *name)
684686
#undef LOCTEXT_NAMESPACE
685687

686688
IMPLEMENT_MODULE(FUnrealEnginePythonModule, UnrealEnginePython)
687-

Source/UnrealEnginePython/Private/Wrappers/UEPyFSlowTask.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static PyObject *py_ue_fslowtask_make_dialog(ue_PyFSlowTask *self, PyObject * ar
7474
static PyObject *py_ue_fslowtask_enter_progress_frame(ue_PyFSlowTask *self, PyObject * args)
7575
{
7676
float expected_work_this_frame = 1.0;
77-
char *text = "";
77+
char *text = (char *)"";
7878
if(!PyArg_ParseTuple(args, "|fs:enter_progress_frame", &expected_work_this_frame, &text))
7979
{
8080
return nullptr;
@@ -153,7 +153,7 @@ static PyTypeObject ue_PyFSlowTaskType = {
153153
static int py_ue_fslowtask_init(ue_PyFSlowTask *self, PyObject * args)
154154
{
155155
float amount_of_work;
156-
char *default_message = "";
156+
char *default_message = (char *)"";
157157
PyObject *py_enabled = nullptr;
158158
if(!PyArg_ParseTuple(args, "f|sO:__init__", &amount_of_work, &default_message, &py_enabled))
159159
{
@@ -189,4 +189,4 @@ ue_PyFSlowTask *py_ue_is_fslowtask(PyObject *obj)
189189
return (ue_PyFSlowTask *)obj;
190190
}
191191

192-
#endif
192+
#endif

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class UnrealEnginePython : ModuleRules
1111
private string pythonHome = "";
1212
// otherwise specify the path of your python installation
1313
//private string pythonHome = "C:/Program Files/Python36";
14-
// this is an example for Homebrew on Mac
14+
// this is an example for Homebrew on Mac
1515
//private string pythonHome = "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/";
1616
// on Linux an include;libs syntax is expected:
1717
//private string pythonHome = "/usr/local/include/python3.6;/usr/local/lib/libpython3.6.so"
@@ -257,8 +257,8 @@ public UnrealEnginePython(TargetInfo Target)
257257
private bool IsPathRelative(string Path)
258258
{
259259
bool IsRooted = Path.StartsWith("\\", System.StringComparison.Ordinal) || // Root of the current directory on Windows. Also covers "\\" for UNC or "network" paths.
260-
Path.StartsWith("/", System.StringComparison.Ordinal) || // Root of the current directory on Windows, root on UNIX-likes.
261-
// Also covers "\\", considering normalization replaces "\\" with "//".
260+
Path.StartsWith("/", System.StringComparison.Ordinal) || // Root of the current directory on Windows, root on UNIX-likes.
261+
// Also covers "\\", considering normalization replaces "\\" with "//".
262262
(Path.Length >= 2 && char.IsLetter(Path[0]) && Path[1] == ':'); // Starts with "<DriveLetter>:"
263263
return !IsRooted;
264264
}

0 commit comments

Comments
 (0)