Fix several in-class initialization clang warning

This commit is contained in:
Marcelo Fernandez 2018-03-22 00:17:18 -03:00
parent f2df8c94b2
commit 35d21c0881
7 changed files with 18 additions and 9 deletions

View file

@ -105,6 +105,7 @@ CommandQueueMT::CommandQueueMT(bool p_sync) {
read_ptr = 0; read_ptr = 0;
write_ptr = 0; write_ptr = 0;
dealloc_ptr = 0;
mutex = Mutex::create(); mutex = Mutex::create();
for (int i = 0; i < SYNC_SEMAPHORES; i++) { for (int i = 0; i < SYNC_SEMAPHORES; i++) {

View file

@ -309,9 +309,9 @@ class CommandQueueMT {
}; };
uint8_t command_mem[COMMAND_MEM_SIZE]; uint8_t command_mem[COMMAND_MEM_SIZE];
uint32_t read_ptr = 0; uint32_t read_ptr;
uint32_t write_ptr = 0; uint32_t write_ptr;
uint32_t dealloc_ptr = 0; uint32_t dealloc_ptr;
SyncSemaphore sync_sems[SYNC_SEMAPHORES]; SyncSemaphore sync_sems[SYNC_SEMAPHORES];
Mutex *mutex; Mutex *mutex;
Semaphore *sync; Semaphore *sync;

View file

@ -63,7 +63,7 @@ public:
template <class T> template <class T>
class Ref { class Ref {
T *reference = NULL; T *reference;
void ref(const Ref &p_from) { void ref(const Ref &p_from) {
@ -213,10 +213,9 @@ public:
Ref(T *p_reference) { Ref(T *p_reference) {
reference = NULL;
if (p_reference) if (p_reference)
ref_pointer(p_reference); ref_pointer(p_reference);
else
reference = NULL;
} }
Ref(const Variant &p_variant) { Ref(const Variant &p_variant) {

View file

@ -39,7 +39,7 @@ class StringBuffer {
CharType short_buffer[SHORT_BUFFER_SIZE]; CharType short_buffer[SHORT_BUFFER_SIZE];
String buffer; String buffer;
int string_length = 0; int string_length;
_FORCE_INLINE_ CharType *current_buffer_ptr() { _FORCE_INLINE_ CharType *current_buffer_ptr() {
return static_cast<Vector<CharType> &>(buffer).empty() ? short_buffer : buffer.ptrw(); return static_cast<Vector<CharType> &>(buffer).empty() ? short_buffer : buffer.ptrw();
@ -79,6 +79,10 @@ public:
_FORCE_INLINE_ operator String() { _FORCE_INLINE_ operator String() {
return as_string(); return as_string();
} }
StringBuffer() {
string_length = 0;
}
}; };
template <int SHORT_BUFFER_SIZE> template <int SHORT_BUFFER_SIZE>

View file

@ -37,7 +37,7 @@
class StringBuilder { class StringBuilder {
uint32_t string_length = 0; uint32_t string_length;
Vector<String> strings; Vector<String> strings;
Vector<const char *> c_strings; Vector<const char *> c_strings;
@ -75,6 +75,10 @@ public:
_FORCE_INLINE_ operator String() const { _FORCE_INLINE_ operator String() const {
return as_string(); return as_string();
} }
StringBuilder() {
string_length = 0;
}
}; };
#endif // STRING_BUILDER_H #endif // STRING_BUILDER_H

View file

@ -100,7 +100,7 @@ public:
id context; id context;
CursorShape cursor_shape; CursorShape cursor_shape;
NSCursor *cursors[CURSOR_MAX] = { NULL }; NSCursor *cursors[CURSOR_MAX];
MouseMode mouse_mode; MouseMode mouse_mode;
String title; String title;

View file

@ -2369,6 +2369,7 @@ OS_OSX *OS_OSX::singleton = NULL;
OS_OSX::OS_OSX() { OS_OSX::OS_OSX() {
memset(cursors, 0, sizeof(cursors));
key_event_pos = 0; key_event_pos = 0;
mouse_mode = OS::MOUSE_MODE_VISIBLE; mouse_mode = OS::MOUSE_MODE_VISIBLE;
main_loop = NULL; main_loop = NULL;