Fix (hopefully) library dependency resolution.

Installing libs is now enabled, hardcoded.
Enable -Wall for all builds.
Fix many warnings and latent bugs.
This commit is contained in:
Petr Mrázek
2013-12-01 16:34:51 +01:00
parent a3fbf05c7b
commit f56eff04ef
29 changed files with 246 additions and 262 deletions

View File

@ -79,7 +79,6 @@ void band::readData(int expectedLength)
// Read one value to see what it might be.
int XB = _meta_default;
int cp1 = 0, cp2 = 0;
if (!is_BYTE1)
{
// must be a variable-length coding
@ -109,7 +108,6 @@ void band::readData(int expectedLength)
{
// Skip over the escape value.
u->rp = xvs.rp;
cp1 = 1;
}
else
{

View File

@ -87,7 +87,7 @@ struct bytes
bytes res;
res.ptr = ptr + beg;
res.len = end - beg;
assert(res.len == 0 || inBounds(res.ptr) && inBounds(res.limit() - 1));
assert(res.len == 0 ||(inBounds(res.ptr) && inBounds(res.limit() - 1)));
return res;
}
// building C strings inside byte buffers:

View File

@ -121,7 +121,6 @@ coding *coding::init()
this->min = this->umin = 0;
if (S != 0 && range != 0)
{
int Smask = (1 << S) - 1;
int64_t maxPosCode = range - 1;
int64_t maxNegCode = range - 1;
while (IS_NEG_CODE(S, maxPosCode))

View File

@ -483,10 +483,6 @@ void unpacker::putu1ref(entry *e)
putu1_at(put_space(1), oidx);
}
static int total_cp_size[] = {0, 0};
static int largest_cp_ref[] = {0, 0};
static int hash_probes[] = {0, 0};
// Allocation of small and large blocks.
enum
@ -705,7 +701,7 @@ void unpacker::read_file_header()
unpack_abort("impossible archive size"); // bad input data
return;
}
if (archive_size < header_size_1)
if (archive_size < (size_t)header_size_1)
{
unpack_abort("too much read-ahead"); // somehow we pre-fetched too much?
return;
@ -1316,8 +1312,6 @@ void unpacker::read_signature_values(entry *cpMap, int len)
// Cf. PackageReader.readConstantPool
void unpacker::read_cp()
{
byte *rp0 = rp;
int i;
for (int k = 0; k < (int)N_TAGS_IN_ORDER; k++)
@ -1596,7 +1590,6 @@ band **unpacker::attr_definitions::buildBands(unpacker::layout_definition *lo)
const char *unpacker::attr_definitions::parseIntLayout(const char *lp, band *&res, byte le_kind,
bool can_be_signed)
{
const char *lp0 = lp;
band *b = U_NEW(band, 1);
char le = *lp++;
int spec = UNSIGNED5_spec;
@ -1638,7 +1631,6 @@ const char *unpacker::attr_definitions::parseIntLayout(const char *lp, band *&re
const char *unpacker::attr_definitions::parseNumeral(const char *lp, int &res)
{
const char *lp0 = lp;
bool sgn = false;
if (*lp == '0')
{
@ -1703,7 +1695,6 @@ band **unpacker::attr_definitions::popBody(int bs_base)
const char *unpacker::attr_definitions::parseLayout(const char *lp, band **&res, int curCble)
{
const char *lp0 = lp;
int bs_base = band_stack.length();
bool top_level = (bs_base == 0);
band *b;
@ -3135,8 +3126,6 @@ unpacker::read_bcs()
void unpacker::read_bands()
{
byte *rp0 = rp;
read_file_header();
if (cp.nentries == 0)
@ -3312,7 +3301,7 @@ void constant_pool::initMemberIndexes()
// Get the pre-existing indexes:
int nclasses = tag_count[CONSTANT_Class];
entry *classes = tag_base[CONSTANT_Class] + entries;
// entry *classes = tag_base[CONSTANT_Class] + entries; // UNUSED
int nfields = tag_count[CONSTANT_Fieldref];
entry *fields = tag_base[CONSTANT_Fieldref] + entries;
int nmethods = tag_count[CONSTANT_Methodref];
@ -3563,8 +3552,6 @@ void unpacker::start(void *packptr, size_t len)
void unpacker::check_options()
{
const char *strue = "true";
const char *sfalse = "false";
if (deflate_hint_or_zero != 0)
{
bool force_deflate_hint = (deflate_hint_or_zero > 0);

View File

@ -97,8 +97,6 @@ static int read_magic(unpacker *u, char peek[], int peeklen)
void unpack_200(std::string input_path, std::string output_path)
{
unpacker u;
int status = 0;
FILE *input = fopen(input_path.c_str(), "rb");
if (!input)
{