From: Augustin Degomme Date: Sun, 23 Sep 2018 16:24:00 +0000 (+0200) Subject: let's not use useless casts X-Git-Tag: v3_21~55^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9ec9be3a71deb3df0b34b15eb3af7720842ac17b let's not use useless casts --- diff --git a/src/smpi/bindings/smpi_f77.cpp b/src/smpi/bindings/smpi_f77.cpp index 5b629f308f..2dea2f48da 100644 --- a/src/smpi/bindings/smpi_f77.cpp +++ b/src/smpi/bindings/smpi_f77.cpp @@ -115,9 +115,9 @@ void mpi_get_count_(MPI_Status * status, int* datatype, int *count, int* ierr){ } void mpi_attr_get_(int* comm, int* keyval, int* attr_value, int* flag, int* ierr ){ - size_t value = 0; + int* value = nullptr; *ierr = MPI_Attr_get(simgrid::smpi::Comm::f2c(*comm), *keyval, &value, flag); - *attr_value = *(int*)value; + *attr_value = *value; } void mpi_error_string_(int* errorcode, char* string, int* resultlen, int* ierr){ @@ -226,9 +226,9 @@ void mpi_win_get_group_(int* win, int* group, int* ierr){ } void mpi_win_get_attr_(int* win, int* type_keyval, int* attribute_val, int* flag, int* ierr){ - size_t value = 0; + int* value = nullptr; *ierr = MPI_Win_get_attr(simgrid::smpi::Win::f2c(*win), *type_keyval, &value, flag); - *attribute_val=*(int*)value; + *attribute_val=*value; } void mpi_win_set_attr_(int* win, int* type_keyval, void* att, int* ierr){ diff --git a/src/smpi/bindings/smpi_f77_comm.cpp b/src/smpi/bindings/smpi_f77_comm.cpp index 93dbf83477..e4c7886f49 100644 --- a/src/smpi/bindings/smpi_f77_comm.cpp +++ b/src/smpi/bindings/smpi_f77_comm.cpp @@ -72,9 +72,9 @@ void mpi_comm_create_group_ (int* comm, int* group, int i, int* comm_out, int* i } void mpi_comm_get_attr_ (int* comm, int* comm_keyval, int *attribute_val, int *flag, int* ierr){ - size_t value = 0; + int* value = nullptr; *ierr = MPI_Comm_get_attr (simgrid::smpi::Comm::f2c(*comm), *comm_keyval, &value, flag); - *attribute_val = *(int*) value; + *attribute_val = *value; } void mpi_comm_set_attr_ (int* comm, int* comm_keyval, void *attribute_val, int* ierr){ diff --git a/src/smpi/bindings/smpi_f77_type.cpp b/src/smpi/bindings/smpi_f77_type.cpp index bb6b3ca25a..6848328e3e 100644 --- a/src/smpi/bindings/smpi_f77_type.cpp +++ b/src/smpi/bindings/smpi_f77_type.cpp @@ -57,9 +57,9 @@ void mpi_type_get_name_ (int* datatype, char * name, int* len, int* ierr){ } void mpi_type_get_attr_ (int* type, int* type_keyval, int *attribute_val, int* flag, int* ierr){ - size_t value = 0; + int* value = nullptr; *ierr = MPI_Type_get_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval, &value, flag); - *attribute_val = *(int*) value; + *attribute_val = *value; } void mpi_type_set_attr_ (int* type, int* type_keyval, void *attribute_val, int* ierr){