Skip to content

Commit

Permalink
Avoid referencing the macro argument defaultValue twice,
Browse files Browse the repository at this point in the history
in case it actually is a function call.
Replace some typedef's by using.
  • Loading branch information
kmokstad committed Dec 29, 2024
1 parent eb8da65 commit ef6e23b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/FFaLib/FFaContainers/FFaFieldContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@ protected:

// The read/writable fields

typedef std::set<std::string> FDict;
typedef FDict::const_iterator FDictIt;
using FDict = std::set<std::string>;
using FDictIt = FDict::const_iterator;

struct FDictLess
{
bool operator()(FDictIt s1, FDictIt s2) const { return *s1 < *s2; }
};

typedef std::map<FDictIt,FFaFieldBase*,FDictLess> FieldContainerMap;
typedef FFaSingelton<FDict,FFaFieldContainer> FieldContainerDict;
using FieldContainerMap = std::map<FDictIt,FFaFieldBase*,FDictLess>;
using FieldContainerDict = FFaSingelton<FDict,FFaFieldContainer>;

FieldContainerMap myFields;

Expand All @@ -173,7 +173,7 @@ private:

// The internal book keeping of who is pointing to whom

typedef std::vector<FFaReferenceBase*> ReferenceSet;
using ReferenceSet = std::vector<FFaReferenceBase*>;

ReferenceSet myRefBy;
std::list<FFaReferenceBase*> myRefTo;
Expand All @@ -189,12 +189,12 @@ private:
#define FFA_FIELD_INIT(field, defaultValue, identifier) \
this->addField(identifier, &field); \
field.setValue(defaultValue,false); \
field.setDefaultValue(defaultValue,false)
field.setDefaultValue(field.getValue(),false)

#define FFA_OBSOLETE_FIELD_INIT(field, defaultValue, identifier, obj) \
obj->addField(identifier, &field); \
field.setValue(defaultValue,false); \
field.setDefaultValue(defaultValue,false)
field.setDefaultValue(field.getValue(),false)

#define FFA_FIELD_DEFAULT_INIT(field, identifier) \
this->addField(identifier, &field)
Expand Down
2 changes: 1 addition & 1 deletion src/FFaLib/FFaContainers/FFaReference.H
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public:
The pointer value in Fields of Ref pointers are not supposed to change.
*/

typedef FFaReferenceBase* FFaRefPtr;
using FFaRefPtr = FFaReferenceBase*;

template<> inline
FFaField<FFaRefPtr>::FFaField()
Expand Down
2 changes: 1 addition & 1 deletion src/FFaLib/FFaContainers/FFaReferenceList.H
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private:
Specialized methods for FFaField.
*/

typedef FFaReferenceListBase* FFaRefListPtr;
using FFaRefListPtr = FFaReferenceListBase*;

template<> inline
FFaField<FFaRefListPtr>::FFaField()
Expand Down

0 comments on commit ef6e23b

Please sign in to comment.