add clang-tidy rule
with a few rules
This commit is contained in:
parent
4f9ea61170
commit
ab464e7b31
@ -45,6 +45,13 @@ uninstall-htmlDATA:
|
|||||||
rm -rf $(DESTDIR)$(htmldir)/html
|
rm -rf $(DESTDIR)$(htmldir)/html
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# "make tidy" to run the clang-tidy linter
|
||||||
|
.PHONY: tidy
|
||||||
|
tidy: $(libvips_cpp_la_SOURCES)
|
||||||
|
clang-tidy $^ \
|
||||||
|
-checks=clang-analyzer-*,portability-* \
|
||||||
|
-- $(AM_CPPFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
README.md \
|
README.md \
|
||||||
vips-operators.cpp \
|
vips-operators.cpp \
|
||||||
|
@ -60,12 +60,11 @@ VIPS_NAMESPACE_START
|
|||||||
std::vector<double>
|
std::vector<double>
|
||||||
to_vectorv( int n, ... )
|
to_vectorv( int n, ... )
|
||||||
{
|
{
|
||||||
std::vector<double> vector;
|
std::vector<double> vector( n );
|
||||||
vector.reserve( n );
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start( ap, n );
|
va_start( ap, n );
|
||||||
for( std::vector<double>::size_type i = 0; i < size_t(n); i++ )
|
for( int i = 0; i < n; i++ )
|
||||||
vector[i] = va_arg( ap, double );
|
vector[i] = va_arg( ap, double );
|
||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
|
||||||
@ -81,10 +80,9 @@ to_vector( double value )
|
|||||||
std::vector<double>
|
std::vector<double>
|
||||||
to_vector( int n, double array[] )
|
to_vector( int n, double array[] )
|
||||||
{
|
{
|
||||||
std::vector<double> vector;
|
std::vector<double> vector( n );
|
||||||
vector.reserve( n );
|
|
||||||
|
|
||||||
for( std::vector<double>::size_type i = 0; i < size_t(n); i++ )
|
for( int i = 0; i < n; i++ )
|
||||||
vector[i] = array[i];
|
vector[i] = array[i];
|
||||||
|
|
||||||
return( vector );
|
return( vector );
|
||||||
@ -93,8 +91,7 @@ to_vector( int n, double array[] )
|
|||||||
std::vector<double>
|
std::vector<double>
|
||||||
negate( std::vector<double> vector )
|
negate( std::vector<double> vector )
|
||||||
{
|
{
|
||||||
std::vector<double> new_vector;
|
std::vector<double> new_vector( vector.size() );
|
||||||
new_vector.reserve( vector.size() );
|
|
||||||
|
|
||||||
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
|
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
|
||||||
new_vector[i] = vector[i] * -1;
|
new_vector[i] = vector[i] * -1;
|
||||||
@ -105,8 +102,7 @@ negate( std::vector<double> vector )
|
|||||||
std::vector<double>
|
std::vector<double>
|
||||||
invert( std::vector<double> vector )
|
invert( std::vector<double> vector )
|
||||||
{
|
{
|
||||||
std::vector<double> new_vector;
|
std::vector<double> new_vector( vector.size() );
|
||||||
new_vector.reserve( vector.size() );
|
|
||||||
|
|
||||||
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
|
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
|
||||||
new_vector[i] = 1.0 / vector[i];
|
new_vector[i] = 1.0 / vector[i];
|
||||||
@ -489,8 +485,9 @@ VOption::get_operation( VipsOperation *operation )
|
|||||||
double *array =
|
double *array =
|
||||||
vips_value_get_array_double( value,
|
vips_value_get_array_double( value,
|
||||||
&length );
|
&length );
|
||||||
|
|
||||||
((*i)->vvector)->resize( length );
|
((*i)->vvector)->resize( length );
|
||||||
for( size_t j = 0; j < length; j++ )
|
for( int j = 0; j < length; j++ )
|
||||||
(*((*i)->vvector))[j] = array[j];
|
(*((*i)->vvector))[j] = array[j];
|
||||||
}
|
}
|
||||||
else if( type == VIPS_TYPE_BLOB ) {
|
else if( type == VIPS_TYPE_BLOB ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user