[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1b1-130-g7288ffe

mysql vizuser noreply at mpich.org
Tue Oct 29 14:35:15 CDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  7288ffe050337c7c2389f0270f671b98673dc350 (commit)
      from  4bb837e86e260c85f0a3b5f93e0c609e582b4c9d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/7288ffe050337c7c2389f0270f671b98673dc350

commit 7288ffe050337c7c2389f0270f671b98673dc350
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Tue Oct 29 11:15:19 2013 -0500

    Fix a problem in passing thread id to a function
    
    The old code used (void*)(intptr_t)i to pass the thread id i.
    However intptr_t is C99, so I changed it to (void*)(long)i.
    
    Direct usage of (void*)i will issue a compilation warning
    saying it is dangerous to convert integer to pointer.
    
    Fixes #1956
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/test/mpi/threads/mpi_t/mpit_threading.c b/test/mpi/threads/mpi_t/mpit_threading.c
index 9c08261..09998f7 100644
--- a/test/mpi/threads/mpi_t/mpit_threading.c
+++ b/test/mpi/threads/mpi_t/mpit_threading.c
@@ -42,7 +42,7 @@ int PrintCategories(FILE * fp, int myThreadId);
 
 MTEST_THREAD_RETURN_TYPE RunTest(void *p)
 {
-    int myThreadId = (int)((intptr_t)p);
+    int myThreadId = (int)(long)p;
 
     PrintControlVars(stdout, myThreadId);
     if (DOPRINT)
@@ -79,8 +79,7 @@ int main(int argc, char *argv[])
 
     /* Spawn threads */
     for (i = 0; i < NTHREADS; i++) {
-        intptr_t tid = (intptr_t)i;
-        MTest_Start_thread(RunTest, (void *)tid);
+        MTest_Start_thread(RunTest, (void *)(long)i);
     }
 
     MTest_Join_threads();

-----------------------------------------------------------------------

Summary of changes:
 test/mpi/threads/mpi_t/mpit_threading.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list