Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cppdap
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
Chen Yisong
cppdap
Commits
96b25aaf
Commit
96b25aaf
authored
Jan 17, 2020
by
Ben Clayton
Committed by
Ben Clayton
Jan 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/io.cpp: Fix uninitialized variable.
`std::atomic<bool>` does not default initialize to `false`. Bug: #12
parent
93b86100
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
io.cpp
src/io.cpp
+2
-3
No files found.
src/io.cpp
View file @
96b25aaf
...
@@ -130,7 +130,6 @@ class File : public dap::ReaderWriter {
...
@@ -130,7 +130,6 @@ class File : public dap::ReaderWriter {
out
[
i
]
=
char
(
c
);
out
[
i
]
=
char
(
c
);
}
}
return
n
;
return
n
;
// return fread(buffer, 1, n, f);
}
}
bool
write
(
const
void
*
buffer
,
size_t
n
)
override
{
bool
write
(
const
void
*
buffer
,
size_t
n
)
override
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
writeMutex
);
std
::
unique_lock
<
std
::
mutex
>
lock
(
writeMutex
);
...
@@ -143,10 +142,10 @@ class File : public dap::ReaderWriter {
...
@@ -143,10 +142,10 @@ class File : public dap::ReaderWriter {
private
:
private
:
FILE
*
const
f
;
FILE
*
const
f
;
const
bool
closable
;
std
::
mutex
readMutex
;
std
::
mutex
readMutex
;
std
::
mutex
writeMutex
;
std
::
mutex
writeMutex
;
std
::
atomic
<
bool
>
closed
;
std
::
atomic
<
bool
>
closed
=
{
false
};
const
bool
closable
;
};
};
class
ReaderSpy
:
public
dap
::
Reader
{
class
ReaderSpy
:
public
dap
::
Reader
{
...
...
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