Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
488d5431
Commit
488d5431
authored
Nov 13, 2012
by
Mathis Rosenhauer
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
avoid implicit casts
parent
b336862e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sz_compat.c
View file @
488d5431
...
...
@@ -23,24 +23,34 @@ static int convert_options(int sz_opts)
return
opts
;
}
static
void
interleave_buffer
(
unsigned
char
*
dest
,
unsigned
char
*
src
,
static
void
interleave_buffer
(
void
*
dest
,
const
void
*
src
,
size_t
n
,
int
wordsize
)
{
size_t
i
,
j
;
const
unsigned
char
*
src8
;
unsigned
char
*
dest8
;
src8
=
(
unsigned
char
*
)
src
;
dest8
=
(
unsigned
char
*
)
dest
;
for
(
i
=
0
;
i
<
n
/
wordsize
;
i
++
)
for
(
j
=
0
;
j
<
wordsize
;
j
++
)
dest
[
j
*
(
n
/
wordsize
)
+
i
]
=
src
[
i
*
wordsize
+
j
];
dest
8
[
j
*
(
n
/
wordsize
)
+
i
]
=
src
8
[
i
*
wordsize
+
j
];
}
static
void
deinterleave_buffer
(
unsigned
char
*
dest
,
unsigned
char
*
src
,
size_t
n
,
int
wordsize
)
static
void
deinterleave_buffer
(
void
*
dest
,
const
void
*
src
,
size_t
n
,
int
wordsize
)
{
size_t
i
,
j
;
const
unsigned
char
*
src8
;
unsigned
char
*
dest8
;
src8
=
(
unsigned
char
*
)
src
;
dest8
=
(
unsigned
char
*
)
dest
;
for
(
i
=
0
;
i
<
n
/
wordsize
;
i
++
)
for
(
j
=
0
;
j
<
wordsize
;
j
++
)
dest
[
i
*
wordsize
+
j
]
=
src
[
j
*
(
n
/
wordsize
)
+
i
];
dest
8
[
i
*
wordsize
+
j
]
=
src
8
[
j
*
(
n
/
wordsize
)
+
i
];
}
int
SZ_BufftoBuffCompress
(
void
*
dest
,
size_t
*
destLen
,
...
...
@@ -49,10 +59,10 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
{
int
status
;
struct
aec_stream
strm
;
unsigned
char
*
buf
;
void
*
buf
;
if
(
param
->
bits_per_pixel
==
32
||
param
->
bits_per_pixel
==
64
)
{
buf
=
(
unsigned
char
*
)
malloc
(
sourceLen
);
buf
=
malloc
(
sourceLen
);
if
(
buf
==
NULL
)
return
SZ_MEM_ERROR
;
...
...
@@ -89,10 +99,10 @@ int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
{
int
status
;
struct
aec_stream
strm
;
unsigned
char
*
buf
;
void
*
buf
;
if
(
param
->
bits_per_pixel
==
32
||
param
->
bits_per_pixel
==
64
)
{
buf
=
(
unsigned
char
*
)
malloc
(
*
destLen
);
buf
=
malloc
(
*
destLen
);
if
(
buf
==
NULL
)
return
SZ_MEM_ERROR
;
...
...
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