From f56eff04ef4d23b62a6e095eca5d4b9f2b52e023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 1 Dec 2013 16:34:51 +0100 Subject: Fix (hopefully) library dependency resolution. Installing libs is now enabled, hardcoded. Enable -Wall for all builds. Fix many warnings and latent bugs. --- depends/groupview/src/categorizedview.cpp | 29 ++++------------------------- depends/groupview/src/categorizedview_p.h | 17 +++++++++-------- depends/groupview/src/categorydrawer.cpp | 2 +- depends/pack200/src/bands.cpp | 2 -- depends/pack200/src/bytes.h | 2 +- depends/pack200/src/coding.cpp | 1 - depends/pack200/src/unpack.cpp | 17 ++--------------- depends/pack200/src/unpack200.cpp | 2 -- depends/quazip/unzip.c | 2 +- depends/quazip/zip.c | 2 +- depends/settings/include/keyring.h | 5 +++++ depends/settings/src/stubkeyring.h | 5 +++++ 12 files changed, 29 insertions(+), 57 deletions(-) (limited to 'depends') diff --git a/depends/groupview/src/categorizedview.cpp b/depends/groupview/src/categorizedview.cpp index f4449949..1345205c 100644 --- a/depends/groupview/src/categorizedview.cpp +++ b/depends/groupview/src/categorizedview.cpp @@ -58,18 +58,6 @@ struct KCategorizedView::Private::Item struct KCategorizedView::Private::Block { - Block() - : topLeft ( QPoint() ) - , height ( -1 ) - , firstIndex ( QModelIndex() ) - , quarantineStart ( QModelIndex() ) - , items ( QList() ) - , outOfQuarantine ( false ) - , alternate ( false ) - , collapsed ( false ) - { - } - bool operator!= ( const Block &rhs ) const { return firstIndex != rhs.firstIndex; @@ -83,7 +71,7 @@ struct KCategorizedView::Private::Block } QPoint topLeft; - int height; + int height = -1; QPersistentModelIndex firstIndex; // if we have n elements on this block, and we inserted an element at position i. The quarantine // will start at index (i, column, parent). This means that for all elements j where i <= j <= n, the @@ -97,25 +85,16 @@ struct KCategorizedView::Private::Block // this affects the whole block, not items separately. items contain the topLeft point relative // to the block. Because of insertions or removals a whole block can be moved, so the whole block // will enter in quarantine, what is faster than moving all items in absolute terms. - bool outOfQuarantine; + bool outOfQuarantine = false; // should we alternate its color ? is just a hint, could not be used - bool alternate; - bool collapsed; + bool alternate = false; + bool collapsed = false; }; KCategorizedView::Private::Private ( KCategorizedView *q ) : q ( q ) - , proxyModel ( 0 ) - , categoryDrawer ( 0 ) - , categorySpacing ( 5 ) - , alternatingBlockColors ( false ) - , collapsibleBlocks ( false ) , hoveredBlock ( new Block() ) - , hoveredIndex ( QModelIndex() ) - , pressedPosition ( QPoint() ) - , rubberBandRect ( QRect() ) - , constantItemWidth( 0 ) { } diff --git a/depends/groupview/src/categorizedview_p.h b/depends/groupview/src/categorizedview_p.h index 13809312..524bba3a 100644 --- a/depends/groupview/src/categorizedview_p.h +++ b/depends/groupview/src/categorizedview_p.h @@ -137,14 +137,15 @@ public: */ void _k_slotCollapseOrExpandClicked(QModelIndex); - KCategorizedView *q; - KCategorizedSortFilterProxyModel *proxyModel; - KCategoryDrawer *categoryDrawer; - int categorySpacing; - bool alternatingBlockColors; - bool collapsibleBlocks; - bool constantItemWidth; - + KCategorizedView *q = nullptr; + KCategorizedSortFilterProxyModel *proxyModel = nullptr; + KCategoryDrawer *categoryDrawer = nullptr; + int categorySpacing = 5; + bool alternatingBlockColors = false; + bool collapsibleBlocks = false; + bool constantItemWidth = false; + + // FIXME: this is some really weird logic. Investigate. Block *hoveredBlock; QString hoveredCategory; QModelIndex hoveredIndex; diff --git a/depends/groupview/src/categorydrawer.cpp b/depends/groupview/src/categorydrawer.cpp index 04903206..214ce3b2 100644 --- a/depends/groupview/src/categorydrawer.cpp +++ b/depends/groupview/src/categorydrawer.cpp @@ -42,9 +42,9 @@ public: ~Private() { } + KCategorizedView *view; int leftMargin; int rightMargin; - KCategorizedView *view; }; KCategoryDrawer::KCategoryDrawer(KCategorizedView *view) diff --git a/depends/pack200/src/bands.cpp b/depends/pack200/src/bands.cpp index 1c10b35b..1608d838 100644 --- a/depends/pack200/src/bands.cpp +++ b/depends/pack200/src/bands.cpp @@ -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 { diff --git a/depends/pack200/src/bytes.h b/depends/pack200/src/bytes.h index 2e4a9daf..6ed0b729 100644 --- a/depends/pack200/src/bytes.h +++ b/depends/pack200/src/bytes.h @@ -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: diff --git a/depends/pack200/src/coding.cpp b/depends/pack200/src/coding.cpp index 226ba458..3e311131 100644 --- a/depends/pack200/src/coding.cpp +++ b/depends/pack200/src/coding.cpp @@ -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)) diff --git a/depends/pack200/src/unpack.cpp b/depends/pack200/src/unpack.cpp index b286269d..55d253b2 100644 --- a/depends/pack200/src/unpack.cpp +++ b/depends/pack200/src/unpack.cpp @@ -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); diff --git a/depends/pack200/src/unpack200.cpp b/depends/pack200/src/unpack200.cpp index 2ff8c34a..0a9d2714 100644 --- a/depends/pack200/src/unpack200.cpp +++ b/depends/pack200/src/unpack200.cpp @@ -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) { diff --git a/depends/quazip/unzip.c b/depends/quazip/unzip.c index 6e115ae6..52bc081f 100644 --- a/depends/quazip/unzip.c +++ b/depends/quazip/unzip.c @@ -1173,7 +1173,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) if (password != NULL) { int i; - s->pcrc_32_tab = get_crc_table(); + s->pcrc_32_tab = (const unsigned long*) get_crc_table(); init_keys(password,s->keys,s->pcrc_32_tab); if (ZSEEK(s->z_filefunc, s->filestream, s->pfile_in_zip_read->pos_in_zipfile + diff --git a/depends/quazip/zip.c b/depends/quazip/zip.c index bf8c0a10..a36a20a1 100644 --- a/depends/quazip/zip.c +++ b/depends/quazip/zip.c @@ -903,7 +903,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, unsigned char bufHead[RAND_HEAD_LEN]; unsigned int sizeHead; zi->ci.encrypt = 1; - zi->ci.pcrc_32_tab = get_crc_table(); + zi->ci.pcrc_32_tab = (const unsigned long*) get_crc_table(); /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ crcForCrypting = (uLong)zi->ci.dosDate << 16; // ATTANTION! Without this row, you don't unpack your password protected archive in other app. diff --git a/depends/settings/include/keyring.h b/depends/settings/include/keyring.h index 747211de..a4da23b1 100644 --- a/depends/settings/include/keyring.h +++ b/depends/settings/include/keyring.h @@ -33,6 +33,11 @@ class LIBSETTINGS_EXPORT Keyring { public: + /** + * @brief virtual dtor + */ + virtual ~Keyring() {}; + /** * @brief the System Keyring instance * @return the Keyring instance diff --git a/depends/settings/src/stubkeyring.h b/depends/settings/src/stubkeyring.h index f25cefde..1f4b1be0 100644 --- a/depends/settings/src/stubkeyring.h +++ b/depends/settings/src/stubkeyring.h @@ -24,6 +24,11 @@ class StubKeyring : public Keyring { public: + /** + * @brief virtual dtor + */ + virtual ~StubKeyring() {}; + virtual bool storePassword(QString service, QString username, QString password); virtual QString getPassword(QString service, QString username); virtual bool hasPassword(QString service, QString username); -- cgit v1.2.3