浏览代码

Merge pull request #105799 from Repiteo/scons/enum-conversion-warnings

SCons: Add enum conversion warning
Thaddeus Crews 3 月之前
父节点
当前提交
1a2a1b07df

+ 1 - 1
SConstruct

@@ -877,7 +877,7 @@ if env.msvc and not methods.using_clang(env):  # MSVC
         env.AppendUnique(LINKFLAGS=["/WX"])
         env.AppendUnique(LINKFLAGS=["/WX"])
 
 
 else:  # GCC, Clang
 else:  # GCC, Clang
-    common_warnings = []
+    common_warnings = ["-Wenum-conversion"]
 
 
     if methods.using_gcc(env):
     if methods.using_gcc(env):
         common_warnings += ["-Wshadow", "-Wno-misleading-indentation"]
         common_warnings += ["-Wshadow", "-Wno-misleading-indentation"]

+ 1 - 3
core/input/input.h

@@ -78,9 +78,7 @@ public:
 		CURSOR_MAX
 		CURSOR_MAX
 	};
 	};
 
 
-	enum {
-		JOYPADS_MAX = 16,
-	};
+	static constexpr int32_t JOYPADS_MAX = 16;
 
 
 	typedef void (*EventDispatchFunc)(const Ref<InputEvent> &p_event);
 	typedef void (*EventDispatchFunc)(const Ref<InputEvent> &p_event);
 
 

+ 1 - 1
editor/import/dynamic_font_import_settings.cpp

@@ -1117,7 +1117,7 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
 			for (int i = 0; i < contours.size(); i++) {
 			for (int i = 0; i < contours.size(); i++) {
 				for (int j = prev_start; j <= contours[i]; j++) {
 				for (int j = prev_start; j <= contours[i]; j++) {
 					int next_point = (j < contours[i]) ? (j + 1) : prev_start;
 					int next_point = (j < contours[i]) ? (j + 1) : prev_start;
-					if ((points[j].z != TextServer::CONTOUR_CURVE_TAG_ON) || (!Math::is_equal_approx(points[j].x, points[next_point].x) && !Math::is_equal_approx(points[j].y, points[next_point].y))) {
+					if ((points[j].z != (real_t)TextServer::CONTOUR_CURVE_TAG_ON) || (!Math::is_equal_approx(points[j].x, points[next_point].x) && !Math::is_equal_approx(points[j].y, points[next_point].y))) {
 						is_pixel = false;
 						is_pixel = false;
 						break;
 						break;
 					}
 					}

+ 1 - 1
editor/import/resource_importer_dynamic_font.cpp

@@ -191,7 +191,7 @@ Error ResourceImporterDynamicFont::import(ResourceUID::ID p_source_id, const Str
 				for (int i = 0; i < contours.size(); i++) {
 				for (int i = 0; i < contours.size(); i++) {
 					for (int j = prev_start; j <= contours[i]; j++) {
 					for (int j = prev_start; j <= contours[i]; j++) {
 						int next_point = (j < contours[i]) ? (j + 1) : prev_start;
 						int next_point = (j < contours[i]) ? (j + 1) : prev_start;
-						if ((points[j].z != TextServer::CONTOUR_CURVE_TAG_ON) || (!Math::is_equal_approx(points[j].x, points[next_point].x) && !Math::is_equal_approx(points[j].y, points[next_point].y))) {
+						if ((points[j].z != (real_t)TextServer::CONTOUR_CURVE_TAG_ON) || (!Math::is_equal_approx(points[j].x, points[next_point].x) && !Math::is_equal_approx(points[j].y, points[next_point].y))) {
 							is_pixel = false;
 							is_pixel = false;
 							break;
 							break;
 						}
 						}

+ 3 - 3
editor/plugins/canvas_item_editor_plugin.cpp

@@ -3439,7 +3439,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
 			Vector2 line_starts[4];
 			Vector2 line_starts[4];
 			Vector2 line_ends[4];
 			Vector2 line_ends[4];
 			for (int i = 0; i < 4; i++) {
 			for (int i = 0; i < 4; i++) {
-				real_t anchor_val = (i >= 2) ? ANCHOR_END - anchors_values[i] : anchors_values[i];
+				real_t anchor_val = (i >= 2) ? (real_t)ANCHOR_END - anchors_values[i] : anchors_values[i];
 				line_starts[i] = corners_pos[i].lerp(corners_pos[(i + 1) % 4], anchor_val);
 				line_starts[i] = corners_pos[i].lerp(corners_pos[(i + 1) % 4], anchor_val);
 				line_ends[i] = corners_pos[(i + 3) % 4].lerp(corners_pos[(i + 2) % 4], anchor_val);
 				line_ends[i] = corners_pos[(i + 3) % 4].lerp(corners_pos[(i + 2) % 4], anchor_val);
 				bool anchor_snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0;
 				bool anchor_snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0;
@@ -3457,11 +3457,11 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
 			_draw_percentage_at_position(percent_val, (anchors_pos[dragged_anchor] + anchors_pos[(dragged_anchor + 3) % 4]) / 2, (Side)(dragged_anchor));
 			_draw_percentage_at_position(percent_val, (anchors_pos[dragged_anchor] + anchors_pos[(dragged_anchor + 3) % 4]) / 2, (Side)(dragged_anchor));
 
 
 			percent_val = anchors_values[(dragged_anchor + 1) % 4];
 			percent_val = anchors_values[(dragged_anchor + 1) % 4];
-			percent_val = ((dragged_anchor + 1) % 4 >= 2) ? ANCHOR_END - percent_val : percent_val;
+			percent_val = ((dragged_anchor + 1) % 4 >= 2) ? (real_t)ANCHOR_END - percent_val : percent_val;
 			_draw_percentage_at_position(percent_val, (line_starts[dragged_anchor] + anchors_pos[dragged_anchor]) / 2, (Side)(dragged_anchor));
 			_draw_percentage_at_position(percent_val, (line_starts[dragged_anchor] + anchors_pos[dragged_anchor]) / 2, (Side)(dragged_anchor));
 
 
 			percent_val = anchors_values[dragged_anchor];
 			percent_val = anchors_values[dragged_anchor];
-			percent_val = (dragged_anchor >= 2) ? ANCHOR_END - percent_val : percent_val;
+			percent_val = (dragged_anchor >= 2) ? (real_t)ANCHOR_END - percent_val : percent_val;
 			_draw_percentage_at_position(percent_val, (line_ends[(dragged_anchor + 1) % 4] + anchors_pos[dragged_anchor]) / 2, (Side)((dragged_anchor + 1) % 4));
 			_draw_percentage_at_position(percent_val, (line_ends[(dragged_anchor + 1) % 4] + anchors_pos[dragged_anchor]) / 2, (Side)((dragged_anchor + 1) % 4));
 		}
 		}
 
 

+ 5 - 7
editor/plugins/node_3d_editor_plugin.h

@@ -181,14 +181,12 @@ class Node3DEditorViewport : public Control {
 	};
 	};
 
 
 public:
 public:
-	enum {
-		GIZMO_BASE_LAYER = 27,
-		GIZMO_EDIT_LAYER = 26,
-		GIZMO_GRID_LAYER = 25,
-		MISC_TOOL_LAYER = 24,
+	static constexpr int32_t GIZMO_BASE_LAYER = 27;
+	static constexpr int32_t GIZMO_EDIT_LAYER = 26;
+	static constexpr int32_t GIZMO_GRID_LAYER = 25;
+	static constexpr int32_t MISC_TOOL_LAYER = 24;
 
 
-		FRAME_TIME_HISTORY = 20,
-	};
+	static constexpr int32_t FRAME_TIME_HISTORY = 20;
 
 
 	enum NavigationScheme {
 	enum NavigationScheme {
 		NAVIGATION_GODOT = 0,
 		NAVIGATION_GODOT = 0,

+ 3 - 5
modules/gdscript/gdscript_tokenizer_buffer.h

@@ -39,11 +39,9 @@ public:
 		COMPRESS_ZSTD,
 		COMPRESS_ZSTD,
 	};
 	};
 
 
-	enum {
-		TOKEN_BYTE_MASK = 0x80,
-		TOKEN_BITS = 8,
-		TOKEN_MASK = (1 << (TOKEN_BITS - 1)) - 1,
-	};
+	static constexpr uint32_t TOKEN_BYTE_MASK = 0x80;
+	static constexpr uint32_t TOKEN_BITS = 8;
+	static constexpr uint32_t TOKEN_MASK = (1 << (TOKEN_BITS - 1)) - 1;
 
 
 	Vector<StringName> identifiers;
 	Vector<StringName> identifiers;
 	Vector<Variant> constants;
 	Vector<Variant> constants;

+ 1 - 3
modules/gridmap/editor/grid_map_editor_plugin.h

@@ -48,9 +48,7 @@ class BaseButton;
 class GridMapEditor : public VBoxContainer {
 class GridMapEditor : public VBoxContainer {
 	GDCLASS(GridMapEditor, VBoxContainer);
 	GDCLASS(GridMapEditor, VBoxContainer);
 
 
-	enum {
-		GRID_CURSOR_SIZE = 50
-	};
+	static constexpr int32_t GRID_CURSOR_SIZE = 50;
 
 
 	enum InputAction {
 	enum InputAction {
 		INPUT_NONE,
 		INPUT_NONE,

+ 3 - 3
platform/macos/display_server_macos.mm

@@ -1829,7 +1829,7 @@ Color DisplayServerMacOS::screen_get_pixel(const Point2i &p_position) const {
 		CGColorSpaceRef color_space = CGColorSpaceCreateDeviceRGB();
 		CGColorSpaceRef color_space = CGColorSpaceCreateDeviceRGB();
 		if (color_space) {
 		if (color_space) {
 			uint8_t img_data[4];
 			uint8_t img_data[4];
-			CGContextRef context = CGBitmapContextCreate(img_data, 1, 1, 8, 4, color_space, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
+			CGContextRef context = CGBitmapContextCreate(img_data, 1, 1, 8, 4, color_space, (uint32_t)kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
 			if (context) {
 			if (context) {
 				CGContextDrawImage(context, CGRectMake(0, 0, 1, 1), image);
 				CGContextDrawImage(context, CGRectMake(0, 0, 1, 1), image);
 				color = Color(img_data[0] / 255.0f, img_data[1] / 255.0f, img_data[2] / 255.0f, img_data[3] / 255.0f);
 				color = Color(img_data[0] / 255.0f, img_data[1] / 255.0f, img_data[2] / 255.0f, img_data[3] / 255.0f);
@@ -1878,7 +1878,7 @@ Ref<Image> DisplayServerMacOS::screen_get_image(int p_screen) const {
 
 
 			Vector<uint8_t> img_data;
 			Vector<uint8_t> img_data;
 			img_data.resize(height * width * 4);
 			img_data.resize(height * width * 4);
-			CGContextRef context = CGBitmapContextCreate(img_data.ptrw(), width, height, 8, 4 * width, color_space, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
+			CGContextRef context = CGBitmapContextCreate(img_data.ptrw(), width, height, 8, 4 * width, color_space, (uint32_t)kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
 			if (context) {
 			if (context) {
 				CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
 				CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
 				img = Image::create_from_data(width, height, false, Image::FORMAT_RGBA8, img_data);
 				img = Image::create_from_data(width, height, false, Image::FORMAT_RGBA8, img_data);
@@ -1926,7 +1926,7 @@ Ref<Image> DisplayServerMacOS::screen_get_image_rect(const Rect2i &p_rect) const
 
 
 			Vector<uint8_t> img_data;
 			Vector<uint8_t> img_data;
 			img_data.resize_zeroed(height * width * 4);
 			img_data.resize_zeroed(height * width * 4);
-			CGContextRef context = CGBitmapContextCreate(img_data.ptrw(), width, height, 8, 4 * width, color_space, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
+			CGContextRef context = CGBitmapContextCreate(img_data.ptrw(), width, height, 8, 4 * width, color_space, (uint32_t)kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
 			if (context) {
 			if (context) {
 				CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
 				CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
 				img = Image::create_from_data(width, height, false, Image::FORMAT_RGBA8, img_data);
 				img = Image::create_from_data(width, height, false, Image::FORMAT_RGBA8, img_data);

+ 4 - 4
platform/windows/joypad_windows.cpp

@@ -525,17 +525,17 @@ float JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool
 		return p_trigger ? -1.0f : 0.0f;
 		return p_trigger ? -1.0f : 0.0f;
 	}
 	}
 	if (!p_xinput) {
 	if (!p_xinput) {
-		return (float)p_val / MAX_JOY_AXIS;
+		return p_val / (float)MAX_JOY_AXIS;
 	}
 	}
 	if (p_trigger) {
 	if (p_trigger) {
 		// Convert to a value between -1.0f and 1.0f.
 		// Convert to a value between -1.0f and 1.0f.
-		return 2.0f * p_val / MAX_TRIGGER - 1.0f;
+		return 2.0f * p_val / (float)MAX_TRIGGER - 1.0f;
 	}
 	}
 	float value;
 	float value;
 	if (p_val < 0) {
 	if (p_val < 0) {
-		value = (float)p_val / MAX_JOY_AXIS;
+		value = p_val / (float)MAX_JOY_AXIS;
 	} else {
 	} else {
-		value = (float)p_val / (MAX_JOY_AXIS - 1);
+		value = p_val / (float)(MAX_JOY_AXIS - 1);
 	}
 	}
 	if (p_negate) {
 	if (p_negate) {
 		value = -value;
 		value = -value;

+ 15 - 15
scene/gui/control.cpp

@@ -1030,56 +1030,56 @@ int Control::_get_anchors_layout_preset() const {
 	float top = get_anchor(SIDE_TOP);
 	float top = get_anchor(SIDE_TOP);
 	float bottom = get_anchor(SIDE_BOTTOM);
 	float bottom = get_anchor(SIDE_BOTTOM);
 
 
-	if (left == ANCHOR_BEGIN && right == ANCHOR_BEGIN && top == ANCHOR_BEGIN && bottom == ANCHOR_BEGIN) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_BEGIN && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_BEGIN) {
 		return (int)LayoutPreset::PRESET_TOP_LEFT;
 		return (int)LayoutPreset::PRESET_TOP_LEFT;
 	}
 	}
-	if (left == ANCHOR_END && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_BEGIN) {
+	if (left == (float)ANCHOR_END && right == (float)ANCHOR_END && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_BEGIN) {
 		return (int)LayoutPreset::PRESET_TOP_RIGHT;
 		return (int)LayoutPreset::PRESET_TOP_RIGHT;
 	}
 	}
-	if (left == ANCHOR_BEGIN && right == ANCHOR_BEGIN && top == ANCHOR_END && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_BEGIN && top == (float)ANCHOR_END && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_BOTTOM_LEFT;
 		return (int)LayoutPreset::PRESET_BOTTOM_LEFT;
 	}
 	}
-	if (left == ANCHOR_END && right == ANCHOR_END && top == ANCHOR_END && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_END && right == (float)ANCHOR_END && top == (float)ANCHOR_END && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_BOTTOM_RIGHT;
 		return (int)LayoutPreset::PRESET_BOTTOM_RIGHT;
 	}
 	}
 
 
-	if (left == ANCHOR_BEGIN && right == ANCHOR_BEGIN && top == 0.5 && bottom == 0.5) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_BEGIN && top == 0.5 && bottom == 0.5) {
 		return (int)LayoutPreset::PRESET_CENTER_LEFT;
 		return (int)LayoutPreset::PRESET_CENTER_LEFT;
 	}
 	}
-	if (left == ANCHOR_END && right == ANCHOR_END && top == 0.5 && bottom == 0.5) {
+	if (left == (float)ANCHOR_END && right == (float)ANCHOR_END && top == 0.5 && bottom == 0.5) {
 		return (int)LayoutPreset::PRESET_CENTER_RIGHT;
 		return (int)LayoutPreset::PRESET_CENTER_RIGHT;
 	}
 	}
-	if (left == 0.5 && right == 0.5 && top == ANCHOR_BEGIN && bottom == ANCHOR_BEGIN) {
+	if (left == 0.5 && right == 0.5 && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_BEGIN) {
 		return (int)LayoutPreset::PRESET_CENTER_TOP;
 		return (int)LayoutPreset::PRESET_CENTER_TOP;
 	}
 	}
-	if (left == 0.5 && right == 0.5 && top == ANCHOR_END && bottom == ANCHOR_END) {
+	if (left == 0.5 && right == 0.5 && top == (float)ANCHOR_END && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_CENTER_BOTTOM;
 		return (int)LayoutPreset::PRESET_CENTER_BOTTOM;
 	}
 	}
 	if (left == 0.5 && right == 0.5 && top == 0.5 && bottom == 0.5) {
 	if (left == 0.5 && right == 0.5 && top == 0.5 && bottom == 0.5) {
 		return (int)LayoutPreset::PRESET_CENTER;
 		return (int)LayoutPreset::PRESET_CENTER;
 	}
 	}
 
 
-	if (left == ANCHOR_BEGIN && right == ANCHOR_BEGIN && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_BEGIN && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_LEFT_WIDE;
 		return (int)LayoutPreset::PRESET_LEFT_WIDE;
 	}
 	}
-	if (left == ANCHOR_END && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_END && right == (float)ANCHOR_END && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_RIGHT_WIDE;
 		return (int)LayoutPreset::PRESET_RIGHT_WIDE;
 	}
 	}
-	if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_BEGIN) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_END && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_BEGIN) {
 		return (int)LayoutPreset::PRESET_TOP_WIDE;
 		return (int)LayoutPreset::PRESET_TOP_WIDE;
 	}
 	}
-	if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == ANCHOR_END && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_END && top == (float)ANCHOR_END && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_BOTTOM_WIDE;
 		return (int)LayoutPreset::PRESET_BOTTOM_WIDE;
 	}
 	}
 
 
-	if (left == 0.5 && right == 0.5 && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
+	if (left == 0.5 && right == 0.5 && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_VCENTER_WIDE;
 		return (int)LayoutPreset::PRESET_VCENTER_WIDE;
 	}
 	}
-	if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == 0.5 && bottom == 0.5) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_END && top == 0.5 && bottom == 0.5) {
 		return (int)LayoutPreset::PRESET_HCENTER_WIDE;
 		return (int)LayoutPreset::PRESET_HCENTER_WIDE;
 	}
 	}
 
 
-	if (left == ANCHOR_BEGIN && right == ANCHOR_END && top == ANCHOR_BEGIN && bottom == ANCHOR_END) {
+	if (left == (float)ANCHOR_BEGIN && right == (float)ANCHOR_END && top == (float)ANCHOR_BEGIN && bottom == (float)ANCHOR_END) {
 		return (int)LayoutPreset::PRESET_FULL_RECT;
 		return (int)LayoutPreset::PRESET_FULL_RECT;
 	}
 	}
 
 

+ 12 - 12
scene/resources/3d/primitive_meshes.cpp

@@ -3078,11 +3078,11 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 		Vector<ContourPoint> polygon;
 		Vector<ContourPoint> polygon;
 
 
 		for (int32_t j = start; j <= end; j++) {
 		for (int32_t j = start; j <= end; j++) {
-			if (points[j].z == TextServer::CONTOUR_CURVE_TAG_ON) {
+			if (points[j].z == (real_t)TextServer::CONTOUR_CURVE_TAG_ON) {
 				// Point on the curve.
 				// Point on the curve.
 				Vector2 p = Vector2(points[j].x, points[j].y) * pixel_size;
 				Vector2 p = Vector2(points[j].x, points[j].y) * pixel_size;
 				polygon.push_back(ContourPoint(p, true));
 				polygon.push_back(ContourPoint(p, true));
-			} else if (points[j].z == TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
+			} else if (points[j].z == (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
 				// Conic Bezier arc.
 				// Conic Bezier arc.
 				int32_t next = (j == end) ? start : (j + 1);
 				int32_t next = (j == end) ? start : (j + 1);
 				int32_t prev = (j == start) ? end : (j - 1);
 				int32_t prev = (j == start) ? end : (j - 1);
@@ -3091,16 +3091,16 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 				Vector2 p2;
 				Vector2 p2;
 
 
 				// For successive conic OFF points add a virtual ON point in the middle.
 				// For successive conic OFF points add a virtual ON point in the middle.
-				if (points[prev].z == TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
+				if (points[prev].z == (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
 					p0 = (Vector2(points[prev].x, points[prev].y) + Vector2(points[j].x, points[j].y)) / 2.0;
 					p0 = (Vector2(points[prev].x, points[prev].y) + Vector2(points[j].x, points[j].y)) / 2.0;
-				} else if (points[prev].z == TextServer::CONTOUR_CURVE_TAG_ON) {
+				} else if (points[prev].z == (real_t)TextServer::CONTOUR_CURVE_TAG_ON) {
 					p0 = Vector2(points[prev].x, points[prev].y);
 					p0 = Vector2(points[prev].x, points[prev].y);
 				} else {
 				} else {
 					ERR_FAIL_MSG(vformat("Invalid conic arc point sequence at %d:%d", i, j));
 					ERR_FAIL_MSG(vformat("Invalid conic arc point sequence at %d:%d", i, j));
 				}
 				}
-				if (points[next].z == TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
+				if (points[next].z == (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CONIC) {
 					p2 = (Vector2(points[j].x, points[j].y) + Vector2(points[next].x, points[next].y)) / 2.0;
 					p2 = (Vector2(points[j].x, points[j].y) + Vector2(points[next].x, points[next].y)) / 2.0;
-				} else if (points[next].z == TextServer::CONTOUR_CURVE_TAG_ON) {
+				} else if (points[next].z == (real_t)TextServer::CONTOUR_CURVE_TAG_ON) {
 					p2 = Vector2(points[next].x, points[next].y);
 					p2 = Vector2(points[next].x, points[next].y);
 				} else {
 				} else {
 					ERR_FAIL_MSG(vformat("Invalid conic arc point sequence at %d:%d", i, j));
 					ERR_FAIL_MSG(vformat("Invalid conic arc point sequence at %d:%d", i, j));
@@ -3118,7 +3118,7 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 					polygon.push_back(ContourPoint(p, false));
 					polygon.push_back(ContourPoint(p, false));
 					t += step;
 					t += step;
 				}
 				}
-			} else if (points[j].z == TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC) {
+			} else if (points[j].z == (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC) {
 				// Cubic Bezier arc.
 				// Cubic Bezier arc.
 				int32_t cur = j;
 				int32_t cur = j;
 				int32_t next1 = (j == end) ? start : (j + 1);
 				int32_t next1 = (j == end) ? start : (j + 1);
@@ -3126,7 +3126,7 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 				int32_t prev = (j == start) ? end : (j - 1);
 				int32_t prev = (j == start) ? end : (j - 1);
 
 
 				// There must be exactly two OFF points and two ON points for each cubic arc.
 				// There must be exactly two OFF points and two ON points for each cubic arc.
-				if (points[prev].z != TextServer::CONTOUR_CURVE_TAG_ON) {
+				if (points[prev].z != (real_t)TextServer::CONTOUR_CURVE_TAG_ON) {
 					cur = (cur == 0) ? end : cur - 1;
 					cur = (cur == 0) ? end : cur - 1;
 					next1 = (next1 == 0) ? end : next1 - 1;
 					next1 = (next1 == 0) ? end : next1 - 1;
 					next2 = (next2 == 0) ? end : next2 - 1;
 					next2 = (next2 == 0) ? end : next2 - 1;
@@ -3134,10 +3134,10 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 				} else {
 				} else {
 					j++;
 					j++;
 				}
 				}
-				ERR_FAIL_COND_MSG(points[prev].z != TextServer::CONTOUR_CURVE_TAG_ON, vformat("Invalid cubic arc point sequence at %d:%d", i, prev));
-				ERR_FAIL_COND_MSG(points[cur].z != TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC, vformat("Invalid cubic arc point sequence at %d:%d", i, cur));
-				ERR_FAIL_COND_MSG(points[next1].z != TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC, vformat("Invalid cubic arc point sequence at %d:%d", i, next1));
-				ERR_FAIL_COND_MSG(points[next2].z != TextServer::CONTOUR_CURVE_TAG_ON, vformat("Invalid cubic arc point sequence at %d:%d", i, next2));
+				ERR_FAIL_COND_MSG(points[prev].z != (real_t)TextServer::CONTOUR_CURVE_TAG_ON, vformat("Invalid cubic arc point sequence at %d:%d", i, prev));
+				ERR_FAIL_COND_MSG(points[cur].z != (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC, vformat("Invalid cubic arc point sequence at %d:%d", i, cur));
+				ERR_FAIL_COND_MSG(points[next1].z != (real_t)TextServer::CONTOUR_CURVE_TAG_OFF_CUBIC, vformat("Invalid cubic arc point sequence at %d:%d", i, next1));
+				ERR_FAIL_COND_MSG(points[next2].z != (real_t)TextServer::CONTOUR_CURVE_TAG_ON, vformat("Invalid cubic arc point sequence at %d:%d", i, next2));
 
 
 				Vector2 p0 = Vector2(points[prev].x, points[prev].y);
 				Vector2 p0 = Vector2(points[prev].x, points[prev].y);
 				Vector2 p1 = Vector2(points[cur].x, points[cur].y);
 				Vector2 p1 = Vector2(points[cur].x, points[cur].y);

+ 9 - 9
scene/resources/mesh.cpp

@@ -978,15 +978,15 @@ enum OldArrayFormat {
 	OLD_ARRAY_FORMAT_INDEX = 1 << OLD_ARRAY_INDEX,
 	OLD_ARRAY_FORMAT_INDEX = 1 << OLD_ARRAY_INDEX,
 
 
 	OLD_ARRAY_COMPRESS_BASE = (OLD_ARRAY_INDEX + 1),
 	OLD_ARRAY_COMPRESS_BASE = (OLD_ARRAY_INDEX + 1),
-	OLD_ARRAY_COMPRESS_VERTEX = 1 << (OLD_ARRAY_VERTEX + OLD_ARRAY_COMPRESS_BASE), // mandatory
-	OLD_ARRAY_COMPRESS_NORMAL = 1 << (OLD_ARRAY_NORMAL + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_TANGENT = 1 << (OLD_ARRAY_TANGENT + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_COLOR = 1 << (OLD_ARRAY_COLOR + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_TEX_UV = 1 << (OLD_ARRAY_TEX_UV + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_TEX_UV2 = 1 << (OLD_ARRAY_TEX_UV2 + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_BONES = 1 << (OLD_ARRAY_BONES + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_WEIGHTS = 1 << (OLD_ARRAY_WEIGHTS + OLD_ARRAY_COMPRESS_BASE),
-	OLD_ARRAY_COMPRESS_INDEX = 1 << (OLD_ARRAY_INDEX + OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_VERTEX = 1 << (OLD_ARRAY_VERTEX + (int32_t)OLD_ARRAY_COMPRESS_BASE), // mandatory
+	OLD_ARRAY_COMPRESS_NORMAL = 1 << (OLD_ARRAY_NORMAL + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_TANGENT = 1 << (OLD_ARRAY_TANGENT + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_COLOR = 1 << (OLD_ARRAY_COLOR + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_TEX_UV = 1 << (OLD_ARRAY_TEX_UV + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_TEX_UV2 = 1 << (OLD_ARRAY_TEX_UV2 + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_BONES = 1 << (OLD_ARRAY_BONES + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_WEIGHTS = 1 << (OLD_ARRAY_WEIGHTS + (int32_t)OLD_ARRAY_COMPRESS_BASE),
+	OLD_ARRAY_COMPRESS_INDEX = 1 << (OLD_ARRAY_INDEX + (int32_t)OLD_ARRAY_COMPRESS_BASE),
 
 
 	OLD_ARRAY_FLAG_USE_2D_VERTICES = OLD_ARRAY_COMPRESS_INDEX << 1,
 	OLD_ARRAY_FLAG_USE_2D_VERTICES = OLD_ARRAY_COMPRESS_INDEX << 1,
 	OLD_ARRAY_FLAG_USE_16_BIT_BONES = OLD_ARRAY_COMPRESS_INDEX << 2,
 	OLD_ARRAY_FLAG_USE_16_BIT_BONES = OLD_ARRAY_COMPRESS_INDEX << 2,

+ 8 - 10
servers/audio/effects/audio_effect_chorus.h

@@ -58,16 +58,14 @@ class AudioEffectChorus : public AudioEffect {
 	friend class AudioEffectChorusInstance;
 	friend class AudioEffectChorusInstance;
 
 
 public:
 public:
-	enum {
-		MAX_DELAY_MS = 50,
-		MAX_DEPTH_MS = 20,
-		MAX_WIDTH_MS = 50,
-		MAX_VOICES = 4,
-		CYCLES_FRAC = 16,
-		CYCLES_MASK = (1 << CYCLES_FRAC) - 1,
-		MAX_CHANNELS = 4,
-		MS_CUTOFF_MAX = 16000
-	};
+	static constexpr int32_t MAX_DELAY_MS = 50;
+	static constexpr int32_t MAX_DEPTH_MS = 20;
+	static constexpr int32_t MAX_WIDTH_MS = 50;
+	static constexpr int32_t MAX_VOICES = 4;
+	static constexpr int32_t CYCLES_FRAC = 16;
+	static constexpr int32_t CYCLES_MASK = (1 << CYCLES_FRAC) - 1;
+	static constexpr int32_t MAX_CHANNELS = 4;
+	static constexpr int32_t MS_CUTOFF_MAX = 16000;
 
 
 private:
 private:
 	struct Voice {
 	struct Voice {