Skip to content

Commit

Permalink
Returning exit codes for more programs (alphabetically in C-G range)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpa committed Dec 7, 2015
1 parent f4e5c30 commit 743e64c
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Examples/CheckTopology.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,6 @@ int CheckTopology( std::vector<std::string> args, std::ostream* )
{
WriteImage<ImageType>(image, argv[2]);
}
return 0;
return EXIT_SUCCESS;
}
} // namespace ants
6 changes: 3 additions & 3 deletions Examples/ComputeSimilarityMetric.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int ComputeSimilarityMetric(int argc, char *argv[])
*/
}

return 0;
return EXIT_SUCCESS;
}

// entry point for the library; parameter 'args' is equivalent to 'argv' in (argc,argv) of commandline parameters to
Expand Down Expand Up @@ -257,7 +257,7 @@ int ComputeSimilarityMetric( std::vector<std::string> args, std::ostream* out_st
std::cout << "Basic useage ex: " << std::endl;
std::cout << argv[0] << " ImageDimension whichmetric image1.ext image2.ext {logfile} {outimage.ext} " << std::endl;
std::cout << " outimage and logfile are optional " << std::endl;
return 1;
return EXIT_FAILURE;
}

// Get the image dimension
Expand All @@ -278,6 +278,6 @@ int ComputeSimilarityMetric( std::vector<std::string> args, std::ostream* out_st
return EXIT_FAILURE;
}

return 0;
return EXIT_SUCCESS;
}
} // namespace ants
4 changes: 2 additions & 2 deletions Examples/CreateDTICohort.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1181,12 +1181,12 @@ int CreateDTICohort( std::vector<std::string> args, std::ostream* /*out_stream =
{
case 2:
{
CreateDTICohort<2>( parser );
return CreateDTICohort<2>( parser );
}
break;
case 3:
{
CreateDTICohort<3>( parser );
return CreateDTICohort<3>( parser );
}
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions Examples/CreateImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,17 @@ int CreateImage( std::vector<std::string> args, std::ostream* /*out_stream = NUL
{
case 1:
{
CreateZeroImage<1>( argc, argv );
return CreateZeroImage<1>( argc, argv );
}
break;
case 2:
{
CreateZeroImage<2>( argc, argv );
return CreateZeroImage<2>( argc, argv );
}
break;
case 3:
{
CreateZeroImage<3>( argc, argv );
return CreateZeroImage<3>( argc, argv );
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions Examples/CreateJacobianDeterminantImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ int CreateJacobianDeterminantImage( std::vector<std::string> args, std::ostream*
{
case 2:
{
CreateJacobianDeterminantImage<2>( argc, argv );
return CreateJacobianDeterminantImage<2>( argc, argv );
}
break;
case 3:
{
CreateJacobianDeterminantImage<3>( argc, argv );
return CreateJacobianDeterminantImage<3>( argc, argv );
}
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion Examples/CreateTiledMosaic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ int CreateTiledMosaic( std::vector<std::string> args, std::ostream* /*out_stream

if( dimension == 3 )
{
CreateMosaic( parser );
return CreateMosaic( parser );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions Examples/CreateWarpedGridImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ int CreateWarpedGridImage( std::vector<std::string> args, std::ostream* /*out_st
{
case 2:
{
CreateWarpedGridImage<2>( argc, argv );
return CreateWarpedGridImage<2>( argc, argv );
}
break;
case 3:
{
CreateWarpedGridImage<3>( argc, argv );
return CreateWarpedGridImage<3>( argc, argv );
}
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions Examples/DenoiseImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -542,17 +542,17 @@ int DenoiseImage( std::vector<std::string> args, std::ostream* /*out_stream = NU
{
case 2:
{
Denoise<2>( parser );
return Denoise<2>( parser );
}
break;
case 3:
{
Denoise<3>( parser );
return Denoise<3>( parser );
}
break;
case 4:
{
Denoise<4>( parser );
return Denoise<4>( parser );
}
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions Examples/ExtractRegionFromImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@ int ExtractRegionFromImage( std::vector<std::string> args, std::ostream* /*out_s
{
case 2:
{
ExtractRegionFromImage<2>( argc, argv );
return ExtractRegionFromImage<2>( argc, argv );
}
break;
case 3:
{
ExtractRegionFromImage<3>( argc, argv );
return ExtractRegionFromImage<3>( argc, argv );
}
break;
case 4:
{
ExtractRegionFromImage<4>( argc, argv );
return ExtractRegionFromImage<4>( argc, argv );
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions Examples/ExtractRegionFromImageByMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ int ExtractRegionFromImageByMask( std::vector<std::string> args, std::ostream* /
{
case 2:
{
ExtractRegionFromImageByMask<2>(argc, argv);
return ExtractRegionFromImageByMask<2>(argc, argv);
}
break;
case 3:
{
ExtractRegionFromImageByMask<3>(argc, argv);
return ExtractRegionFromImageByMask<3>(argc, argv);
}
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions Examples/ExtractSliceFromImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ int ExtractSliceFromImage( std::vector<std::string> args, std::ostream* /*out_st
{
case 2:
{
ExtractSliceFromImage<2>( argc, argv );
return ExtractSliceFromImage<2>( argc, argv );
}
break;
case 3:
{
ExtractSliceFromImage<3>( argc, argv );
return ExtractSliceFromImage<3>( argc, argv );
}
break;
case 4:
{
ExtractSliceFromImage<4>( argc, argv );
return ExtractSliceFromImage<4>( argc, argv );
}
break;
default:
Expand Down
20 changes: 10 additions & 10 deletions Examples/FitBSplineToPoints.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ int FitBSplineCurveToPoints( unsigned int argc, char *argv[] )
// ostr.close();
// }

return 0;
return EXIT_SUCCESS;
}


Expand Down Expand Up @@ -393,7 +393,7 @@ int FitBSplineToPoints( std::vector<std::string> args, std::ostream* /*out_strea
std::cout << " Note: 1. Points are assumed to be parametrically ordered for fitting to a curve. " << std::endl
<< " 2. The last column (pointDimension+1) is used for weights." << std::endl
<< " 3. To specify a warp field, add a 'w' to the dimension argument, e.g. 2w." << std::endl;
exit( 1 );
return EXIT_FAILURE;
}

std::string imageDimensionString( argv[1] );
Expand All @@ -404,14 +404,14 @@ int FitBSplineToPoints( std::vector<std::string> args, std::ostream* /*out_strea
switch( atoi( &imageDimensionString[0] ) )
{
case 2:
FitBSplineWarpFieldToPoints<2>( argc, argv );
return FitBSplineWarpFieldToPoints<2>( argc, argv );
break;
case 3:
FitBSplineWarpFieldToPoints<3>( argc, argv );
return FitBSplineWarpFieldToPoints<3>( argc, argv );
break;
default:
std::cerr << "Unsupported dimension" << std::endl;
exit( EXIT_FAILURE );
return EXIT_FAILURE;
}
}
else
Expand All @@ -425,20 +425,20 @@ int FitBSplineToPoints( std::vector<std::string> args, std::ostream* /*out_strea
switch( atoi( argv[1] ) )
{
case 1:
FitBSplineCurveToPoints<2>( argc, argv );
return FitBSplineCurveToPoints<2>( argc, argv );
break;
case 2:
FitBSplineCurveToPoints<2>( argc, argv );
return FitBSplineCurveToPoints<2>( argc, argv );
break;
case 3:
FitBSplineCurveToPoints<3>( argc, argv );
return FitBSplineCurveToPoints<3>( argc, argv );
break;
case 4:
FitBSplineCurveToPoints<4>( argc, argv );
return FitBSplineCurveToPoints<4>( argc, argv );
break;
default:
std::cerr << "Unsupported dimension" << std::endl;
exit( EXIT_FAILURE );
return EXIT_FAILURE;
}
}

Expand Down

0 comments on commit 743e64c

Please sign in to comment.