]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Improved source code portability.
authorBart Van Assche <bvanassche@acm.org>
Thu, 23 Jul 2009 07:11:27 +0000 (07:11 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 23 Jul 2009 07:11:27 +0000 (07:11 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10545

drd/drd_semaphore.c

index b29856e28b8214a1b98af763924ecc48ab164b8b..da3d867b3a500d7de8778fa126b56c224eacf252 100644 (file)
@@ -247,7 +247,7 @@ void DRD_(semaphore_pre_wait)(const Addr semaphore)
    tl_assert(p);
    p->waiters++;
 
-   if ((int)p->waiters <= 0)
+   if ((Word)(p->waiters) <= 0)
    {
       SemaphoreErrInfo sei = { DRD_(thread_get_running_tid)(), semaphore };
       VG_(maybe_record_error)(VG_(get_running_tid)(),
@@ -293,7 +293,7 @@ void DRD_(semaphore_post_wait)(const DrdThreadId tid, const Addr semaphore,
     * DRD_(semaphore_pre_wait)() has finished before
     * DRD_(semaphore_post_wait)() has been called.
     */
-   if (p == NULL || (int)p->value < 0 || (int)p->waiters < 0)
+   if (p == NULL || (Int)(p->value) < 0 || (Word)(p->waiters) < 0)
    {
       SemaphoreErrInfo sei = { DRD_(thread_get_running_tid)(), semaphore };
       VG_(maybe_record_error)(VG_(get_running_tid)(),