summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/gdnative.cpp3
-rw-r--r--modules/gdscript/gd_compiler.cpp4
-rw-r--r--modules/gdscript/gd_parser.cpp20
-rw-r--r--modules/gdscript/gd_tokenizer.cpp4
-rw-r--r--modules/nativescript/api_generator.cpp3
-rw-r--r--modules/openssl/stream_peer_openssl.cpp13
-rw-r--r--modules/pbm/bitmap_loader_pbm.cpp3
-rw-r--r--modules/theora/video_stream_theora.cpp1
8 files changed, 16 insertions, 35 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index fc4fc5c10d..ccc7e5f2da 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -247,9 +247,8 @@ bool GDNative::terminate() {
return false;
}
- Error error = OK;
void *library_terminate;
- error = OS::get_singleton()->get_dynamic_library_symbol_handle(
+ Error error = OS::get_singleton()->get_dynamic_library_symbol_handle(
native_handle,
terminate_symbol,
library_terminate);
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index d4ede4cb17..c243f88b7a 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1451,15 +1451,13 @@ Error GDCompiler::_parse_function(GDScript *p_script, const GDParser::ClassNode
codegen.opcodes.push_back(GDFunction::OPCODE_END);
- GDFunction *gdfunc = NULL;
-
/*
if (String(p_func->name)=="") { //initializer func
gdfunc = &p_script->initializer;
*/
//} else { //regular func
p_script->member_functions[func_name] = memnew(GDFunction);
- gdfunc = p_script->member_functions[func_name];
+ GDFunction *gdfunc = p_script->member_functions[func_name];
//}
if (p_func) {
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 9023fd4bf4..7d3857266e 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2381,9 +2381,7 @@ void GDParser::_parse_block(BlockNode *p_block, bool p_static) {
if (tokenizer->get_token() == GDTokenizer::TK_OP_ASSIGN) {
tokenizer->advance();
- Node *subexpr = NULL;
-
- subexpr = _parse_and_reduce_expression(p_block, p_static);
+ Node *subexpr = _parse_and_reduce_expression(p_block, p_static);
if (!subexpr) {
if (_recover_from_completion()) {
break;
@@ -3135,9 +3133,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
if (tokenizer->get_token() == GDTokenizer::TK_OP_ASSIGN) {
defaulting = true;
tokenizer->advance(1);
- Node *defval = NULL;
-
- defval = _parse_and_reduce_expression(p_class, _static);
+ Node *defval = _parse_and_reduce_expression(p_class, _static);
if (!defval || error_set)
return;
@@ -3875,9 +3871,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
#endif
tokenizer->advance();
- Node *subexpr = NULL;
-
- subexpr = _parse_and_reduce_expression(p_class, false, autoexport);
+ Node *subexpr = _parse_and_reduce_expression(p_class, false, autoexport);
if (!subexpr) {
if (_recover_from_completion()) {
break;
@@ -4035,9 +4029,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
tokenizer->advance();
- Node *subexpr = NULL;
-
- subexpr = _parse_and_reduce_expression(p_class, true, true);
+ Node *subexpr = _parse_and_reduce_expression(p_class, true, true);
if (!subexpr) {
if (_recover_from_completion()) {
break;
@@ -4103,9 +4095,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
if (tokenizer->get_token() == GDTokenizer::TK_OP_ASSIGN) {
tokenizer->advance();
- Node *subexpr = NULL;
-
- subexpr = _parse_and_reduce_expression(p_class, true, true);
+ Node *subexpr = _parse_and_reduce_expression(p_class, true, true);
if (!subexpr) {
if (_recover_from_completion()) {
break;
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 5803046185..f70982d7c0 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -1187,9 +1187,7 @@ Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> &p_buffer) {
int line_count = decode_uint32(&buf[16]);
int token_count = decode_uint32(&buf[20]);
- const uint8_t *b = buf;
-
- b = &buf[24];
+ const uint8_t *b = &buf[24];
total_len -= 24;
identifiers.resize(identifier_count);
diff --git a/modules/nativescript/api_generator.cpp b/modules/nativescript/api_generator.cpp
index 47162bfc49..d9e78ba54a 100644
--- a/modules/nativescript/api_generator.cpp
+++ b/modules/nativescript/api_generator.cpp
@@ -155,10 +155,9 @@ List<ClassAPI> generate_c_api_classes() {
class_api.is_instanciable = !class_api.is_singleton && ClassDB::can_instance(class_name);
{
- bool is_reference = false;
List<StringName> inheriters;
ClassDB::get_inheriters_from_class("Reference", &inheriters);
- is_reference = !!inheriters.find(class_name);
+ bool is_reference = !!inheriters.find(class_name);
// @Unclear
class_api.is_reference = !class_api.is_singleton && is_reference;
}
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp
index 7a9d5195a9..8c5e6f83c3 100644
--- a/modules/openssl/stream_peer_openssl.cpp
+++ b/modules/openssl/stream_peer_openssl.cpp
@@ -41,27 +41,22 @@ bool StreamPeerOpenSSL::_match_host_name(const char *name, const char *hostname)
Error StreamPeerOpenSSL::_match_common_name(const char *hostname, const X509 *server_cert) {
- int common_name_loc = -1;
- X509_NAME_ENTRY *common_name_entry = NULL;
- ASN1_STRING *common_name_asn1 = NULL;
- char *common_name_str = NULL;
-
// Find the position of the CN field in the Subject field of the certificate
- common_name_loc = X509_NAME_get_index_by_NID(X509_get_subject_name((X509 *)server_cert), NID_commonName, -1);
+ int common_name_loc = X509_NAME_get_index_by_NID(X509_get_subject_name((X509 *)server_cert), NID_commonName, -1);
ERR_FAIL_COND_V(common_name_loc < 0, ERR_INVALID_PARAMETER);
// Extract the CN field
- common_name_entry = X509_NAME_get_entry(X509_get_subject_name((X509 *)server_cert), common_name_loc);
+ X509_NAME_ENTRY *common_name_entry = X509_NAME_get_entry(X509_get_subject_name((X509 *)server_cert), common_name_loc);
ERR_FAIL_COND_V(common_name_entry == NULL, ERR_INVALID_PARAMETER);
// Convert the CN field to a C string
- common_name_asn1 = X509_NAME_ENTRY_get_data(common_name_entry);
+ ASN1_STRING *common_name_asn1 = X509_NAME_ENTRY_get_data(common_name_entry);
ERR_FAIL_COND_V(common_name_asn1 == NULL, ERR_INVALID_PARAMETER);
- common_name_str = (char *)ASN1_STRING_data(common_name_asn1);
+ char *common_name_str = (char *)ASN1_STRING_data(common_name_asn1);
// Make sure there isn't an embedded NUL character in the CN
bool malformed_certificate = (size_t)ASN1_STRING_length(common_name_asn1) != strlen(common_name_str);
diff --git a/modules/pbm/bitmap_loader_pbm.cpp b/modules/pbm/bitmap_loader_pbm.cpp
index c8f25ad68c..93dedbd05f 100644
--- a/modules/pbm/bitmap_loader_pbm.cpp
+++ b/modules/pbm/bitmap_loader_pbm.cpp
@@ -95,6 +95,9 @@ static bool _get_token(FileAccessRef &f, uint8_t &saved, PoolVector<uint8_t> &r_
resized = true;
}
if (resized) {
+ // Note: Certain C++ static analyzers might point out that the following assigment is unnecessary.
+ // This is wrong since PoolVector<class T>::Write has an operator= method where the lhs gets updated under certain conditions.
+ // See core/dvector.h.
w = PoolVector<uint8_t>::Write();
r_token.resize(token_max);
w = r_token.write();
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index 977062dd14..a83d3ead0e 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -451,7 +451,6 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
ti.frame_width, ti.frame_height, ti.pic_x, ti.pic_y);
th_decode_ctl(td, TH_DECCTL_GET_PPLEVEL_MAX, &pp_level_max,
sizeof(pp_level_max));
- pp_level = pp_level_max;
pp_level = 0;
th_decode_ctl(td, TH_DECCTL_SET_PPLEVEL, &pp_level, sizeof(pp_level));
pp_inc = 0;