Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
nexedi
babeld
Commits
2b208fd0
Commit
2b208fd0
authored
Oct 19, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make roughly work with unsigned values.
parent
200bed8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
util.c
util.c
+2
-2
util.h
util.h
+1
-1
No files found.
util.c
View file @
2b208fd0
...
@@ -63,8 +63,8 @@ seqno_plus(unsigned short s, int plus)
...
@@ -63,8 +63,8 @@ seqno_plus(unsigned short s, int plus)
return
((
s
+
plus
)
&
0xFFFF
);
return
((
s
+
plus
)
&
0xFFFF
);
}
}
int
unsigned
roughly
(
int
value
)
roughly
(
unsigned
value
)
{
{
return
value
*
3
/
4
+
random
()
%
(
value
/
2
);
return
value
*
3
/
4
+
random
()
%
(
value
/
2
);
}
}
...
...
util.h
View file @
2b208fd0
...
@@ -43,7 +43,7 @@ int seqno_minus(unsigned short s1, unsigned short s2)
...
@@ -43,7 +43,7 @@ int seqno_minus(unsigned short s1, unsigned short s2)
ATTRIBUTE
((
const
));
ATTRIBUTE
((
const
));
unsigned
short
seqno_plus
(
unsigned
short
s
,
int
plus
)
unsigned
short
seqno_plus
(
unsigned
short
s
,
int
plus
)
ATTRIBUTE
((
const
));
ATTRIBUTE
((
const
));
int
roughly
(
int
value
);
unsigned
roughly
(
unsigned
value
);
void
timeval_minus
(
struct
timeval
*
d
,
void
timeval_minus
(
struct
timeval
*
d
,
const
struct
timeval
*
s1
,
const
struct
timeval
*
s2
);
const
struct
timeval
*
s1
,
const
struct
timeval
*
s2
);
int
timeval_minus_msec
(
const
struct
timeval
*
s1
,
const
struct
timeval
*
s2
)
int
timeval_minus_msec
(
const
struct
timeval
*
s1
,
const
struct
timeval
*
s2
)
...
...
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