From 7f72947bf91d5ff1a0032894fa3f0df3097b5eef Mon Sep 17 00:00:00 2001 From: Gengbin Zheng Date: Sun, 11 Aug 2013 16:17:47 -0500 Subject: [PATCH] Commit by Nikhil from Windows: fixing compiler matching trouble on windows --- src/arch/net/charmrun/charmrun.C | 4 ++-- src/util/partitioning_strategies.C | 12 ++++++------ src/util/partitioning_strategies.h | 2 +- src/util/sockRoutines.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/arch/net/charmrun/charmrun.C b/src/arch/net/charmrun/charmrun.C index 8eb7e23cbe..a96b913e72 100644 --- a/src/arch/net/charmrun/charmrun.C +++ b/src/arch/net/charmrun/charmrun.C @@ -123,8 +123,8 @@ const char *mylogin(void) { #if defined(_WIN32) && !defined(__CYGWIN__) static char name[100]={'d','u','n','n','o',0}; - int len=100; - GetUserName(name,&len); + unsigned int len=100; + GetUserName(name,(LPDWORD)&len); return name; #else /*UNIX*/ struct passwd *self; diff --git a/src/util/partitioning_strategies.C b/src/util/partitioning_strategies.C index 14d9b5c118..9773e202ff 100644 --- a/src/util/partitioning_strategies.C +++ b/src/util/partitioning_strategies.C @@ -40,11 +40,11 @@ static void initial_start_end(int nChunks, int dim, int& start, int& end) { if (mod_val < 0) { mod_val += dim; } - end = pow(2, mod_val); + end = pow((double)2, (double)mod_val); } static int pack_index(vector chunks, int dim) { - int p = pow(2, dim); + int p = pow((double)2, (double)dim); int chunk_size = chunks.size(); int val = 0; for (int i = 0;i < chunk_size; i++) { @@ -76,8 +76,8 @@ static vector pack_coords(vector coord_chunks, int dim) { } static void unpack_index(int i, int dim, vector& chunks) { - int p = pow(2, dim); - int nChunks = max(1, int(ceil(double(log(i+1))/log(p)))); + int p = pow((double)2, (double)dim); + int nChunks = max(1, int(ceil(double(log((double)i+1))/log((double)p)))); //cout << "num chunks " << nChunks << endl; chunks.resize(nChunks); for (int j = nChunks-1; j > -1; j--) { @@ -120,7 +120,7 @@ static vector int_to_Hilbert(int i, int dim) { unpack_index(i, dim, index_chunks); nChunks = index_chunks.size(); //cout << "int to hilbert of " << i << " in dim " << dim << " size " << nChunks << endl; - mask = pow(2, dim) - 1; + mask = pow((double)2, (double)dim) - 1; //cout << "mask " << mask << endl; initial_start_end(nChunks, dim, start, end); //cout << "start " << start << " end " << end << endl; @@ -203,7 +203,7 @@ void getHilbertList(int * procList) /** \brief A function to traverse the given processors, and get a planar list */ -void * getPlanarList(int *procList) +void getPlanarList(int *procList) { int numDims; int *dims, *pdims; diff --git a/src/util/partitioning_strategies.h b/src/util/partitioning_strategies.h index 532711b153..7b625358ec 100644 --- a/src/util/partitioning_strategies.h +++ b/src/util/partitioning_strategies.h @@ -7,6 +7,6 @@ extern void getHilbertList(int * procList); /** \brief A function to traverse the given processors, and get a planar list */ -extern void * getPlanarList(int *procList); +extern void getPlanarList(int *procList); #endif diff --git a/src/util/sockRoutines.c b/src/util/sockRoutines.c index 30d29c6721..0c6df1ea2c 100644 --- a/src/util/sockRoutines.c +++ b/src/util/sockRoutines.c @@ -410,7 +410,7 @@ retry: if (skt_should_retry()) goto retry; else return skt_abort(93483,"Error creating server socket."); } - setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)); + setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on)); if (bind(ret, (struct sockaddr *)&addr, sizeof(addr)) == SOCKET_ERROR) return skt_abort(93484,"Error binding server socket."); -- 2.11.4.GIT