Skip to content
Merged
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 Source/CLI/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions Source/Checker/Checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ 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;

//TODO: mmt
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;
}

Expand Down Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Checker/Checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion Source/Checker/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ std::vector<PathElement> 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()))
Expand Down
12 changes: 6 additions & 6 deletions Source/Common/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

//--------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion Source/Common/Policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Common/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Common/Scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions Source/Common/Xslt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ bool Xslt::register_schema_from_doc(void* data)
return false;

xsltSetGenericErrorFunc(this, &manage_generic_error);
xmlLoadExtDtdDefaultValue = 1;

if (xslt_ctx)
{
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/IMSC1/IMSC1Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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*, ...)
{
}
}
Expand Down