Fix errors detected with gcc.

This commit is contained in:
David Capello 2012-01-01 23:37:32 -03:00
parent 9320dca214
commit ea3570796a
5 changed files with 19 additions and 19 deletions

View File

@ -48,7 +48,7 @@ public:
void bottom(const T& bottom) { m_bottom = bottom; }
SizeT<T> getSize() const {
return Size(m_left + m_right, m_top + m_bottom);
return SizeT<T>(m_left + m_right, m_top + m_bottom);
}
const BorderT& operator+=(const BorderT& br) {

View File

@ -60,8 +60,8 @@ public:
// See that point2 isn't included in the rectangle, it's like the
// point returned by getPoint2() member function.
RectT(const PointT<T>& point1, const PointT<T>& point2) {
Point leftTop = point1;
Point rightBottom = point2;
PointT<T> leftTop = point1;
PointT<T> rightBottom = point2;
register T t;
if (leftTop.x > rightBottom.x) {
@ -216,21 +216,21 @@ public:
else if (rc.isEmpty())
return *this;
else
return Rect(Point(x < rc.x ? x: rc.x,
y < rc.y ? y: rc.y),
Point(x+w > rc.x+rc.w ? x+w: rc.x+rc.w,
y+h > rc.y+rc.h ? y+h: rc.y+rc.h));
return RectT(PointT<T>(x < rc.x ? x: rc.x,
y < rc.y ? y: rc.y),
PointT<T>(x+w > rc.x+rc.w ? x+w: rc.x+rc.w,
y+h > rc.y+rc.h ? y+h: rc.y+rc.h));
}
// Returns the intersection rectangle between this and rc rectangles.
RectT createIntersect(const RectT& rc) const {
if (intersects(rc))
return Rect(Point(x > rc.x ? x: rc.x,
y > rc.y ? y: rc.y),
Point(x+w < rc.x+rc.w ? x+w: rc.x+rc.w,
y+h < rc.y+rc.h ? y+h: rc.y+rc.h));
return RectT(PointT<T>(x > rc.x ? x: rc.x,
y > rc.y ? y: rc.y),
PointT<T>(x+w < rc.x+rc.w ? x+w: rc.x+rc.w,
y+h < rc.y+rc.h ? y+h: rc.y+rc.h));
else
return Rect();
return RectT();
}
const RectT& operator+=(const BorderT<T>& br) {
@ -244,11 +244,11 @@ public:
}
RectT operator+(const BorderT<T>& br) const {
return Rect(*this).enlarge(br);
return RectT(*this).enlarge(br);
}
RectT operator-(const BorderT<T>& br) const {
return Rect(*this).shrink(br);
return RectT(*this).shrink(br);
}
bool operator==(const RectT& rc) const {

View File

@ -31,11 +31,11 @@ public:
}
template<typename T2>
explicit SizeT(const SizeT<T2>& size) : x(static_cast<T>(size.x)),
y(static_cast<T>(size.y)) {
explicit SizeT(const SizeT<T2>& size) : w(static_cast<T>(size.w)),
h(static_cast<T>(size.h)) {
}
explicit SizeT(const PointT<T>& point) : w(pt.x), h(pt.y) {
explicit SizeT(const PointT<T>& point) : w(point.x), h(point.y) {
}
SizeT createUnion(const SizeT& sz) const {

View File

@ -153,7 +153,7 @@ protected:
typename Traits::address_t m_addr;
public:
void startScan(Image* bmp, int x, int y) {
m_addr = ((Traits::address_t*)bmp->line)[y]+x;
m_addr = ((typename Traits::address_t*)bmp->line)[y]+x;
}
};

View File

@ -176,7 +176,7 @@ bool MovingPixelsState::onMouseUp(Editor* editor, Message* msg)
m_pixelsMovement->dropImageTemporarily();
// Redraw the new pivot location.
invalidate();
editor->invalidate();
editor->releaseMouse();
return true;