summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/callable.h2
-rw-r--r--core/cowdata.h2
-rw-r--r--core/hash_map.h8
-rw-r--r--core/image.cpp14
-rw-r--r--core/io/file_access_buffered.h2
-rw-r--r--core/io/http_client.cpp2
-rw-r--r--core/list.h12
-rw-r--r--core/math/face3.h4
-rw-r--r--core/math/geometry.h8
-rw-r--r--core/math/plane.h2
-rw-r--r--core/oa_hash_map.h4
-rw-r--r--core/os/memory.h4
-rw-r--r--core/string_name.h2
13 files changed, 33 insertions, 33 deletions
diff --git a/core/callable.h b/core/callable.h
index 5fa1ebf1d1..1f6ff48d4f 100644
--- a/core/callable.h
+++ b/core/callable.h
@@ -75,7 +75,7 @@ public:
return method == StringName() && object == 0;
}
_FORCE_INLINE_ bool is_custom() const {
- return method == StringName() && custom != 0;
+ return method == StringName() && custom != nullptr;
}
_FORCE_INLINE_ bool is_standard() const {
return method != StringName();
diff --git a/core/cowdata.h b/core/cowdata.h
index e9cfa2925a..b63a407511 100644
--- a/core/cowdata.h
+++ b/core/cowdata.h
@@ -132,7 +132,7 @@ public:
}
_FORCE_INLINE_ void clear() { resize(0); }
- _FORCE_INLINE_ bool empty() const { return _ptr == 0; }
+ _FORCE_INLINE_ bool empty() const { return _ptr == nullptr; }
_FORCE_INLINE_ void set(int p_index, const T &p_elem) {
diff --git a/core/hash_map.h b/core/hash_map.h
index 4a3bee04c5..cfc0f87010 100644
--- a/core/hash_map.h
+++ b/core/hash_map.h
@@ -107,7 +107,7 @@ private:
hash_table_power = MIN_HASH_TABLE_POWER;
elements = 0;
for (int i = 0; i < (1 << MIN_HASH_TABLE_POWER); i++)
- hash_table[i] = 0;
+ hash_table[i] = nullptr;
}
void erase_hash_table() {
@@ -115,7 +115,7 @@ private:
ERR_FAIL_COND_MSG(elements, "Cannot erase hash table if there are still elements inside.");
memdelete_arr(hash_table);
- hash_table = 0;
+ hash_table = nullptr;
hash_table_power = 0;
elements = 0;
}
@@ -155,7 +155,7 @@ private:
for (int i = 0; i < (1 << new_hash_table_power); i++) {
- new_hash_table[i] = 0;
+ new_hash_table[i] = nullptr;
}
if (hash_table) {
@@ -541,7 +541,7 @@ public:
memdelete_arr(hash_table);
}
- hash_table = 0;
+ hash_table = nullptr;
hash_table_power = 0;
elements = 0;
}
diff --git a/core/image.cpp b/core/image.cpp
index 277f6e9bf0..c88ed7e3cb 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -474,7 +474,7 @@ void Image::convert(Format p_new_format) {
} else if (format > FORMAT_RGBA8 || p_new_format > FORMAT_RGBA8) {
//use put/set pixel which is slower but works with non byte formats
- Image new_img(width, height, 0, p_new_format);
+ Image new_img(width, height, false, p_new_format);
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
@@ -492,7 +492,7 @@ void Image::convert(Format p_new_format) {
return;
}
- Image new_img(width, height, 0, p_new_format);
+ Image new_img(width, height, false, p_new_format);
const uint8_t *rptr = data.ptr();
uint8_t *wptr = new_img.data.ptrw();
@@ -991,7 +991,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
if (p_width == width && p_height == height)
return;
- Image dst(p_width, p_height, 0, format);
+ Image dst(p_width, p_height, false, format);
// Setup mipmap-aware scaling
Image dst2;
@@ -1011,7 +1011,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
}
bool interpolate_mipmaps = mipmap_aware && mip1 != mip2;
if (interpolate_mipmaps) {
- dst2.create(p_width, p_height, 0, format);
+ dst2.create(p_width, p_height, false, format);
}
bool had_mipmaps = mipmaps;
@@ -1304,7 +1304,7 @@ void Image::crop_from_point(int p_x, int p_y, int p_width, int p_height) {
uint8_t pdata[16]; //largest is 16
uint32_t pixel_size = get_format_pixel_size(format);
- Image dst(p_width, p_height, 0, format);
+ Image dst(p_width, p_height, false, format);
{
const uint8_t *r = data.ptr();
@@ -2157,7 +2157,7 @@ void Image::create(const char **p_xpm) {
if (line == colormap_size) {
status = READING_PIXELS;
- create(size_width, size_height, 0, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8);
+ create(size_width, size_height, false, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8);
w = data.ptrw();
pixel_size = has_alpha ? 4 : 3;
}
@@ -3329,7 +3329,7 @@ Ref<Image> Image::rgbe_to_srgb() {
Ref<Image> new_image;
new_image.instance();
- new_image->create(width, height, 0, Image::FORMAT_RGB8);
+ new_image->create(width, height, false, Image::FORMAT_RGB8);
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h
index 2832367a8b..f473886330 100644
--- a/core/io/file_access_buffered.h
+++ b/core/io/file_access_buffered.h
@@ -66,7 +66,7 @@ protected:
int offset;
} cache;
- virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = 0) const = 0;
+ virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = nullptr) const = 0;
void set_cache_size(int p_size);
int get_cache_size();
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 672569c5db..940bac0009 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -283,7 +283,7 @@ void HTTPClient::close() {
body_size = -1;
body_left = 0;
chunk_left = 0;
- chunk_trailer_part = 0;
+ chunk_trailer_part = false;
read_until_eof = false;
response_num = 0;
handshaking = false;
diff --git a/core/list.h b/core/list.h
index eb74fa7917..7fbf3e50fc 100644
--- a/core/list.h
+++ b/core/list.h
@@ -182,14 +182,14 @@ public:
*/
_FORCE_INLINE_ const Element *front() const {
- return _data ? _data->first : 0;
+ return _data ? _data->first : nullptr;
};
/**
* return an iterator to the beginning of the list.
*/
_FORCE_INLINE_ Element *front() {
- return _data ? _data->first : 0;
+ return _data ? _data->first : nullptr;
};
/**
@@ -197,7 +197,7 @@ public:
*/
_FORCE_INLINE_ const Element *back() const {
- return _data ? _data->last : 0;
+ return _data ? _data->last : nullptr;
};
/**
@@ -205,7 +205,7 @@ public:
*/
_FORCE_INLINE_ Element *back() {
- return _data ? _data->last : 0;
+ return _data ? _data->last : nullptr;
};
/**
@@ -225,7 +225,7 @@ public:
n->value = (T &)value;
n->prev_ptr = _data->last;
- n->next_ptr = 0;
+ n->next_ptr = nullptr;
n->data = _data;
if (_data->last) {
@@ -264,7 +264,7 @@ public:
Element *n = memnew_allocator(Element, A);
n->value = (T &)value;
- n->prev_ptr = 0;
+ n->prev_ptr = nullptr;
n->next_ptr = _data->first;
n->data = _data;
diff --git a/core/math/face3.h b/core/math/face3.h
index f4b8721caa..da269028f5 100644
--- a/core/math/face3.h
+++ b/core/math/face3.h
@@ -69,8 +69,8 @@ public:
Vector3 get_median_point() const;
Vector3 get_closest_point_to(const Vector3 &p_point) const;
- bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection = 0) const;
- bool intersects_segment(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection = 0) const;
+ bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection = nullptr) const;
+ bool intersects_segment(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection = nullptr) const;
ClockDirection get_clock_dir() const; ///< todo, test if this is returning the proper clockwisity
diff --git a/core/math/geometry.h b/core/math/geometry.h
index 45c8558fac..b90cae3786 100644
--- a/core/math/geometry.h
+++ b/core/math/geometry.h
@@ -190,7 +190,7 @@ public:
return dP.length(); // Return the closest distance.
}
- static inline bool ray_intersects_triangle(const Vector3 &p_from, const Vector3 &p_dir, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2, Vector3 *r_res = 0) {
+ static inline bool ray_intersects_triangle(const Vector3 &p_from, const Vector3 &p_dir, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2, Vector3 *r_res = nullptr) {
Vector3 e1 = p_v1 - p_v0;
Vector3 e2 = p_v2 - p_v0;
Vector3 h = p_dir.cross(e2);
@@ -225,7 +225,7 @@ public:
return false;
}
- static inline bool segment_intersects_triangle(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2, Vector3 *r_res = 0) {
+ static inline bool segment_intersects_triangle(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2, Vector3 *r_res = nullptr) {
Vector3 rel = p_to - p_from;
Vector3 e1 = p_v1 - p_v0;
@@ -262,7 +262,7 @@ public:
return false;
}
- static inline bool segment_intersects_sphere(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_sphere_pos, real_t p_sphere_radius, Vector3 *r_res = 0, Vector3 *r_norm = 0) {
+ static inline bool segment_intersects_sphere(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_sphere_pos, real_t p_sphere_radius, Vector3 *r_res = nullptr, Vector3 *r_norm = nullptr) {
Vector3 sphere_pos = p_sphere_pos - p_from;
Vector3 rel = (p_to - p_from);
@@ -298,7 +298,7 @@ public:
return true;
}
- static inline bool segment_intersects_cylinder(const Vector3 &p_from, const Vector3 &p_to, real_t p_height, real_t p_radius, Vector3 *r_res = 0, Vector3 *r_norm = 0) {
+ static inline bool segment_intersects_cylinder(const Vector3 &p_from, const Vector3 &p_to, real_t p_height, real_t p_radius, Vector3 *r_res = nullptr, Vector3 *r_norm = nullptr) {
Vector3 rel = (p_to - p_from);
real_t rel_l = rel.length();
diff --git a/core/math/plane.h b/core/math/plane.h
index f91f816556..f4f205465f 100644
--- a/core/math/plane.h
+++ b/core/math/plane.h
@@ -56,7 +56,7 @@ public:
/* intersections */
- bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = 0) const;
+ bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = nullptr) const;
bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *p_intersection) const;
bool intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 *p_intersection) const;
diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h
index f7c31f8aae..b4d9ce4d51 100644
--- a/core/oa_hash_map.h
+++ b/core/oa_hash_map.h
@@ -90,7 +90,7 @@ private:
uint32_t pos = hash % capacity;
uint32_t distance = 0;
- while (42) {
+ while (true) {
if (hashes[pos] == EMPTY_HASH) {
return false;
}
@@ -118,7 +118,7 @@ private:
TKey key = p_key;
TValue value = p_value;
- while (42) {
+ while (true) {
if (hashes[pos] == EMPTY_HASH) {
_construct(pos, hash, key, value);
diff --git a/core/os/memory.h b/core/os/memory.h
index 0588e47289..03c6a80e89 100644
--- a/core/os/memory.h
+++ b/core/os/memory.h
@@ -142,13 +142,13 @@ template <typename T>
T *memnew_arr_template(size_t p_elements, const char *p_descr = "") {
if (p_elements == 0)
- return 0;
+ return nullptr;
/** overloading operator new[] cannot be done , because it may not return the real allocated address (it may pad the 'element count' before the actual array). Because of that, it must be done by hand. This is the
same strategy used by std::vector, and the Vector class, so it should be safe.*/
size_t len = sizeof(T) * p_elements;
uint64_t *mem = (uint64_t *)Memory::alloc_static(len, true);
- T *failptr = 0; //get rid of a warning
+ T *failptr = nullptr; //get rid of a warning
ERR_FAIL_COND_V(!mem, failptr);
*(mem - 1) = p_elements;
diff --git a/core/string_name.h b/core/string_name.h
index 5f69f3a235..762eb43610 100644
--- a/core/string_name.h
+++ b/core/string_name.h
@@ -85,7 +85,7 @@ class StringName {
StringName(_Data *p_data) { _data = p_data; }
public:
- operator const void *() const { return (_data && (_data->cname || !_data->name.empty())) ? (void *)1 : 0; }
+ operator const void *() const { return (_data && (_data->cname || !_data->name.empty())) ? (void *)1 : nullptr; }
bool operator==(const String &p_name) const;
bool operator==(const char *p_name) const;