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
[sonar] Declare functions "const" (round #2).
[simgrid.git]
/
src
/
smpi
/
mpi
/
smpi_info.cpp
diff --git
a/src/smpi/mpi/smpi_info.cpp
b/src/smpi/mpi/smpi_info.cpp
index
c20ae58
..
446e6b9
100644
(file)
--- a/
src/smpi/mpi/smpi_info.cpp
+++ b/
src/smpi/mpi/smpi_info.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-20
19
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-20
20
. 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. */
@@
-21,7
+21,8
@@
void Info::unref(Info* info){
}
}
}
}
-int Info::get(const char *key, int valuelen, char *value, int *flag){
+int Info::get(const char* key, int valuelen, char* value, int* flag) const
+{
*flag=false;
auto val = map_.find(key);
if (val != map_.end()) {
*flag=false;
auto val = map_.find(key);
if (val != map_.end()) {
@@
-42,12
+43,14
@@
int Info::remove(const char *key){
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
-int Info::get_nkeys(int *nkeys){
+int Info::get_nkeys(int* nkeys) const
+{
*nkeys = map_.size();
return MPI_SUCCESS;
}
*nkeys = map_.size();
return MPI_SUCCESS;
}
-int Info::get_nthkey(int n, char *key){
+int Info::get_nthkey(int n, char* key) const
+{
int num=0;
for (auto const& elm : map_) {
if (num == n) {
int num=0;
for (auto const& elm : map_) {
if (num == n) {
@@
-59,7
+62,8
@@
int Info::get_nthkey(int n, char *key){
return MPI_ERR_ARG;
}
return MPI_ERR_ARG;
}
-int Info::get_valuelen(const char *key, int *valuelen, int *flag){
+int Info::get_valuelen(const char* key, int* valuelen, int* flag) const
+{
*flag=false;
auto val = map_.find(key);
if (val != map_.end()) {
*flag=false;
auto val = map_.find(key);
if (val != map_.end()) {