diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-27 21:26:37 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-28 19:57:10 +0100 |
commit | 6b3dbd5c67f5f3a03c712682f603e646afa2f621 (patch) | |
tree | e671224ba176585579513dedca867c8ab5a44ced | |
parent | 70199495747543c97a05ca2d692780107e528ebd (diff) |
Implement IncSet_filter as function
Make it more readable and fix unenclosed macro arguments
-rw-r--r-- | IncSet.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -21,8 +21,6 @@ typedef enum { INC_FILTER = 1 } IncType; -#define IncSet_filter(inc_) (inc_->filtering ? inc_->modes[INC_FILTER].buffer : NULL) - typedef struct IncMode_ { char buffer[INCMODE_MAX+1]; int index; @@ -38,6 +36,10 @@ typedef struct IncSet_ { bool found; } IncSet; +static inline const char* IncSet_filter(const IncSet* this) { + return this->filtering ? this->modes[INC_FILTER].buffer : NULL; +} + typedef const char* (*IncMode_GetPanelValue)(Panel*, int); void IncSet_reset(IncSet* this, IncType type); |