Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
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
nexedi
libloc
Commits
2e2325a9
Commit
2e2325a9
authored
Oct 19, 2019
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct cast off_t to intmax_t before printing it
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
7a8ded5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/database.c
src/database.c
+5
-5
src/writer.c
src/writer.c
+1
-1
No files found.
src/database.c
View file @
2e2325a9
...
...
@@ -205,7 +205,7 @@ static int loc_database_read_countries_section_v0(struct loc_database* db,
size_t
countries_length
=
be32toh
(
header
->
countries_length
);
DEBUG
(
db
->
ctx
,
"Reading countries section from %jd (%zu bytes)
\n
"
,
countries_offset
,
countries_length
);
(
intmax_t
)
countries_offset
,
countries_length
);
if
(
countries_length
>
0
)
{
db
->
countries_v0
=
mmap
(
NULL
,
countries_length
,
PROT_READ
,
...
...
@@ -614,7 +614,7 @@ static int loc_database_fetch_country(struct loc_database* db,
if
((
size_t
)
pos
>=
db
->
countries_count
)
return
-
EINVAL
;
DEBUG
(
db
->
ctx
,
"Fetching country at position %jd
\n
"
,
pos
);
DEBUG
(
db
->
ctx
,
"Fetching country at position %jd
\n
"
,
(
intmax_t
)
pos
);
int
r
;
switch
(
db
->
version
)
{
...
...
@@ -844,7 +844,7 @@ static int loc_database_enumerator_stack_push_node(
// Increase stack size
int
s
=
++
e
->
network_stack_depth
;
DEBUG
(
e
->
ctx
,
"Added node %jd to stack (%d)
\n
"
,
offset
,
depth
);
DEBUG
(
e
->
ctx
,
"Added node %jd to stack (%d)
\n
"
,
(
intmax_t
)
offset
,
depth
);
e
->
network_stack
[
s
].
offset
=
offset
;
e
->
network_stack
[
s
].
i
=
i
;
...
...
@@ -884,7 +884,7 @@ LOC_EXPORT int loc_database_enumerator_next_network(
in6_addr_set_bit
(
&
enumerator
->
network_address
,
(
node
->
depth
>
0
)
?
node
->
depth
-
1
:
0
,
node
->
i
);
DEBUG
(
enumerator
->
ctx
,
"Looking at node %jd
\n
"
,
node
->
offset
);
DEBUG
(
enumerator
->
ctx
,
"Looking at node %jd
\n
"
,
(
intmax_t
)
node
->
offset
);
enumerator
->
networks_visited
[
node
->
offset
]
++
;
// Pop node from top of the stack
...
...
@@ -908,7 +908,7 @@ LOC_EXPORT int loc_database_enumerator_next_network(
if
(
__loc_database_node_is_leaf
(
n
))
{
off_t
network_index
=
be32toh
(
n
->
network
);
DEBUG
(
enumerator
->
ctx
,
"Node has a network at %jd
\n
"
,
network_index
);
DEBUG
(
enumerator
->
ctx
,
"Node has a network at %jd
\n
"
,
(
intmax_t
)
network_index
);
// Fetch the network object
r
=
loc_database_fetch_network
(
enumerator
->
db
,
network
,
...
...
src/writer.c
View file @
2e2325a9
...
...
@@ -444,7 +444,7 @@ static int loc_database_write_networks(struct loc_writer* writer,
static
int
loc_database_write_countries
(
struct
loc_writer
*
writer
,
struct
loc_database_header_v0
*
header
,
off_t
*
offset
,
FILE
*
f
)
{
DEBUG
(
writer
->
ctx
,
"Countries section starts at %jd bytes
\n
"
,
*
offset
);
DEBUG
(
writer
->
ctx
,
"Countries section starts at %jd bytes
\n
"
,
(
intmax_t
)
*
offset
);
header
->
countries_offset
=
htobe32
(
*
offset
);
size_t
countries_length
=
0
;
...
...
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