WSL/SLF GitLab Repository

Commit 3d3de7f4 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Fixed two warnings on osX and turned off the global-constructor /...

Fixed two warnings on osX and turned off the global-constructor / exit-time-destructor warnings for Clang (since there is pretty much no viable alternative to what these warnings are about). Fixed a formatting typo in smet_extract.sh
parent e083b94e
......@@ -81,7 +81,7 @@ ELSE()
SET(PROFILING "-pg") #add ${PROFILING} to the CFLAGS when necessary
SET(EXTRA "${EXTRA} -fcolor-diagnostics") #-fapple-pragma-pack does not seems necessary; -ftrapv should be replaced by sanitize=integer
SET(OPTIM "${OPTIM} -flto")
SET(WARNINGS "${WARNINGS} -Weverything -Wno-date-time -Wno-float-equal -Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast -Wno-padded -Wno-missing-noreturn -Wno-weak-vtables -Wno-switch-enum -Wno-covered-switch-default") #obviously, we should try to fix the warnings! Keeping in mind that some of these W are half buggy...
SET(WARNINGS "${WARNINGS} -Weverything -Wno-date-time -Wno-float-equal -Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast -Wno-padded -Wno-missing-noreturn -Wno-weak-vtables -Wno-switch-enum -Wno-covered-switch-default -Wno-global-constructors -Wno-exit-time-destructors") #obviously, we should try to fix the warnings! Keeping in mind that some of these W are half buggy...
SET(DEEP_WARNINGS "${DEEP_WARNINGS} -Rpass=.*")
SET(LEAKS_CHECK OFF CACHE BOOL "Set to ON to dynamically check for memory corruption (and do the same for applications linked with MeteoIO)")
IF (LEAKS_CHECK)
......
......@@ -112,8 +112,8 @@ const double CosmoXMLIO::in_tz = 0.; //Plugin specific timezone
const xmlChar* CosmoXMLIO::xml_attribute = (const xmlChar *)"id";
const xmlChar* CosmoXMLIO::xml_namespace = (const xmlChar *)"http://www.meteoswiss.ch/xmlns/modeltemplate/2";
const xmlChar* CosmoXMLIO::xml_namespace_abrev = (const xmlChar*)"ns";
const std::string CosmoXMLIO::StationData_xpath = "//ns:datainformation/ns:data-tables/ns:data/ns:row/ns:col";
const std::string CosmoXMLIO::MeteoData_xpath = "//ns:valueinformation/ns:values-tables/ns:data/ns:row/ns:col";
const char* CosmoXMLIO::StationData_xpath = "//ns:datainformation/ns:data-tables/ns:data/ns:row/ns:col";
const char* CosmoXMLIO::MeteoData_xpath = "//ns:valueinformation/ns:values-tables/ns:data/ns:row/ns:col";
CosmoXMLIO::CosmoXMLIO(const std::string& configfile)
: cache_meteo_files(), xml_stations_id(), input_id(),
......@@ -292,7 +292,7 @@ bool CosmoXMLIO::parseStationData(const std::string& station_id, const xmlXPathC
//match something like "//ns:valueinformation/ns:values-tables/ns:data/ns:row/ns:col[@id='station_abbreviation' and text()='ATT']/.."
//the namespace "ns" has been previously defined
const std::string xpath_id = (imis_stations)? station_id.substr(0, station_id.find_first_of("0123456789")) : station_id;
const std::string xpath = StationData_xpath+"[@id='station_abbreviation' and text()='"+xpath_id+"']/.."; //and we take the parent node <row>
const std::string xpath = std::string(StationData_xpath)+"[@id='station_abbreviation' and text()='"+xpath_id+"']/.."; //and we take the parent node <row>
xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression((const xmlChar*)xpath.c_str(), xpathCtx);
if (xpathObj == NULL) return false;
......@@ -445,7 +445,7 @@ void CosmoXMLIO::readStationData(const Date& station_date, std::vector<StationDa
bool CosmoXMLIO::parseMeteoData(const Date& dateStart, const Date& dateEnd, const std::string& station_id, const StationData& sd, const xmlXPathContextPtr& xpathCtx, std::vector<MeteoData> &vecMeteo) const
{
const std::string xpath = MeteoData_xpath+"[@id='identifier' and text()='"+station_id+"']";
const std::string xpath = std::string(MeteoData_xpath)+"[@id='identifier' and text()='"+station_id+"']";
xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression((const xmlChar*)xpath.c_str(), xpathCtx);
if (xpathObj == NULL) return false;
......
......@@ -83,7 +83,8 @@ class CosmoXMLIO : public IOInterface {
static const xmlChar* xml_attribute;
static const xmlChar* xml_namespace;
static const xmlChar* xml_namespace_abrev;
static const std::string StationData_xpath, MeteoData_xpath;
static const char* StationData_xpath;
static const char* MeteoData_xpath;
std::string coordin, coordinparam; //projection parameters
};
......
......@@ -6,7 +6,7 @@ if [ $# -lt 1 ]; then
printf "Usage: \n"
printf "\t$me {smet_file} {parameter}\n\t\t to extract the given parameter out of the given file\n"
printf "\t$me {smet_file} {parameter} {aggregation}\n\t\t to extract the monthly aggregated given parameter out of the given file\n"
printf "\t\t\t where {aggregation} is any of (AVG, MIN, MAX)"
printf "\t\t where {aggregation} is any of (AVG, MIN, MAX)\n"
exit 0
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment