]> git.lizzy.rs Git - minetest.git/commitdiff
Fix some MSVC-specific warnings and add debug path as an MSVC directory
authorkwolekr <kwolekr@minetest.net>
Mon, 2 Feb 2015 07:01:13 +0000 (02:01 -0500)
committerkwolekr <kwolekr@minetest.net>
Mon, 2 Feb 2015 07:01:13 +0000 (02:01 -0500)
src/jthread/win32/jsemaphore.cpp [changed mode: 0755->0644]
src/mods.cpp
src/porting.cpp

old mode 100755 (executable)
new mode 100644 (file)
index 40623b1..27a11e8
@@ -81,9 +81,9 @@ typedef struct _SEMAPHORE_BASIC_INFORMATION {
 
 /* Note: this will only work as long as jthread is directly linked to application */
 /* it's gonna fail if someone tries to build jthread as dll */
-static _NtQuerySemaphore NtQuerySemaphore = 
+static _NtQuerySemaphore NtQuerySemaphore =
                (_NtQuerySemaphore)
-               GetProcAddress 
+               GetProcAddress
                (GetModuleHandle ("ntdll.dll"), "NtQuerySemaphore");
 
 int JSemaphore::GetValue() {
@@ -91,16 +91,14 @@ int JSemaphore::GetValue() {
        LONG retval;
 
        assert(NtQuerySemaphore);
-       
+
        retval = NtQuerySemaphore (m_hSemaphore, 0,
                &BasicInfo, sizeof (SEMAPHORE_BASIC_INFORMATION), NULL);
 
        if (retval == ERROR_SUCCESS)
-       {
                return BasicInfo.CurrentCount;
-       }
-       else {
-               assert("unable to read semaphore count" == 0);
-       }
+
+       assert("unable to read semaphore count" == 0);
+       return 0;
 }
 
index 7d6b4f5f7686f64389e7d2c49f216e3d9329afc2..6126de7a19d1b08b9edcd55ecd4255438cf4f021 100644 (file)
@@ -240,7 +240,7 @@ void ModConfiguration::addMods(std::vector<ModSpec> new_mods)
                for(std::vector<ModSpec>::const_iterator it = new_mods.begin();
                                it != new_mods.end(); ++it){
                        const ModSpec &mod = *it;
-                       if(mod.part_of_modpack != want_from_modpack)
+                       if(mod.part_of_modpack != (bool)want_from_modpack)
                                continue;
                        if(existing_mods.count(mod.name) == 0){
                                // GOOD CASE: completely new mod.
index 584d2e2a2924c54a10ca67310395b53a84c42525..e99d084261804964bb5c967257c7c77bfd7cb155 100644 (file)
@@ -290,7 +290,11 @@ void pathRemoveFile(char *path, char delim)
 bool detectMSVCBuildDir(char *c_path)
 {
        std::string path(c_path);
-       const char *ends[] = {"bin\\Release", "bin\\Build", NULL};
+       const char *ends[] = {
+               "bin\\Release",
+               "bin\\Debug",
+               "bin\\Build",
+               NULL};
        return (removeStringEnd(path, ends) != "");
 }