Various code fixes for building on Mac OSX

This commit is contained in:
Rob Taylor 2023-08-25 17:07:29 +01:00 committed by Jean-Paul Chaput
parent bda776ec02
commit 1e74e5a167
6 changed files with 39 additions and 44 deletions

View File

@ -50,13 +50,13 @@ namespace Bora {
SlicingPlotWidget ( QWidget* parent=NULL ); SlicingPlotWidget ( QWidget* parent=NULL );
virtual ~SlicingPlotWidget (); virtual ~SlicingPlotWidget ();
Cell* getCell (); Cell* getCell ();
void setViewer ( CellViewer* ); void setViewer ( CellViewer* viewer);
void setDatas (); void setDatas ();
public slots: public slots:
#if QWT_VERSION < 0x060000 #if QWT_VERSION < 0x060000
void onPointSelect ( const QwtDoublePoint& ); void onPointSelect ( const QwtDoublePoint& point);
#else #else
void onPointSelect ( const QPointF& ); void onPointSelect ( const QPointF& point);
#endif #endif
void updateSelectedPoint ( double x, double y ); void updateSelectedPoint ( double x, double y );
signals: signals:

View File

@ -48,7 +48,7 @@ void deallocate_heap()
void heap_init( long n ) void heap_init( long n )
{ {
register long p; long p;
allocate_heap( n ); allocate_heap( n );
_heap_size = 0; _heap_size = 0;
@ -66,9 +66,9 @@ void heap_insert(
long key long key
) )
{ {
register long k; /* hole in the heap */ long k; /* hole in the heap */
register long j; /* parent of the hole */ long j; /* parent of the hole */
register long q; /* heap_elt(j) */ long q; /* heap_elt(j) */
heap_key( p ) = key; heap_key( p ) = key;
@ -107,9 +107,9 @@ void heap_decrease_key
long new_key long new_key
) )
{ {
register long k; /* hole in the heap */ long k; /* hole in the heap */
register long j; /* parent of the hole */ long j; /* parent of the hole */
register long q; /* heap_elt(j) */ long q; /* heap_elt(j) */
heap_key( p ) = new_key; heap_key( p ) = new_key;
k = heap_idx( p ); k = heap_idx( p );
@ -138,9 +138,9 @@ void heap_decrease_key
long heap_delete_min() long heap_delete_min()
{ {
long min, last; long min, last;
register long k; /* hole in the heap */ long k; /* hole in the heap */
register long j; /* child of the hole */ long j; /* child of the hole */
register long l_key; /* key of last point */ long l_key; /* key of last point */
if( _heap_size == 0 ) /* heap is empty */ if( _heap_size == 0 ) /* heap is empty */
return( -1 ); return( -1 );

View File

@ -172,8 +172,8 @@ namespace Cfg {
void ConfigurationWidget::syncSlaves () void ConfigurationWidget::syncSlaves ()
{ {
const map<string,Parameter*>& parameters = Configuration::get()->getParameters (); const map<const string,Parameter*>& parameters = Configuration::get()->getParameters ();
map<string,Parameter*>::const_iterator iparam = parameters.begin(); map<const string,Parameter*>::const_iterator iparam = parameters.begin();
for ( ; iparam != parameters.end() ; ++iparam ) { for ( ; iparam != parameters.end() ; ++iparam ) {
if ( (*iparam).second->getSlaves().empty() ) continue; if ( (*iparam).second->getSlaves().empty() ) continue;

View File

@ -36,7 +36,7 @@ namespace Cfg {
public: public:
class LogEntry { class LogEntry {
public: public:
inline LogEntry ( std::string id ); inline LogEntry ( const std::string id );
inline std::string getId () const; inline std::string getId () const;
inline std::string getValid () const; inline std::string getValid () const;
inline void restore () const; inline void restore () const;
@ -50,37 +50,37 @@ namespace Cfg {
static Parameter::Priority pushDefaultPriority ( Parameter::Priority ); static Parameter::Priority pushDefaultPriority ( Parameter::Priority );
static Parameter::Priority popDefaultPriority (); static Parameter::Priority popDefaultPriority ();
static Parameter::Priority getDefaultPriority (); static Parameter::Priority getDefaultPriority ();
static void _tokenize ( std::set<std::string>& tokens, std::string line ); static void _tokenize ( std::set<const std::string>& tokens, const std::string line );
public: public:
// Methods. // Methods.
ConfigurationWidget* buildWidget ( unsigned int flags ); ConfigurationWidget* buildWidget ( unsigned int flags );
ConfigurationDialog* buildDialog (); ConfigurationDialog* buildDialog ();
inline const std::map<std::string,Parameter*>& inline const std::map<const std::string,Parameter*>&
getParameters () const; getParameters () const;
const std::set<LogEntry>& getLogs ( unsigned int ilog ) const; const std::set<LogEntry>& getLogs ( unsigned int ilog ) const;
inline unsigned int getFlags () const; inline unsigned int getFlags () const;
inline const LayoutDescription& getLayout () const; inline const LayoutDescription& getLayout () const;
inline LayoutDescription& getLayout (); inline LayoutDescription& getLayout ();
Parameter* getParameter ( std::string id Parameter* getParameter ( const std::string id
, Parameter::Type type=Parameter::Unknown ) const; , Parameter::Type type=Parameter::Unknown ) const;
Parameter* addParameter ( std::string id Parameter* addParameter ( const std::string id
, Parameter::Type type , Parameter::Type type
, std::string value , const std::string value
, Parameter::Priority priority=Parameter::UseDefault ); , Parameter::Priority priority=Parameter::UseDefault );
inline void setFlags ( unsigned int mask ); inline void setFlags ( unsigned int mask );
inline bool hasLogs ( unsigned int mask ) const; inline bool hasLogs ( unsigned int mask ) const;
void addLog ( unsigned int mask, std::string id ); void addLog ( unsigned int mask, const std::string id );
void removeLog ( unsigned int mask, std::string id ); void removeLog ( unsigned int mask, const std::string id );
inline void restoreFromLogs ( unsigned int mask ); inline void restoreFromLogs ( unsigned int mask );
inline void clearLogs ( unsigned int mask ); inline void clearLogs ( unsigned int mask );
void print ( std::ostream& ) const; void print ( std::ostream& ) const;
bool readFromFile ( std::string ); bool readFromFile ( const std::string );
bool writeToFile ( std::string, unsigned int flags, std::string tabs="" ) const; bool writeToFile ( const std::string, unsigned int flags, const std::string tabs="" ) const;
void writeToStream ( std::ostream&, unsigned int flags, std::string tabs="" ) const; void writeToStream ( std::ostream&, unsigned int flags, const std::string tabs="" ) const;
private: private:
// Attributes. // Attributes.
static Configuration* _singleton; static Configuration* _singleton;
std::map<std::string,Parameter*> _parameters; std::map<const std::string,Parameter*> _parameters;
LayoutDescription _layout; LayoutDescription _layout;
unsigned int _flags; unsigned int _flags;
std::map< unsigned int, std::set<LogEntry> > _logSets; std::map< unsigned int, std::set<LogEntry> > _logSets;
@ -90,7 +90,7 @@ namespace Cfg {
// Inline Methods. // Inline Methods.
inline const std::map<std::string,Parameter*>& Configuration::getParameters () const inline const std::map<const std::string,Parameter*>& Configuration::getParameters () const
{ return _parameters; } { return _parameters; }
inline const LayoutDescription& Configuration::getLayout () const { return _layout; } inline const LayoutDescription& Configuration::getLayout () const { return _layout; }
@ -132,13 +132,13 @@ namespace Cfg {
} }
inline bool hasParameter ( std::string id ) inline bool hasParameter ( const std::string id )
{ {
return (Configuration::get()->getParameter(id,Parameter::Unknown) != NULL); return (Configuration::get()->getParameter(id,Parameter::Unknown) != NULL);
} }
inline Parameter* getParamString ( std::string id, std::string value="<undefined>" ) inline Parameter* getParamString ( const std::string id, std::string value="<undefined>" )
{ {
Parameter* parameter = Configuration::get()->getParameter(id,Parameter::String); Parameter* parameter = Configuration::get()->getParameter(id,Parameter::String);
if ( parameter == NULL ) { if ( parameter == NULL ) {
@ -148,7 +148,7 @@ namespace Cfg {
} }
inline Parameter* getParamBool ( std::string id, bool value=false ) inline Parameter* getParamBool ( const std::string id, bool value=false )
{ {
Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Bool); Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Bool);
if ( parameter == NULL ) { if ( parameter == NULL ) {
@ -159,7 +159,7 @@ namespace Cfg {
} }
inline Parameter* getParamInt ( std::string id, int value=0 ) inline Parameter* getParamInt ( const std::string id, int value=0 )
{ {
//std::cerr << "getParamInt() " << id << " value:" << value << std::endl; //std::cerr << "getParamInt() " << id << " value:" << value << std::endl;
@ -172,7 +172,7 @@ namespace Cfg {
} }
inline Parameter* getParamEnumerate ( std::string id, int value=0 ) inline Parameter* getParamEnumerate ( const std::string id, int value=0 )
{ {
Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Enumerate); Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Enumerate);
if ( parameter == NULL ) { if ( parameter == NULL ) {
@ -183,7 +183,7 @@ namespace Cfg {
} }
inline Parameter* getParamDouble ( std::string id, double value=0.0 ) inline Parameter* getParamDouble ( const std::string id, double value=0.0 )
{ {
Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Double); Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Double);
if ( parameter == NULL ) { if ( parameter == NULL ) {
@ -194,7 +194,7 @@ namespace Cfg {
} }
inline Parameter* getParamPercentage ( std::string id, double value=91.0 ) inline Parameter* getParamPercentage ( const std::string id, double value=91.0 )
{ {
Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Percentage); Parameter* parameter = Configuration::get()->getParameter(id,Parameter::Percentage);
if ( parameter == NULL ) { if ( parameter == NULL ) {
@ -205,7 +205,7 @@ namespace Cfg {
} }
inline Configuration::LogEntry::LogEntry ( std::string id ) inline Configuration::LogEntry::LogEntry ( const std::string id )
: _id (id) : _id (id)
, _valid("") , _valid("")
{ {

View File

@ -90,7 +90,7 @@
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <map> #include <map>
//#include <regex> #include <regex>
#include <regex.h> #include <regex.h>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace boptions = boost::program_options; namespace boptions = boost::program_options;

View File

@ -50,8 +50,8 @@ namespace Hurricane {
Warning ( const Warning& warning ); Warning ( const Warning& warning );
Warning& operator= ( const Warning& warning ); Warning& operator= ( const Warning& warning );
// Methods. // Methods.
inline string getReason () const; inline string getReason () const { return _reason; }
inline int getCode () const; inline int getCode () const { return _code; }
// Hurricane Managment. // Hurricane Managment.
virtual string _getTypeName () const; virtual string _getTypeName () const;
virtual string _getString () const; virtual string _getString () const;
@ -63,11 +63,6 @@ namespace Hurricane {
}; };
// Inline Functions.
inline string Warning::getReason () const { return _reason; }
inline int Warning::getCode () const { return _code; }
} // Hurricane namespace. } // Hurricane namespace.