diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-14 17:14:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 11:38:15 +0200 |
commit | 1f08bff31238d5818c54a0b86570689644dff087 (patch) | |
tree | d4d6f4b62a3c48ddeb85ba89818247c17f2578c8 /sal | |
parent | ff130af9661a57d290dbf89b54a4c0ce8d0f71ea (diff) |
new loplugin:shouldreturnbool
look for methods returning only 1 and/or 0, which (most of the time)
should be returning bool.
Off by default, because some of this is a matter of taste
Change-Id: Ib17782e629888255196e89d4a178618a9612a0de
Reviewed-on: https://gerrit.libreoffice.org/54379
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 94944c105845..1cd06615d1a3 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -73,14 +73,12 @@ void rtl_machdep_free( sal_Size rtl_machdep_pagesize(); -int rtl_arena_segment_constructor(void * obj) +void rtl_arena_segment_constructor(void * obj) { rtl_arena_segment_type * segment = static_cast<rtl_arena_segment_type*>(obj); QUEUE_START_NAMED(segment, s); QUEUE_START_NAMED(segment, f); - - return 1; } void rtl_arena_segment_destructor(void * obj) @@ -425,7 +423,7 @@ dequeue_and_leave: @precond arena->m_lock acquired @precond (*ppSegment == 0) */ -int rtl_arena_segment_create( +bool rtl_arena_segment_create( rtl_arena_type * arena, sal_Size size, rtl_arena_segment_type ** ppSegment @@ -463,14 +461,14 @@ int rtl_arena_segment_create( QUEUE_INSERT_HEAD_NAMED(span, (*ppSegment), s); /* report success */ - return 1; + return true; } rtl_arena_segment_put (arena, &span); } rtl_arena_segment_put (arena, ppSegment); } } - return 0; + return false; // failure } /** |