Skip to content

fix more issues from clang(++) and cppchecker#43

Closed
dalgaaf wants to merge 13 commits intoceph:masterfrom
dalgaaf:wip-da-sca-cppcheck-clang
Closed

fix more issues from clang(++) and cppchecker#43
dalgaaf wants to merge 13 commits intoceph:masterfrom
dalgaaf:wip-da-sca-cppcheck-clang

Conversation

@dalgaaf
Copy link
Contributor

@dalgaaf dalgaaf commented Feb 10, 2013

Here another set of patches to fix issues found by clang/clang++ and cppcheck. As already send to the ceph-ML for review. Doesn't contain the 2 patches sage commented on (01/15 and 13/15).

Please pull from wip-da-sca-cppcheck-clang.

Change declaration of config_option from 'class' to 'struct' since
it's defined as struct and used this way (access members). The declaration
as class doesn't change the behaviour.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix "Function parameter 'm' should be passed by reference." from cppchecker.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix 'const static struct fuse_lowlevel_ops fuse_ll_oper' related
-Wgnu-designator warning from clang(++):

client/fuse_ll.cc:537:2: warning: use of GNU old-style field
  designator extension [-Wgnu-designator]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of queue.size() in do_queues(). Use empty()
since it should be prefered as it has, following the standard, a
constant time complexity regardless of the containter type. The
same is not guaranteed for size().

warning from cppchecker was:
[common/AsyncReserver.h:40]: (performance) Possible inefficient
  checking for 'queue' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of out->size() in _void_dequeue(). Use empty()
since it should be prefered as it has, following the standard, a
constant time complexity regardless of the containter type. The
same is not guaranteed for size().

warning from cppchecker was:
[common/WorkQueue.h:97]: (performance) Possible inefficient
  checking for 'queue' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix 'struct ceph_file_layout g_default_file_layout' related
-Wgnu-designator warning from clang(++):

common/config.cc:61:2: warning: use of GNU old-style field
  designator extension [-Wgnu-designator]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix "(performance) Function parameter 's' should be passed by reference."
from cppchecker.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Remove unused variable to fix:

mon/PGMonitor.cc:170:11: warning: unused variable 'now'
  [-Wunused-variable]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix "(performance) Function parameter 'm' should be passed by reference."
from cppchecker.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of *.size(). Use empty() since it should be
prefered as it has, following the standard, a constant time
complexity regardless of the containter type. The same is not
guaranteed for size().

warning from cppchecker was:
[osd/OSD.h:265]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.
[osd/OSD.h:274]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of objects.size(). Use empty() since it
should be prefered as it has, following the standard, a constant
time complexity regardless of the containter type. The same is not
guaranteed for size().

warning from cppchecker was:
[osd/PG.h:599]: (performance) Possible inefficient checking for
  'objects' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning from clang(++):

 test/mon/test_mon_workloadgen.cc:311:23: warning: in-class
 initializer for static data member of type 'const double' is
 a GNU extension [-Wgnu]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning from clang(++):

librados/librados.cc:15:17: warning: using directive refers to
 implicitly-defined namespace 'std'
using namespace std;
                ^
Include what we need and use the related classes.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
@dalgaaf
Copy link
Contributor Author

dalgaaf commented Feb 11, 2013

Close pull request , replaced by pull request #47

@dalgaaf dalgaaf closed this Feb 11, 2013
XinzeChi pushed a commit to XinzeChi/ceph that referenced this pull request Jan 29, 2016
osd: misc optimization for map utilization
ddiss pushed a commit to ddiss/ceph that referenced this pull request Oct 25, 2016
rgw: add missing metadata_heap pool to old zones
adamemerson added a commit to adamemerson/ceph that referenced this pull request Nov 4, 2017
d1ff03b Merge pull request ceph#44 from adamemerson/wip-system-includes
4cc4b94 build: Mark dependency includes as SYSTEM in dmclock
05096c1 Merge pull request ceph#43 from TaewoongKim/anticipation_conf
f356c45 Add missing anticipation_timeout argument for PullPriorityQueue constructor
9896448 Merge pull request ceph#42 from tchaikov/wip-cmake
979899e add travis CI on gnu/linux
8a3dabd cmake: the built archives are located in ${binary_dir}
ee15ced cmake: check for include in /usr/include also

git-subtree-dir: src/dmclock
git-subtree-split: d1ff03b
galsalomon66 added a commit that referenced this pull request Jan 14, 2021
…Wunused-variable/ (#43)

Signed-off-by: gal salomon <gal.salomon@gmail.com>
votdev referenced this pull request in votdev/ceph Sep 22, 2022
Moisi pushed a commit to Moisi/ceph that referenced this pull request Oct 14, 2024
Merge in STORAGEENG/ceph from OBJGEN1-1142-handoff-fix-sign-errors to aka_version_18.2.1

* commit '58855145c93406c222ed337d990487414e4a8e4a':
  Fix signedness bugs in error code handling.
athanatos pushed a commit to athanatos/ceph that referenced this pull request Feb 14, 2025
Add missing anticipation_timeout argument to PullPriorityQueue constructor

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant