Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BDIO.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
BDIO.jl
Commits
ed653c27
Commit
ed653c27
authored
5 years ago
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug in BDIO_read
parent
e8eec401
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
src/BDIOmethods.jl
src/BDIOmethods.jl
+10
-7
src/BDIOtypes.jl
src/BDIOtypes.jl
+2
-1
No files found.
src/BDIOmethods.jl
View file @
ed653c27
...
...
@@ -149,7 +149,7 @@ function BDIO_start_record!(fb::BDIOstream, ifmt, iuinfo, long::Bool = false)
ist
::
Int64
=
position
(
fb
.
io
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
new
=
Record
(
false
,
long
,
Int64
(
0
),
ist
,
ist
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
new
=
Record
(
false
,
long
,
Int64
(
0
),
ist
,
ist
,
0
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
push!
(
fb
.
records
,
new
)
fb
.
ipt
+=
1
flush
(
fb
.
io
)
...
...
@@ -285,11 +285,14 @@ function BDIO_read(fb, vdata::Vector, n::Int64 = 0)
if
(
nmax
*
sizeof
(
vdata
[
1
])
>
fb
.
records
[
fb
.
ipt
]
.
rlen
)
error
(
"Data in record not available"
)
end
seek
(
fb
.
io
,
fb
.
records
[
fb
.
ipt
]
.
rpos
)
rpos
::
Int64
=
max
(
fb
.
records
[
fb
.
ipt
]
.
rpos
,
fb
.
records
[
fb
.
ipt
]
.
rsav
)
seek
(
fb
.
io
,
rpos
)
for
i
=
1
:
nmax
vdata
[
i
]
=
read
(
fb
.
io
,
typeof
(
vdata
[
1
]))
end
fb
.
records
[
fb
.
ipt
]
.
rsav
=
position
(
fb
.
io
)
end
"""
...
...
@@ -410,7 +413,7 @@ function BDIO_parse!(fb::BDIOstream)
if
(
ihdr!
=
BDIO_MAGIC
)
error
(
"Not a BDIO file"
)
end
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
0
,
hsh
)
push!
(
fb
.
records
,
new
)
seek
(
fb
.
io
,
rpos
+
rlen
)
...
...
@@ -426,7 +429,7 @@ function BDIO_parse!(fb::BDIOstream)
i32
::
Int32
=
read
(
fb
.
io
,
Int32
)
rlen
=
Int64
(
i32
&
0b111111111111
)
rpos
=
position
(
fb
.
io
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
0
,
hsh
)
else
islong
=
(
mask
=
1
<<
3
;
ihdr
&
mask
==
mask
)
ifmt
::
Int32
=
(
ihdr
&
0b11110000
)
>>>
4
...
...
@@ -439,7 +442,7 @@ function BDIO_parse!(fb::BDIOstream)
rpos
=
position
(
fb
.
io
)
rlen
=
ihdr
>>>
12
end
new
=
Record
(
false
,
islong
,
rlen
,
rpos
,
rpos
+
rlen
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
new
=
Record
(
false
,
islong
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
end
push!
(
fb
.
records
,
new
)
...
...
@@ -490,7 +493,7 @@ function BDIO_write_header!(fb::BDIOstream)
flush
(
fb
.
io
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
new
=
Record
(
true
,
false
,
Int64
(
ill
),
ist
,
ind
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
Int64
(
ill
),
ist
,
ind
,
0
,
0
,
0
,
hsh
)
push!
(
fb
.
records
,
new
)
fb
.
ipt
+=
1
...
...
This diff is collapsed.
Click to expand it.
src/BDIOtypes.jl
View file @
ed653c27
...
...
@@ -6,7 +6,8 @@ mutable struct Record
rlen
::
Int64
rpos
::
Int64
rend
::
Int64
rsav
::
Int64
rfmt
::
Int32
ruinfo
::
Int8
...
...
This diff is collapsed.
Click to expand it.
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