Skip to content

Commit

Permalink
Per #2979, delete commented out code and make error/warning message f…
Browse files Browse the repository at this point in the history
…ormatting consistent.
  • Loading branch information
JohnHalleyGotway committed Sep 26, 2024
1 parent 67eb4f9 commit c4ddea7
Show file tree
Hide file tree
Showing 23 changed files with 227 additions and 816 deletions.
17 changes: 3 additions & 14 deletions src/tools/other/mode_time_domain/2d_att.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



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


Expand Down Expand Up @@ -399,15 +398,7 @@ a.ObjectNumber = obj_number;

moments = mask_2d.calc_2d_moments();

if ( moments.N == 0 ) {

// mlog << Error << "\n\n calc_2d_single_atts() -> empty object!\n\n";

// exit ( 1 );

return a;

}
if ( moments.N == 0 ) return a;

a.Xbar = (moments.Sx)/(moments.N);
a.Ybar = (moments.Sy)/(moments.N);
Expand All @@ -430,7 +421,8 @@ values = new float [a.Area];

if ( !values ) {

mlog << Error << "\n\n calc_2d_single_atts() -> memory allocation error\n\n";
mlog << Error << "\ncalc_2d_single_atts() -> "
<< "memory allocation error\n\n";

exit ( 1 );

Expand Down Expand Up @@ -626,6 +618,3 @@ return;
////////////////////////////////////////////////////////////////////////





40 changes: 12 additions & 28 deletions src/tools/other/mode_time_domain/2d_att_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



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


//
// Warning: This file is machine generated
//
// Do not edit by hand
//
//
// Created by arraygen on September 17, 2015 10:11 am MDT
//


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


Expand Down Expand Up @@ -127,13 +113,10 @@ void SingleAtt2DArray::clear()
if ( e ) { delete [] e; e = (SingleAtt2D *) nullptr; }



Nelements = 0;

Nalloc = 0;

// AllocInc = 50; // don't reset AllocInc


return;

Expand Down Expand Up @@ -174,7 +157,8 @@ SingleAtt2D * u = new SingleAtt2D [N];

if ( !u ) {

mlog << Error << "SingleAtt2DArray::extend(int) -> memory allocation error\n\n";
mlog << Error << "\nSingleAtt2DArray::extend(int) -> "
<< "memory allocation error\n\n";

exit ( 1 );

Expand Down Expand Up @@ -238,7 +222,8 @@ void SingleAtt2DArray::set_alloc_inc(int N)

if ( N < 0 ) {

mlog << Error << "SingleAtt2DArray::set_alloc_int(int) -> bad value ... " << N << "\n\n";
mlog << Error << "\nSingleAtt2DArray::set_alloc_int(int) -> "
<< "bad value ... " << N << "\n\n";

exit ( 1 );

Expand Down Expand Up @@ -299,7 +284,8 @@ SingleAtt2D & SingleAtt2DArray::operator[](int N) const

if ( (N < 0) || (N >= Nelements) ) {

mlog << Error << "\n\n SingleAtt2DArray::operator[](int) -> range check error ... " << N << "\n\n";
mlog << Error << "\nSingleAtt2DArray::operator[](int) -> "
<< "range check error ... " << N << "\n\n";

exit ( 1 );
}
Expand Down Expand Up @@ -344,8 +330,8 @@ unixtime SingleAtt2DArray::valid_time(int index) const

if ( (index < 0) || (index >= Nelements) ) {

mlog << Error
<< "SingleAtt2DArray::valid_time(int) const -> range check error\n\n";
mlog << Error << "\nSingleAtt2DArray::valid_time(int) const -> "
<< "range check error\n\n";

exit ( 1 );

Expand All @@ -365,8 +351,8 @@ int SingleAtt2DArray::lead_time(int index) const

if ( (index < 0) || (index >= Nelements) ) {

mlog << Error
<< "SingleAtt2DArray::lead_time(int) const -> range check error\n\n";
mlog << Error << "\nSingleAtt2DArray::lead_time(int) const -> "
<< "range check error\n\n";

exit ( 1 );

Expand All @@ -386,8 +372,8 @@ int SingleAtt2DArray::time_index(int index) const

if ( (index < 0) || (index >= Nelements) ) {

mlog << Error
<< "SingleAtt2DArray::time_index(int) const -> range check error\n\n";
mlog << Error << "\nSingleAtt2DArray::time_index(int) const -> "
<< "range check error\n\n";

exit ( 1 );

Expand All @@ -401,5 +387,3 @@ return e[index].time_index();
////////////////////////////////////////////////////////////////////////




12 changes: 4 additions & 8 deletions src/tools/other/mode_time_domain/2d_moments.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



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


Expand All @@ -25,12 +24,10 @@ using namespace std;

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


//
// Code for class Mtd_2D_Moments
//


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


Expand Down Expand Up @@ -177,7 +174,8 @@ void Mtd_2D_Moments::centralize()

if ( N == 0 ) {

mlog << Error << "\n\n Mtd_2D_Moments::centralize() -> no data!\n\n";
mlog << Error << "\nMtd_2D_Moments::centralize() -> "
<< "no data!\n\n";

exit ( 1 );

Expand Down Expand Up @@ -220,7 +218,8 @@ double Mtd_2D_Moments::calc_2D_axis_plane_angle() const

if ( ! IsCentralized ) {

mlog << Error << "\n\n Mtd_2D_Moments::calc_2D_axis_plane_angle() const -> moments must be centralized first!\n\n";
mlog << Error << "\nMtd_2D_Moments::calc_2D_axis_plane_angle() const -> "
<< "moments must be centralized first!\n\n";

exit ( 1 );

Expand All @@ -242,6 +241,3 @@ return angle;
////////////////////////////////////////////////////////////////////////





Loading

0 comments on commit c4ddea7

Please sign in to comment.