Skip to content

Commit

Permalink
Merge pull request cloudflare#15 from daxtens/cleanups
Browse files Browse the repository at this point in the history
Compile with -Wall -Werror
  • Loading branch information
Dead2 committed May 4, 2015
2 parents 63045bc + bd4a76b commit 7f6dc8f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions arch/x86/crc_folding.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ ZLIB_INTERNAL void crc_fold_copy(deflate_state *z_const s,
goto partial;
}

algn_diff = 0 - (unsigned long)src & 0xF;
algn_diff = (0 - (unsigned long)src) & 0xF;
if (algn_diff) {
xmm_crc_part = _mm_loadu_si128((__m128i *)src);
_mm_storeu_si128((__m128i *)dst, xmm_crc_part);
Expand Down Expand Up @@ -418,7 +418,7 @@ unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state *z_const s)
z_const __m128i xmm_mask2 = _mm_load_si128((__m128i *)crc_mask2);

unsigned crc;
__m128i x_tmp0, x_tmp1, x_tmp2, x_tmp3, crc_fold;
__m128i x_tmp0, x_tmp1, x_tmp2, crc_fold;

CRC_LOAD(s)

Expand Down
3 changes: 3 additions & 0 deletions arch/x86/deflate_quick.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ local inline long compare258(z_const unsigned char *z_const src0,

ax = 16;
dx = 16;
/* set cx to something, otherwise gcc thinks it's used
uninitalised */
cx = 0;

__asm__ __volatile__ (
"1:"
Expand Down
12 changes: 8 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ show $cc -c $test.c
if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
echo ... using gcc >> configure.log
CC="$cc"
CFLAGS="${CFLAGS--O3} ${ARCHS}"
CFLAGS="${CFLAGS--O3} ${ARCHS} -Wall -Werror"
SFLAGS="${CFLAGS--O3} -fPIC"
LDFLAGS="${LDFLAGS} ${ARCHS}"
if test $build64 -eq 1; then
Expand All @@ -197,9 +197,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
fi
if test "${ZLIBGCCWARN}" = "YES"; then
if test "$zconst" -eq 1; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
CFLAGS="${CFLAGS} -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
else
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
CFLAGS="${CFLAGS} -Wextra -pedantic"
fi
fi
if test -z "$uname"; then
Expand Down Expand Up @@ -528,6 +528,7 @@ int main(void)
{
unsigned int zero = 0;
long test = __builtin_ctzl(zero);
(void)test;
return 0;
}
EOF
Expand All @@ -545,6 +546,7 @@ cat > $test.c << EOF
int main(void)
{
__m128i zero = _mm_setzero_si128();
(void)zero;
return 0;
}
EOF
Expand All @@ -565,6 +567,7 @@ int main(void)
__m128i a = _mm_setzero_si128();
__m128i b = _mm_setzero_si128();
__m128i c = _mm_clmulepi64_si128(a, b, 0x10);
(void)c;
return 0;
}
EOF
Expand Down Expand Up @@ -630,7 +633,8 @@ case "${ARCH}" in
fi

# Enable deflate_quick at level 1?
if test $without_new_strategies -eq 0; then
# requires SSE2: code uses fill_window_sse
if test ${HAVE_SSE2_INTRIN} -eq 1 && test $without_new_strategies -eq 0; then
CFLAGS="${CFLAGS} -DX86_QUICK_STRATEGY"
SFLAGS="${SFLAGS} -DX86_QUICK_STRATEGY"

Expand Down
2 changes: 1 addition & 1 deletion deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ local inline Pos insert_string(deflate_state *z_const s, z_const Pos str)


#ifndef NOT_TWEAK_COMPILER
alwaysinline local void
local inline void
bulk_insert_str(deflate_state *s, Pos startpos, uInt count) {
uInt idx;
for (idx = 0; idx < count; idx++) {
Expand Down
6 changes: 0 additions & 6 deletions zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
But it provides __inline instead, so use that. */
#if defined(_MSC_VER) && !defined(inline)
# define inline __inline
#endif

#if defined(_MSC_VER)
# define alwaysinline __forceinline
#else
# define alwaysinline __attribute__ ((always_inline))
#endif

/* common defaults */
Expand Down

0 comments on commit 7f6dc8f

Please sign in to comment.