aboutsummaryrefslogtreecommitdiff
path: root/src/jthread/win32
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-02-02 02:01:13 -0500
committerkwolekr <kwolekr@minetest.net>2015-02-02 02:01:13 -0500
commit0118c111e8f12602b03cee8deb4c86f9b9e28cf3 (patch)
treee159f2199eb6af32e6beb7c62ce7c9001147ff27 /src/jthread/win32
parent43f102271dd3dc64b167ee305be5061976bd41d6 (diff)
downloadminetest-0118c111e8f12602b03cee8deb4c86f9b9e28cf3.tar.gz
minetest-0118c111e8f12602b03cee8deb4c86f9b9e28cf3.tar.bz2
minetest-0118c111e8f12602b03cee8deb4c86f9b9e28cf3.zip
Fix some MSVC-specific warnings and add debug path as an MSVC directory
Diffstat (limited to 'src/jthread/win32')
-rw-r--r--[-rwxr-xr-x]src/jthread/win32/jsemaphore.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/jthread/win32/jsemaphore.cpp b/src/jthread/win32/jsemaphore.cpp
index 40623b13d..27a11e819 100755..100644
--- a/src/jthread/win32/jsemaphore.cpp
+++ b/src/jthread/win32/jsemaphore.cpp
@@ -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;
}