Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid compiler warnings when using g++-6 #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/fc/rpc/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace fc { namespace rpc {
struct request
{
std::string jsonrpc = "2.0";
std::string jsonrpc;
optional<uint64_t> id;
std::string method;
variants params;
Expand Down
23 changes: 17 additions & 6 deletions src/compress/miniz.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
{
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
for ( i = 0; i <= 143; ++i) *p++ = 8;
for ( ; i <= 255; ++i) *p++ = 9;
for ( ; i <= 279; ++i) *p++ = 7;
for ( ; i <= 287; ++i) *p++ = 8;
}
else
{
Expand Down Expand Up @@ -2264,24 +2267,31 @@ static int tdefl_flush_block(tdefl_compressor *d, int flush)
#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16*)(p)
static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len)
{
mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len;
mz_uint dist = 0, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len;
mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
const mz_uint16 *s = (const mz_uint16*)(d->m_dict + pos), *p, *q;
mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD(s);
mz_uint8 *c01_src = &d->m_dict[pos + match_len - 1];
mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(c01_src), s01 = TDEFL_READ_UNALIGNED_WORD(s);
MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return;
for ( ; ; )
{
for ( ; ; )
{
if (--num_probes_left == 0) return;
#define TDEFL_PROBE \
{ \
next_probe_pos = d->m_next[probe_pos]; \
if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \
probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break;
mz_uint8 *c01_check = &d->m_dict[probe_pos + match_len - 1]; \
if (TDEFL_READ_UNALIGNED_WORD(c01_check) == c01) break; \
}
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
}
if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32;
if (!dist) break;
q = (const mz_uint16*)(d->m_dict + probe_pos);
if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue;
p = s; probe_len = 32;
do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
(TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) );
if (!probe_len)
Expand All @@ -2291,7 +2301,8 @@ static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahe
else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8*)p == *(const mz_uint8*)q)) > match_len)
{
*pMatch_dist = dist; if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len) break;
c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]);
mz_uint8 *c01_check = &d->m_dict[probe_pos + match_len - 1];
c01 = TDEFL_READ_UNALIGNED_WORD(c01_check);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/rpc/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ char* my_generator(const char* text, int state)
}


#ifdef __GNUC__
static char** cli_completion( const char * text , int start, int end) __attribute__ ((unused));
#endif

static char** cli_completion( const char * text , int start, int end)
{
char **matches;
Expand Down
5 changes: 4 additions & 1 deletion src/thread/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#include <boost/version.hpp>

#define BOOST_COROUTINES_NO_DEPRECATION_WARNING // Boost 1.61
#define BOOST_COROUTINE_NO_DEPRECATION_WARNING // Boost 1.62

#if BOOST_VERSION >= 105400
# include <boost/coroutine/stack_context.hpp>
namespace bc = boost::context;
Expand Down Expand Up @@ -97,7 +100,7 @@ namespace fc {
}

context( fc::thread* t) :
#if BOOST_VERSION >= 105600 && BOOST_VERSION <= 106100
#if BOOST_VERSION >= 105600
my_context(nullptr),
#elif BOOST_VERSION >= 105300
my_context(new bc::fcontext_t),
Expand Down