Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
01dd6eb1
Commit
01dd6eb1
authored
Jul 01, 2013
by
Richard Newton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cmake build
Fix build on windows, uint isn't a standard type, unsigned int is.
parent
1cfee8d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
CMakeLists.txt
CMakeLists.txt
+1
-0
z85_codec.hpp
src/z85_codec.hpp
+6
-6
No files found.
CMakeLists.txt
View file @
01dd6eb1
...
...
@@ -339,6 +339,7 @@ set(cxx-sources
session_base.cpp
signaler.cpp
socket_base.cpp
stream.cpp
stream_engine.cpp
sub.cpp
tcp.cpp
...
...
src/z85_codec.hpp
View file @
01dd6eb1
...
...
@@ -54,15 +54,15 @@ char *
Z85_encode
(
char
*
dest
,
uint8_t
*
data
,
size_t
size
)
{
assert
(
size
%
4
==
0
);
uint
char_nbr
=
0
;
uint
byte_nbr
=
0
;
u
nsigned
int
char_nbr
=
0
;
u
nsigned
int
byte_nbr
=
0
;
uint32_t
value
=
0
;
while
(
byte_nbr
<
size
)
{
// Accumulate value in base 256 (binary)
value
=
value
*
256
+
data
[
byte_nbr
++
];
if
(
byte_nbr
%
4
==
0
)
{
// Output value in base 85
uint
divisor
=
85
*
85
*
85
*
85
;
u
nsigned
int
divisor
=
85
*
85
*
85
*
85
;
while
(
divisor
)
{
dest
[
char_nbr
++
]
=
encoder
[
value
/
divisor
%
85
];
divisor
/=
85
;
...
...
@@ -85,15 +85,15 @@ uint8_t *
Z85_decode
(
uint8_t
*
dest
,
char
*
string
)
{
assert
(
strlen
(
string
)
%
5
==
0
);
uint
byte_nbr
=
0
;
uint
char_nbr
=
0
;
u
nsigned
int
byte_nbr
=
0
;
u
nsigned
int
char_nbr
=
0
;
uint32_t
value
=
0
;
while
(
char_nbr
<
strlen
(
string
))
{
// Accumulate value in base 85
value
=
value
*
85
+
decoder
[(
uint8_t
)
string
[
char_nbr
++
]
-
32
];
if
(
char_nbr
%
5
==
0
)
{
// Output value in base 256
uint
divisor
=
256
*
256
*
256
;
u
nsigned
int
divisor
=
256
*
256
*
256
;
while
(
divisor
)
{
dest
[
byte_nbr
++
]
=
value
/
divisor
%
256
;
divisor
/=
256
;
...
...
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