Skip to content

Commit 62120c7

Browse files
committed
Fix Steam input "crc" errors, and some other Coverity reports of uninitialized scalar variable
- Fixes #88630. - Fixes #92578.
1 parent a4f2ea9 commit 62120c7

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

core/input/input.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,7 @@ void Input::parse_mapping(const String &p_mapping) {
15041504
JoyAxis output_axis = _get_output_axis(output);
15051505
if (output_button == JoyButton::INVALID && output_axis == JoyAxis::INVALID) {
15061506
print_verbose(vformat("Unrecognized output string \"%s\" in mapping:\n%s", output, p_mapping));
1507+
continue;
15071508
}
15081509
ERR_CONTINUE_MSG(output_button != JoyButton::INVALID && output_axis != JoyAxis::INVALID,
15091510
vformat("Output string \"%s\" matched both button and axis in mapping:\n%s", output, p_mapping));

drivers/gles3/rasterizer_gles3.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,11 @@ void RasterizerGLES3::clear_depth(float p_depth) {
130130

131131
#ifdef CAN_DEBUG
132132
static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) {
133-
if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
133+
// These are ultimately annoying, so removing for now.
134+
if (type == _EXT_DEBUG_TYPE_OTHER_ARB || type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
134135
return;
135136
}
136137

137-
if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
138-
return; //these are ultimately annoying, so removing for now
139-
}
140-
141138
char debSource[256], debType[256], debSev[256];
142139

143140
if (source == _EXT_DEBUG_SOURCE_API_ARB) {
@@ -152,6 +149,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
152149
strcpy(debSource, "Application");
153150
} else if (source == _EXT_DEBUG_SOURCE_OTHER_ARB) {
154151
strcpy(debSource, "Other");
152+
} else {
153+
ERR_FAIL_MSG(vformat("GL ERROR: Invalid or unhandled source '%d' in debug callback.", source));
155154
}
156155

157156
if (type == _EXT_DEBUG_TYPE_ERROR_ARB) {
@@ -162,10 +161,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
162161
strcpy(debType, "Undefined behavior");
163162
} else if (type == _EXT_DEBUG_TYPE_PORTABILITY_ARB) {
164163
strcpy(debType, "Portability");
165-
} else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
166-
strcpy(debType, "Performance");
167-
} else if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
168-
strcpy(debType, "Other");
164+
} else {
165+
ERR_FAIL_MSG(vformat("GL ERROR: Invalid or unhandled type '%d' in debug callback.", type));
169166
}
170167

171168
if (severity == _EXT_DEBUG_SEVERITY_HIGH_ARB) {
@@ -174,6 +171,8 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
174171
strcpy(debSev, "Medium");
175172
} else if (severity == _EXT_DEBUG_SEVERITY_LOW_ARB) {
176173
strcpy(debSev, "Low");
174+
} else {
175+
ERR_FAIL_MSG(vformat("GL ERROR: Invalid or unhandled severity '%d' in debug callback.", severity));
177176
}
178177

179178
String output = String() + "GL ERROR: Source: " + debSource + "\tType: " + debType + "\tID: " + itos(id) + "\tSeverity: " + debSev + "\tMessage: " + message;

editor/debugger/debug_adapter/debug_adapter_types.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ struct Source {
100100
};
101101

102102
struct Breakpoint {
103-
int id;
104-
bool verified;
103+
int id = 0;
104+
bool verified = false;
105105
Source source;
106-
int line;
106+
int line = 0;
107107

108108
bool operator==(const Breakpoint &p_other) const {
109109
return source.path == p_other.source.path && line == p_other.line;
@@ -121,7 +121,7 @@ struct Breakpoint {
121121
};
122122

123123
struct BreakpointLocation {
124-
int line;
124+
int line = 0;
125125
int endLine = -1;
126126

127127
_FORCE_INLINE_ Dictionary to_json() const {
@@ -169,10 +169,10 @@ struct Capabilities {
169169
};
170170

171171
struct Message {
172-
int id;
172+
int id = 0;
173173
String format;
174174
bool sendTelemetry = false; // Just in case :)
175-
bool showUser;
175+
bool showUser = false;
176176
Dictionary variables;
177177

178178
_FORCE_INLINE_ Dictionary to_json() const {
@@ -190,8 +190,8 @@ struct Message {
190190
struct Scope {
191191
String name;
192192
String presentationHint;
193-
int variablesReference;
194-
bool expensive;
193+
int variablesReference = 0;
194+
bool expensive = false;
195195

196196
_FORCE_INLINE_ Dictionary to_json() const {
197197
Dictionary dict;
@@ -205,19 +205,19 @@ struct Scope {
205205
};
206206

207207
struct SourceBreakpoint {
208-
int line;
208+
int line = 0;
209209

210210
_FORCE_INLINE_ void from_json(const Dictionary &p_params) {
211211
line = p_params["line"];
212212
}
213213
};
214214

215215
struct StackFrame {
216-
int id;
216+
int id = 0;
217217
String name;
218218
Source source;
219-
int line;
220-
int column;
219+
int line = 0;
220+
int column = 0;
221221

222222
static uint32_t hash(const StackFrame &p_frame) {
223223
return hash_murmur3_one_32(p_frame.id);
@@ -247,7 +247,7 @@ struct StackFrame {
247247
};
248248

249249
struct Thread {
250-
int id;
250+
int id = 0;
251251
String name;
252252

253253
_FORCE_INLINE_ Dictionary to_json() const {

modules/gdscript/language_server/godot_lsp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ struct ReferenceContext {
236236
/**
237237
* Include the declaration of the current symbol.
238238
*/
239-
bool includeDeclaration;
239+
bool includeDeclaration = false;
240240
};
241241

242242
struct ReferenceParams : TextDocumentPositionParams {

scene/resources/2d/tile_set.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ class TileSet : public Resource {
265265
class TerrainsPattern {
266266
bool valid = false;
267267
int terrain = -1;
268-
int bits[TileSet::CELL_NEIGHBOR_MAX];
269-
bool is_valid_bit[TileSet::CELL_NEIGHBOR_MAX];
268+
int bits[TileSet::CELL_NEIGHBOR_MAX] = {};
269+
bool is_valid_bit[TileSet::CELL_NEIGHBOR_MAX] = {};
270270

271271
int not_empty_terrains_count = 0;
272272

0 commit comments

Comments
 (0)