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.
This commit is contained in:
Hein-Pieter van Braam 2017-09-07 21:48:50 +02:00
parent d1cb73b47a
commit 67a706fc1b
17 changed files with 125 additions and 136 deletions

View file

@ -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();

View file

@ -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 {

View file

@ -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
#endif // ORDERED_HASH_MAP_H