Skip to content

Commit

Permalink
Revert "Enable (some) compile-time warnings, change stlplus header …
Browse files Browse the repository at this point in the history
…location"
  • Loading branch information
tannerbk authored Nov 29, 2023
1 parent 34cb4af commit c627aae
Show file tree
Hide file tree
Showing 60 changed files with 66 additions and 120 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
add_compile_options(-Wno-terminate)
add_compile_options(-w)

###########################################################
# Set CMAKE standards
Expand Down
13 changes: 0 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,9 @@ add_library(RATEvent SHARED
stlplus/src/stringio.cc
stlplus/src/textio.cc
util/src/ReadFile.cc)
target_include_directories(RATEvent SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS}/stlplus)
target_include_directories(RATEvent PUBLIC ${RATPAC_INCLUDE_DIR})
target_link_libraries(RATEvent PUBLIC
${Geant4_LIBRARIES} ${ROOT_LIBRARIES} RATDict)
set_source_files_properties(
stlplus/src/debug.cc
stlplus/src/dprintf.cc
stlplus/src/exceptions.cc
stlplus/src/file_system.cc
stlplus/src/fileio.cc
stlplus/src/multiio.cc
stlplus/src/string_utilities.cc
stlplus/src/stringio.cc
stlplus/src/textio.cc
PROPERTIES COMPILE_FLAGS -w
)

# This copies the root dict files to <build>/lib
add_custom_command(TARGET RATEvent POST_BUILD
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ add_library(cmd OBJECT
src/TrackingMessenger.cc)

# Set our include directories
target_include_directories(cmd SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(cmd PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 0 additions & 2 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ add_library(core OBJECT
src/GLG4HitPMTCollection.cc)

# Set our include directories
target_include_directories(core SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(core PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/Log.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <RAT/Log.hh>
#include <RAT/fileio.hpp>
#include <cstdlib>
#include <fileio.hpp>
#include <fstream>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion src/core/src/PruneProc.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <RAT/Log.hh>
#include <RAT/PruneProc.hh>
#include <RAT/string_utilities.hpp>
#include <algorithm>
#include <string_utilities.hpp>
#include <vector>

namespace RAT {
Expand Down
2 changes: 0 additions & 2 deletions src/daq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ add_library(daq OBJECT
)

# Set our include directories
target_include_directories(daq SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(daq PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
4 changes: 2 additions & 2 deletions src/daq/include/RAT/NoiseProc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class NoiseProc : public Processor {
double fLookback;
double fLookforward;
double fMaxTime;
int fNearHits;
int fNoiseFlag;
bool fNearHits;
bool fNoiseFlag;
std::vector<RAT::PMTTime *> fPMTTime;
std::vector<RAT::PMTCharge *> fPMTCharge;
std::map<std::string, double> fModelNoiseMap;
Expand Down
2 changes: 1 addition & 1 deletion src/daq/src/NoiseProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NoiseProc::NoiseProc() : Processor("noise") {}
void NoiseProc::BeginOfRun(DS::Run *run) {
DBLinkPtr lnoise = DB::Get()->GetLink("NOISEPROC");

fNoiseFlag = lnoise->GetI("noise_flag");
fNoiseFlag = lnoise->GetD("noise_flag");
fDefaultNoiseRate = lnoise->GetD("default_noise_rate");
fLookback = lnoise->GetD("noise_lookback");
fLookforward = lnoise->GetD("noise_lookforward");
Expand Down
2 changes: 0 additions & 2 deletions src/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ add_library(db OBJECT
src/DBTable.cc)

# Set our include directories
target_include_directories(db SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(db PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/db/include/RAT/DB.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ double rindex = lmedia->GetD("index_of_refraction");
#include <RAT/DBTable.hh>
#include <RAT/HTTPDownloader.hh>
#include <RAT/Log.hh>
#include <RAT/smart_ptr.hpp>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <smart_ptr.hpp>
#include <string>

namespace RAT {
Expand Down
2 changes: 1 addition & 1 deletion src/db/include/RAT/DBTable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#include <RAT/DBFieldCallback.hh>
#include <RAT/HashFunc.hh>
#include <RAT/hash.hpp>
#include <RAT/json.hh>
#include <hash.hpp>
#include <string>
#include <vector>

Expand Down
4 changes: 0 additions & 4 deletions src/ds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ add_library(ds OBJECT
src/MCPMT.cc
src/RunStore.cc)
# Set our include directories
target_include_directories(ds SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(ds PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down Expand Up @@ -57,8 +55,6 @@ root_generate_dictionary(G__RATDict
DEPENDENCIES core ds db io)

add_library(RATDict OBJECT G__RATDict.cxx)
target_include_directories(RATDict SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(RATDict PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 0 additions & 2 deletions src/fit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ add_library(fit OBJECT


# Set our include directories
target_include_directories(fit SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(fit PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 0 additions & 2 deletions src/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ endif()
add_library(gen OBJECT ${gen_sources})

# Set our include directories
target_include_directories(gen SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(gen PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
15 changes: 6 additions & 9 deletions src/gen/src/BetaFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,8 @@ bool BetaFunction::ReadInputFile(const std::string dName, int iZ, int iA, int iT
iRead = (fscanf(inputFile, "%s", dummy) > 0);
std::string iString(dummy);
if (iString == dProbe) {
bool readParseSuccess = fscanf(inputFile, "%s", tName) == 1;
readParseSuccess &= fscanf(inputFile, "%d %d %lf", &Z, &A, &tau) == 3;
if (!readParseSuccess) {
ThrowParsingException(inputFileName, dName);
}
fscanf(inputFile, "%s", tName);
fscanf(inputFile, "%d %d %f", &Z, &A, &tau);
std::string iString2(tName);
iFound = (dName == iString2);
iFound = ((iFound) || ((iA == A) && (iZ == Z)));
Expand All @@ -417,17 +414,17 @@ bool BetaFunction::ReadInputFile(const std::string dName, int iZ, int iA, int iT

bool iScan = true;
while (iScan) {
bool scanParseSuccess = fscanf(inputFile, "%lf %d %lf %d", &iBr, &iSpin, &W0, &nP) == 4;
bool parseSuccess = fscanf(inputFile, "%f %d %f %d", &iBr, &iSpin, &W0, &nP) == 4;
SetBranches((double)iBr, iSpin, (double)W0);
for (int j = 0; j < nReadGamma; j++) {
scanParseSuccess &= fscanf(inputFile, "%lf", &eP[j]) == 1;
parseSuccess &= fscanf(inputFile, "%f", &eP[j]) == 1;
if (eP[j] > 0.) SetGammas((double)eP[j]);
}
scanParseSuccess &= fscanf(inputFile, "%lf %lf %lf", &aC[0], &aC[1], &aC[2]) == 3;
parseSuccess &= fscanf(inputFile, "%f %f %f", &aC[0], &aC[1], &aC[2]) == 3;
if (iBr >= 1.) {
iScan = false;
}
if (!scanParseSuccess) {
if (!parseSuccess) {
ThrowParsingException(inputFileName, dName);
}
}
Expand Down
17 changes: 3 additions & 14 deletions src/gen/src/DecayChain.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <CLHEP/Vector/LorentzVector.h>

#include <G4Exception.hh>
#include <G4ExceptionSeverity.hh>
#include <RAT/DecayChain.hh>
#include <RAT/FermiFunction.hh>
#include <RAT/Log.hh>
Expand Down Expand Up @@ -187,27 +185,18 @@ bool DecayChain::ReadInputFile(const std::string dName) {
std::string iString(dummy);

if (iString == dProbe) {
bool parseSuccess = fscanf(inputFile, "%s", tName) == 1;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
fscanf(inputFile, "%s", tName);
std::string iString2(tName);
if (dName == iString2) {
if (!fAlphaDecayStart) {
iFound = true;
}
parseSuccess = fscanf(inputFile, "%d", &eP) == 1;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
fscanf(inputFile, "%d", &eP);
if (isVerbose) {
printf("Reading %s \n \n", tName);
}
for (int j = 0; j < eP; j++) {
parseSuccess &= fscanf(inputFile, "%s %d %lf %d %lf", sName, &iChain, &weight, &iDecay, &tau) == 5;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
fscanf(inputFile, "%s %d %f %d %f", sName, &iChain, &weight, &iDecay, &tau);
std::string iString3(sName);
if (iDecay != NullParticle && !fAlphaDecayStart) {
AddElement(iString3, iChain, iDecay, (double)tau, (double)weight);
Expand Down
2 changes: 0 additions & 2 deletions src/geo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ add_library(geo OBJECT
)

# Set our include directories
target_include_directories(geo SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(geo PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 0 additions & 2 deletions src/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ add_library(io OBJECT
src/TrackNav.cc)

# Set our include directories
target_include_directories(io SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(io PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/io/src/OutNetProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <RAT/Config.hh>
#include <RAT/Log.hh>
#include <RAT/OutNetProc.hh>
#include <string_utilities.hpp>
#include <RAT/string_utilities.hpp>
#include <vector>

namespace RAT {
Expand Down
4 changes: 2 additions & 2 deletions src/io/src/TrackCursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <RAT/Log.hh>
#include <RAT/TrackCursor.hh>
#include <RAT/TrackNode.hh>
#include <dprintf.hpp>
#include <RAT/dprintf.hpp>
#include <RAT/string_utilities.hpp>
#include <iostream>
#include <string_utilities.hpp>

namespace RAT {

Expand Down
2 changes: 0 additions & 2 deletions src/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ add_library(physics OBJECT
)

# Set our include directories
target_include_directories(physics SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(physics PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/physics/src/GLG4Scint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <RAT/NaiveQuenchingCalculator.hh>
#include <RAT/PhotonThinning.hh>
#include <RAT/TrackInfo.hh>
#include <fileio.hpp>
#include <RAT/fileio.hpp>

#include "G4Timer.hh"
#include "G4TrackFastVector.hh" // for G4TrackFastVectorSize
Expand Down
2 changes: 0 additions & 2 deletions src/ratbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ add_library(ratbase OBJECT
src/AnyParse.cc)

# Set our include directories
target_include_directories(ratbase SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(ratbase PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
3 changes: 0 additions & 3 deletions src/stlplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ add_library(stlplus OBJECT
src/stringio.cc
src/textio.cc)

target_compile_options(stlplus PUBLIC -w)
# Set our include directories
target_include_directories(stlplus SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(stlplus PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class hash_iterator {
hash_element<K, T>* m_element;

void check_owner(const hash<K, T, H, E>* owner) const throw();
void check_non_null(void) const;
void check_non_end(void) const;
void check_non_null(void) const throw();
void check_non_end(void) const throw();
void check_valid(void) const throw();
void check(const hash<K, T, H, E>* owner) const throw();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ void hash_iterator<K,T,H,E,V>::check_owner(const hash<K,T,H,E>* _owner) const

template<typename K, typename T, class H, class E, typename V>
void hash_iterator<K,T,H,E,V>::check_non_null(void) const
throw()
{
if (null())
throw null_dereference("hash iterator");
}

template<typename K, typename T, class H, class E, typename V>
void hash_iterator<K,T,H,E,V>::check_non_end(void) const
throw()
{
if (end())
throw end_dereference("hash iterator");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/stlplus/src/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
License: BSD License, see ../docs/license.html
------------------------------------------------------------------------------*/
#include "debug.hpp"
#include "RAT/debug.hpp"

#include <stdlib.h>

#include "file_system.hpp"
#include "string_utilities.hpp"
#include "RAT/file_system.hpp"
#include "RAT/string_utilities.hpp"

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

Expand Down
6 changes: 3 additions & 3 deletions src/stlplus/src/dprintf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
License: BSD License, see ../docs/license.html
------------------------------------------------------------------------------*/
#include "dprintf.hpp"
#include "RAT/dprintf.hpp"

#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <stdio.h>

#include "debug.hpp"
#include "string_utilities.hpp"
#include "RAT/debug.hpp"
#include "RAT/string_utilities.hpp"

/*--------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/stlplus/src/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
------------------------------------------------------------------------------*/

#include "exceptions.hpp"
#include "RAT/exceptions.hpp"

#include "debug.hpp"
#include "fileio.hpp"
#include "RAT/debug.hpp"
#include "RAT/fileio.hpp"

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

Expand Down
Loading

0 comments on commit c627aae

Please sign in to comment.