diff options
| author | Remko Tronçon <git@el-tramo.be> | 2011-10-07 19:23:51 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2011-10-07 19:24:59 (GMT) |
| commit | 3fafb8bb9387d859bc187c23db6efac90c8683d4 (patch) | |
| tree | cd94ab5dd12e97f639951f5a6588bc560b50b09f | |
| parent | f17433cc4d1054dbae8002a1995e0b632e26124a (diff) | |
| download | swift-contrib-3fafb8bb9387d859bc187c23db6efac90c8683d4.zip swift-contrib-3fafb8bb9387d859bc187c23db6efac90c8683d4.tar.bz2 | |
Fixed CLang warnings.
| -rw-r--r-- | BuildTools/SCons/SConscript.boot | 2 | ||||
| -rw-r--r-- | Swift/Controllers/Roster/TableRoster.h | 2 | ||||
| -rw-r--r-- | Swiften/Parser/BOSHBodyExtractor.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot index 7148f6e..24a8b67 100644 --- a/BuildTools/SCons/SConscript.boot +++ b/BuildTools/SCons/SConscript.boot @@ -149,71 +149,71 @@ if env.get("universal", 0) : "-arch", "i386", "-arch", "ppc"]) if env.get("mac105", 0) : assert(env["PLATFORM"] == "darwin") env.Append(CCFLAGS = [ "-isysroot", "/Developer/SDKs/MacOSX10.5.sdk", "-arch", "i386"]) env.Append(LINKFLAGS = [ "-mmacosx-version-min=10.5", "-isysroot", "/Developer/SDKs/MacOSX10.5.sdk", "-arch", "i386"]) env.Append(FRAMEWORKS = ["Security"]) if not env["assertions"] : env.Append(CPPDEFINES = ["NDEBUG"]) if env["experimental"] : env.Append(CPPDEFINES = ["SWIFT_EXPERIMENTAL_FT"]) # If we build shared libs on AMD64, we need -fPIC. # This should have no performance impact om AMD64 if env["PLATFORM"] == "posix" and platform.machine() == "x86_64" : env.Append(CCFLAGS = ["-fPIC"]) # Warnings if env["PLATFORM"] == "win32" : # TODO: Find the ideal set of warnings #env.Append(CCFLAGS = ["/Wall"]) pass else : env.Append(CXXFLAGS = ["-Wextra", "-Wall", "-Wnon-virtual-dtor", "-Wundef", "-Wold-style-cast", "-Wno-long-long", "-Woverloaded-virtual", "-Wfloat-equal", "-Wredundant-decls"]) if not env.get("allow_warnings", False) : env.Append(CXXFLAGS = ["-Werror"]) gccVersion = env.get("CCVERSION", "0.0.0").split(".") - if gccVersion >= ["4", "5", "0"] : + if gccVersion >= ["4", "5", "0"] and not "clang" in env["CC"] : env.Append(CXXFLAGS = ["-Wlogical-op"]) if "clang" in env["CC"] : env.Append(CXXFLAGS = ["-W#warnings", "-Wc++0x-compat", "-Waddress-of-temporary", "-Wambiguous-member-template", "-Warray-bounds", "-Watomic-properties", "-Wbind-to-temporary-copy", "-Wbuiltin-macro-redefined", "-Wc++-compat", "-Wc++0x-extensions", "-Wcomments", "-Wconditional-uninitialized", "-Wconstant-logical-operand", "-Wdeclaration-after-statement", "-Wdeprecated", "-Wdeprecated-implementations", "-Wdeprecated-writable-strings", "-Wduplicate-method-arg", "-Wempty-body", "-Wendif-labels", "-Wenum-compare", "-Wformat=2", "-Wfour-char-constants", "-Wgnu", "-Wincomplete-implementation", "-Winvalid-noreturn", "-Winvalid-offsetof", "-Winvalid-token-paste", "-Wlocal-type-template-args", "-Wmethod-signatures", "-Wmicrosoft", "-Wmissing-declarations", "-Wnon-pod-varargs", "-Wnonfragile-abi2", "-Wnull-dereference", "-Wout-of-line-declaration", "-Woverlength-strings", "-Wpacked", "-Wpointer-arith", "-Wpointer-sign", "-Wprotocol", "-Wreadonly-setter-attrs", "-Wselector", "-Wshift-overflow", "-Wshift-sign-overflow", "-Wstrict-selector-match", "-Wsuper-class-method-mismatch", "-Wtautological-compare", "-Wtypedef-redefinition", "-Wundeclared-selector", "-Wunknown-warning-option", "-Wunnamed-type-template-args", "-Wunused-exception-parameter", "-Wunused-member-function", "-Wused-but-marked-unused", "-Wvariadic-macros"]) # To enable: # "-Wheader-hygiene" # "-Wnon-gcc", # "-Wweak-vtables", # "-Wlarge-by-value-copy", if env.get("coverage", 0) : assert(env["PLATFORM"] != "win32") env.Append(CCFLAGS = ["-fprofile-arcs", "-ftest-coverage"]) env.Append(LINKFLAGS = ["-fprofile-arcs", "-ftest-coverage"]) if env["PLATFORM"] == "win32" : env.Append(LIBS = ["user32", "crypt32", "dnsapi", "iphlpapi", "ws2_32", "wsock32", "Advapi32"]) env.Append(CCFLAGS = ["/EHsc", "/nologo"]) # FIXME: We should find a decent solution for MSVS 10 if int(env["MSVS_VERSION"].split(".")[0]) < 10 : env["LINKCOM"] = [env["LINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'] env["SHLINKCOM"] = [env["SHLINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2'] if env["PLATFORM"] == "darwin" and not env["target"] in ["iphone-device", "iphone-simulator", "xcode"] : env.Append(FRAMEWORKS = ["IOKit", "AppKit", "SystemConfiguration"]) # Testing env["TEST_TYPE"] = env["test"] if "check" in ARGUMENTS : env["TEST_TYPE"] = "unit" env["checker_report"] = ARGUMENTS.get("checker_report", False) env["TEST"] = (env["TEST_TYPE"] != "none") or env.GetOption("clean") if env.get("valgrind", 0) : env["TEST_RUNNER"] = "valgrind --suppressions=QA/valgrind.supp -q --leak-check=full --track-origins=yes " env["TEST_IGNORE_RESULT"] = "ignore_test_result" in ARGUMENTS env["TEST_CREATE_LIBRARIES"] = "create_test_libraries" in ARGUMENTS diff --git a/Swift/Controllers/Roster/TableRoster.h b/Swift/Controllers/Roster/TableRoster.h index 8ff16d0..d4612ed 100644 --- a/Swift/Controllers/Roster/TableRoster.h +++ b/Swift/Controllers/Roster/TableRoster.h @@ -34,50 +34,50 @@ namespace Swift { Index(size_t section = 0, size_t row = 0) : section(section), row(row) { } size_t section; size_t row; bool operator==(const Index& o) const { return o.section == section && o.row == row; } }; struct Update { std::vector<Index> updatedRows; std::vector<Index> insertedRows; std::vector<Index> deletedRows; std::vector<size_t> insertedSections; std::vector<size_t> deletedSections; }; TableRoster(Roster* model, TimerFactory* timerFactory, int updateDelay); ~TableRoster(); size_t getNumberOfSections() const; size_t getNumberOfRowsInSection(size_t section) const; const std::string& getSectionTitle(size_t); const Item& getItem(const Index&) const; boost::signal<void (const Update&)> onUpdate; private: void handleUpdateTimerTick(); void scheduleUpdate(); private: - friend class SectionNameEquals; + friend struct SectionNameEquals; struct Section { Section(const std::string& name) : name(name) { } std::string name; std::vector<Item> items; }; Roster* model; std::vector<Section> sections; bool updatePending; boost::shared_ptr<Timer> updateTimer; }; } diff --git a/Swiften/Parser/BOSHBodyExtractor.h b/Swiften/Parser/BOSHBodyExtractor.h index c263b1b..07203ae 100644 --- a/Swiften/Parser/BOSHBodyExtractor.h +++ b/Swiften/Parser/BOSHBodyExtractor.h @@ -1,34 +1,34 @@ /* * Copyright (c) 2011 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include <boost/optional.hpp> #include <Swiften/Base/ByteArray.h> #include <Swiften/Parser/XMLParserClient.h> namespace Swift { - struct XMLParserFactory; + class XMLParserFactory; class BOSHBodyExtractor { friend class BOSHBodyParserClient; public: struct BOSHBody { AttributeMap attributes; std::string content; }; BOSHBodyExtractor(XMLParserFactory* parserFactory, const ByteArray& data); const boost::optional<BOSHBody>& getBody() const { return body; } private: boost::optional<BOSHBody> body; }; } |
Swift