diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-07 21:48:50 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-08 14:57:48 +0200 |
commit | 67a706fc1b9721f3f06eef8be7312f175e2041ce (patch) | |
tree | bd0fb17813ac40b1b1e21a1e3a7236b30b7d69bb /core | |
parent | d1cb73b47a17de830d9474026ffa7b3587cfbc68 (diff) |
Fix various assorted warnings
Fix various warnings that don't have enough instances to merit
individual commits. Also fixes a potential bug in audio_server.cpp.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/resource_format_binary.cpp | 4 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 3 | ||||
-rw-r--r-- | core/ordered_hash_map.h | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 084d8ffcab..661eba2106 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1814,11 +1814,11 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p if (skip_editor && F->get().name.begins_with("__editor")) continue; - if (F->get().usage & PROPERTY_USAGE_STORAGE) { + if ((F->get().usage & PROPERTY_USAGE_STORAGE)) { Property p; p.name_idx = get_string_index(F->get().name); p.value = E->get()->get(F->get().name); - if ((F->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO && p.value.is_zero()) || (F->get().usage & PROPERTY_USAGE_STORE_IF_NONONE && p.value.is_one())) + if (((F->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && p.value.is_zero()) || ((F->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && p.value.is_one())) continue; p.pi = F->get(); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 1006158003..f4f81f0807 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -446,6 +446,7 @@ Error StreamPeerBuffer::get_data(uint8_t *p_buffer, int p_bytes) { return OK; } + Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_received) { if (pointer + p_bytes > data.size()) { @@ -463,6 +464,8 @@ Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_ pointer += r_received; // FIXME: return what? OK or ERR_* + // return OK for now so we don't maybe return garbage + return OK; } int StreamPeerBuffer::get_available_bytes() const { diff --git a/core/ordered_hash_map.h b/core/ordered_hash_map.h index 3e619d2b2e..9e95f963e1 100644 --- a/core/ordered_hash_map.h +++ b/core/ordered_hash_map.h @@ -55,8 +55,8 @@ public: friend class OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>; typename InternalList::Element *list_element; - typename InternalList::Element *next_element; typename InternalList::Element *prev_element; + typename InternalList::Element *next_element; Element(typename InternalList::Element *p_element) { list_element = p_element; @@ -69,7 +69,7 @@ public: public: _FORCE_INLINE_ Element() - : list_element(NULL), next_element(NULL), prev_element(NULL) { + : list_element(NULL), prev_element(NULL), next_element(NULL) { } Element next() const { @@ -312,4 +312,4 @@ bool operator!=(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH return (first.list_element != second.list_element); } -#endif // ORDERED_HASH_MAP_H
\ No newline at end of file +#endif // ORDERED_HASH_MAP_H |