From a5cc0ffcad3a7b4dcd7d9a9ab496d4eb5f2f25f2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 23 Jan 2019 09:03:06 +0100 Subject: [PATCH] STYLE: use const reference for caught exceptions --- .../test/PackedList1/Test-PackedList1.C | 6 +++--- applications/test/Random/Test-Random.C | 2 +- .../coordinateSystem/Test-coordinateSystem.C | 8 ++++---- .../test/dictionary2/Test-dictionary2.C | 12 +++++------ .../test/dimensionSet/Test-dimensionSet.C | 2 +- applications/test/error/Test-error.C | 4 ++-- applications/test/faces/Test-faces.C | 2 +- applications/test/fileName/Test-fileName.C | 2 +- .../test/primitives/Test-primitives.C | 2 +- applications/test/regex/Test-regex.C | 14 ++++++------- .../mesh/manipulation/setSet/setSet.C | 4 ++-- .../miscellaneous/foamHelp/foamHelp.C | 2 +- .../foamToVTK/convertAreaFields.H | 2 +- .../vtkPVFoam/vtkPVFoamFieldTemplates.C | 20 +++++++++---------- .../postProcessing/postProcess/postProcess.C | 4 ++-- src/OpenFOAM/db/IOobjectList/IOobjectList.C | 5 ++--- src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C | 2 +- .../functionObjectList/functionObjectList.C | 4 ++-- .../functionObjectList/postProcess.H | 2 +- src/OpenFOAM/db/typeInfo/typeInfo.H | 10 +++++----- 20 files changed, 54 insertions(+), 55 deletions(-) diff --git a/applications/test/PackedList1/Test-PackedList1.C b/applications/test/PackedList1/Test-PackedList1.C index 81a212ddaa..7e6d233820 100644 --- a/applications/test/PackedList1/Test-PackedList1.C +++ b/applications/test/PackedList1/Test-PackedList1.C @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) << "(non-const)\n"; } } - catch (Foam::error& err) + catch (const Foam::error& err) { Info<< "Failed (expected) " << err << nl << endl; } @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) Info<< "[20] is false, as expected for const-access\n"; } } - catch (Foam::error& err) + catch (const Foam::error& err) { Info<< "Failed (expected) " << err << nl << endl; } @@ -275,7 +275,7 @@ int main(int argc, char *argv[]) list1[16] = 5; list1[36] = list1.max_value; } - catch (Foam::error& err) + catch (const Foam::error& err) { Info<< "Failed (expected) " << err << nl << endl; diff --git a/applications/test/Random/Test-Random.C b/applications/test/Random/Test-Random.C index a0635488b0..b4d4eb1259 100644 --- a/applications/test/Random/Test-Random.C +++ b/applications/test/Random/Test-Random.C @@ -201,7 +201,7 @@ int main(int argc, char *argv[]) Info<<"Random position(10,5): " << Random().position