use nullptr
This commit is contained in:
22
src/atom.cpp
22
src/atom.cpp
@ -2533,27 +2533,27 @@ void Atom::remove_custom(int index, int flag, int cols)
|
|||||||
{
|
{
|
||||||
if (flag == 0 && cols == 0) {
|
if (flag == 0 && cols == 0) {
|
||||||
memory->destroy(ivector[index]);
|
memory->destroy(ivector[index]);
|
||||||
ivector[index] = NULL;
|
ivector[index] = nullptr;
|
||||||
delete [] ivname[index];
|
delete [] ivname[index];
|
||||||
ivname[index] = NULL;
|
ivname[index] = nullptr;
|
||||||
|
|
||||||
} else if (flag == 1 && cols == 0) {
|
} else if (flag == 1 && cols == 0) {
|
||||||
memory->destroy(dvector[index]);
|
memory->destroy(dvector[index]);
|
||||||
dvector[index] = NULL;
|
dvector[index] = nullptr;
|
||||||
delete [] dvname[index];
|
delete [] dvname[index];
|
||||||
dvname[index] = NULL;
|
dvname[index] = nullptr;
|
||||||
|
|
||||||
} else if (flag == 0 && cols) {
|
} else if (flag == 0 && cols) {
|
||||||
memory->destroy(iarray[index]);
|
memory->destroy(iarray[index]);
|
||||||
iarray[index] = NULL;
|
iarray[index] = nullptr;
|
||||||
delete [] ianame[index];
|
delete [] ianame[index];
|
||||||
ianame[index] = NULL;
|
ianame[index] = nullptr;
|
||||||
|
|
||||||
} else if (flag == 1 && cols) {
|
} else if (flag == 1 && cols) {
|
||||||
memory->destroy(darray[index]);
|
memory->destroy(darray[index]);
|
||||||
darray[index] = NULL;
|
darray[index] = nullptr;
|
||||||
delete [] daname[index];
|
delete [] daname[index];
|
||||||
daname[index] = NULL;
|
daname[index] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2786,9 +2786,9 @@ void *Atom::extract(const char *name)
|
|||||||
if (!array) index = find_custom(&name[2],flag,cols);
|
if (!array) index = find_custom(&name[2],flag,cols);
|
||||||
else index = find_custom(&name[3],flag,cols);
|
else index = find_custom(&name[3],flag,cols);
|
||||||
|
|
||||||
if (index < 0) return NULL;
|
if (index < 0) return nullptr;
|
||||||
if (which != flag) return NULL;
|
if (which != flag) return nullptr;
|
||||||
if ((!array && cols) || (array && !cols)) return NULL;
|
if ((!array && cols) || (array && !cols)) return nullptr;
|
||||||
|
|
||||||
if (!which && !array) return (void *) ivector[index];
|
if (!which && !array) return (void *) ivector[index];
|
||||||
if (which && !array) return (void *) dvector[index];
|
if (which && !array) return (void *) dvector[index];
|
||||||
|
|||||||
Reference in New Issue
Block a user