From 83f11bc317575032094bb86e6025281bee4f79c5 Mon Sep 17 00:00:00 2001 From: Jarrett Johnson Date: Sun, 2 Jun 2024 20:44:43 -0400 Subject: [PATCH] More Replace NULL with nullptr --- layer0/Field.cpp | 2 +- layer0/GenericBuffer.h | 2 +- layer0/Isosurf.cpp | 2 +- layer0/MemoryCache.h | 2 +- layer0/MemoryDebug.h | 6 +++--- layer1/CGO.cpp | 20 ++++++++++---------- layer1/CGO.h | 8 ++++---- layer1/Color.cpp | 2 +- layer1/Movie.cpp | 6 +++--- layer1/P.cpp | 2 +- layer1/PyMOLObject.cpp | 2 +- layer1/Ray.cpp | 2 +- layer1/Scene.cpp | 2 +- layer1/SceneRender.cpp | 2 +- layer1/Setting.h | 2 +- layer1/View.cpp | 18 +++++++++--------- layer2/CoordSet.cpp | 10 +++++----- layer2/CoordSet.h | 2 +- layer2/DistSet.cpp | 6 +++--- layer2/GadgetSet.cpp | 10 +++++----- layer2/ObjectAlignment.cpp | 2 +- layer2/ObjectCGO.cpp | 2 +- layer2/ObjectDist.cpp | 2 +- layer2/ObjectGadgetRamp.cpp | 8 ++++---- layer2/ObjectMap.cpp | 2 +- layer2/ObjectMesh.cpp | 6 +++--- layer2/ObjectMolecule.cpp | 4 ++-- layer2/ObjectMolecule.h | 2 +- layer2/ObjectMolecule2.cpp | 4 ++-- layer2/ObjectSlice.cpp | 2 +- layer2/ObjectSurface.cpp | 4 ++-- layer2/ObjectVolume.cpp | 12 ++++++------ layer2/RepAngle.cpp | 2 +- layer2/RepCartoon.cpp | 2 +- layer2/RepCylBond.cpp | 2 +- layer2/RepDihedral.cpp | 2 +- layer2/RepDistDash.cpp | 2 +- layer2/RepMesh.cpp | 2 +- layer2/RepNonbonded.cpp | 2 +- layer2/RepNonbondedSphere.cpp | 2 +- layer2/RepSurface.cpp | 2 +- layer2/RepWireBond.cpp | 4 ++-- layer2/VFont.h | 2 +- layer3/Executive.cpp | 18 +++++++++--------- layer3/Executive.h | 4 ++-- layer3/Selector.cpp | 2 +- layer4/Cmd.cpp | 8 ++++---- 47 files changed, 107 insertions(+), 107 deletions(-) diff --git a/layer0/Field.cpp b/layer0/Field.cpp index 19ab14166..bc8bd3a82 100644 --- a/layer0/Field.cpp +++ b/layer0/Field.cpp @@ -43,7 +43,7 @@ PyObject *FieldAsNumPyArray(CField * field, short copy) PyObject *result; int typenum = -1; - import_array1(NULL); + import_array1(nullptr); if(field->type == cFieldFloat) { switch(field->base_size) { diff --git a/layer0/GenericBuffer.h b/layer0/GenericBuffer.h index fc4587688..c83528200 100644 --- a/layer0/GenericBuffer.h +++ b/layer0/GenericBuffer.h @@ -158,7 +158,7 @@ struct AttribOpFuncData { AttribOpFuncData(AttribOpFuncDataFunctionPtr _funcDataConversion, void *_funcDataGlobalArg, const char *_attribName) - : funcDataConversion(_funcDataConversion), funcDataGlobalArg(_funcDataGlobalArg), attribName(_attribName), attrib(NULL){} + : funcDataConversion(_funcDataConversion), funcDataGlobalArg(_funcDataGlobalArg), attribName(_attribName), attrib(nullptr){} }; using AttribOpFuncDataDesc = std::vector< AttribOpFuncData >; diff --git a/layer0/Isosurf.cpp b/layer0/Isosurf.cpp index 33ed241c4..77cf42eeb 100644 --- a/layer0/Isosurf.cpp +++ b/layer0/Isosurf.cpp @@ -114,7 +114,7 @@ PyObject *IsosurfAsPyList(PyMOLGlobals * G, Isofield * field) if(field->save_points) PyList_SetItem(result, 3, FieldAsPyList(G, field->points.get())); else - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); return (PConvAutoNone(result)); } diff --git a/layer0/MemoryCache.h b/layer0/MemoryCache.h index 894b515f3..12a4d5782 100644 --- a/layer0/MemoryCache.h +++ b/layer0/MemoryCache.h @@ -84,6 +84,6 @@ Z* ------------------------------------------------------------------- #define CacheAlloc(G,type,size,thread,id) pymol::malloc(size) #define CacheCalloc(G,type,size,thread,id) pymol::calloc(size) #define CacheRealloc(G,ptr,type,size,thread,id) pymol::realloc(size) -#define CacheFreeP(G,ptr,thread,id,force) {if(ptr) {mfree(ptr);ptr=NULL;}} +#define CacheFreeP(G,ptr,thread,id,force) {if(ptr) {mfree(ptr);ptr=nullptr;}} #endif diff --git a/layer0/MemoryDebug.h b/layer0/MemoryDebug.h index ed866a2ca..3560f0af5 100644 --- a/layer0/MemoryDebug.h +++ b/layer0/MemoryDebug.h @@ -82,9 +82,9 @@ template T* realloc(T* ptr, size_t num) } } // namespace pymol -#define FreeP(ptr) {if(ptr) {mfree(ptr);ptr=NULL;}} -#define DeleteP(ptr) {if(ptr) {delete ptr;ptr=NULL;}} -#define DeleteAP(ptr) {if(ptr) {delete[] ptr;ptr=NULL;}} +#define FreeP(ptr) {if(ptr) {mfree(ptr);ptr=nullptr;}} +#define DeleteP(ptr) {if(ptr) {delete ptr;ptr=nullptr;}} +#define DeleteAP(ptr) {if(ptr) {delete[] ptr;ptr=nullptr;}} void *VLAExpand(void *ptr, ov_size rec); /* NOTE: rec is index (total-1) */ void *MemoryReallocForSure(void *ptr, size_t newSize); diff --git a/layer1/CGO.cpp b/layer1/CGO.cpp index 64516f1ef..c94068365 100644 --- a/layer1/CGO.cpp +++ b/layer1/CGO.cpp @@ -2112,7 +2112,7 @@ void SetVertexValuesForVBO(PyMOLGlobals * G, CGO *cgo, int pl, int plc, int cnt, float *vertexVals, uchar *normalValsC, float *normalVals, uchar *colorValsUC, float *colorVals, float *pickColorVals, - float *accessibilityVals=NULL, + float *accessibilityVals=nullptr, const float *accessibilityValsDA=nullptr) { int pl2 = pl + 1, pl3 = pl + 2; @@ -2834,7 +2834,7 @@ CGO *CGOOptimizeToVBONotIndexed(const CGO * I, int est, bool addshaders, float * "%s-Error(%d): vertexVals could not be allocated (tot=%zu)\n", __func__, __LINE__, tot ENDFB(G); CGOFree(cgo); - return (NULL); + return (nullptr); } normalVals = vertexVals + 3 * num_total_indexes; unsigned nxtn = VERTEX_NORMAL_SIZE; @@ -2863,7 +2863,7 @@ CGO *CGOOptimizeToVBONotIndexed(const CGO * I, int est, bool addshaders, float * PRINTFB(G, FB_CGO, FB_Errors) "ERROR: CGOProcessCGOtoArrays() could not allocate enough memory\n" ENDFB(G); FreeP(vertexVals); CGOFree(cgo); - return (NULL); + return (nullptr); } if (ok){ auto fmt = GetNormalColorFormatSize(G); @@ -2913,7 +2913,7 @@ CGO *CGOOptimizeToVBONotIndexed(const CGO * I, int est, bool addshaders, float * PRINTFB(G, FB_CGO, FB_Errors) "CGOOptimizeToVBONotIndexedWithReturnedData: ERROR: CGODrawBuffersNotIndexed() could not allocate enough memory\n" ENDFB(G); FreeP(vertexVals); CGOFree(cgo); - return (NULL); + return (nullptr); } memcpy(newPickColorVals + num_total_indexes, pickColorVals, num_total_indexes * 2 * sizeof(float)); has_draw_buffer = true; @@ -2950,7 +2950,7 @@ CGO *CGOOptimizeToVBONotIndexed(const CGO * I, int est, bool addshaders, float * "%s-Error(%d): vertexVals could not be allocated (tot=%zu)\n", __func__, __LINE__, tot ENDFB(G); CGOFree(cgo); - return (NULL); + return (nullptr); } normalVals = vertexVals + 3 * num_total_indexes_lines; nxtn = 3; @@ -3152,7 +3152,7 @@ CGO *CGOOptimizeToVBONotIndexed(const CGO * I, int est, bool addshaders, float * G->ShaderMgr->freeGPUBuffer(pickvboid); G->ShaderMgr->freeGPUBuffer(vboid); } - return (NULL); + return (nullptr); } memcpy(newPickColorVals + num_total_indexes_lines, pickColorVals, num_total_indexes_lines * 2 * sizeof(float)); has_draw_buffer = true; @@ -3273,7 +3273,7 @@ CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est, if (vertexIndices.empty()) { PRINTFB(I->G, FB_CGO, FB_Errors) "ERROR: CGOOptimizeToVBOIndexed() vertexIndices could not be allocated\n" ENDFB(I->G); CGOFree(cgo); - return (NULL); + return (nullptr); } unsigned mul = VERTEX_POS_SIZE + VERTEX_PICKCOLOR_SIZE + VERTEX_ACCESSIBILITY_SIZE; @@ -3287,7 +3287,7 @@ CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est, "%s-Error(%d): vertexVals could not be allocated (tot=%zu)\n", __func__, __LINE__, tot ENDFB(G); CGOFree(cgo); - return (NULL); + return (nullptr); } normalVals = vertexVals + 3 * num_total_vertices; nxtn = 3; @@ -3572,7 +3572,7 @@ CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est, if (vertexIndexes.empty()) { PRINTFB(I->G, FB_CGO, FB_Errors) "ERROR: CGOOptimizeToVBOIndexed() vertexIndexes could not be allocated\n" ENDFB(I->G); CGOFree(cgo); - return (NULL); + return (nullptr); } unsigned mul = VERTEX_POS_SIZE + VERTEX_PICKCOLOR_SIZE; @@ -3588,7 +3588,7 @@ CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est, "%s-Error(%d): vertexVals could not be allocated (tot=%zu)\n", __func__, __LINE__, tot ENDFB(G); CGOFree(cgo); - return (NULL); + return (nullptr); } nxtVals = vertexVals + VERTEX_POS_SIZE * num_total_vertices_lines; diff --git a/layer1/CGO.h b/layer1/CGO.h index 22883bfdb..27c1f78e9 100644 --- a/layer1/CGO.h +++ b/layer1/CGO.h @@ -956,7 +956,7 @@ CGO* CGOCombineBeginEnd(const CGO* I, int est = 0, bool do_not_split_lines = fal void CGOFreeVBOs(CGO *I); -CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est=0, const float *color=NULL, bool addshaders=true, bool embedTransparencyInfo=false); +CGO *CGOOptimizeToVBOIndexed(const CGO * I, int est=0, const float *color=nullptr, bool addshaders=true, bool embedTransparencyInfo=false); #define CGOOptimizeToVBOIndexedWithColorEmbedTransparentInfo(I, est, color, addshaders) CGOOptimizeToVBOIndexed(I, est, color, addshaders, true) #define CGOOptimizeToVBOIndexedWithColor CGOOptimizeToVBOIndexed #define CGOOptimizeToVBOIndexedNoShader(I, est) CGOOptimizeToVBOIndexed(I, est, nullptr, false) @@ -969,7 +969,7 @@ CGO* CGOOptimizeToVBONotIndexed(const CGO* I, int est = 0, #define CGOOptimizeToVBONotIndexedNoShader(I) CGOOptimizeToVBONotIndexed(I, 0, false) -CGO *CGOOptimizeSpheresToVBONonIndexed(const CGO * I, int est=0, bool addshaders=false, CGO *leftOverCGO=NULL); +CGO *CGOOptimizeSpheresToVBONonIndexed(const CGO * I, int est=0, bool addshaders=false, CGO *leftOverCGO=nullptr); #define CGOOptimizeSpheresToVBONonIndexedNoShader(I, est) CGOOptimizeSpheresToVBONonIndexed(I, est, false, nullptr) /** @@ -1082,7 +1082,7 @@ int CGOAlphaTriangle(CGO * I, void CGOSetZVector(CGO * I, float z0, float z1, float z2); struct GadgetSet; void CGORenderPicking(CGO * I, RenderInfo *info, - PickContext * context, CSetting * set1, CSetting * set2, Rep *rep=NULL); + PickContext * context, CSetting * set1, CSetting * set2, Rep *rep=nullptr); void CGORender(CGO * I, const float *color, CSetting * set1, CSetting * set2, RenderInfo * info, Rep *rep); void CGORenderAlpha(CGO * I, RenderInfo * info, bool calcDepth); @@ -1184,7 +1184,7 @@ int CGOUniform3f(CGO *I, int uniform_id, const float *value); CGO *CGOConvertSpheresToPoints(const CGO *I); -CGO *CGOConvertToShader(const CGO *I, AttribDataDesc &attrData, AttribDataDesc &pickData, int mode, const VertexBuffer::buffer_layout layout=VertexBuffer::INTERLEAVED, bool check_attr_for_data=true, int *idx_array=NULL, int nindicesperfrag=0, int nfragspergroup = 1); +CGO *CGOConvertToShader(const CGO *I, AttribDataDesc &attrData, AttribDataDesc &pickData, int mode, const VertexBuffer::buffer_layout layout=VertexBuffer::INTERLEAVED, bool check_attr_for_data=true, int *idx_array=nullptr, int nindicesperfrag=0, int nfragspergroup = 1); bool CGOCheckSplitLineInterpolationIsSame(const CGO *I, bool &interp_value); diff --git a/layer1/Color.cpp b/layer1/Color.cpp index b7fb67697..2efed2068 100644 --- a/layer1/Color.cpp +++ b/layer1/Color.cpp @@ -776,7 +776,7 @@ const char *ColorGetName(PyMOLGlobals * G, int index) } else return nullptr; } - return (NULL); + return (nullptr); } diff --git a/layer1/Movie.cpp b/layer1/Movie.cpp index 49d9248dd..423a51d08 100644 --- a/layer1/Movie.cpp +++ b/layer1/Movie.cpp @@ -509,17 +509,17 @@ PyObject *MovieAsPyList(PyMOLGlobals * G) if(I->Sequence) { PyList_SetItem(result, 4, PConvIntArrayToPyList(I->Sequence, I->NFrame)); } else { - PyList_SetItem(result, 4, PConvAutoNone(NULL)); + PyList_SetItem(result, 4, PConvAutoNone(nullptr)); } if(!I->Cmd.empty()) { PyList_SetItem(result, 5, MovieCmdAsPyList(G)); } else { - PyList_SetItem(result, 5, PConvAutoNone(NULL)); + PyList_SetItem(result, 5, PConvAutoNone(nullptr)); } if(I->ViewElem) { PyList_SetItem(result, 6, ViewElemVLAAsPyList(G, I->ViewElem, I->NFrame)); } else { - PyList_SetItem(result, 6, PConvAutoNone(NULL)); + PyList_SetItem(result, 6, PConvAutoNone(nullptr)); } diff --git a/layer1/P.cpp b/layer1/P.cpp index e81196efa..b78d6d85b 100644 --- a/layer1/P.cpp +++ b/layer1/P.cpp @@ -1247,7 +1247,7 @@ static ov_status CacheCreateEntry(PyObject ** result, PyObject * input) PyList_SetItem(entry, 0, PyInt_FromLong(tot_size)); PyList_SetItem(entry, 1, hash_code); PyList_SetItem(entry, 2, PXIncRef(input)); - PyList_SetItem(entry, 3, PXIncRef(NULL)); + PyList_SetItem(entry, 3, PXIncRef(nullptr)); PyList_SetItem(entry, 4, PyInt_FromLong(0)); /* access count */ PyList_SetItem(entry, 5, PyFloat_FromDouble(0.0)); /* timestamp */ } diff --git a/layer1/PyMOLObject.cpp b/layer1/PyMOLObject.cpp index 969fdeefe..97ffc2298 100644 --- a/layer1/PyMOLObject.cpp +++ b/layer1/PyMOLObject.cpp @@ -701,7 +701,7 @@ PyObject *ObjectAsPyList(const pymol::CObject * I) PyList_SetItem(result, 13, ViewElemVLAAsPyList(I->G, I->ViewElem, nFrame)); } else { PyList_SetItem(result, 12, PyInt_FromLong(0)); - PyList_SetItem(result, 13, PConvAutoNone(NULL)); + PyList_SetItem(result, 13, PConvAutoNone(nullptr)); } return (PConvAutoNone(result)); } diff --git a/layer1/Ray.cpp b/layer1/Ray.cpp index be9ba6e04..482baf318 100644 --- a/layer1/Ray.cpp +++ b/layer1/Ray.cpp @@ -2895,7 +2895,7 @@ static void RayHashSpawn(CRayHashThreadInfo * Thread, int n_thread, int n_total) PyList_SetItem( info_list, a, PyCapsule_New(Thread + c + a, nullptr, nullptr)); } else { - PyList_SetItem(info_list, a, PConvAutoNone(NULL)); + PyList_SetItem(info_list, a, PConvAutoNone(nullptr)); } n++; } diff --git a/layer1/Scene.cpp b/layer1/Scene.cpp index 646e5a46d..6845ce9e6 100644 --- a/layer1/Scene.cpp +++ b/layer1/Scene.cpp @@ -4925,7 +4925,7 @@ const char * lightsource_diffuse_names[] = { #undef TEMPLATE /** - * Sets up lighting for immediate mode if shaderPrg=NULL, otherwise + * Sets up lighting for immediate mode if shaderPrg=nullptr, otherwise * sets lighting uniforms for the given shader program. * * Supports up to light_count=8 diff --git a/layer1/SceneRender.cpp b/layer1/SceneRender.cpp index 94aec2f51..994656402 100644 --- a/layer1/SceneRender.cpp +++ b/layer1/SceneRender.cpp @@ -1634,7 +1634,7 @@ void SceneInitializeViewport(PyMOLGlobals* G, bool offscreen) G, I, I->vp_stereo_mode, 0, I->vp_times, I->vp_pos, I->vp_oversize); } else { PRINTFB(G, FB_Scene, FB_Errors) - " SceneInitializeViewport: I->vp_prepareViewPortForStereo=NULL\n" ENDFB( + " SceneInitializeViewport: I->vp_prepareViewPortForStereo=nullptr\n" ENDFB( G); } } diff --git a/layer1/Setting.h b/layer1/Setting.h index 331334cdf..ee95d5b5c 100644 --- a/layer1/Setting.h +++ b/layer1/Setting.h @@ -181,7 +181,7 @@ const char * SettingGetTextPtr(PyMOLGlobals * G, const CSetting * set1, const CS int SettingUnset(CSetting * I, int index); -void SettingRestoreDefault(CSetting * I, int index, const CSetting * src=NULL); +void SettingRestoreDefault(CSetting * I, int index, const CSetting * src=nullptr); int SettingGetType(int index); inline int SettingGetType(PyMOLGlobals *, int index) { diff --git a/layer1/View.cpp b/layer1/View.cpp index 9330494cd..ebed0df49 100644 --- a/layer1/View.cpp +++ b/layer1/View.cpp @@ -351,21 +351,21 @@ PyObject *ViewElemAsPyList(PyMOLGlobals * G, const CViewElem * view) if(view->matrix_flag) { PyList_SetItem(result, 1, PConvDoubleArrayToPyList(view->matrix, 16)); } else { - PyList_SetItem(result, 1, PConvAutoNone(NULL)); + PyList_SetItem(result, 1, PConvAutoNone(nullptr)); } PyList_SetItem(result, 2, PyInt_FromLong(view->pre_flag)); if(view->pre_flag) { PyList_SetItem(result, 3, PConvDoubleArrayToPyList(view->pre, 3)); } else { - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); } PyList_SetItem(result, 4, PyInt_FromLong(view->post_flag)); if(view->post_flag) { PyList_SetItem(result, 5, PConvDoubleArrayToPyList(view->post, 3)); } else { - PyList_SetItem(result, 5, PConvAutoNone(NULL)); + PyList_SetItem(result, 5, PConvAutoNone(nullptr)); } PyList_SetItem(result, 6, PyInt_FromLong(view->clip_flag)); @@ -373,15 +373,15 @@ PyObject *ViewElemAsPyList(PyMOLGlobals * G, const CViewElem * view) PyList_SetItem(result, 7, PyFloat_FromDouble((double) view->front)); PyList_SetItem(result, 8, PyFloat_FromDouble((double) view->back)); } else { - PyList_SetItem(result, 7, PConvAutoNone(NULL)); - PyList_SetItem(result, 8, PConvAutoNone(NULL)); + PyList_SetItem(result, 7, PConvAutoNone(nullptr)); + PyList_SetItem(result, 8, PConvAutoNone(nullptr)); } PyList_SetItem(result, 9, PyInt_FromLong(view->ortho_flag)); if(view->ortho_flag) { PyList_SetItem(result, 10, PyFloat_FromDouble(view->ortho)); } else { - PyList_SetItem(result, 10, PConvAutoNone(NULL)); + PyList_SetItem(result, 10, PConvAutoNone(nullptr)); } PyList_SetItem(result, 11, PyInt_FromLong(view->view_mode)); @@ -404,21 +404,21 @@ PyObject *ViewElemAsPyList(PyMOLGlobals * G, const CViewElem * view) if(view->ortho_flag) { PyList_SetItem(result, 16, PyFloat_FromDouble(view->power)); } else { - PyList_SetItem(result, 16, PConvAutoNone(NULL)); + PyList_SetItem(result, 16, PConvAutoNone(nullptr)); } PyList_SetItem(result, 17, PyInt_FromLong(view->bias_flag)); if(view->bias_flag) { PyList_SetItem(result, 18, PyFloat_FromDouble(view->bias)); } else { - PyList_SetItem(result, 18, PConvAutoNone(NULL)); + PyList_SetItem(result, 18, PConvAutoNone(nullptr)); } PyList_SetItem(result, 19, PyInt_FromLong(view->state_flag)); if(view->state_flag) { PyList_SetItem(result, 20, PyInt_FromLong(view->state)); } else { - PyList_SetItem(result, 20, PConvAutoNone(NULL)); + PyList_SetItem(result, 20, PConvAutoNone(nullptr)); } } diff --git a/layer2/CoordSet.cpp b/layer2/CoordSet.cpp index 6c670f9ef..a37665bf1 100644 --- a/layer2/CoordSet.cpp +++ b/layer2/CoordSet.cpp @@ -335,7 +335,7 @@ PyObject *CoordSetAsNumPyArray(CoordSet * cs, short copy) int typenum = -1; npy_intp dims[2] = {0, 3}; - import_array1(NULL); + import_array1(nullptr); switch(base_size) { case 4: typenum = NPY_FLOAT32; break; @@ -378,7 +378,7 @@ PyObject *CoordSetAsPyList(CoordSet * I) && pse_export_version < 1770) PyList_SetItem(result, 4, PConvIntArrayToPyList(I->AtmToIdx.data(), NAtIndex, dump_binary)); else - PyList_SetItem(result, 4, PConvAutoNone(NULL)); + PyList_SetItem(result, 4, PConvAutoNone(nullptr)); PyList_SetItem(result, 5, PyString_FromString(I->Name)); PyList_SetItem(result, 6, ObjectStateAsPyList(I)); PyList_SetItem(result, 7, SettingAsPyList(I->Setting.get())); @@ -392,7 +392,7 @@ PyObject *CoordSetAsPyList(CoordSet * I) if(I->SculptCGO) { PyList_SetItem(result, 10, CGOAsPyList(I->SculptCGO)); } else { - PyList_SetItem(result, 10, PConvAutoNone(NULL)); + PyList_SetItem(result, 10, PConvAutoNone(nullptr)); } if (I->has_any_atom_state_settings()) { int a; @@ -402,12 +402,12 @@ PyObject *CoordSetAsPyList(CoordSet * I) if (I->has_atom_state_settings(a)) { PyList_SetItem(settings_list, a, PyInt_FromLong(I->atom_state_setting_id[a])); } else { - PyList_SetItem(settings_list, a, PConvAutoNone(NULL)); + PyList_SetItem(settings_list, a, PConvAutoNone(nullptr)); } } PyList_SetItem(result, 11, settings_list); } else { - PyList_SetItem(result, 11, PConvAutoNone(NULL)); + PyList_SetItem(result, 11, PConvAutoNone(nullptr)); } PyList_SetItem(result, 12, SymmetryAsPyList(I->Symmetry.get())); /* TODO spheroid, periodic box ... */ diff --git a/layer2/CoordSet.h b/layer2/CoordSet.h index 0c7d3649e..1c60b143d 100644 --- a/layer2/CoordSet.h +++ b/layer2/CoordSet.h @@ -198,7 +198,7 @@ void CoordSetFracToReal(CoordSet * I, const CCrystal * cryst); bool CoordSetInsureOrthogonal(PyMOLGlobals * G, CoordSet * cset, const float * sca, - const CCrystal *cryst=NULL, + const CCrystal *cryst=nullptr, bool quiet=true); void CoordSetGetAverage(const CoordSet * I, float *v0); diff --git a/layer2/DistSet.cpp b/layer2/DistSet.cpp index 2cf5cc2e2..1b2c6c975 100644 --- a/layer2/DistSet.cpp +++ b/layer2/DistSet.cpp @@ -318,7 +318,7 @@ PyObject *DistSetAsPyList(DistSet * I) PyList_SetItem(result, 0, PyInt_FromLong(I->NIndex)); PyList_SetItem(result, 1, PConvFloatArrayToPyListNullOkay(I->Coord, I->NIndex * 3)); - PyList_SetItem(result, 2, PConvAutoNone(NULL)); // I->LabCoord recalculated in RepDistLabelNew + PyList_SetItem(result, 2, PConvAutoNone(nullptr)); // I->LabCoord recalculated in RepDistLabelNew PyList_SetItem(result, 3, PyInt_FromLong(I->NAngleIndex)); PyList_SetItem(result, 4, PConvFloatArrayToPyListNullOkay(I->AngleCoord, I->NAngleIndex * 3)); @@ -327,11 +327,11 @@ PyObject *DistSetAsPyList(DistSet * I) PConvFloatArrayToPyListNullOkay(I->DihedralCoord, I->NDihedralIndex * 3)); // DistSet->Setting never gets set (removed BB 11/14), was state settings? - PyList_SetItem(result, 7, PConvAutoNone(NULL) /* SettingAsPyList(I->Setting) */); + PyList_SetItem(result, 7, PConvAutoNone(nullptr) /* SettingAsPyList(I->Setting) */); if(!I->LabPos.empty()) { PyList_SetItem(result, 8, PConvLabPosVecToPyList(I->LabPos)); } else { - PyList_SetItem(result, 8, PConvAutoNone(NULL)); + PyList_SetItem(result, 8, PConvAutoNone(nullptr)); } PyList_SetItem(result, 9, MeasureInfoListAsPyList(I->MeasureInfo)); /* TODO setting ... */ diff --git a/layer2/GadgetSet.cpp b/layer2/GadgetSet.cpp index 1517f895d..a904084b2 100644 --- a/layer2/GadgetSet.cpp +++ b/layer2/GadgetSet.cpp @@ -164,7 +164,7 @@ PyObject *GadgetSetAsPyList(GadgetSet * I, bool incl_cgos) if(I->NCoord) { PyList_SetItem(result, 1, PConvFloatArrayToPyList(I->Coord, I->NCoord * 3)); } else { - PyList_SetItem(result, 1, PConvAutoNone(NULL)); + PyList_SetItem(result, 1, PConvAutoNone(nullptr)); } PyList_SetItem(result, 2, PyInt_FromLong(I->NNormal)); @@ -172,7 +172,7 @@ PyObject *GadgetSetAsPyList(GadgetSet * I, bool incl_cgos) if(I->NNormal) { PyList_SetItem(result, 3, PConvFloatArrayToPyList(I->Normal, I->NNormal * 3)); } else { - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); } PyList_SetItem(result, 4, PyInt_FromLong(I->NColor)); @@ -180,19 +180,19 @@ PyObject *GadgetSetAsPyList(GadgetSet * I, bool incl_cgos) if(I->NColor) { PyList_SetItem(result, 5, PConvFloatArrayToPyList(I->Color, I->NColor)); } else { - PyList_SetItem(result, 5, PConvAutoNone(NULL)); + PyList_SetItem(result, 5, PConvAutoNone(nullptr)); } if(incl_cgos && I->ShapeCGO) { PyList_SetItem(result, 6, CGOAsPyList(I->ShapeCGO)); } else { - PyList_SetItem(result, 6, PConvAutoNone(NULL)); + PyList_SetItem(result, 6, PConvAutoNone(nullptr)); } if(incl_cgos && I->PickShapeCGO) { PyList_SetItem(result, 7, CGOAsPyList(I->PickShapeCGO)); } else { - PyList_SetItem(result, 7, PConvAutoNone(NULL)); + PyList_SetItem(result, 7, PConvAutoNone(nullptr)); } } diff --git a/layer2/ObjectAlignment.cpp b/layer2/ObjectAlignment.cpp index 783d893d8..c4c0c588c 100644 --- a/layer2/ObjectAlignment.cpp +++ b/layer2/ObjectAlignment.cpp @@ -743,7 +743,7 @@ static PyObject *ObjectAlignmentStateAsPyList(ObjectAlignmentState * I) if(I->alignVLA) { PyList_SetItem(result, 0, PConvIntVLAToPyList(I->alignVLA)); } else { - PyList_SetItem(result, 0, PConvAutoNone(NULL)); + PyList_SetItem(result, 0, PConvAutoNone(nullptr)); } PyList_SetItem(result, 1, PyString_FromString(I->guide)); return (PConvAutoNone(result)); diff --git a/layer2/ObjectCGO.cpp b/layer2/ObjectCGO.cpp index 7585482ef..6a157e35d 100644 --- a/layer2/ObjectCGO.cpp +++ b/layer2/ObjectCGO.cpp @@ -42,7 +42,7 @@ static PyObject *ObjectCGOStateAsPyList(ObjectCGOState * I) if(I->origCGO) PyList_SetItem(result, 0, CGOAsPyList(I->origCGO.get())); else - PyList_SetItem(result, 0, PConvAutoNone(NULL)); + PyList_SetItem(result, 0, PConvAutoNone(nullptr)); return (PConvAutoNone(result)); } diff --git a/layer2/ObjectDist.cpp b/layer2/ObjectDist.cpp index 741d03dd8..2c28db49b 100644 --- a/layer2/ObjectDist.cpp +++ b/layer2/ObjectDist.cpp @@ -299,7 +299,7 @@ static CSetting **ObjectDistGetSettingHandle(ObjectDist * I, int state) if(state < 0) { return (&I->Setting.get()); } else { - return (NULL); + return (nullptr); } } #endif diff --git a/layer2/ObjectGadgetRamp.cpp b/layer2/ObjectGadgetRamp.cpp index 737d4f6f3..e91787178 100644 --- a/layer2/ObjectGadgetRamp.cpp +++ b/layer2/ObjectGadgetRamp.cpp @@ -357,12 +357,12 @@ PyObject *ObjectGadgetRampAsPyList(ObjectGadgetRamp * I) if(I->Level && I->NLevel) { PyList_SetItem(result, 3, PConvFloatVLAToPyList(I->Level)); } else { - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); } if(I->Color && I->NLevel) { PyList_SetItem(result, 4, PConvFloatVLAToPyList(I->Color)); } else { - PyList_SetItem(result, 4, PConvAutoNone(NULL)); + PyList_SetItem(result, 4, PConvAutoNone(nullptr)); } PyList_SetItem(result, 5, PyInt_FromLong(I->var_index)); PyList_SetItem(result, 6, PyString_FromString(I->SrcName)); @@ -380,10 +380,10 @@ PyObject *ObjectGadgetRampAsPyList(ObjectGadgetRamp * I) any = (special[a] = GetSpecial(I->Color + a * 3)) || any; } } - PyList_SetItem(result, 9, any ? PConvIntVLAToPyList(special) : PConvAutoNone(NULL)); + PyList_SetItem(result, 9, any ? PConvIntVLAToPyList(special) : PConvAutoNone(nullptr)); VLAFreeP(special); - PyList_SetItem(result, 10, PConvAutoNone(NULL) /* I->Extreme, removed in PyMOL 1.8 */); + PyList_SetItem(result, 10, PConvAutoNone(nullptr) /* I->Extreme, removed in PyMOL 1.8 */); return (PConvAutoNone(result)); } diff --git a/layer2/ObjectMap.cpp b/layer2/ObjectMap.cpp index 5dd018ec1..ada826f8a 100644 --- a/layer2/ObjectMap.cpp +++ b/layer2/ObjectMap.cpp @@ -1281,7 +1281,7 @@ static PyObject *ObjectMapAllStatesAsPyList(ObjectMap * I) if(I->State[a].Active) { PyList_SetItem(result, a, ObjectMapStateAsPyList(&I->State[a])); } else { - PyList_SetItem(result, a, PConvAutoNone(NULL)); + PyList_SetItem(result, a, PConvAutoNone(nullptr)); } } return (PConvAutoNone(result)); diff --git a/layer2/ObjectMesh.cpp b/layer2/ObjectMesh.cpp index afc8d5fd4..1ab6a13a9 100644 --- a/layer2/ObjectMesh.cpp +++ b/layer2/ObjectMesh.cpp @@ -63,7 +63,7 @@ static PyObject *ObjectMeshStateAsPyList(ObjectMeshState * I) if(I->CarveFlag && I->AtomVertex) { PyList_SetItem(result, 12, PConvFloatVLAToPyList(I->AtomVertex)); } else { - PyList_SetItem(result, 12, PConvAutoNone(NULL)); + PyList_SetItem(result, 12, PConvAutoNone(nullptr)); } PyList_SetItem(result, 13, PyInt_FromLong(static_cast(I->MeshMode))); PyList_SetItem(result, 14, PyFloat_FromDouble(I->AltLevel)); @@ -71,7 +71,7 @@ static PyObject *ObjectMeshStateAsPyList(ObjectMeshState * I) if(I->Field) { PyList_SetItem(result, 16, IsosurfAsPyList(I->G, I->Field.get())); } else { - PyList_SetItem(result, 16, PConvAutoNone(NULL)); + PyList_SetItem(result, 16, PConvAutoNone(nullptr)); } return (PConvAutoNone(result)); } @@ -103,7 +103,7 @@ static PyObject *ObjectMeshAllStatesAsPyList(ObjectMesh * I) if(I->State[a].Active) { PyList_SetItem(result, a, ObjectMeshStateAsPyList(&I->State[a])); } else { - PyList_SetItem(result, a, PConvAutoNone(NULL)); + PyList_SetItem(result, a, PConvAutoNone(nullptr)); } } return (PConvAutoNone(result)); diff --git a/layer2/ObjectMolecule.cpp b/layer2/ObjectMolecule.cpp index 1e6f3b9ec..d5fa4f655 100644 --- a/layer2/ObjectMolecule.cpp +++ b/layer2/ObjectMolecule.cpp @@ -2645,10 +2645,10 @@ pymol::copyable_ptr* ObjectMolecule::getSettingHandle(int state) if(I->CSet[state]) { return (&I->CSet[state]->Setting); } else { - return (NULL); + return (nullptr); } } else { - return (NULL); + return (nullptr); } } diff --git a/layer2/ObjectMolecule.h b/layer2/ObjectMolecule.h index 08230c5c8..f79ff4292 100644 --- a/layer2/ObjectMolecule.h +++ b/layer2/ObjectMolecule.h @@ -344,7 +344,7 @@ ObjectMolecule *ObjectMoleculeReadStr(PyMOLGlobals * G, ObjectMolecule * I, cLoadType_t content_format, int frame, int discrete, int quiet, int multiplex, char *new_name, - short loadpropertiesall=false, OVLexicon *loadproplex=NULL); + short loadpropertiesall=false, OVLexicon *loadproplex=nullptr); ObjectMolecule *ObjectMoleculeReadPDBStr(PyMOLGlobals * G, ObjectMolecule * obj, const char *molstr, int frame, int discrete, diff --git a/layer2/ObjectMolecule2.cpp b/layer2/ObjectMolecule2.cpp index db53946e4..eedc3d078 100644 --- a/layer2/ObjectMolecule2.cpp +++ b/layer2/ObjectMolecule2.cpp @@ -3575,8 +3575,8 @@ PyObject *ObjectMoleculeAsPyList(ObjectMolecule * I) PyList_SetItem(result, 15, PConvIntArrayToPyList(dcs, I->NAtom)); FreeP(dcs); } else { - PyList_SetItem(result, 14, PConvAutoNone(NULL)); - PyList_SetItem(result, 15, PConvAutoNone(NULL)); + PyList_SetItem(result, 14, PConvAutoNone(nullptr)); + PyList_SetItem(result, 15, PConvAutoNone(nullptr)); } return (PConvAutoNone(result)); diff --git a/layer2/ObjectSlice.cpp b/layer2/ObjectSlice.cpp index 8a0a66545..a8b77f07d 100644 --- a/layer2/ObjectSlice.cpp +++ b/layer2/ObjectSlice.cpp @@ -79,7 +79,7 @@ static PyObject *ObjectSliceAllStatesAsPyList(ObjectSlice * I) if(I->State[a].Active) { PyList_SetItem(result, a, ObjectSliceStateAsPyList(I->State.data() + a)); } else { - PyList_SetItem(result, a, PConvAutoNone(NULL)); + PyList_SetItem(result, a, PConvAutoNone(nullptr)); } } return (PConvAutoNone(result)); diff --git a/layer2/ObjectSurface.cpp b/layer2/ObjectSurface.cpp index 169e651cd..aaf6f555d 100644 --- a/layer2/ObjectSurface.cpp +++ b/layer2/ObjectSurface.cpp @@ -67,7 +67,7 @@ static PyObject *ObjectSurfaceStateAsPyList(ObjectSurfaceState * I) if(I->CarveFlag && I->AtomVertex) { PyList_SetItem(result, 12, PConvFloatVLAToPyList(I->AtomVertex)); } else { - PyList_SetItem(result, 12, PConvAutoNone(NULL)); + PyList_SetItem(result, 12, PConvAutoNone(nullptr)); } PyList_SetItem(result, 13, PyInt_FromLong(I->DotFlag)); PyList_SetItem(result, 14, PyInt_FromLong(static_cast(I->Mode))); @@ -85,7 +85,7 @@ static PyObject *ObjectSurfaceAllStatesAsPyList(ObjectSurface * I) if(I->State[a].Active) { PyList_SetItem(result, a, ObjectSurfaceStateAsPyList(&I->State[a])); } else { - PyList_SetItem(result, a, PConvAutoNone(NULL)); + PyList_SetItem(result, a, PConvAutoNone(nullptr)); } } return (PConvAutoNone(result)); diff --git a/layer2/ObjectVolume.cpp b/layer2/ObjectVolume.cpp index cd7b30240..f61aa6af9 100644 --- a/layer2/ObjectVolume.cpp +++ b/layer2/ObjectVolume.cpp @@ -99,30 +99,30 @@ static PyObject *ObjectVolumeStateAsPyList(ObjectVolumeState * I) PyList_SetItem(result, 0, PyInt_FromLong(I->Active)); PyList_SetItem(result, 1, PyString_FromString(I->MapName)); PyList_SetItem(result, 2, PyInt_FromLong(I->MapState)); - PyList_SetItem(result, 3, PConvAutoNone(NULL) /* CrystalAsPyList(&I->Crystal) */); + PyList_SetItem(result, 3, PConvAutoNone(nullptr) /* CrystalAsPyList(&I->Crystal) */); PyList_SetItem(result, 4, PyInt_FromLong(I->ExtentFlag)); PyList_SetItem(result, 5, PConvFloatArrayToPyList(I->ExtentMin, 3)); PyList_SetItem(result, 6, PConvFloatArrayToPyList(I->ExtentMax, 3)); - PyList_SetItem(result, 7, PConvAutoNone(NULL) /* PConvIntArrayToPyList(I->Range, 6) */); + PyList_SetItem(result, 7, PConvAutoNone(nullptr) /* PConvIntArrayToPyList(I->Range, 6) */); PyList_SetItem(result, 8, PyFloat_FromDouble(0.0 /* I->Level */)); PyList_SetItem(result, 9, PyFloat_FromDouble(0.0 /* I->Radius */)); PyList_SetItem(result, 10, PyInt_FromLong(/* I->CarveFlag */ I->AtomVertex.data() != nullptr)); PyList_SetItem(result, 11, PyFloat_FromDouble(I->CarveBuffer)); PyList_SetItem(result, 12, I->AtomVertex ? - PConvFloatVLAToPyList(I->AtomVertex) : PConvAutoNone(NULL)); + PConvFloatVLAToPyList(I->AtomVertex) : PConvAutoNone(nullptr)); PyList_SetItem(result, 13, PyInt_FromLong(0 /* I->VolumeMode */)); PyList_SetItem(result, 14, PyFloat_FromDouble(0.0 /* I->AltLevel */)); PyList_SetItem(result, 15, PyInt_FromLong(1 /* I->quiet */)); if(I->Field) { PyList_SetItem(result, 16, IsosurfAsPyList(I->G, I->Field.get())); } else { - PyList_SetItem(result, 16, PConvAutoNone(NULL)); + PyList_SetItem(result, 16, PConvAutoNone(nullptr)); } PyList_SetItem(result,17,PyInt_FromLong(I->RampSize())); if (!I->Ramp.empty()) { PyList_SetItem(result, 18, PConvToPyObject(I->Ramp)); } else { - PyList_SetItem(result, 18, PConvAutoNone(NULL)); + PyList_SetItem(result, 18, PConvAutoNone(nullptr)); } return (PConvAutoNone(result)); } @@ -134,7 +134,7 @@ static PyObject *ObjectVolumeAllStatesAsPyList(ObjectVolume * I) if(I->State[a].Active) { PyList_SetItem(result, a, ObjectVolumeStateAsPyList(&I->State[a])); } else { - PyList_SetItem(result, a, PConvAutoNone(NULL)); + PyList_SetItem(result, a, PConvAutoNone(nullptr)); } } return (PConvAutoNone(result)); diff --git a/layer2/RepAngle.cpp b/layer2/RepAngle.cpp index b30e7a9f1..28ef1c5f0 100644 --- a/layer2/RepAngle.cpp +++ b/layer2/RepAngle.cpp @@ -319,7 +319,7 @@ Rep *RepAngleNew(DistSet * ds, int state) PRINTFD(G, FB_RepAngle) "RepAngleNew: entered.\n" ENDFD; if(!ok || !ds->NAngleIndex) { - return (NULL); + return (nullptr); } auto I = new RepAngle(ds->Obj, state); diff --git a/layer2/RepCartoon.cpp b/layer2/RepCartoon.cpp index 2467f0105..ce7e6c2d4 100644 --- a/layer2/RepCartoon.cpp +++ b/layer2/RepCartoon.cpp @@ -2750,7 +2750,7 @@ class nuc_acid_cap { // constructor nuc_acid_cap(PyMOLGlobals * G_, nuc_acid_data * ndata_, CoordSet * cs_, int mode) - : G(G_), ndata(ndata_), cs(cs_), idx(0), atm(0), ai(NULL) { + : G(G_), ndata(ndata_), cs(cs_), idx(0), atm(0), ai(nullptr) { enabled = (ndata->na_mode == 4 || ndata->na_mode == mode); } diff --git a/layer2/RepCylBond.cpp b/layer2/RepCylBond.cpp index 96abcf76f..b6ae3ab60 100644 --- a/layer2/RepCylBond.cpp +++ b/layer2/RepCylBond.cpp @@ -572,7 +572,7 @@ Rep *RepCylBondNew(CoordSet * cs, int state) b++; } if(!visFlag) { - return (NULL); /* skip if no sticks are visible */ + return (nullptr); /* skip if no sticks are visible */ } capdrawn = pymol::calloc(obj->NAtom); // max radius of caps diff --git a/layer2/RepDihedral.cpp b/layer2/RepDihedral.cpp index 7f1a5f934..f40cfb21f 100644 --- a/layer2/RepDihedral.cpp +++ b/layer2/RepDihedral.cpp @@ -321,7 +321,7 @@ Rep *RepDihedralNew(DistSet * ds, int state) int ok = true; if(!ok || !ds->NDihedralIndex) { - return (NULL); + return (nullptr); } auto I = new RepDihedral(ds->Obj, state); diff --git a/layer2/RepDistDash.cpp b/layer2/RepDistDash.cpp index 9ed52c586..811344225 100644 --- a/layer2/RepDistDash.cpp +++ b/layer2/RepDistDash.cpp @@ -336,7 +336,7 @@ Rep *RepDistDashNew(DistSet * ds, int state) int ok = true; if(!ok || !ds->NIndex) { - return (NULL); + return (nullptr); } auto I = new RepDistDash(ds->Obj, state); diff --git a/layer2/RepMesh.cpp b/layer2/RepMesh.cpp index e8bcbfce9..55d488acd 100644 --- a/layer2/RepMesh.cpp +++ b/layer2/RepMesh.cpp @@ -763,7 +763,7 @@ Rep *RepMeshNew(CoordSet * cs, int state) } } if(!ok || !visFlag) { - return (NULL); /* skip if no dots are visible */ + return (nullptr); /* skip if no dots are visible */ } auto I = new RepMesh(cs, state); diff --git a/layer2/RepNonbonded.cpp b/layer2/RepNonbonded.cpp index 520bb29e5..700be3eec 100644 --- a/layer2/RepNonbonded.cpp +++ b/layer2/RepNonbonded.cpp @@ -260,7 +260,7 @@ Rep *RepNonbondedNew(CoordSet * cs, int state) } } if(!hasNonbondedAtoms) { - return (NULL); /* skip if no dots are visible */ + return (nullptr); /* skip if no dots are visible */ } auto I = new RepNonbonded(cs, state); diff --git a/layer2/RepNonbondedSphere.cpp b/layer2/RepNonbondedSphere.cpp index 978f4ce00..cd3624165 100644 --- a/layer2/RepNonbondedSphere.cpp +++ b/layer2/RepNonbondedSphere.cpp @@ -132,7 +132,7 @@ Rep *RepNonbondedSphereNew(CoordSet * cs, int state) } if(!nSphere) { FreeP(active); - return (NULL); + return (nullptr); } float nb_spheres_size = SettingGet_f(G, cs->Setting.get(), obj->Setting.get(), cSetting_nb_spheres_size); diff --git a/layer2/RepSurface.cpp b/layer2/RepSurface.cpp index e91013918..41ccee9ce 100644 --- a/layer2/RepSurface.cpp +++ b/layer2/RepSurface.cpp @@ -4129,7 +4129,7 @@ Rep *RepSurfaceNew(CoordSet * cs, int state) } } if(!visFlag) { - return (NULL); /* skip if no thing visible */ + return (nullptr); /* skip if no thing visible */ } auto I = new RepSurface(cs, state); diff --git a/layer2/RepWireBond.cpp b/layer2/RepWireBond.cpp index aab9eb994..1b1ba75b7 100644 --- a/layer2/RepWireBond.cpp +++ b/layer2/RepWireBond.cpp @@ -619,12 +619,12 @@ Rep *RepWireBondNew(CoordSet * cs, int state) } } if(!visFlag) { - return (NULL); /* skip if no dots are visible */ + return (nullptr); /* skip if no dots are visible */ } marked = pymol::calloc(obj->NAtom); CHECKOK(ok, marked); if (!ok){ - return (NULL); + return (nullptr); } valence_flag = SettingGet_b(G, cs->Setting.get(), obj->Setting.get(), cSetting_valence); diff --git a/layer2/VFont.h b/layer2/VFont.h index b7ec5d584..b3d0011ae 100644 --- a/layer2/VFont.h +++ b/layer2/VFont.h @@ -25,7 +25,7 @@ void VFontFree(PyMOLGlobals * G); int VFontLoad(PyMOLGlobals * G, float size, int face, int style, int can_load_new); int VFontWriteToCGO(PyMOLGlobals * G, int font_id, CGO * cgo, const char *text, - float *pos, float *scale, float *matrix, float *color=NULL); + float *pos, float *scale, float *matrix, float *color=nullptr); int VFontIndent(PyMOLGlobals * G, int font_id, const char *text, float *pos, float *scale, float *matrix, float dir); diff --git a/layer3/Executive.cpp b/layer3/Executive.cpp index c36affd58..29290dc9a 100644 --- a/layer3/Executive.cpp +++ b/layer3/Executive.cpp @@ -1181,7 +1181,7 @@ ExecutiveVolume(PyMOLGlobals * G, const char *volume_name, const char *map_name, * - transform (translate/rotate) the VOLUME vis so that it * matches the map's ObjectMatrix. * - * - if this is a new VOLUME, (eg., origObj==NULL) then set the internal + * - if this is a new VOLUME, (eg., origObj==nullptr) then set the internal * PyMOL state to manage the object and add the name to the object list * * - update the map state for the next loop and re-iterate @@ -5221,7 +5221,7 @@ static PyObject *ExecutiveGetExecObjectAsPyList(PyMOLGlobals * G, SpecRec * rec) PyList_SetItem(result, 1, PyInt_FromLong(cExecObject)); PyList_SetItem(result, 2, PyInt_FromLong(rec->visible)); /* before version 1.8 item 3 was rec reps (repOn) */ - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); PyList_SetItem(result, 4, PyInt_FromLong(recobjtype)); switch (rec->obj->type) { case cObjectGadget: @@ -5264,7 +5264,7 @@ static PyObject *ExecutiveGetExecObjectAsPyList(PyMOLGlobals * G, SpecRec * rec) PyList_SetItem(result, 5, static_cast(rec->obj)->asPyList()); break; default: - PyList_SetItem(result, 5, PConvAutoNone(NULL)); + PyList_SetItem(result, 5, PConvAutoNone(nullptr)); break; } PyList_SetItem(result, 6, PyString_FromString(rec->group_name)); @@ -5284,7 +5284,7 @@ static PyObject *ExecutiveGetExecSeleAsPyList(PyMOLGlobals * G, SpecRec * rec) PyList_SetItem(result, 1, PyInt_FromLong(cExecSelection)); PyList_SetItem(result, 2, PyInt_FromLong(rec->visible)); /* before version 1.8 item 3 was rec reps (repOn) */ - PyList_SetItem(result, 3, PConvAutoNone(NULL)); + PyList_SetItem(result, 3, PConvAutoNone(nullptr)); PyList_SetItem(result, 4, PyInt_FromLong(-1)); PyList_SetItem(result, 5, SelectorAsPyList(G, sele)); PyList_SetItem(result, 6, PyString_FromString(rec->group_name)); @@ -5332,21 +5332,21 @@ static PyObject *ExecutiveGetNamedEntries(PyMOLGlobals * G, int list_id, int par PyList_SetItem(result, count, ExecutiveGetExecSeleAsPyList(G, rec)); } else { /* cannot currently save selections in partial sessions */ - PyList_SetItem(result, count, PConvAutoNone(NULL)); + PyList_SetItem(result, count, PConvAutoNone(nullptr)); } break; default: - PyList_SetItem(result, count, PConvAutoNone(NULL)); + PyList_SetItem(result, count, PConvAutoNone(nullptr)); break; } } else { - PyList_SetItem(result, count, PConvAutoNone(NULL)); + PyList_SetItem(result, count, PConvAutoNone(nullptr)); } count++; } while(count < total_count) { /* insure that all members of outgoing list are defined */ - PyList_SetItem(result, count, PConvAutoNone(NULL)); + PyList_SetItem(result, count, PConvAutoNone(nullptr)); count++; } @@ -6724,7 +6724,7 @@ const char * ExecutiveMapGenerate(PyMOLGlobals * G, const char * name, const cha ok = 0; if (weights && (!strncmp(weights,"None",4))) - weights=NULL; + weights=nullptr; /* printf("Passing to primex driver: space_group=%s, cell=[%f %f %f %f %f %f], reso_high=%f, rseo_low=%f, refl_file=%s, ampl=%s, phases=%s, weights=%s, map_file=%s", space_group, cell[0], cell[1], cell[2], cell[3], cell[4], cell[5], reso_high, reso_low, reflection_file, amplitudes, phases, weights, tempFile); */ diff --git a/layer3/Executive.h b/layer3/Executive.h index 9343bb8ce..69a8cef3c 100644 --- a/layer3/Executive.h +++ b/layer3/Executive.h @@ -219,7 +219,7 @@ pymol::Result<> ExecutiveLoad( const char *object_name, int state, int zoom, int discrete, int finish, int multiplex, int quiet, const char *plugin, - const char * object_props=NULL, const char * atom_props=NULL, + const char * object_props=nullptr, const char * atom_props=nullptr, bool mimic=true); int ExecutiveDebug(PyMOLGlobals * G, const char *name); @@ -790,7 +790,7 @@ pymol::TrackerAdapter ExecutiveGetSpecRecsFromPattern(PyMOLGlobals* G, char *ExecutiveGetObjectNames(PyMOLGlobals * G, int mode, const char *name, int enabled_only, int *numstrs); -CoordSet * ExecutiveGetCoordSet(PyMOLGlobals * G, const char * name, int state, ObjectMolecule ** omp=NULL); +CoordSet * ExecutiveGetCoordSet(PyMOLGlobals * G, const char * name, int state, ObjectMolecule ** omp=nullptr); pymol::Result<> ExecutiveLoadCoordset( PyMOLGlobals* G, pymol::zstring_view oname, PyObject* model, int frame, bool quiet); diff --git a/layer3/Selector.cpp b/layer3/Selector.cpp index 4a9586b76..834a4d1a0 100644 --- a/layer3/Selector.cpp +++ b/layer3/Selector.cpp @@ -5650,7 +5650,7 @@ PyObject *SelectorGetCoordsAsNumPy(PyMOLGlobals * G, int sele, int state) dims[0] = nAtom; - import_array1(NULL); + import_array1(nullptr); switch(base_size) { case 4: typenum = NPY_FLOAT32; break; diff --git a/layer4/Cmd.cpp b/layer4/Cmd.cpp index 56fd0662d..0764ee6d5 100644 --- a/layer4/Cmd.cpp +++ b/layer4/Cmd.cpp @@ -678,7 +678,7 @@ static PyObject * CmdFindMolfilePlugin(PyObject * self, PyObject * args) return PyUnicode_FromString(plugin ? plugin : ""); } } - return APIAutoNone(NULL); + return APIAutoNone(nullptr); } static PyObject * CmdGetCCP4Str(PyObject * self, PyObject * args) @@ -702,7 +702,7 @@ static PyObject * CmdGetCCP4Str(PyObject * self, PyObject * args) return APIAutoNone(result); } } - return APIAutoNone(NULL); + return APIAutoNone(nullptr); } static PyObject * CmdGetVolumeField(PyObject * self, PyObject * args) @@ -3843,7 +3843,7 @@ static PyObject *CmdGetFeedback(PyObject * self, PyObject * args) return (APIAutoNone(result)); } } - return (APIAutoNone(NULL)); + return (APIAutoNone(nullptr)); } static PyObject *CmdGetSeqAlignStr(PyObject * self, PyObject * args) @@ -6183,7 +6183,7 @@ static PyObject *CmdCifGetArray(PyObject * self, PyObject * args) return APIAutoNone(ret); ok_except1: API_HANDLE_ERROR; - return APIAutoNone(NULL); + return APIAutoNone(nullptr); } static PyObject* CmdM2ioFirstBlockProperties(PyObject* self, PyObject* args)