Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
80e95491
Commit
80e95491
authored
Aug 24, 2016
by
Jon Griffiths
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shachain: Fix signed/unsigned mismatches
Signed-off-by:
Jon Griffiths
<
jon_p_griffiths@yahoo.com
>
parent
b7cb7dfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ccan/crypto/shachain/shachain.c
ccan/crypto/shachain/shachain.c
+5
-5
No files found.
ccan/crypto/shachain/shachain.c
View file @
80e95491
...
...
@@ -12,12 +12,12 @@ static void change_bit(unsigned char *arr, size_t index)
arr
[
index
/
CHAR_BIT
]
^=
(
1
<<
(
index
%
CHAR_BIT
));
}
static
int
count_trailing_zeroes
(
shachain_index_t
index
)
static
unsigned
int
count_trailing_zeroes
(
shachain_index_t
index
)
{
#if HAVE_BUILTIN_CTZLL
return
index
?
__builtin_ctzll
(
index
)
:
INDEX_BITS
;
return
index
?
(
unsigned
int
)
__builtin_ctzll
(
index
)
:
INDEX_BITS
;
#else
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
INDEX_BITS
;
i
++
)
{
if
(
index
&
(
1ULL
<<
i
))
...
...
@@ -77,7 +77,7 @@ void shachain_init(struct shachain *chain)
bool
shachain_add_hash
(
struct
shachain
*
chain
,
shachain_index_t
index
,
const
struct
sha256
*
hash
)
{
int
i
,
pos
;
unsigned
int
i
,
pos
;
/* You have to insert them in order! */
assert
(
index
==
chain
->
min_index
-
1
||
...
...
@@ -107,7 +107,7 @@ bool shachain_add_hash(struct shachain *chain,
bool
shachain_get_hash
(
const
struct
shachain
*
chain
,
shachain_index_t
index
,
struct
sha256
*
hash
)
{
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
chain
->
num_valid
;
i
++
)
{
/* If we can get from key to index only by resetting bits,
...
...
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