Skip to content

Commit 35c83ed

Browse files
committed
Wrap remaining references
1 parent 18e5357 commit 35c83ed

32 files changed

+219
-227
lines changed

Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ PyObject *py_ue_graph_add_node_variable_get(ue_PyUObject * self, PyObject * args
209209
UEdGraph *graph = (UEdGraph *)self->ue_object;
210210
UStruct *u_struct = nullptr;
211211

212-
if (py_struct && py_struct != Py_None)
212+
if (py_struct && py_struct != ue_Py_None)
213213
{
214214
if (!ue_is_pyuobject(py_struct))
215215
{
@@ -257,7 +257,7 @@ PyObject *py_ue_graph_add_node_variable_set(ue_PyUObject * self, PyObject * args
257257
UEdGraph *graph = (UEdGraph *)self->ue_object;
258258
UStruct *u_struct = nullptr;
259259

260-
if (py_struct && py_struct != Py_None)
260+
if (py_struct && py_struct != ue_Py_None)
261261
{
262262
if (!ue_is_pyuobject(py_struct))
263263
{

Source/UnrealEnginePython/Private/Http/UEPyIHttpRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void FPythonSmartHttpDelegate::OnRequestComplete(FHttpRequestPtr request, FHttpR
154154
return;
155155
}
156156

157-
PyObject *ret = PyObject_CallFunction(py_callable, (char *)"ONO", py_http_request, py_ue_new_ihttp_response(response.Get()), successful ? Py_True : Py_False);
157+
PyObject *ret = PyObject_CallFunction(py_callable, (char *)"ONO", py_http_request, py_ue_new_ihttp_response(response.Get()), successful ? ue_Py_True : ue_Py_False);
158158
if (!ret)
159159
{
160160
unreal_engine_py_log_error();

Source/UnrealEnginePython/Private/PyCharacter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ void APyCharacter::SetPythonAttrBool(FString attr, bool b)
302302

303303
FScopePythonGIL gil;
304304

305-
PyObject *py_bool = Py_False;
305+
PyObject *py_bool = ue_Py_False;
306306
if (b)
307307
{
308-
py_bool = Py_True;
308+
py_bool = ue_Py_True;
309309
}
310310

311311
if (PyObject_SetAttrString(py_character_instance, TCHAR_TO_UTF8(*attr), py_bool) < 0)

Source/UnrealEnginePython/Private/PythonComponent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ void UPythonComponent::SetPythonAttrBool(FString attr, bool b)
324324

325325
FScopePythonGIL gil;
326326

327-
PyObject *py_bool = Py_False;
327+
PyObject *py_bool = ue_Py_False;
328328
if (b)
329329
{
330-
py_bool = Py_True;
330+
py_bool = ue_Py_True;
331331
}
332332

333333
if (PyObject_SetAttrString(py_component_instance, TCHAR_TO_UTF8(*attr), py_bool) < 0)

Source/UnrealEnginePython/Private/PythonInterface.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ bool _Bytes_Check(PyObject* op) { return op->ob_type == _Bytes_Type(); }
6161

6262
#if DELAYLOAD_PYTHON_DLL
6363

64-
#if PLATFORM_WINDOWS
6564
static PyObject* ptr__Exc_ArithmeticError = nullptr;
6665
static PyObject* ptr__Exc_AssertionError = nullptr;
6766
static PyObject* ptr__Exc_AttributeError = nullptr;
@@ -384,10 +383,6 @@ void ue_Py_XDECREF(void* op)
384383
}
385384

386385

387-
#else
388-
#error "Can only delay load under Win32"
389-
#endif
390-
391386
#else
392387

393388
//================================================================================
@@ -436,7 +431,7 @@ PyObject* _Exc_UnicodeError() { return ::PyExc_UnicodeError; }
436431
//
437432
// wrap items in Object.h
438433
//
439-
PyObject* _None() { return &::_Py_NoneStruct; }
434+
PyObject* _None() { return &::Py_None; }
440435

441436
PyObject* _False() { return Py_False; }
442437
PyObject* _True() { return Py_True; }

Source/UnrealEnginePython/Private/PythonSmartDelegate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void FPythonSmartDelegate::PyFOnAssetPostImport(UFactory *factory, UObject *u_ob
6868
void FPythonSmartDelegate::PyFOnMainFrameCreationFinished(TSharedPtr<SWindow> InRootWindow, bool bIsNewProjectWindow)
6969
{
7070
FScopePythonGIL gil;
71-
PyObject *ret = PyObject_CallFunction(py_callable, (char *)"NO", py_ue_new_swidget<ue_PySWindow>(InRootWindow.ToSharedRef(), &ue_PySWindowType), bIsNewProjectWindow ? Py_True : Py_False);
71+
PyObject *ret = PyObject_CallFunction(py_callable, (char *)"NO", py_ue_new_swidget<ue_PySWindow>(InRootWindow.ToSharedRef(), &ue_PySWindowType), bIsNewProjectWindow ? ue_Py_True : ue_Py_False);
7272
if (!ret)
7373
{
7474
unreal_engine_py_log_error();

Source/UnrealEnginePython/Private/Slate/UEPySPythonMultiColumnTableRow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class SPythonMultiColumnTableRow : public SMultiColumnTableRow<TSharedPtr<FPytho
7474
return FReply::Unhandled();
7575
}
7676

77-
if (ret == Py_False)
77+
if (ret == ue_Py_False)
7878
{
7979
Py_DECREF(ret);
8080
return FReply::Unhandled();

Source/UnrealEnginePython/Private/Slate/UEPySPythonWidget.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SPythonWidget : public SCompoundWidget
4646
return FReply::Unhandled();
4747
}
4848

49-
if (ret == Py_False)
49+
if (ret == ue_Py_False)
5050
{
5151
Py_DECREF(ret);
5252
return FReply::Unhandled();
@@ -76,7 +76,7 @@ class SPythonWidget : public SCompoundWidget
7676
return FReply::Unhandled();
7777
}
7878

79-
if (ret == Py_False)
79+
if (ret == ue_Py_False)
8080
{
8181
Py_DECREF(ret);
8282
return FReply::Unhandled();
@@ -106,7 +106,7 @@ class SPythonWidget : public SCompoundWidget
106106
return FReply::Unhandled();
107107
}
108108

109-
if (ret == Py_False)
109+
if (ret == ue_Py_False)
110110
{
111111
Py_DECREF(ret);
112112
return FReply::Unhandled();
@@ -136,7 +136,7 @@ class SPythonWidget : public SCompoundWidget
136136
return FReply::Unhandled();
137137
}
138138

139-
if (ret == Py_False)
139+
if (ret == ue_Py_False)
140140
{
141141
Py_DECREF(ret);
142142
return FReply::Unhandled();
@@ -166,7 +166,7 @@ class SPythonWidget : public SCompoundWidget
166166
return FReply::Unhandled();
167167
}
168168

169-
if (ret == Py_False)
169+
if (ret == ue_Py_False)
170170
{
171171
Py_DECREF(ret);
172172
return FReply::Unhandled();
@@ -196,7 +196,7 @@ class SPythonWidget : public SCompoundWidget
196196
return FReply::Unhandled();
197197
}
198198

199-
if (ret == Py_False)
199+
if (ret == ue_Py_False)
200200
{
201201
Py_DECREF(ret);
202202
return FReply::Unhandled();

Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ FReply FPythonSlateDelegate::OnMouseEvent(const FGeometry &geometry, const FPoin
122122
return FReply::Unhandled();
123123
}
124124

125-
if (ret == Py_False)
125+
if (ret == ue_Py_False)
126126
{
127127
Py_DECREF(ret);
128128
return FReply::Unhandled();
@@ -142,7 +142,7 @@ FReply FPythonSlateDelegate::OnKeyDown(const FGeometry &geometry, const FKeyEven
142142
return FReply::Unhandled();
143143
}
144144

145-
if (ret == Py_False)
145+
if (ret == ue_Py_False)
146146
{
147147
Py_DECREF(ret);
148148
return FReply::Unhandled();
@@ -162,7 +162,7 @@ FReply FPythonSlateDelegate::OnClicked()
162162
return FReply::Unhandled();
163163
}
164164

165-
if (ret == Py_False)
165+
if (ret == ue_Py_False)
166166
{
167167
Py_DECREF(ret);
168168
return FReply::Unhandled();
@@ -1384,8 +1384,8 @@ PyObject *py_unreal_engine_add_tool_bar_extension(PyObject * self, PyObject * ar
13841384

13851385
ExtensibleModule.GetToolBarExtensibilityManager()->AddExtender(extender);
13861386

1387-
Py_INCREF(Py_None);
1388-
return Py_None;
1387+
Py_INCREF(ue_Py_None);
1388+
return ue_Py_None;
13891389
}
13901390

13911391
PyObject *py_unreal_engine_add_asset_view_context_menu_extension(PyObject * self, PyObject * args)
@@ -1474,8 +1474,8 @@ PyObject *py_unreal_engine_unregister_nomad_tab_spawner(PyObject * self, PyObjec
14741474

14751475
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(UTF8_TO_TCHAR(name));
14761476

1477-
Py_INCREF(Py_None);
1478-
return Py_None;
1477+
Py_INCREF(ue_Py_None);
1478+
return ue_Py_None;
14791479
}
14801480

14811481
PyObject *py_unreal_engine_invoke_tab(PyObject * self, PyObject * args)
@@ -1489,8 +1489,8 @@ PyObject *py_unreal_engine_invoke_tab(PyObject * self, PyObject * args)
14891489

14901490
FGlobalTabmanager::Get()->InvokeTab(FTabId(FName(UTF8_TO_TCHAR(name))));
14911491

1492-
Py_INCREF(Py_None);
1493-
return Py_None;
1492+
Py_INCREF(ue_Py_None);
1493+
return ue_Py_None;
14941494
}
14951495

14961496

Source/UnrealEnginePython/Private/UEPyEditor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args)
336336
UFactory *factory = nullptr;
337337
bool sync_to_browser = false;
338338

339-
if (!obj || obj == Py_None)
339+
if (!obj || obj == ue_Py_None)
340340
{
341341
factory_class = nullptr;
342342
}
@@ -1060,8 +1060,8 @@ PyObject *py_unreal_engine_find_plugin(PyObject * self, PyObject * args)
10601060

10611061
if (!plugin.IsValid())
10621062
{
1063-
Py_INCREF(Py_None);
1064-
return Py_None;
1063+
Py_INCREF(ue_Py_None);
1064+
return ue_Py_None;
10651065
}
10661066

10671067
PyObject *ret = py_ue_new_iplugin(plugin.Get());
@@ -1247,8 +1247,8 @@ PyObject *py_unreal_engine_set_fbx_import_option(PyObject * self, PyObject * arg
12471247

12481248
FbxMeshUtils::SetImportOption(ui);
12491249

1250-
Py_INCREF(Py_None);
1251-
return Py_None;
1250+
Py_INCREF(ue_Py_None);
1251+
return ue_Py_None;
12521252
}
12531253

12541254
PyObject *py_unreal_engine_create_blueprint(PyObject * self, PyObject * args)
@@ -1263,7 +1263,7 @@ PyObject *py_unreal_engine_create_blueprint(PyObject * self, PyObject * args)
12631263

12641264
UClass *parent = UObject::StaticClass();
12651265

1266-
if (py_parent != Py_None)
1266+
if (py_parent != ue_Py_None)
12671267
{
12681268
UClass *new_parent = ue_py_check_type<UClass>(py_parent);
12691269
if (!new_parent)
@@ -1776,8 +1776,8 @@ PyObject *py_unreal_engine_blueprint_mark_as_structurally_modified(PyObject * se
17761776

17771777
FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(bp);
17781778

1779-
Py_INCREF(Py_None);
1780-
return Py_None;
1779+
Py_INCREF(ue_Py_None);
1780+
return ue_Py_None;
17811781
}
17821782

17831783
PyObject *py_unreal_engine_blueprint_add_ubergraph_page(PyObject * self, PyObject * args)

0 commit comments

Comments
 (0)