Skip to content

Commit

Permalink
Fix warnings seen with -Wignored-qualifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Feb 21, 2019
1 parent a01dca7 commit c11e7ff
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ int String::find(const char *p_str, int p_from) const {
return -1;
}

int String::find_char(CharType p_char, int p_from) const {
int String::find_char(const CharType &p_char, int p_from) const {
return _cowdata.find(p_char, p_from);
}

Expand Down
8 changes: 3 additions & 5 deletions core/ustring.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class CharString {
_FORCE_INLINE_ int size() const { return _cowdata.size(); }
Error resize(int p_size) { return _cowdata.resize(p_size); }

_FORCE_INLINE_ char get(int p_index) { return _cowdata.get(p_index); }
_FORCE_INLINE_ const char get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ char get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(int p_index, const char &p_elem) { _cowdata.set(p_index, p_elem); }
_FORCE_INLINE_ const char &operator[](int p_index) const {
if (unlikely(p_index == _cowdata.size()))
Expand Down Expand Up @@ -143,8 +142,7 @@ class String {

_FORCE_INLINE_ void clear() { resize(0); }

_FORCE_INLINE_ CharType get(int p_index) { return _cowdata.get(p_index); }
_FORCE_INLINE_ const CharType get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ CharType get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(int p_index, const CharType &p_elem) { _cowdata.set(p_index, p_elem); }
_FORCE_INLINE_ int size() const { return _cowdata.size(); }
Error resize(int p_size) { return _cowdata.resize(p_size); }
Expand Down Expand Up @@ -197,7 +195,7 @@ class String {
String substr(int p_from, int p_chars) const;
int find(const String &p_str, int p_from = 0) const; ///< return <0 if failed
int find(const char *p_str, int p_from = 0) const; ///< return <0 if failed
int find_char(CharType p_char, int p_from = 0) const; ///< return <0 if failed
int find_char(const CharType &p_char, int p_from = 0) const; ///< return <0 if failed
int find_last(const String &p_str) const; ///< return <0 if failed
int findn(const String &p_str, int p_from = 0) const; ///< return <0 if failed, case insensitive
int rfind(const String &p_str, int p_from = -1) const; ///< return <0 if failed
Expand Down
2 changes: 1 addition & 1 deletion modules/bullet/rigid_body_bullet.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class RigidBodyBullet : public RigidCollisionObjectBullet {

KinematicShape() :
shape(NULL) {}
const bool is_active() const { return shape; }
bool is_active() const { return shape; }
};

struct KinematicUtilities {
Expand Down
2 changes: 1 addition & 1 deletion modules/gdnative/arvr/arvr_interface_gdnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_

Ref<ARVRInterfaceGDNative> new_interface;
new_interface.instance();
new_interface->set_interface((godot_arvr_interface_gdnative *const)p_interface);
new_interface->set_interface((const godot_arvr_interface_gdnative *)p_interface);
ARVRServer::get_singleton()->add_interface(new_interface);
}

Expand Down
6 changes: 3 additions & 3 deletions modules/gdscript/gdscript_tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class GDScriptTokenizer {
#ifdef DEBUG_ENABLED
virtual const Vector<Pair<int, String> > &get_warning_skips() const = 0;
virtual const Set<String> &get_warning_global_skips() const = 0;
virtual const bool is_ignoring_warnings() const = 0;
virtual bool is_ignoring_warnings() const = 0;
#endif // DEBUG_ENABLED

virtual ~GDScriptTokenizer(){};
Expand Down Expand Up @@ -245,7 +245,7 @@ class GDScriptTokenizerText : public GDScriptTokenizer {
#ifdef DEBUG_ENABLED
virtual const Vector<Pair<int, String> > &get_warning_skips() const { return warning_skips; }
virtual const Set<String> &get_warning_global_skips() const { return warning_global_skips; }
virtual const bool is_ignoring_warnings() const { return ignore_warnings; }
virtual bool is_ignoring_warnings() const { return ignore_warnings; }
#endif // DEBUG_ENABLED
};

Expand Down Expand Up @@ -289,7 +289,7 @@ class GDScriptTokenizerBuffer : public GDScriptTokenizer {
static Set<String> s;
return s;
}
virtual const bool is_ignoring_warnings() const { return true; }
virtual bool is_ignoring_warnings() const { return true; }
#endif // DEBUG_ENABLED
GDScriptTokenizerBuffer();
};
Expand Down
2 changes: 1 addition & 1 deletion servers/physics/collision_object_sw.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class CollisionObjectSW : public ShapeOwnerSW {
_FORCE_INLINE_ const Transform &get_shape_transform(int p_index) const { return shapes[p_index].xform; }
_FORCE_INLINE_ const Transform &get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; }
_FORCE_INLINE_ const AABB &get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; }
_FORCE_INLINE_ const real_t get_shape_area(int p_index) const { return shapes[p_index].area_cache; }
_FORCE_INLINE_ real_t get_shape_area(int p_index) const { return shapes[p_index].area_cache; }

_FORCE_INLINE_ Transform get_transform() const { return transform; }
_FORCE_INLINE_ Transform get_inv_transform() const { return inv_transform; }
Expand Down

0 comments on commit c11e7ff

Please sign in to comment.