Noise: Prevent unittest crash caused by division by zero
[oweals/minetest.git] / src / mods.cpp
index 0e583b2db59ca71b2e3837bec627af933da8d092..7e2d83944407c78a8cef5781a1cb60f5fb3f9754 100644 (file)
@@ -144,7 +144,8 @@ void ModConfiguration::printUnsatisfiedModsError() const
                it != m_unsatisfied_mods.end(); ++it) {
                ModSpec mod = *it;
                errorstream << "mod \"" << mod.name << "\" has unsatisfied dependencies: ";
-               for (UNORDERED_SET<std::string>::iterator dep_it = mod.unsatisfied_depends.begin();
+               for (std::unordered_set<std::string>::iterator dep_it =
+                       mod.unsatisfied_depends.begin();
                        dep_it != mod.unsatisfied_depends.end(); ++dep_it)
                        errorstream << " \"" << *dep_it << "\"";
                errorstream << std::endl;
@@ -268,8 +269,8 @@ void ModConfiguration::checkConflictsAndDeps()
        // report on name conflicts
        if (!m_name_conflicts.empty()) {
                std::string s = "Unresolved name conflicts for mods ";
-               for (UNORDERED_SET<std::string>::const_iterator it = m_name_conflicts.begin();
-                       it != m_name_conflicts.end(); ++it) {
+               for (std::unordered_set<std::string>::const_iterator it =
+                       m_name_conflicts.begin(); it != m_name_conflicts.end(); ++it) {
                        if (it != m_name_conflicts.begin()) s += ", ";
                        s += std::string("\"") + (*it) + "\"";
                }
@@ -299,7 +300,7 @@ void ModConfiguration::resolveDependencies()
                ModSpec mod = *it;
                mod.unsatisfied_depends = mod.depends;
                // check which optional dependencies actually exist
-               for (UNORDERED_SET<std::string>::iterator it_optdep = mod.optdepends.begin();
+               for (std::unordered_set<std::string>::iterator it_optdep = mod.optdepends.begin();
                                it_optdep != mod.optdepends.end(); ++it_optdep) {
                        std::string optdep = *it_optdep;
                        if (modnames.count(optdep) != 0)
@@ -364,30 +365,9 @@ ClientModConfiguration::ClientModConfiguration(const std::string &path):
 }
 #endif
 
-#if USE_CURL
-Json::Value getModstoreUrl(const std::string &url)
-{
-       std::vector<std::string> extra_headers;
-
-       bool special_http_header = true;
-
-       try {
-               special_http_header = g_settings->getBool("modstore_disable_special_http_header");
-       } catch (SettingNotFoundException) {}
-
-       if (special_http_header) {
-               extra_headers.push_back("Accept: application/vnd.minetest.mmdb-v1+json");
-       }
-       return fetchJsonValue(url, special_http_header ? &extra_headers : NULL);
-}
-
-#endif
-
 ModMetadata::ModMetadata(const std::string &mod_name):
-       m_mod_name(mod_name),
-       m_modified(false)
+       m_mod_name(mod_name)
 {
-       m_stringvars.clear();
 }
 
 void ModMetadata::clear()