Skip to content

Commit 5ca2acd

Browse files
committed
NULL -> nullptr.
1 parent 1bd4200 commit 5ca2acd

File tree

161 files changed

+1784
-1785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1784
-1785
lines changed

Win32/StackWalker.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class StackWalker
6464

6565
StackWalker(
6666
int options = OptionsAll, // 'int' is by design, to combine the enum-flags
67-
LPCSTR szSymPath = NULL,
67+
LPCSTR szSymPath = nullptr,
6868
DWORD dwProcessId = GetCurrentProcessId(),
6969
HANDLE hProcess = GetCurrentProcess()
7070
);
@@ -84,9 +84,9 @@ class StackWalker
8484

8585
BOOL ShowCallstack(
8686
HANDLE hThread = GetCurrentThread(),
87-
const CONTEXT *context = NULL,
88-
PReadProcessMemoryRoutine readMemoryFunction = NULL,
89-
LPVOID pUserData = NULL // optional to identify some data in the 'readMemoryFunction'-callback
87+
const CONTEXT *context = nullptr,
88+
PReadProcessMemoryRoutine readMemoryFunction = nullptr,
89+
LPVOID pUserData = nullptr // optional to identify some data in the 'readMemoryFunction'-callback
9090
);
9191

9292
#if _MSC_VER >= 1300
@@ -155,11 +155,11 @@ class StackWalker
155155
#define GET_CURRENT_CONTEXT(c, contextFlags) \
156156
do { \
157157
memset(&c, 0, sizeof(CONTEXT)); \
158-
EXCEPTION_POINTERS *pExp = NULL; \
158+
EXCEPTION_POINTERS *pExp = nullptr; \
159159
__try { \
160160
throw 0; \
161161
} __except( ( (pExp = GetExceptionInformation()) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_EXECUTE_HANDLER)) {} \
162-
if (pExp != NULL) \
162+
if (pExp != nullptr) \
163163
memcpy(&c, pExp->ContextRecord, sizeof(CONTEXT)); \
164164
c.ContextFlags = contextFlags; \
165165
} while(0);

hermes2d/include/adapt/adapt.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ namespace Hermes
128128
public:
129129
/// Constructor. Suitable for problems where various solution components belong to different spaces (L2, H1, Hcurl,
130130
/// Hdiv). If proj_norms are not specified, they are defined according to the spaces.
131-
Adapt(Hermes::vector<SpaceSharedPtr<Scalar> > spaces, ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = NULL);
132-
Adapt(SpaceSharedPtr<Scalar> space, ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = NULL);
133-
Adapt(ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = NULL);
131+
Adapt(Hermes::vector<SpaceSharedPtr<Scalar> > spaces, ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = nullptr);
132+
Adapt(SpaceSharedPtr<Scalar> space, ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = nullptr);
133+
Adapt(ErrorCalculator<Scalar>* error_calculator, AdaptivityStoppingCriterion<Scalar>* strategy = nullptr);
134134
virtual ~Adapt(); ///< Destructor. Deallocates allocated private data.
135135

136136
/// Refines elements based on results from the ErrorCalculator class.

hermes2d/include/adapt/kelly_type_adapt.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace Hermes
217217
218218
KellyTypeAdapt(SpaceSharedPtr<Scalar> space,
219219
bool ignore_visited_segments = true,
220-
const InterfaceEstimatorScalingFunction* interface_scaling_fn_ = NULL,
220+
const InterfaceEstimatorScalingFunction* interface_scaling_fn_ = nullptr,
221221
NormType norm_ = HERMES_UNSET_NORM);
222222
223223
/// Destructor.
@@ -273,11 +273,11 @@ namespace Hermes
273273
throw Exceptions::Exception("Wrong number of solutions.");
274274
Hermes::vector<MeshFunctionSharedPtr<Scalar> > slns;
275275
slns.push_back(sln);
276-
return calc_err_est(slns, NULL, error_flags);
276+
return calc_err_est(slns, nullptr, error_flags);
277277
}
278278
279279
double calc_err_est(Hermes::vector<MeshFunctionSharedPtr<Scalar> > slns,
280-
Hermes::vector<double>* component_errors = NULL,
280+
Hermes::vector<double>* component_errors = nullptr,
281281
unsigned int error_flags = HERMES_TOTAL_ERROR_REL | HERMES_ELEMENT_ERROR_REL)
282282
{
283283
return calc_err_internal(slns, component_errors, error_flags);
@@ -323,7 +323,7 @@ namespace Hermes
323323
Func<Scalar> **ext) const
324324
{
325325
Scalar result = 0.;
326-
if(u->fn_central != NULL)
326+
if(u->fn_central != nullptr)
327327
for (int i = 0; i < n; i++)
328328
result += wt[i] * Hermes::sqr( const_by_laplacian * ( e->nx[i] * u->dx[i] + e->ny[i] * u->dy[i]));
329329
else
@@ -337,7 +337,7 @@ namespace Hermes
337337
DiscontinuousFunc<Hermes::Ord> *u, Geom<Hermes::Ord> *e,
338338
Func<Ord> **ext) const
339339
{
340-
if(u->fn_central != NULL)
340+
if(u->fn_central != nullptr)
341341
return Hermes::sqr(u->dx[0] + u->dy[0]);
342342
else
343343
return Hermes::sqr(u->dx_neighbor[0] + u->dy_neighbor[0]);
@@ -362,7 +362,7 @@ namespace Hermes
362362
}
363363
364364
BasicKellyAdapt(SpaceSharedPtr<Scalar> space_, double const_by_laplacian = 1.0, NormType norm_ = HERMES_UNSET_NORM)
365-
: KellyTypeAdapt<Scalar>(space_, true, NULL, norm_)
365+
: KellyTypeAdapt<Scalar>(space_, true, nullptr, norm_)
366366
{
367367
set_scaling_consts(const_by_laplacian);
368368
this->error_estimators_surf.push_back(new ErrorEstimatorFormKelly(0, const_by_laplacian));

hermes2d/include/discrete_problem.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ namespace Hermes
6666
void set_linear(bool to_set = true, bool dirichlet_lift_accordingly = true);
6767

6868
/// Assembling.
69-
void assemble(Scalar* coeff_vec, SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = NULL);
69+
void assemble(Scalar* coeff_vec, SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = nullptr);
7070
/// Assembling.
7171
/// Without the matrix.
72-
void assemble(Scalar* coeff_vec, Vector<Scalar>* rhs = NULL);
73-
/// Light version passing NULL for the coefficient vector. External solutions
72+
void assemble(Scalar* coeff_vec, Vector<Scalar>* rhs = nullptr);
73+
/// Light version passing nullptr for the coefficient vector. External solutions
7474
/// are initialized with zeros.
75-
void assemble(SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = NULL);
76-
/// Light version passing NULL for the coefficient vector. External solutions
75+
void assemble(SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs = nullptr);
76+
/// Light version passing nullptr for the coefficient vector. External solutions
7777
/// are initialized with zeros.
7878
/// Without the matrix.
7979
void assemble(Vector<Scalar>* rhs);
@@ -106,7 +106,7 @@ namespace Hermes
106106
void deinit_assembling(Traverse::State** states, int num_states);
107107

108108
/// RungeKutta helpers.
109-
void set_RK(int original_spaces_count, bool force_diagonal_blocks = NULL, Table* block_weights = NULL);
109+
void set_RK(int original_spaces_count, bool force_diagonal_blocks = nullptr, Table* block_weights = nullptr);
110110

111111
/// State querying helpers.
112112
bool isOkay() const;

hermes2d/include/discrete_problem/discrete_problem_helpers.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace Hermes
3333
DiscreteProblemRungeKutta();
3434

3535
/// Set the special handling of external functions of Runge-Kutta methods, including information how many spaces were there in the original problem.
36-
virtual void set_RK(int original_spaces_count, bool force_diagonal_blocks = NULL, Table* block_weights = NULL);
36+
virtual void set_RK(int original_spaces_count, bool force_diagonal_blocks = nullptr, Table* block_weights = nullptr);
3737

3838
/// Turn on Runge-Kutta specific handling of external functions.
3939
bool rungeKutta;
@@ -57,7 +57,7 @@ namespace Hermes
5757
WeakForm<Scalar>* get_weak_formulation() const;
5858

5959
protected:
60-
DiscreteProblemWeakForm(WeakForm<Scalar>* wf = NULL);
60+
DiscreteProblemWeakForm(WeakForm<Scalar>* wf = nullptr);
6161

6262
virtual void set_weak_formulation(WeakForm<Scalar>* wf);
6363

hermes2d/include/function/exact_solution.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ namespace Hermes
269269
virtual Hermes::Ord ord(Hermes::Ord* values, Hermes::Ord* dx, Hermes::Ord* dy, Hermes::Ord* dxx, Hermes::Ord* dxy, Hermes::Ord* dyy, Hermes::Ord result[6]) const = 0;
270270
#endif
271271

272-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL)
272+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr)
273273
{
274274
throw Exceptions::Exception("UExtFunction is only usable in assembling, not for getting point values.");
275-
return NULL;
275+
return nullptr;
276276
}
277277

278278
virtual void precalculate(int order, int mask) {};

hermes2d/include/function/filter.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace Hermes
117117

118118
SimpleFilter(Hermes::vector<MeshFunctionSharedPtr<Scalar> > solutions, Hermes::vector<int> items = Hermes::vector<int>());
119119

120-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
120+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
121121

122122
protected:
123123
int item[H2D_MAX_COMPONENTS];
@@ -140,7 +140,7 @@ namespace Hermes
140140

141141
virtual ~ComplexFilter();
142142
protected:
143-
virtual Func<double>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
143+
virtual Func<double>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
144144

145145
virtual void set_quad_2d(Quad2D* quad_2d);
146146

@@ -180,7 +180,7 @@ namespace Hermes
180180
protected:
181181
void init(Hermes::vector<MeshFunctionSharedPtr<Scalar> > solutions);
182182

183-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
183+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
184184

185185
virtual void filter_fn (int n, Hermes::vector<Scalar *> values, Hermes::vector<Scalar *> dx, Hermes::vector<Scalar *> dy, Scalar* rslt, Scalar* rslt_dx, Scalar* rslt_dy) = 0;
186186

@@ -398,7 +398,7 @@ namespace Hermes
398398
VonMisesFilter(MeshFunctionSharedPtr<double>* solutions, int num, double lambda, double mu,
399399
int cyl = 0, int item1 = H2D_FN_VAL, int item2 = H2D_FN_VAL);
400400

401-
virtual Func<double>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
401+
virtual Func<double>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
402402

403403
virtual MeshFunction<double>* clone() const;
404404
virtual ~VonMisesFilter();
@@ -423,7 +423,7 @@ namespace Hermes
423423

424424
LinearFilter(MeshFunctionSharedPtr<Scalar> older, MeshFunctionSharedPtr<Scalar> old, double tau_frac = 1);
425425

426-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
426+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
427427
virtual MeshFunction<Scalar>* clone() const;
428428
virtual ~LinearFilter();
429429

hermes2d/include/function/mesh_function.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class HERMES_API MeshFunctionSharedPtr : public std::tr1::shared_ptr<Hermes::Her
3737
#endif
3838
{
3939
public:
40-
MeshFunctionSharedPtr(Hermes::Hermes2D::MeshFunction<Scalar>* ptr = NULL);
40+
MeshFunctionSharedPtr(Hermes::Hermes2D::MeshFunction<Scalar>* ptr = nullptr);
4141

4242
MeshFunctionSharedPtr(const MeshFunctionSharedPtr<Scalar>& other);
4343

@@ -92,14 +92,14 @@ namespace Hermes
9292
RefMap* get_refmap(bool update = true);
9393

9494
/// Return the value at the coordinates x,y.
95-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL) = 0;
95+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr) = 0;
9696

9797
/// Cloning function - for parallel OpenMP blocks.
9898
/// Designed to return an identical clone of this instance.
9999
virtual MeshFunction<Scalar>* clone() const
100100
{
101101
throw Hermes::Exceptions::Exception("You need to implement MeshFunctionSharedPtr::clone() to be able to use paralellization");
102-
return NULL;
102+
return nullptr;
103103
}
104104

105105
/// Multiplies the function represented by this class by the given coefficient.

hermes2d/include/function/solution.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace Hermes
9191
virtual void copy(const MeshFunction<Scalar>* sln);
9292

9393
/// Sets solution equal to Dirichlet lift only, solution vector = 0.
94-
void set_dirichlet_lift(SpaceSharedPtr<Scalar> space, PrecalcShapeset* pss = NULL);
94+
void set_dirichlet_lift(SpaceSharedPtr<Scalar> space, PrecalcShapeset* pss = nullptr);
9595

9696
/// Saves the complete solution (i.e., including the internal copy of the mesh and
9797
/// element orders) to an XML file.
@@ -131,7 +131,7 @@ namespace Hermes
131131
/// NOTE: This function should be used for postprocessing only, it is not effective
132132
/// enough for calculations. Since it searches for an element sequentinally, it is extremelly
133133
/// slow. Prefer Solution::get_ref_value if possible.
134-
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = NULL);
134+
virtual Func<Scalar>* get_pt_value(double x, double y, bool use_MeshHashGrid = false, Element* e = nullptr);
135135

136136
/// Adds another mesh function on the given space.
137137
/// See method of parent class.

hermes2d/include/global.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
#define H2D_MAX_SOLUTION_COMPONENTS 2
3939
static const std::string H2D_DG_INNER_EDGE = "-1234567";
4040

41-
#define HERMES_ONE NULL
42-
#define HERMES_DEFAULT_FUNCTION NULL
43-
#define HERMES_DEFAULT_SPLINE NULL
41+
#define HERMES_ONE nullptr
42+
#define HERMES_DEFAULT_FUNCTION nullptr
43+
#define HERMES_DEFAULT_SPLINE nullptr
4444

4545
#define CENTROID_QUAD_X 0.
4646
#define CENTROID_QUAD_Y 0.

hermes2d/include/graph.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ namespace Hermes
3333
{
3434
public:
3535

36-
Graph(const char* title = NULL, const char* x_axis_name = NULL, const char* y_axis_name = NULL);
36+
Graph(const char* title = nullptr, const char* x_axis_name = nullptr, const char* y_axis_name = nullptr);
3737

38-
void set_captions(const char* title = NULL, const char* x_axis_name = NULL, const char* y_axis_name = NULL);
38+
void set_captions(const char* title = nullptr, const char* x_axis_name = nullptr, const char* y_axis_name = nullptr);
3939

4040
void set_log_x(bool log = true);
4141
void set_log_y(bool log = true);
4242

4343
void show_legend(bool show = true);
4444
void show_grid(bool show = true);
4545

46-
int add_row(const char* name = NULL, const char* color = "k", const char* line = "-", const char* marker = "");
46+
int add_row(const char* name = nullptr, const char* color = "k", const char* line = "-", const char* marker = "");
4747
void set_row_style(int row, const char* color = "k", const char* line = "-", const char* marker = "");
4848

4949
void add_values(int row, double x, double y);
@@ -79,7 +79,7 @@ namespace Hermes
7979
{
8080
public:
8181

82-
SimpleGraph(const char* title = NULL, const char* x_axis_name = NULL, const char* y_axis_name = NULL)
82+
SimpleGraph(const char* title = nullptr, const char* x_axis_name = nullptr, const char* y_axis_name = nullptr)
8383
: Graph(title, x_axis_name, y_axis_name) {}
8484

8585
virtual void save(const char* filename);
@@ -91,7 +91,7 @@ namespace Hermes
9191
{
9292
public:
9393

94-
MatlabGraph(const char* title = NULL, const char* x_axis_name = NULL, const char* y_axis_name = NULL)
94+
MatlabGraph(const char* title = nullptr, const char* x_axis_name = nullptr, const char* y_axis_name = nullptr)
9595
: Graph(title, x_axis_name, y_axis_name) {}
9696

9797
virtual void save(const char* filename);
@@ -106,8 +106,8 @@ namespace Hermes
106106
{
107107
public:
108108

109-
GnuplotGraph(const char* title = NULL, const char* x_axis_name = NULL, const
110-
char* y_axis_name = NULL, double lines_width = 1.0, const
109+
GnuplotGraph(const char* title = nullptr, const char* x_axis_name = nullptr, const
110+
char* y_axis_name = nullptr, double lines_width = 1.0, const
111111
std::string& terminal_str = default_terminal) :
112112
Graph(title, x_axis_name, y_axis_name),
113113
legend_pos(),
@@ -142,7 +142,7 @@ namespace Hermes
142142
{
143143
public:
144144

145-
PNGGraph(const char* title = NULL, const char* x_axis_name = NULL, const char* y_axis_name = NULL,
145+
PNGGraph(const char* title = nullptr, const char* x_axis_name = nullptr, const char* y_axis_name = nullptr,
146146
double lines_width = 1.0, double plot_width = 800, double plot_height = 600);
147147
};
148148
}

hermes2d/include/mesh/curved.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace Hermes
4545
Nurbs()
4646
{
4747
ref = 0; twin = false;
48-
pt = NULL;
49-
kv = NULL;
48+
pt = nullptr;
49+
kv = nullptr;
5050
};
5151

5252
~Nurbs()
@@ -78,7 +78,7 @@ namespace Hermes
7878
public:
7979
CurvMap()
8080
{
81-
coeffs = NULL;};
81+
coeffs = nullptr;};
8282
CurvMap(CurvMap* cm);
8383
~CurvMap();
8484
private:
@@ -110,7 +110,7 @@ namespace Hermes
110110
/// this is called for every curvilinear element when it is created
111111
/// or when it is necessary to re-calculate coefficients for another
112112
/// order: 'e' is a pointer to the element to which this CurvMap
113-
/// belongs to. First, old "coeffs" are removed if they are not NULL,
113+
/// belongs to. First, old "coeffs" are removed if they are not nullptr,
114114
/// then new coefficients are projected.
115115
void update_refmap_coeffs(Element* e);
116116

hermes2d/include/mesh/element.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ namespace Hermes
6969
/// Returns true if the (vertex) node is constrained.
7070
bool is_constrained_vertex() const;
7171

72-
void ref_element(Element* e = NULL);
73-
void unref_element(HashTable* ht, Element* e = NULL);
72+
void ref_element(Element* e = nullptr);
73+
void unref_element(HashTable* ht, Element* e = nullptr);
7474
};
7575

7676
/// \brief Stores one element of a mesh.
@@ -92,7 +92,7 @@ namespace Hermes
9292
/// elements store pointers to thier son elements and to vertex nodes.
9393
///
9494
/// If an element has curved edges, the member 'cm' points to an associated CurvMap structure,
95-
/// otherwise it is NULL.
95+
/// otherwise it is nullptr.
9696
///
9797
class HERMES_API Element
9898
{
@@ -138,7 +138,7 @@ namespace Hermes
138138
bool vsplit() const;
139139
bool bsplit() const;
140140

141-
CurvMap* cm; ///< curved mapping, NULL if not curvilinear
141+
CurvMap* cm; ///< curved mapping, nullptr if not curvilinear
142142
/// Serves for saving the once calculated area of this element.
143143
bool areaCalculated;
144144
/// Serves for saving the once calculated area of this element.
@@ -160,7 +160,7 @@ namespace Hermes
160160
int prev_vert(int i) const;
161161

162162
/// Returns a pointer to the neighboring element across the edge 'ie', or
163-
/// NULL if it does not exist or is across an irregular edge.
163+
/// nullptr if it does not exist or is across an irregular edge.
164164
Element* get_neighbor(int ie) const;
165165

166166
/// Internal.

hermes2d/include/mesh/hash.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ namespace Hermes
5656
/// Returns the total number of nodes stored.
5757
int get_num_nodes() const;
5858

59-
/// Returns a vertex node with parent id's p1 and p2 if it exists, NULL otherwise.
59+
/// Returns a vertex node with parent id's p1 and p2 if it exists, nullptr otherwise.
6060
Node* peek_vertex_node(int p1, int p2) const;
6161

62-
/// Returns an edge node with parent id's p1 and p2 if it exists, NULL otherwise.
62+
/// Returns an edge node with parent id's p1 and p2 if it exists, nullptr otherwise.
6363
Node* peek_edge_node(int p1, int p2) const;
6464

6565
/// Central function: obtains a vertex node pointer given the id

0 commit comments

Comments
 (0)