OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr42183.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
class IntSize {
4
public:
5
    IntSize(int width, int height) : m_width(width), m_height(height) { }
6
    int m_width, m_height;
7
};
8
class IntPoint {
9
public:
10
    IntPoint(int x, int y) : m_x(x), m_y(y) { }
11
    int m_x, m_y;
12
};
13
class IntRect {
14
public:
15
    IntRect(int x, int y, int width, int height)
16
        : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) { }
17
    void intersect(const IntRect&);
18
    IntPoint m_location;
19
    IntSize m_size;
20
};
21
inline IntRect intersection(const IntRect& a, const IntRect& b) {
22
    IntRect c = a;
23
    c.intersect(b);
24
    return c;
25
}
26
class RenderObject  {
27
public:
28
    int contentWidth() const { }
29
    int contentHeight() const { }
30
    virtual int xPos() const { }
31
    virtual int yPos() const { }
32
    virtual int paddingTop() const;
33
    virtual int paddingLeft() const;
34
    virtual int borderTop() const { }
35
    virtual int borderLeft() const { }
36
};
37
class RenderMenuList : public RenderObject {
38
    virtual IntRect controlClipRect(int tx, int ty) const;
39
    RenderObject* m_innerBlock;
40
};
41
IntRect RenderMenuList::controlClipRect(int tx, int ty) const {
42
    IntRect outerBox(tx + borderLeft() + paddingLeft(),
43
                     ty + borderTop() + paddingTop(),
44
                     contentWidth(), contentHeight());
45
    IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(),
46
                     ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(),
47
                     m_innerBlock->contentWidth(),
48
                     m_innerBlock->contentHeight());
49
    return intersection(outerBox, innerBox);
50
}
51
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.