diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-01-21 09:45:29 +1100 | 
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-01-21 09:45:29 +1100 | 
| commit | c63c9dc7ca058d1b352c14f8052769d541c7e955 (patch) | |
| tree | 726bbd8e98196bc0b224448af3ed6227fae96d3e /src/LineMarker.cxx | |
| parent | 023603c25dfdc73b0a51baaf3309d1bf18e04261 (diff) | |
| download | scintilla-mirror-c63c9dc7ca058d1b352c14f8052769d541c7e955.tar.gz | |
Added ELEMENTS macro and use it to clarify determining size of arrays.
Diffstat (limited to 'src/LineMarker.cxx')
| -rw-r--r-- | src/LineMarker.cxx | 20 | 
1 files changed, 8 insertions, 12 deletions
| diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index cf44928b4..708e6a320 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -14,6 +14,8 @@  #include "Platform.h"  #include "Scintilla.h" + +#include "StringCopy.h"  #include "XPM.h"  #include "LineMarker.h" @@ -141,8 +143,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac      		Point(centreX - dimOn4, centreY + dimOn2),      		Point(centreX + dimOn2 - dimOn4, centreY),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -                 		fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else if (markType == SC_MARK_ARROWDOWN) {  		Point pts[] = { @@ -150,8 +151,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac      		Point(centreX + dimOn2, centreY - dimOn4),      		Point(centreX, centreY + dimOn2 - dimOn4),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -                 		fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else if (markType == SC_MARK_PLUS) {  		Point pts[] = { @@ -168,8 +168,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac      		Point(centreX - 1, centreY + 1),      		Point(centreX - armSize, centreY + 1),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -                 		fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else if (markType == SC_MARK_MINUS) {  		Point pts[] = { @@ -178,8 +177,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac      		Point(centreX + armSize, centreY +1),      		Point(centreX - armSize, centreY + 1),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -                 		fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else if (markType == SC_MARK_SMALLRECT) {  		PRectangle rcSmall; @@ -374,8 +372,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  			Point(centreX, centreY + dimOn4),  			Point(centreX, centreY + dimOn2),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -				fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else if (markType == SC_MARK_LEFTRECT) {  		PRectangle rcLeft = rcWhole;  		rcLeft.right = rcLeft.left + 4; @@ -389,8 +386,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  			Point(rc.right-3, centreY+halfHeight),  			Point(rc.left, centreY+halfHeight),  		}; -		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), -				fore, back); +		surface->Polygon(pts, ELEMENTS(pts), fore, back);  	} else { // SC_MARK_FULLRECT  		surface->FillRectangle(rcWhole, back);  	} | 
