Browse Source

Merge pull request #22672 from akien-mga/fix-warnings

Fix various warnings reported by CI in #22620
Rémi Verschelde 6 years ago
parent
commit
f8484bb77d

+ 0 - 2
core/io/marshalls.cpp

@@ -868,8 +868,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
 		} break;
 		case Variant::REAL: {
 
-			double d = p_variant;
-			float f = d;
 			if (flags & ENCODE_FLAG_64) {
 				if (buf) {
 					encode_double(p_variant.operator double(), buf);

+ 2 - 2
core/ustring.cpp

@@ -1828,8 +1828,8 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
 	int sign, expSign = false;
 	double fraction, dblExp;
 	const double *d;
-	register const C *p;
-	register int c;
+	const C *p;
+	int c;
 	int exp = 0; /* Exponent read from "EX" field. */
 	int fracExp = 0; /* Exponent that derives from the fractional
 				 * part. Under normal circumstances, it is

+ 3 - 0
drivers/gles3/rasterizer_gles3.cpp

@@ -73,6 +73,8 @@ RasterizerScene *RasterizerGLES3::get_scene() {
 #define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148
 #define _EXT_DEBUG_OUTPUT 0x92E0
 
+#ifdef GLAD_ENABLED
+// Restricting to GLAD as only used in initialize() with GLAD_GL_ARB_debug_output
 #if (defined WINDOWS_ENABLED) && !(defined UWP_ENABLED)
 #define GLAPIENTRY APIENTRY
 #else
@@ -123,6 +125,7 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
 
 	ERR_PRINTS(output);
 }
+#endif // GLAD_ENABLED
 
 typedef void (*DEBUGPROCARB)(GLenum source,
 		GLenum type,

+ 3 - 1
main/main.cpp

@@ -115,9 +115,11 @@ static bool editor = false;
 static bool project_manager = false;
 static String locale;
 static bool show_help = false;
-static bool auto_build_solutions = false;
 static bool auto_quit = false;
 static OS::ProcessID allow_focus_steal_pid = 0;
+#ifdef TOOLS_ENABLED
+static bool auto_build_solutions = false;
+#endif
 
 // Display
 

+ 1 - 1
modules/csg/csg_gizmos.cpp

@@ -215,7 +215,7 @@ void CSGShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int
 		UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
 		ur->create_action(TTR("Change Box Shape Extents"));
 		static const char *method[3] = { "set_width", "set_height", "set_depth" };
-		float current;
+		float current = 0;
 		switch (p_idx) {
 			case 0: current = s->get_width(); break;
 			case 1: current = s->get_height(); break;

+ 2 - 2
modules/gdnative/include/gdnative/gdnative.h

@@ -35,7 +35,7 @@
 extern "C" {
 #endif
 
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__ANDROID__)
 #define GDCALLINGCONV
 #define GDAPI GDCALLINGCONV
 #elif defined(__APPLE__)
@@ -47,7 +47,7 @@ extern "C" {
 #define GDCALLINGCONV __attribute__((sysv_abi))
 #define GDAPI GDCALLINGCONV
 #endif
-#else
+#else // !_WIN32 && !__APPLE__
 #define GDCALLINGCONV __attribute__((sysv_abi))
 #define GDAPI GDCALLINGCONV
 #endif