Skip to content

Commit 0b67734

Browse files
authored
Merge pull request #583 from jabl/index-type
Use size_t for index argument
2 parents f57481b + 25d74b2 commit 0b67734

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/mpi/mpi_caf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ unimplemented_alloc_comps_message(const char * functionname);
441441

442442
static void
443443
locking_atomic_op(MPI_Win win, int *value, int newval,
444-
int compare, int image_index, int index)
444+
int compare, int image_index, size_t index)
445445
{
446446
CAF_Win_lock(MPI_LOCK_EXCLUSIVE, image_index - 1, win);
447447
int ierr = MPI_Compare_and_swap(&newval, &compare,value, MPI_INT,
@@ -652,7 +652,7 @@ failed_stopped_errorhandler_function (MPI_Comm* pcomm, int* perr, ...)
652652
}
653653
#endif
654654

655-
void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
655+
void mutex_lock(MPI_Win win, int image_index, size_t index, int *stat,
656656
int *acquired_lock, char *errmsg, size_t errmsg_len)
657657
{
658658
const char msg[] = "Already locked";
@@ -737,7 +737,7 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
737737
#endif // MPI_VERSION
738738
}
739739

740-
void mutex_unlock(MPI_Win win, int image_index, int index, int *stat,
740+
void mutex_unlock(MPI_Win win, int image_index, size_t index, int *stat,
741741
char* errmsg, size_t errmsg_len)
742742
{
743743
const char msg[] = "Variable is not locked";

src/openshmem/openshmem_caf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ caf_runtime_error (const char *message, ...)
269269
/* being used, we could add something of the form "#ifdef _CMAKE" to remove the */
270270
/* keyword only when building with CMake */
271271
/* inline */ void locking_atomic_op(MPI_Win win, int *value, int newval,
272-
int compare, int image_index, int index)
272+
int compare, int image_index, size_t index)
273273
{
274274
CAF_Win_lock (MPI_LOCK_EXCLUSIVE, image_index-1, win);
275275
MPI_Compare_and_swap (&newval,&compare,value, MPI_INT,image_index-1,
276276
index*sizeof(int), win);
277277
CAF_Win_unlock (image_index-1, win);
278278
}
279279

280-
void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
280+
void mutex_lock(MPI_Win win, int image_index, size_t index, int *stat,
281281
int *acquired_lock, char *errmsg, int errmsg_len)
282282
{
283283
const char msg[] = "Already locked";
@@ -326,7 +326,7 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
326326
#endif // MPI_VERSION
327327
}
328328

329-
void mutex_unlock(MPI_Win win, int image_index, int index, int *stat,
329+
void mutex_unlock(MPI_Win win, int image_index, size_t index, int *stat,
330330
char* errmsg, int errmsg_len)
331331
{
332332
const char msg[] = "Variable is not locked";

0 commit comments

Comments
 (0)