Skip to content

Commit e5c30db

Browse files
committed
chore(UnityPyBoost): replace all NULL with nullptr
1 parent 9a7c0ab commit e5c30db

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

UnityPyBoost/ArchiveStorageDecryptor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ PyObject *decrypt_block(PyObject *self, PyObject *args) {
6262
if (index_data.buf) PyBuffer_Release(&index_data);
6363
if (substitute_data.buf) PyBuffer_Release(&substitute_data);
6464
if (data.buf) PyBuffer_Release(&data);
65-
return NULL;
65+
return nullptr;
6666
}
6767

68-
PyObject *result = PyBytes_FromStringAndSize(NULL, data.len);
69-
if (result == NULL) {
68+
PyObject *result = PyBytes_FromStringAndSize(nullptr, data.len);
69+
if (result == nullptr) {
7070
PyBuffer_Release(&index_data);
7171
PyBuffer_Release(&substitute_data);
7272
PyBuffer_Release(&data);
73-
return NULL;
73+
return nullptr;
7474
}
7575

7676
unsigned char *result_raw = (unsigned char *)PyBytes_AS_STRING(result);

UnityPyBoost/Mesh.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
3939
{
4040
PyBuffer_Release(&vertexDataView);
4141
}
42-
return NULL;
42+
return nullptr;
4343
}
4444

4545
uint8_t *vertexData = (uint8_t *)vertexDataView.buf;
@@ -52,14 +52,14 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
5252
{
5353
PyBuffer_Release(&vertexDataView);
5454
PyErr_SetString(PyExc_ValueError, "Vertex data access out of bounds");
55-
return NULL;
55+
return nullptr;
5656
}
5757

5858
PyObject *res = PyBytes_FromStringAndSize(nullptr, componentBytesLength);
5959
if (!res)
6060
{
6161
PyBuffer_Release(&vertexDataView);
62-
return NULL;
62+
return nullptr;
6363
}
6464
uint8_t *componentBytes = (uint8_t *)PyBytes_AS_STRING(res);
6565

@@ -102,7 +102,7 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
102102
// uint32_t itemCount = componentBytesLength / componentByteSize;
103103
// PyObject *lst = PyList_New(itemCount);
104104
// if (!lst)
105-
// return NULL;
105+
// return nullptr;
106106

107107
// switch (format)
108108
// {
@@ -124,7 +124,7 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
124124
// double x = _PyFloat_Unpack2(items++, 0);
125125
// if (x == -1.0 && PyErr_Occurred())
126126
// {
127-
// return NULL;
127+
// return nullptr;
128128
// }
129129
// PyList_SetItem(lst, i, PyFloat_FromDouble(x));
130130
// }

UnityPyBoost/UnityPyBoost.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ static struct PyMethodDef method_table[] = {
1919
(PyCFunction)decrypt_block,
2020
METH_VARARGS,
2121
"replacement for ArchiveStorageDecryptor.decrypt_block"},
22-
{NULL,
23-
NULL,
22+
{nullptr,
23+
nullptr,
2424
0,
25-
NULL} // Sentinel value ending the table
25+
nullptr} // Sentinel value ending the table
2626
};
2727

2828
// A struct contains the definition of a module
@@ -32,10 +32,10 @@ static PyModuleDef UnityPyBoost_module = {
3232
"TODO",
3333
-1, // Optional size of the module state memory
3434
method_table,
35-
NULL, // Optional slot definitions
36-
NULL, // Optional traversal function
37-
NULL, // Optional clear function
38-
NULL // Optional module deallocation function
35+
nullptr, // Optional slot definitions
36+
nullptr, // Optional traversal function
37+
nullptr, // Optional clear function
38+
nullptr // Optional module deallocation function
3939
};
4040

4141
// The module init function

0 commit comments

Comments
 (0)