Skip to content

Commit

Permalink
#2673 Removed the redundant parentheses with return
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Feb 28, 2024
1 parent 55f5d3e commit 6bb41bc
Show file tree
Hide file tree
Showing 42 changed files with 662 additions and 662 deletions.
4 changes: 2 additions & 2 deletions src/libcode/vx_seeps/seeps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void SeepsAggScore::clear() {
SeepsAggScore & SeepsAggScore::operator+=(const SeepsAggScore &c) {

// Check for degenerate case
if(n_obs == 0 && c.n_obs == 0) return(*this);
if(n_obs == 0 && c.n_obs == 0) return *this;

// Compute weights
double w1 = (double) n_obs / (n_obs + c.n_obs);
Expand Down Expand Up @@ -160,7 +160,7 @@ SeepsAggScore & SeepsAggScore::operator+=(const SeepsAggScore &c) {
score = weighted_average(score, w1, c.score, w2);
weighted_score = weighted_average(weighted_score, w1, c.weighted_score, w2);

return(*this);
return *this;
}


Expand Down
12 changes: 6 additions & 6 deletions src/libcode/vx_series_data/series_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool get_series_entry(int i_series, VarInfo* data_info,
// Restore warnings to their original state
mlog.set_print_warning(save_print_warning_state);

return(found);
return found;
}

////////////////////////////////////////////////////////////////////////
Expand All @@ -89,7 +89,7 @@ bool read_single_entry(VarInfo* info, const ConcatString& filename,
if(!file_exists(filename.c_str())) {
mlog << Warning << "\nread_single_entry() -> "
<< "File does not exist: " << filename << "\n\n";
return(false);
return false;
}

// Open data file
Expand All @@ -104,7 +104,7 @@ bool read_single_entry(VarInfo* info, const ConcatString& filename,
// Cleanup
if(mtddf) { delete mtddf; mtddf = (Met2dDataFile *) 0; }

return(found);
return found;
}

////////////////////////////////////////////////////////////////////////
Expand All @@ -117,7 +117,7 @@ bool get_series_entries(int i_series, vector<VarInfo*> &vi_list,
bool found;

// Check for at least one field requested
if(vi_list.size() <= 0) return(false);
if(vi_list.size() <= 0) return false;

// Save the log print warning state
bool save_print_warning_state = mlog.print_warning();
Expand Down Expand Up @@ -156,7 +156,7 @@ bool get_series_entries(int i_series, vector<VarInfo*> &vi_list,
// Restore warnings to their original state
mlog.set_print_warning(save_print_warning_state);

return(found);
return found;
}

////////////////////////////////////////////////////////////////////////
Expand All @@ -171,7 +171,7 @@ bool read_all_entries(vector<VarInfo*> &vi_list, const ConcatString &filename,
if(!file_exists(filename.c_str())) {
mlog << Warning << "\nread_all_entries() -> "
<< "File does not exist: " << filename << "\n\n";
return(false);
return false;
}

// Open data file
Expand Down
26 changes: 13 additions & 13 deletions src/libcode/vx_shapedata/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static const int print_interest_log_level = 5;

///////////////////////////////////////////////////////////////////////

static inline double area_ratio_conf(double t) { return(t); }
static inline double area_ratio_conf(double t) { return t; }

///////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -588,7 +588,7 @@ int ModeFuzzyEngine::two_to_one(int n_f, int n_o) const {

n = n_o*n_fcst + n_f;

return(n);
return n;
}


Expand Down Expand Up @@ -2508,11 +2508,11 @@ int ModeFuzzyEngine::get_info_index(int pair_n) const {

for(i=0; i<(info_singles.n()); i++) {

if(info_singles[i].pair_number == pair_n) return(i);
if(info_singles[i].pair_number == pair_n) return i;

}

return(-1);
return -1;
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -2530,7 +2530,7 @@ int ModeFuzzyEngine::get_matched_fcst(int area) const {
}
}

return(count);
return count;
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -2548,7 +2548,7 @@ int ModeFuzzyEngine::get_unmatched_fcst(int area) const {
}
}

return(count);
return count;
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -2566,7 +2566,7 @@ int ModeFuzzyEngine::get_matched_obs(int area) const {
}
}

return(count);
return count;
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -2584,7 +2584,7 @@ int ModeFuzzyEngine::get_unmatched_obs(int area) const {
}
}

return(count);
return count;
}

///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -2631,7 +2631,7 @@ double total_interest(ModeConfInfo &mc, const PairFeature &p,
<< ") > Max Centroid Distance ("
<< mc.max_centroid_dist << ")\n";
}
return(total);
return total;
}

sum = 0.0;
Expand Down Expand Up @@ -2917,7 +2917,7 @@ double total_interest(ModeConfInfo &mc, const PairFeature &p,
<< " = " << total << "\n\n";
}

return(total);
return total;
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -2930,7 +2930,7 @@ double interest_percentile(ModeFuzzyEngine &eng, const double p, const int flag)

if(eng.conf_info.match_flag == 0 ||
eng.n_fcst == 0 ||
eng.n_obs == 0) return(0.0);
eng.n_obs == 0) return 0.0;

//
// Initialize the maximum interest value for each object to zero.
Expand Down Expand Up @@ -2995,7 +2995,7 @@ double interest_percentile(ModeFuzzyEngine &eng, const double p, const int flag)

if(v) { delete [] v; v = (double *) 0; }

return(ptile);
return ptile;
}

///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -4144,7 +4144,7 @@ double aspect_ratio_conf(double t)
const double tm1 = t - 1.0;
const double ratio = (tm1*tm1)/(t*t + 1.0);

return( pow(ratio, 0.3) );
return pow(ratio, 0.3);

}

Expand Down
10 changes: 5 additions & 5 deletions src/libcode/vx_shapedata/ihull.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,22 @@ int lex_compare(const void * _a, const void * _b)
const IntPoint & a = *((const IntPoint *) _a);
const IntPoint & b = *((const IntPoint *) _b);

if ( a.x < b.x ) return ( -1 );
if ( a.x > b.x ) return ( 1 );
if ( a.x < b.x ) return -1;
if ( a.x > b.x ) return 1;

//
// now we know that a.x = b.x
//

if ( a.y < b.y ) return ( -1 );
if ( a.y > b.y ) return ( 1 );
if ( a.y < b.y ) return -1;
if ( a.y > b.y ) return 1;


//
// done
//

return ( 0 );
return 0;

}

Expand Down
12 changes: 6 additions & 6 deletions src/libcode/vx_shapedata/interest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ assign(s);

SingleFeature & SingleFeature::operator=(const SingleFeature &s) {

if(this == &s) return(*this);
if(this == &s) return *this;

assign(s);

return(*this);
return *this;
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -316,11 +316,11 @@ PairFeature & PairFeature::operator=(const PairFeature &p)

{

if(this == &p) return(*this);
if(this == &p) return *this;

assign(p);

return(*this);
return *this;
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -560,7 +560,7 @@ ostream & operator<<(ostream & out, const SingleFeature & s)
out << "Intensity Sum = " << (s.intensity_ptile.sum) << "\n";
out.flush();

return(out);
return out;
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -588,7 +588,7 @@ ostream & operator<<(ostream & out, const PairFeature & p)
out << "Percentile Intensity Ratio = " << (p.percentile_intensity_ratio) << "\n";
out.flush();

return(out);
return out;
}

////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions src/libcode/vx_shapedata/mode_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ ModeConfInfo::~ModeConfInfo()

ModeConfInfo & ModeConfInfo::operator=(const ModeConfInfo &s)
{
if(this == &s) return(*this);
if(this == &s) return *this;

clear();
assign(s);

return(*this);
return *this;
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1087,7 +1087,7 @@ for (int j=0; j<pwl_if->n_points(); ++j) {

} // for j

return ( pwl_if );
return pwl_if;

}

Expand Down Expand Up @@ -1670,7 +1670,7 @@ switch ( e2->type() ) {
}


return ( status );
return status;

}

Expand Down Expand Up @@ -1860,7 +1860,7 @@ bool ModeNcOutInfo::all_false() const

bool status = do_latlon || do_raw || do_object_raw || do_object_id || do_cluster_id || do_polylines;

return ( !status );
return !status;

}

Expand Down
6 changes: 3 additions & 3 deletions src/libcode/vx_shapedata/mode_field_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ Mode_Field_Info & Mode_Field_Info::operator=(const Mode_Field_Info & i)

{

if ( this == &i ) return ( * this );
if ( this == &i ) return *this;

assign(i);

return ( * this );
return *this;

}

Expand Down Expand Up @@ -405,7 +405,7 @@ bool Mode_Field_Info::need_merge_thresh () const

bool status = (merge_flag == MergeType_Both) || (merge_flag == MergeType_Thresh);

return ( status );
return status;

}

Expand Down
8 changes: 4 additions & 4 deletions src/libcode/vx_shapedata/moments.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ Moments::Moments(const Moments &m) {

Moments & Moments::operator=(const Moments &m) {
if ( this == &m ) {
return ( *this );
return *this;
}
assign(m);

return ( *this );
return *this;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -277,7 +277,7 @@ double Moments::angle_degrees() const {
// Compute axis angle using 2nd order moments
deg = 0.5*deg_per_rad*atan2(2.0*(m.sxy), m.sxx - m.syy);

return(deg);
return deg;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -310,7 +310,7 @@ double Moments::curvature(double &xcurv, double &ycurv) const {
xcurv = xcenter + xbar;
ycurv = ycenter + ybar;

return(radius);
return radius;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 6bb41bc

Please sign in to comment.