Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c5e9d1ad
Commit
c5e9d1ad
authored
May 18, 2017
by
Alexander Alekhin
Committed by
Maksim Shabunin
May 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macro for static analysis tools
parent
0bc30d38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
base.hpp
modules/core/include/opencv2/core/base.hpp
+13
-0
cvdef.h
modules/core/include/opencv2/core/cvdef.h
+12
-0
thresh.cpp
modules/imgproc/src/thresh.cpp
+6
-6
No files found.
modules/core/include/opencv2/core/base.hpp
View file @
c5e9d1ad
...
...
@@ -381,6 +381,17 @@ CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const ch
#define CV_Func ""
#endif
#ifdef CV_STATIC_ANALYSIS
// In practice, some macro are not processed correctly (noreturn is not detected).
// We need to use simplified definition for them.
#define CV_Error(...) do { abort(); } while (0)
#define CV_Error_(...) do { abort(); } while (0)
#define CV_Assert(cond) do { if (!(cond)) abort(); } while (0)
#define CV_ErrorNoReturn(...) do { abort(); } while (0)
#define CV_ErrorNoReturn_(...) do { abort(); } while (0)
#else // CV_STATIC_ANALYSIS
/** @brief Call the error handler.
Currently, the error handler prints the error code and the error message to the standard
...
...
@@ -421,6 +432,8 @@ configurations while CV_DbgAssert is only retained in the Debug configuration.
/** same as CV_Error_(code,args), but does not return */
#define CV_ErrorNoReturn_( code, args ) cv::errorNoReturn( code, cv::format args, CV_Func, __FILE__, __LINE__ )
#endif // CV_STATIC_ANALYSIS
/** replaced with CV_Assert(expr) in Debug configuration */
#ifdef _DEBUG
# define CV_DbgAssert(expr) CV_Assert(expr)
...
...
modules/core/include/opencv2/core/cvdef.h
View file @
c5e9d1ad
...
...
@@ -302,6 +302,18 @@ Cv64suf;
# define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
/****************************************************************************************\
* static analysys *
\****************************************************************************************/
// In practice, some macro are not processed correctly (noreturn is not detected).
// We need to use simplified definition for them.
#ifndef CV_STATIC_ANALYSIS
# if defined(__KLOCWORK__) || defined(__clang_analyzer__) || defined(__COVERITY__)
# define CV_STATIC_ANALYSIS
# endif
#endif
/****************************************************************************************\
* exchange-add operation for atomic operations on reference counters *
\****************************************************************************************/
...
...
modules/imgproc/src/thresh.cpp
View file @
c5e9d1ad
...
...
@@ -463,7 +463,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
else
...
...
@@ -517,7 +517,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
}
...
...
@@ -698,7 +698,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
else
...
...
@@ -752,7 +752,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
}
...
...
@@ -893,7 +893,7 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type)
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
else
...
...
@@ -952,7 +952,7 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type)
}
break
;
default
:
return
CV_Error
(
CV_StsBadArg
,
""
)
;
CV_Error
(
CV_StsBadArg
,
""
);
return
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment