Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
a0e33e17
Unverified
Commit
a0e33e17
authored
Mar 04, 2020
by
Rémi Verschelde
Committed by
GitHub
Mar 04, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #36733 from qarmin/static_analyzer_fixes
Fixes bugs found by Sonarcloud and Coverity
parents
f83f1d7c
1f209bfc
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22 additions
and
10 deletions
+22
-10
resource_format_binary.cpp
core/io/resource_format_binary.cpp
+2
-0
resource_loader.cpp
core/io/resource_loader.cpp
+1
-0
resource_loader.h
core/io/resource_loader.h
+1
-1
message_queue.cpp
core/message_queue.cpp
+3
-0
variant_parser.h
core/variant_parser.h
+1
-1
rendering_device_vulkan.cpp
drivers/vulkan/rendering_device_vulkan.cpp
+3
-0
resource_format_text.cpp
scene/resources/resource_format_text.cpp
+6
-6
rasterizer.h
servers/visual/rasterizer.h
+1
-0
rasterizer_effects_rd.cpp
servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
+1
-1
rasterizer_storage_rd.cpp
servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
+3
-1
No files found.
core/io/resource_format_binary.cpp
View file @
a0e33e17
...
@@ -1008,7 +1008,9 @@ String ResourceLoaderBinary::recognize(FileAccess *p_f) {
...
@@ -1008,7 +1008,9 @@ String ResourceLoaderBinary::recognize(FileAccess *p_f) {
ResourceLoaderBinary
::
ResourceLoaderBinary
()
:
ResourceLoaderBinary
::
ResourceLoaderBinary
()
:
translation_remapped
(
false
),
translation_remapped
(
false
),
ver_format
(
0
),
f
(
NULL
),
f
(
NULL
),
importmd_ofs
(
0
),
error
(
OK
)
{
error
(
OK
)
{
progress
=
nullptr
;
progress
=
nullptr
;
...
...
core/io/resource_loader.cpp
View file @
a0e33e17
...
@@ -538,6 +538,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
...
@@ -538,6 +538,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
if
(
r_error
)
{
if
(
r_error
)
{
*
r_error
=
err
;
*
r_error
=
err
;
}
}
thread_load_mutex
->
unlock
();
return
RES
();
return
RES
();
}
}
thread_load_mutex
->
unlock
();
thread_load_mutex
->
unlock
();
...
...
core/io/resource_loader.h
View file @
a0e33e17
...
@@ -116,7 +116,7 @@ private:
...
@@ -116,7 +116,7 @@ private:
String
type_hint
;
String
type_hint
;
float
progress
=
0
.
0
;
float
progress
=
0
.
0
;
ThreadLoadStatus
status
=
THREAD_LOAD_IN_PROGRESS
;
ThreadLoadStatus
status
=
THREAD_LOAD_IN_PROGRESS
;
Error
error
;
Error
error
=
OK
;
RES
resource
;
RES
resource
;
bool
xl_remapped
=
false
;
bool
xl_remapped
=
false
;
bool
use_sub_threads
=
false
;
bool
use_sub_threads
=
false
;
...
...
core/message_queue.cpp
View file @
a0e33e17
...
@@ -268,7 +268,10 @@ void MessageQueue::flush() {
...
@@ -268,7 +268,10 @@ void MessageQueue::flush() {
//using reverse locking strategy
//using reverse locking strategy
_THREAD_SAFE_LOCK_
_THREAD_SAFE_LOCK_
if
(
flushing
)
{
_THREAD_SAFE_UNLOCK_
ERR_FAIL_COND
(
flushing
);
//already flushing, you did something odd
ERR_FAIL_COND
(
flushing
);
//already flushing, you did something odd
}
flushing
=
true
;
flushing
=
true
;
while
(
read_pos
<
buffer_end
)
{
while
(
read_pos
<
buffer_end
)
{
...
...
core/variant_parser.h
View file @
a0e33e17
...
@@ -77,7 +77,7 @@ public:
...
@@ -77,7 +77,7 @@ public:
struct
ResourceParser
{
struct
ResourceParser
{
void
*
userdata
;
void
*
userdata
=
nullptr
;
ParseResourceFunc
func
;
ParseResourceFunc
func
;
ParseResourceFunc
ext_func
;
ParseResourceFunc
ext_func
;
ParseResourceFunc
sub_func
;
ParseResourceFunc
sub_func
;
...
...
drivers/vulkan/rendering_device_vulkan.cpp
View file @
a0e33e17
...
@@ -4182,7 +4182,10 @@ RenderingDeviceVulkan::DescriptorPool *RenderingDeviceVulkan::_descriptor_pool_a
...
@@ -4182,7 +4182,10 @@ RenderingDeviceVulkan::DescriptorPool *RenderingDeviceVulkan::_descriptor_pool_a
descriptor_pool_create_info
.
poolSizeCount
=
sizes
.
size
();
descriptor_pool_create_info
.
poolSizeCount
=
sizes
.
size
();
descriptor_pool_create_info
.
pPoolSizes
=
sizes
.
ptr
();
descriptor_pool_create_info
.
pPoolSizes
=
sizes
.
ptr
();
VkResult
res
=
vkCreateDescriptorPool
(
device
,
&
descriptor_pool_create_info
,
NULL
,
&
pool
->
pool
);
VkResult
res
=
vkCreateDescriptorPool
(
device
,
&
descriptor_pool_create_info
,
NULL
,
&
pool
->
pool
);
if
(
res
)
{
memdelete
(
pool
);
ERR_FAIL_COND_V
(
res
,
NULL
);
ERR_FAIL_COND_V
(
res
,
NULL
);
}
descriptor_pools
[
p_key
].
insert
(
pool
);
descriptor_pools
[
p_key
].
insert
(
pool
);
}
}
...
...
scene/resources/resource_format_text.cpp
View file @
a0e33e17
...
@@ -403,8 +403,6 @@ Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars
...
@@ -403,8 +403,6 @@ Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars
return
Ref
<
PackedScene
>
();
return
Ref
<
PackedScene
>
();
}
}
}
}
return
packed_scene
;
}
}
Error
ResourceLoaderText
::
load
()
{
Error
ResourceLoaderText
::
load
()
{
...
@@ -671,10 +669,6 @@ Error ResourceLoaderText::load() {
...
@@ -671,10 +669,6 @@ Error ResourceLoaderText::load() {
return
error
;
return
error
;
}
}
}
}
if
(
progress
)
{
*
progress
=
resource_current
/
float
(
resources_total
);
}
}
}
//for scene files
//for scene files
...
@@ -731,9 +725,15 @@ void ResourceLoaderText::set_translation_remapped(bool p_remapped) {
...
@@ -731,9 +725,15 @@ void ResourceLoaderText::set_translation_remapped(bool p_remapped) {
}
}
ResourceLoaderText
::
ResourceLoaderText
()
{
ResourceLoaderText
::
ResourceLoaderText
()
{
resources_total
=
0
;
resource_current
=
0
;
use_sub_threads
=
false
;
progress
=
nullptr
;
progress
=
nullptr
;
lines
=
false
;
translation_remapped
=
false
;
translation_remapped
=
false
;
use_sub_threads
=
false
;
use_sub_threads
=
false
;
error
=
OK
;
}
}
ResourceLoaderText
::~
ResourceLoaderText
()
{
ResourceLoaderText
::~
ResourceLoaderText
()
{
...
...
servers/visual/rasterizer.h
View file @
a0e33e17
...
@@ -1171,6 +1171,7 @@ public:
...
@@ -1171,6 +1171,7 @@ public:
Command
*
n
=
c
->
next
;
Command
*
n
=
c
->
next
;
if
(
c
==
commands
)
{
if
(
c
==
commands
)
{
memdelete
(
commands
);
memdelete
(
commands
);
commands
=
NULL
;
}
else
{
}
else
{
c
->~
Command
();
c
->~
Command
();
}
}
...
...
servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
View file @
a0e33e17
...
@@ -1081,7 +1081,7 @@ RasterizerEffectsRD::~RasterizerEffectsRD() {
...
@@ -1081,7 +1081,7 @@ RasterizerEffectsRD::~RasterizerEffectsRD() {
RD
::
get_singleton
()
->
free
(
filter
.
image_uniform_set
);
RD
::
get_singleton
()
->
free
(
filter
.
image_uniform_set
);
}
}
if
(
RD
::
get_singleton
()
->
uniform_set_is_valid
(
filter
.
image_
uniform_set
))
{
if
(
RD
::
get_singleton
()
->
uniform_set_is_valid
(
filter
.
uniform_set
))
{
RD
::
get_singleton
()
->
free
(
filter
.
uniform_set
);
RD
::
get_singleton
()
->
free
(
filter
.
uniform_set
);
}
}
...
...
servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
View file @
a0e33e17
...
@@ -1906,8 +1906,10 @@ void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_
...
@@ -1906,8 +1906,10 @@ void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_
for
(
int
i
=
0
;
i
<
p_surface
.
blend_shapes
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
p_surface
.
blend_shapes
.
size
();
i
++
)
{
if
(
p_surface
.
blend_shapes
[
i
].
size
()
!=
p_surface
.
vertex_data
.
size
())
{
memdelete
(
s
);
ERR_FAIL_COND
(
p_surface
.
blend_shapes
[
i
].
size
()
!=
p_surface
.
vertex_data
.
size
());
ERR_FAIL_COND
(
p_surface
.
blend_shapes
[
i
].
size
()
!=
p_surface
.
vertex_data
.
size
());
}
RID
vertex_buffer
=
RD
::
get_singleton
()
->
vertex_buffer_create
(
p_surface
.
blend_shapes
[
i
].
size
(),
p_surface
.
blend_shapes
[
i
]);
RID
vertex_buffer
=
RD
::
get_singleton
()
->
vertex_buffer_create
(
p_surface
.
blend_shapes
[
i
].
size
(),
p_surface
.
blend_shapes
[
i
]);
s
->
blend_shapes
.
push_back
(
vertex_buffer
);
s
->
blend_shapes
.
push_back
(
vertex_buffer
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment