diff --git a/Source/CLI/CLI.cpp b/Source/CLI/CLI.cpp index c879eea6..9ed451c4 100644 --- a/Source/CLI/CLI.cpp +++ b/Source/CLI/CLI.cpp @@ -124,7 +124,7 @@ void __stdcall Event_CallBackFunction(unsigned char* Data_Content, size_t Data_S //-------------------------------------------------------------------------- CLI::CLI() : watch_folder_user(NULL), use_as_user(-1), use_daemon(false), asynchronous(false), - force_analyze(false), full_report(false), no_database(false), include_hidden_files(false), mil_analyze(true), + force_analyze(false), no_database(false), full_report(false), include_hidden_files(false), mil_analyze(true), watch_folder_recursive(true), create_policy_mode(false), file_information(false), plugins_list_mode(false), list_watch_folders_mode(false), no_needs_files_mode(false), list_mode(false), fixer(false) diff --git a/Source/Checker/Checker.cpp b/Source/Checker/Checker.cpp index 4e2be86b..722c23f8 100644 --- a/Source/Checker/Checker.cpp +++ b/Source/Checker/Checker.cpp @@ -118,7 +118,7 @@ int tfsxml_hasvalue(tfsxml_string* priv) } //--------------------------------------------------------------------------- -std::string tokenize(const std::string& scope, const std::string& list, const std::string& delimiter) +std::string tokenize(const std::string& scope, const std::string& list, const char delimiter) { std::stringstream ss; @@ -126,7 +126,7 @@ std::string tokenize(const std::string& scope, const std::string& list, const st if (scope.empty() || scope=="mi") { std::istringstream iss(list); - for (std::string token; std::getline(iss, token, '/');) + for (std::string token; std::getline(iss, token, delimiter);) ss << "/mi:" << token; } @@ -280,7 +280,7 @@ std::string PolicyChecker::PolicyElement::to_string(size_t level, bool verbose) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -PolicyChecker::RuleElement::RuleElement() : resolved(false), pass(false), tracks(0), source(NULL) +PolicyChecker::RuleElement::RuleElement() : source(NULL), tracks(0), resolved(false), pass(false) { } @@ -624,7 +624,7 @@ PolicyChecker::RuleElement* PolicyChecker::parse_rule(tfsxml_string& tfsxml_priv << rule->source->tracktype << "'][" << ((rule->source->occurrence.empty() || rule->source->occurrence=="all" || rule->source->occurrence=="any") ? "*" : rule->source->occurrence) << "]" - << tokenize(rule->source->scope, rule->source->field, "/"); + << tokenize(rule->source->scope, rule->source->field, '/'); rule->source->path=parse_path(ss.str()); } break; @@ -650,7 +650,7 @@ PolicyChecker::RuleElement* PolicyChecker::parse_rule(tfsxml_string& tfsxml_priv << rule->tracktype << "'][" << ((rule->occurrence.empty() || rule->occurrence=="all" || rule->occurrence=="any") ? "*" : rule->occurrence) - << "]" << tokenize(rule->scope, rule->field, "/"); + << "]" << tokenize(rule->scope, rule->field, '/'); rule->xpath=ss.str(); rule->path=parse_path(rule->xpath); } diff --git a/Source/Checker/Checker.h b/Source/Checker/Checker.h index ce2aeee2..29f18ba3 100644 --- a/Source/Checker/Checker.h +++ b/Source/Checker/Checker.h @@ -47,14 +47,14 @@ class PolicyChecker class Element { public: - typedef enum Level { + enum Level { LEVEL_NONE = 0, LEVEL_INFO, LEVEL_WARN, LEVEL_FAIL, }; - typedef enum Result { + enum Result { RESULT_PASS = 0, RESULT_INFO, RESULT_WARN, diff --git a/Source/Checker/Path.cpp b/Source/Checker/Path.cpp index aeec50e4..208f0ab4 100644 --- a/Source/Checker/Path.cpp +++ b/Source/Checker/Path.cpp @@ -113,7 +113,6 @@ std::vector parse_path(const std::string& xpath) bool path_is_matching(tfsxml_string& tfsxml_priv, tfsxml_string& node, PathElement path, size_t& occurrence) { tfsxml_string tfsxml_priv_local = tfsxml_priv; - tfsxml_string value; // compare names if (tfsxml_strcmp_charp(node, path.name.c_str())) diff --git a/Source/Common/Core.cpp b/Source/Common/Core.cpp index 950e3779..3b3977b7 100644 --- a/Source/Common/Core.cpp +++ b/Source/Common/Core.cpp @@ -506,7 +506,7 @@ long Core::checker_analyze(int user, const std::string& filename, long src_id, s } //-------------------------------------------------------------------------- -int Core::checker_list_mediainfo_outputs(std::string& output, std::string& err) +int Core::checker_list_mediainfo_outputs(std::string& output, std::string&) { output = Ztring(MI->Option(__T("Info_OutputFormats_JSON"))).To_UTF8(); @@ -980,7 +980,7 @@ int Core::transform_mixml_report(const std::string& mi_xml, const std::string& m } tmpMI->Open_Buffer_Init(BufferSize); - tmpMI->Open_Buffer_Continue((ZenLib::int8u*)mi_xml.data(), BufferSize); + tmpMI->Open_Buffer_Continue((const ZenLib::int8u*)mi_xml.data(), BufferSize); tmpMI->Open_Buffer_Finalize(); report = Ztring(tmpMI->Inform()).To_UTF8(); @@ -1697,10 +1697,10 @@ unsigned long long Core::mil_version() build = strtol(version, &end, 10); } - return ((unsigned long long )major << 52) & 0xFFF0000000000000 | - ((unsigned long long )minor << 40) & 0x000FFF0000000000 | - ((unsigned long long )patch << 32) & 0x000000FF00000000 | - ((unsigned long long )build) & 0x00000000FFFFFFFF; + return (((unsigned long long )major << 52) & 0xFFF0000000000000) | + (((unsigned long long )minor << 40) & 0x000FFF0000000000) | + (((unsigned long long )patch << 32) & 0x000000FF00000000) | + (((unsigned long long )build) & 0x00000000FFFFFFFF); } //-------------------------------------------------------------------------- diff --git a/Source/Common/Policy.cpp b/Source/Common/Policy.cpp index c17400da..3a14079e 100644 --- a/Source/Common/Policy.cpp +++ b/Source/Common/Policy.cpp @@ -95,7 +95,6 @@ int Policy::import_schema(const std::string& filename, const std::string& save_n int ret = import_schema_from_doc(doc, save_name); xmlFreeDoc(doc); - xmlCleanupCharEncodingHandlers(); xmlSetGenericErrorFunc(NULL, NULL); return ret; } diff --git a/Source/Common/Scheduler.cpp b/Source/Common/Scheduler.cpp index 11789a65..6a557fe0 100644 --- a/Source/Common/Scheduler.cpp +++ b/Source/Common/Scheduler.cpp @@ -42,7 +42,7 @@ namespace MediaConch { //*************************************************************************** //--------------------------------------------------------------------------- - Scheduler::Scheduler(Core* c) : core(c), max_threads_modified(false), max_threads(1) + Scheduler::Scheduler(Core* c) : core(c), max_threads(1), max_threads_modified(false) { queue = new Queue(this); } diff --git a/Source/Common/Scheduler.h b/Source/Common/Scheduler.h index 34d093e9..28aae2b9 100644 --- a/Source/Common/Scheduler.h +++ b/Source/Common/Scheduler.h @@ -72,7 +72,7 @@ class Scheduler void write_log_timestamp(int level, std::string log); void log_cb(struct MediaInfo_Event_Log_0 *Event); - void set_default_max_threads(size_t nb) {} // { if (max_threads_modified) return; max_threads = nb; } //TODO: check issues with the GUI when there are tons of files + void set_default_max_threads(size_t /* nb */) {} // { if (max_threads_modified) return; max_threads = nb; } //TODO: check issues with the GUI when there are tons of files void set_max_threads(size_t nb) { max_threads_modified = true; max_threads = nb; } private: diff --git a/Source/Common/Xslt.cpp b/Source/Common/Xslt.cpp index 82d9f7d3..b8f506af 100644 --- a/Source/Common/Xslt.cpp +++ b/Source/Common/Xslt.cpp @@ -74,7 +74,6 @@ bool Xslt::register_schema_from_doc(void* data) return false; xsltSetGenericErrorFunc(this, &manage_generic_error); - xmlLoadExtDtdDefaultValue = 1; if (xslt_ctx) { @@ -100,7 +99,6 @@ bool Xslt::register_schema_from_doc(void* data) //--------------------------------------------------------------------------- bool Xslt::register_schema_from_memory(const std::string& schem) { - xmlLoadExtDtdDefaultValue = 1; xmlSetGenericErrorFunc(this, &manage_generic_error); int doc_flags = XML_PARSE_COMPACT | XML_PARSE_DTDLOAD; @@ -135,10 +133,7 @@ int Xslt::validate_xml(const std::string& xml, bool) if (!xslt_ctx) return -1; - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - - int doc_flags = XML_PARSE_COMPACT | XML_PARSE_DTDLOAD; + int doc_flags = XML_PARSE_COMPACT | XML_PARSE_DTDLOAD | XML_PARSE_NOENT; xmlSetGenericErrorFunc(this, &manage_generic_error); #ifdef XML_PARSE_BIG_LINES diff --git a/Source/IMSC1/IMSC1Plugin.cpp b/Source/IMSC1/IMSC1Plugin.cpp index f9b4fd4e..f7595047 100644 --- a/Source/IMSC1/IMSC1Plugin.cpp +++ b/Source/IMSC1/IMSC1Plugin.cpp @@ -81,7 +81,7 @@ namespace MediaConch { } //--------------------------------------------------------------------------- - int IMSC1Plugin::create_report(std::string& report, const std::string& filename, bool result, const std::string& message, std::string& error) + int IMSC1Plugin::create_report(std::string& report, const std::string& filename, bool result, const std::string& message, std::string&) { xmlDocPtr doc = xmlNewDoc((const xmlChar *)"1.0"); @@ -348,7 +348,7 @@ namespace MediaConch { } //--------------------------------------------------------------------------- - void IMSC1Plugin::xml_error_discard(void* user_data, const char* format, ...) + void IMSC1Plugin::xml_error_discard(void*, const char*, ...) { } }