Commit 54621e8b authored by Explorer09's avatar Explorer09
Browse files

Fix macro Header_forEachColumn

The (this_) token was not expanded properly, but the bug was not caught
because all uses of this macro specifies (this_)=this .

Also parenthesize macro tokens to prevent further problems.
parent 572546f8
...@@ -37,7 +37,7 @@ typedef struct Header_ { ...@@ -37,7 +37,7 @@ typedef struct Header_ {
#endif #endif
#ifndef Header_forEachColumn #ifndef Header_forEachColumn
#define Header_forEachColumn(this_, i_) for (int i_=0; i_ < this->nrColumns; i_++) #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_))
#endif #endif
Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns) { Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns) {
......
...@@ -28,7 +28,7 @@ typedef struct Header_ { ...@@ -28,7 +28,7 @@ typedef struct Header_ {
#endif #endif
#ifndef Header_forEachColumn #ifndef Header_forEachColumn
#define Header_forEachColumn(this_, i_) for (int i_=0; i_ < this->nrColumns; i_++) #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_))
#endif #endif
Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns);
......
Markdown is supported
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