A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update copyright lines for 2023.
[simgrid.git]
/
src
/
smpi
/
include
/
smpi_keyvals.hpp
diff --git
a/src/smpi/include/smpi_keyvals.hpp
b/src/smpi/include/smpi_keyvals.hpp
index
66b5e2f
..
768bc51
100644
(file)
--- a/
src/smpi/include/smpi_keyvals.hpp
+++ b/
src/smpi/include/smpi_keyvals.hpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-202
3
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-38,8
+38,7
@@
struct smpi_key_elem {
bool delete_attr; // if true, xbt_free(attr) on delete: used by Fortran bindings
};
bool delete_attr; // if true, xbt_free(attr) on delete: used by Fortran bindings
};
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
class Keyval{
private:
class Keyval{
private:
@@
-106,8
+105,7
@@
template <typename T> int Keyval::attr_delete(int keyval){
smpi_key_elem& elem = elem_it->second;
int flag = 0;
smpi_key_elem& elem = elem_it->second;
int flag = 0;
- int ret = call_deleter<T>((T*)this, elem, keyval, attr->second, &flag);
- if (ret != MPI_SUCCESS)
+ if (int ret = call_deleter<T>((T*)this, elem, keyval, attr->second, &flag); ret != MPI_SUCCESS)
return ret;
elem.refcount--;
return ret;
elem.refcount--;
@@
-119,12
+117,10
@@
template <typename T> int Keyval::attr_delete(int keyval){
template <typename T> int Keyval::attr_get(int keyval, void* attr_value, int* flag){
template <typename T> int Keyval::attr_get(int keyval, void* attr_value, int* flag){
- auto elem_it = T::keyvals_.find(keyval);
- if (elem_it == T::keyvals_.end() || elem_it->second.deleted)
+ if (auto elem_it = T::keyvals_.find(keyval); elem_it == T::keyvals_.end() || elem_it->second.deleted)
return MPI_ERR_ARG;
return MPI_ERR_ARG;
- auto attr = attributes().find(keyval);
- if (attr != attributes().end()) {
+ if (auto attr = attributes().find(keyval); attr != attributes().end()) {
*static_cast<void**>(attr_value) = attr->second;
*flag=1;
} else {
*static_cast<void**>(attr_value) = attr->second;
*flag=1;
} else {
@@
-166,7
+162,6
@@
template <typename T> void Keyval::cleanup_attr(){
attributes().clear();
}
attributes().clear();
}
-}
-}
+} // namespace simgrid::smpi
#endif
#endif