Fix warnings on non-static data member initializers (C++11 feature)

We're not formally using C++11 yet so those trigger compilation warnings
(at least with GCC 5):

./main/input_default.h:122:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
  CursorShape default_shape = CURSOR_ARROW;
                              ^

Note: We may allow those eventually (especially for non-int static const),
but most of current occurrences were inconsistent with all other classes.

See also http://www.stroustrup.com/C++11FAQ.html#member-init
This commit is contained in:
Rémi Verschelde 2018-09-26 11:22:59 +02:00
parent 2893b5a6be
commit 2b084352b9
10 changed files with 15 additions and 7 deletions

View file

@ -86,7 +86,7 @@ public:
Vector<Vector3> handles;
Vector<Vector3> secondary_handles;
float selectable_icon_size = -1.0f;
float selectable_icon_size;
bool billboard_handle;
bool valid;

View file

@ -715,6 +715,7 @@ EditorSpatialGizmo::EditorSpatialGizmo() {
instanced = false;
spatial_node = NULL;
gizmo_plugin = NULL;
selectable_icon_size = -1.0f;
}
EditorSpatialGizmo::~EditorSpatialGizmo() {

View file

@ -636,6 +636,7 @@ InputDefault::InputDefault() {
emulate_mouse_from_touch = false;
mouse_from_touch_index = -1;
main_loop = NULL;
default_shape = CURSOR_ARROW;
hat_map_default[HAT_UP].type = TYPE_BUTTON;
hat_map_default[HAT_UP].index = JOY_DPAD_UP;

View file

@ -119,7 +119,8 @@ class InputDefault : public Input {
SpeedTrack mouse_speed_track;
Map<int, Joypad> joy_names;
int fallback_mapping;
CursorShape default_shape = CURSOR_ARROW;
CursorShape default_shape;
public:
enum HatMask {

View file

@ -3496,6 +3496,7 @@ VisualScriptEditor::VisualScriptEditor() {
clipboard = memnew(Clipboard);
}
updating_graph = false;
seq_connect = false;
edit_menu = memnew(MenuButton);
edit_menu->set_text(TTR("Edit"));

View file

@ -37,6 +37,7 @@
#include "scene/gui/graph_edit.h"
#include "visual_script.h"
#include "visual_script_property_selector.h"
class VisualScriptEditorSignalEdit;
class VisualScriptEditorVariableEdit;
@ -159,7 +160,7 @@ class VisualScriptEditor : public ScriptEditorBase {
MemberType member_type;
String member_name;
bool seq_connect = false;
bool seq_connect;
PortAction port_action;
int port_action_node;

View file

@ -721,6 +721,7 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() {
search_options->set_hide_root(true);
search_options->set_hide_folding(true);
virtuals_only = false;
seq_connect = false;
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
help_bit->connect("request_hide", this, "_closed");

View file

@ -63,8 +63,7 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
ObjectID script;
Object *instance;
bool virtuals_only;
bool seq_connect = false;
bool seq_connect;
void _item_selected();

View file

@ -122,7 +122,7 @@ class AudioStreamPlaybackMicrophone : public AudioStreamPlaybackResampled {
GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlayback)
friend class AudioStreamMicrophone;
const int MICROPHONE_PLAYBACK_DELAY = 256;
static const int MICROPHONE_PLAYBACK_DELAY = 256;
bool active;
unsigned int input_ofs;

View file

@ -49,7 +49,7 @@ class AudioEffectRecordInstance : public AudioEffectInstance {
bool is_recording;
Thread *io_thread;
bool thread_active = false;
bool thread_active;
Vector<AudioFrame> ring_buffer;
Vector<float> recording_data;
@ -67,6 +67,9 @@ public:
void init();
virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count);
virtual bool process_silence();
AudioEffectRecordInstance() :
thread_active(false) {}
};
class AudioEffectRecord : public AudioEffect {