[segyio] 267/376: Add inline cppcheck suppressions

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit 1e0f4999ee4784ee1b1e9f45f6e83b2fc4d1ca86
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Wed Mar 29 13:43:37 2017 +0200

    Add inline cppcheck suppressions
    
    These suppersions are verified to be pointless or false positives, but
    cannot be disabled file-wide.
---
 lib/src/segy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/src/segy.c b/lib/src/segy.c
index d26026d..91052ce 100644
--- a/lib/src/segy.c
+++ b/lib/src/segy.c
@@ -367,8 +367,8 @@ int segy_mmap( segy_file* fp ) {
     int fd = fileno( fp->fp );
     void* addr = mmap( NULL, fsize, prot, MAP_SHARED, fd, 0 );
 
-    if( addr == MAP_FAILED )
-        return SEGY_MMAP_ERROR;
+    // cppcheck-suppress memleak
+    if( addr == MAP_FAILED ) return SEGY_MMAP_ERROR;
 
     fp->addr = fp->cur = addr;
     fp->fsize = fsize;
@@ -401,6 +401,7 @@ long long segy_ftell( segy_file* fp ) {
     // meant for testing - it's not a part of the public interface.
     return _ftelli64( fp->fp );
 #else
+    // cppcheck-suppress duplicateExpression
     assert( sizeof( long ) == sizeof( long long ) );
     return ftell( fp->fp );
 #endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list