Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Use clang-tidy to use nullptr instead of 0 or NULL in e direc… #2925

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions M2/Macaulay2/e/Eschreyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ GBMatrix *GBKernelComputation::get_syzygies()
for (int i = 0; i < syzygies.size(); i++)
{
result->append(syzygies[i]);
syzygies[i] = nullptr;
syzygies[i] = 0;
}
return result;
}
Expand Down Expand Up @@ -132,20 +132,20 @@ void GBKernelComputation::strip_gb(const GBMatrix *m)
int i;
int *components = newarray_atomic_clear(int, F->rank());
for (i = 0; i < g.size(); i++)
if (g[i] != nullptr) components[g[i]->comp - 1]++;
if (g[i] != 0) components[g[i]->comp - 1]++;

for (i = 0; i < g.size(); i++)
{
gbvector head;
gbvector *last = &head;
for (gbvector *v = g[i]; v != nullptr; v = v->next)
for (gbvector *v = g[i]; v != 0; v = v->next)
if (components[v->comp - 1] > 0)
{
gbvector *t = GR->gbvector_copy_term(v);
last->next = t;
last = t;
}
last->next = nullptr;
last->next = 0;
gb.push_back(head.next);
}
for (i = 0; i < F->rank(); i++) mi.push_back(new MonomialIdeal(R));
Expand Down Expand Up @@ -182,7 +182,7 @@ void GBKernelComputation::new_pairs(int i)
{
thisvp.resize(0);
varpower::var(w, 1, thisvp);
Bag *b = new Bag(static_cast<void *>(nullptr), thisvp);
Bag *b = new Bag(static_cast<void *>(0), thisvp);
elems.push_back(b);
}

Expand All @@ -203,7 +203,7 @@ void GBKernelComputation::new_pairs(int i)
varpower::quotient(a.monom().data(), vp.data(), thisvp);
if (varpower::is_equal(a.monom().data(), thisvp.data()))
continue;
Bag *b = new Bag(static_cast<void *>(nullptr), thisvp);
Bag *b = new Bag(static_cast<void *>(0), thisvp);
elems.push_back(b);
}
}
Expand Down Expand Up @@ -297,9 +297,9 @@ int GBKernelComputation::find_divisor(const MonomialIdeal *this_mi,

gbvector *GBKernelComputation::s_pair(gbvector *gsyz)
{
gbvector *result = nullptr;
gbvector *result = NULL;
monomial si = M->make_one();
for (gbvector *f = gsyz; f != nullptr; f = f->next)
for (gbvector *f = gsyz; f != 0; f = f->next)
{
SG->schreyer_down(f->monom, f->comp - 1, si);
gbvector *h = GR->mult_by_term(F, gb[f->comp - 1], f->coeff, si, 0);
Expand All @@ -318,7 +318,7 @@ void GBKernelComputation::wipe_unneeded_terms(gbvector *&f)
// int nterms = 1;
// int nsaved = 0;
gbvector *g = f;
while (g->next != nullptr)
while (g->next != 0)
{
// First check to see if the term g->next is in the monideal
// nterms++;
Expand All @@ -335,7 +335,7 @@ void GBKernelComputation::wipe_unneeded_terms(gbvector *&f)
// nsaved++;
gbvector *tmp = g->next;
g->next = tmp->next;
tmp->next = nullptr;
tmp->next = 0;
GR->gbvector_remove(tmp);
}
}
Expand Down Expand Up @@ -367,7 +367,7 @@ void GBKernelComputation::reduce(gbvector *&f, gbvector *&fsyz)
int count = 0;
if (M2_gbTrace >= 4) emit_wrapped(",");

while (f != nullptr)
while (f != NULL)
{
if (SF)
{
Expand Down Expand Up @@ -452,14 +452,14 @@ void GBKernelComputation::geo_reduce(gbvector *&f, gbvector *&fsyz)
const gbvector *r;
gbvectorHeap fb(GR, F);
fb.add(f);
f = nullptr;
f = NULL;
const gbvector *lead;
int q;

int count = 0;
if (M2_gbTrace >= 4) emit_wrapped(",");

while ((lead = fb.get_lead_term()) != nullptr)
while ((lead = fb.get_lead_term()) != NULL)
{
if (SF)
{
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/e/GF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ GF::~GF() {}
GF *GF::create(const RingElement *prim)
{
GF *result = new GF;
if (!result->initialize_GF(prim)) return nullptr;
if (!result->initialize_GF(prim)) return 0;

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/e/LLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool LLLoperations::initializeLLL(const MutableMatrix *A,
MutableMatrix *&LLLstate)
{
// First check m: should be a matrix over globalZZ.
if (A == nullptr || A->get_ring() != globalZZ)
if (A == 0 || A->get_ring() != globalZZ)
{
ERROR("LLL only defined for matrices over ZZ");
return false;
Expand Down
Loading
Loading