about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-10-24 18:24:50 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-10-24 18:24:50 +0200
commit92f2a44b28d21b7c64358b7d2883fb4793508a73 (patch)
treede47461ac686464b3c1f28df56f444bbcf78880e /src/libtools
parent7585a984b2db86bf0d55112a8ecc878f1f1384be (diff)
downloadbox64-92f2a44b28d21b7c64358b7d2883fb4793508a73.tar.gz
box64-92f2a44b28d21b7c64358b7d2883fb4793508a73.zip
Small fixes with unaligned pthread_cond_t
Diffstat (limited to 'src/libtools')
-rwxr-xr-xsrc/libtools/threads.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index 6ca79091..e09f5085 100755
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -704,7 +704,7 @@ pthread_cond_t* alignCond(pthread_cond_t* pc)
 {
 #ifndef NOALIGN
 	if((uintptr_t)pc&7)
-		return (pthread_cond_t*)(((uintptr_t)pc+7)&~7);
+		return (pthread_cond_t*)(((uintptr_t)pc+7)&~7LL);
 #endif
 	return pc;
 }
@@ -1172,8 +1172,8 @@ EXPORT int my_pthread_cond_init(x64emu_t* emu, pthread_cond_t *pc, my_condattr_t
 		// cond is not allign, re-align it on the fly
 		pthread_cond_t newc;
 		ret = pthread_cond_init(&newc, c?(&cond.nat):NULL);
-		memcpy((void*)(((uintptr_t)pc+7)&~7), &newc, sizeof(pthread_cond_t)-((uintptr_t)pc&7));
-	}
+		memcpy((void*)(((uintptr_t)pc+7)&~7LL), &newc, sizeof(pthread_cond_t)-((uintptr_t)pc&7));
+	} else
 	#endif
 	ret = pthread_cond_init(pc, c?(&cond.nat):NULL);
 	if(c)