Skip to content

Commit 55f052f

Browse files
committed
[3018198] Fixing the build with clang
Typo in agg causes a template instantiation bug on compilers that actually instantiate everything. svn path=/trunk/matplotlib/; revision=8465
1 parent dc5b8c6 commit 55f052f

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

agg24/include/agg_scanline_u.h

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Anti-Grain Geometry - Version 2.4
33
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
44
//
5-
// Permission to copy, use, modify, sell and distribute this software
6-
// is granted provided this copyright notice appears in all copies.
5+
// Permission to copy, use, modify, sell and distribute this software
6+
// is granted provided this copyright notice appears in all copies.
77
// This software is provided "as is" without express or implied
88
// warranty, and with no claim as to its suitability for any purpose.
99
//
@@ -13,12 +13,12 @@
1313
// http://www.antigrain.com
1414
//----------------------------------------------------------------------------
1515
//
16-
// Adaptation for 32-bit screen coordinates (scanline32_u) has been sponsored by
16+
// Adaptation for 32-bit screen coordinates (scanline32_u) has been sponsored by
1717
// Liberty Technology Systems, Inc., visit http://lib-sys.com
1818
//
1919
// Liberty Technology Systems, Inc. is the provider of
2020
// PostScript and PDF technology for software developers.
21-
//
21+
//
2222
//----------------------------------------------------------------------------
2323

2424
#ifndef AGG_SCANLINE_U_INCLUDED
@@ -32,22 +32,22 @@ namespace agg
3232
//
3333
// Unpacked scanline container class
3434
//
35-
// This class is used to transfer data from a scanline rasterizer
36-
// to the rendering buffer. It's organized very simple. The class stores
37-
// information of horizontal spans to render it into a pixel-map buffer.
38-
// Each span has staring X, length, and an array of bytes that determine the
39-
// cover-values for each pixel.
40-
// Before using this class you should know the minimal and maximal pixel
35+
// This class is used to transfer data from a scanline rasterizer
36+
// to the rendering buffer. It's organized very simple. The class stores
37+
// information of horizontal spans to render it into a pixel-map buffer.
38+
// Each span has staring X, length, and an array of bytes that determine the
39+
// cover-values for each pixel.
40+
// Before using this class you should know the minimal and maximal pixel
4141
// coordinates of your scanline. The protocol of using is:
4242
// 1. reset(min_x, max_x)
43-
// 2. add_cell() / add_span() - accumulate scanline.
43+
// 2. add_cell() / add_span() - accumulate scanline.
4444
// When forming one scanline the next X coordinate must be always greater
4545
// than the last stored one, i.e. it works only with ordered coordinates.
4646
// 3. Call finalize(y) and render the scanline.
4747
// 3. Call reset_spans() to prepare for the new scanline.
48-
//
48+
//
4949
// 4. Rendering:
50-
//
50+
//
5151
// Scanline provides an iterator class that allows you to extract
5252
// the spans and the cover values for each pixel. Be aware that clipping
5353
// has not been done yet, so you should perform it yourself.
@@ -61,10 +61,10 @@ namespace agg
6161
// ************************************
6262
//
6363
// scanline_u8::const_iterator span = sl.begin();
64-
//
65-
// unsigned char* row = m_rbuf->row(y); // The the address of the beginning
64+
//
65+
// unsigned char* row = m_rbuf->row(y); // The the address of the beginning
6666
// // of the current row
67-
//
67+
//
6868
// unsigned num_spans = sl.num_spans(); // Number of spans. It's guaranteed that
6969
// // num_spans is always greater than 0.
7070
//
@@ -75,7 +75,7 @@ namespace agg
7575
//
7676
// int num_pix = span->len; // Number of pixels of the span.
7777
// // Always greater than 0, still it's
78-
// // better to use "int" instead of
78+
// // better to use "int" instead of
7979
// // "unsigned" because it's more
8080
// // convenient for clipping
8181
// int x = span->x;
@@ -86,24 +86,24 @@ namespace agg
8686
// **************************************
8787
//
8888
// unsigned char* dst = row + x; // Calculate the start address of the row.
89-
// // In this case we assume a simple
89+
// // In this case we assume a simple
9090
// // grayscale image 1-byte per pixel.
9191
// do
9292
// {
93-
// *dst++ = *covers++; // Hypotetical rendering.
93+
// *dst++ = *covers++; // Hypotetical rendering.
9494
// }
9595
// while(--num_pix);
9696
//
9797
// ++span;
98-
// }
98+
// }
9999
// while(--num_spans); // num_spans cannot be 0, so this loop is quite safe
100100
//------------------------------------------------------------------------
101101
//
102102
// The question is: why should we accumulate the whole scanline when we
103103
// could render just separate spans when they're ready?
104-
// That's because using the scanline is generally faster. When is consists
104+
// That's because using the scanline is generally faster. When is consists
105105
// of more than one span the conditions for the processor cash system
106-
// are better, because switching between two different areas of memory
106+
// are better, because switching between two different areas of memory
107107
// (that can be very large) occurs less frequently.
108108
//------------------------------------------------------------------------
109109
class scanline_u8
@@ -203,9 +203,9 @@ namespace agg
203203
}
204204

205205
//--------------------------------------------------------------------
206-
void finalize(int y)
207-
{
208-
m_y = y;
206+
void finalize(int y)
207+
{
208+
m_y = y;
209209
}
210210

211211
//--------------------------------------------------------------------
@@ -238,11 +238,11 @@ namespace agg
238238

239239

240240
//==========================================================scanline_u8_am
241-
//
241+
//
242242
// The scanline container with alpha-masking
243-
//
243+
//
244244
//------------------------------------------------------------------------
245-
template<class AlphaMask>
245+
template<class AlphaMask>
246246
class scanline_u8_am : public scanline_u8
247247
{
248248
public:
@@ -264,9 +264,9 @@ namespace agg
264264
unsigned count = base_type::num_spans();
265265
do
266266
{
267-
m_alpha_mask->combine_hspan(span->x,
268-
base_type::y(),
269-
span->covers,
267+
m_alpha_mask->combine_hspan(span->x,
268+
base_type::y(),
269+
span->covers,
270270
span->len);
271271
++span;
272272
}
@@ -390,8 +390,8 @@ namespace agg
390390
}
391391
else
392392
{
393-
m_spans.add(span(coord_type(x + m_min_x),
394-
coord_type(len),
393+
m_spans.add(span(coord_type(x + m_min_x),
394+
coord_type(len),
395395
&m_covers[x]));
396396
}
397397
m_last_x = x + len - 1;
@@ -408,17 +408,17 @@ namespace agg
408408
}
409409
else
410410
{
411-
m_spans.add(span(coord_type(x + m_min_x),
412-
coord_type(len),
411+
m_spans.add(span(coord_type(x + m_min_x),
412+
coord_type(len),
413413
&m_covers[x]));
414414
}
415415
m_last_x = x + len - 1;
416416
}
417417

418418
//--------------------------------------------------------------------
419-
void finalize(int y)
420-
{
421-
m_y = y;
419+
void finalize(int y)
420+
{
421+
m_y = y;
422422
}
423423

424424
//--------------------------------------------------------------------
@@ -450,15 +450,15 @@ namespace agg
450450

451451

452452
//========================================================scanline32_u8_am
453-
//
453+
//
454454
// The scanline container with alpha-masking
455-
//
455+
//
456456
//------------------------------------------------------------------------
457-
template<class AlphaMask>
457+
template<class AlphaMask>
458458
class scanline32_u8_am : public scanline32_u8
459459
{
460460
public:
461-
typedef scanline_u8 base_type;
461+
typedef scanline32_u8 base_type;
462462
typedef AlphaMask alpha_mask_type;
463463
typedef base_type::cover_type cover_type;
464464
typedef base_type::coord_type coord_type;
@@ -477,9 +477,9 @@ namespace agg
477477
unsigned count = base_type::num_spans();
478478
do
479479
{
480-
m_alpha_mask->combine_hspan(span->x,
481-
base_type::y(),
482-
span->covers,
480+
m_alpha_mask->combine_hspan(span->x,
481+
base_type::y(),
482+
span->covers,
483483
span->len);
484484
++span;
485485
}

0 commit comments

Comments
 (0)