various GCC 4 build fixes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18875 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen
2006-09-17 15:08:41 +00:00
parent d67b1efc99
commit 3ec18e87d6
25 changed files with 55 additions and 19 deletions
+2
View File
@@ -18,6 +18,8 @@
#include "CommandStack.h" #include "CommandStack.h"
#include "IconRenderer.h" #include "IconRenderer.h"
using std::nothrow;
// constructor // constructor
CanvasView::CanvasView(BRect frame) CanvasView::CanvasView(BRect frame)
: StateView(frame, "canvas view", B_FOLLOW_ALL, : StateView(frame, "canvas view", B_FOLLOW_ALL,
@@ -22,6 +22,7 @@
// //
#include "RWLocker.h" #include "RWLocker.h"
using std::nothrow;
class EventFilter : public BMessageFilter { class EventFilter : public BMessageFilter {
public: public:
@@ -17,7 +17,7 @@
#include "support.h" #include "support.h"
using std::nowthrow; using std::nothrow;
// constructor // constructor
Property::Property(uint32 identifier) Property::Property(uint32 identifier)
@@ -12,7 +12,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
using std::nowthrow; using std::nothrow;
// constructor // constructor
Int64Property::Int64Property(uint32 identifier, int64 value) Int64Property::Int64Property(uint32 identifier, int64 value)
@@ -93,7 +93,7 @@ write_string(BPositionIO* stream, BString& string)
// append_float // append_float
void void
append_float(BString& string, float n, int32 maxDigits = 4) append_float(BString& string, float n, int32 maxDigits)
{ {
int32 rounded = n >= 0.0 ? (int32)fabs(floorf(n)) : (int32)fabs(ceilf(n)); int32 rounded = n >= 0.0 ? (int32)fabs(floorf(n)) : (int32)fabs(ceilf(n));
@@ -27,12 +27,12 @@ constrain(float& value, float min, float max)
// constrain_int32_0_255_asm // constrain_int32_0_255_asm
inline int32 inline int32
constrain_int32_0_255_asm(int32 value) { constrain_int32_0_255_asm(int32 value) {
asm("movl $0, %%ecx; asm("movl $0, %%ecx;\n"
movl $255, %%edx; "movl $255, %%edx;\n"
cmpl %%ecx, %%eax; "cmpl %%ecx, %%eax;\n"
cmovl %%ecx, %%eax; "cmovl %%ecx, %%eax;\n"
cmpl %%edx, %%eax; "cmpl %%edx, %%eax;\n"
cmovg %%edx, %%eax" "cmovg %%edx, %%eax"
: "=a" (value) : "=a" (value)
: "a" (value) : "a" (value)
: "%ecx", "%edx" ); : "%ecx", "%edx" );
@@ -32,6 +32,8 @@
#include "Util.h" #include "Util.h"
#include "VectorPath.h" #include "VectorPath.h"
using std::nothrow;
static const float kMarkWidth = 14.0; static const float kMarkWidth = 14.0;
static const float kBorderOffset = 3.0; static const float kBorderOffset = 3.0;
static const float kTextOffset = 4.0; static const float kTextOffset = 4.0;
@@ -33,6 +33,8 @@
#include "Selection.h" #include "Selection.h"
#include "Util.h" #include "Util.h"
using std::nothrow;
static const float kMarkWidth = 14.0; static const float kMarkWidth = 14.0;
static const float kBorderOffset = 3.0; static const float kBorderOffset = 3.0;
static const float kTextOffset = 4.0; static const float kTextOffset = 4.0;
@@ -19,6 +19,7 @@ class Selection;
class Shape; class Shape;
class ShapeContainer; class ShapeContainer;
class ShapeListener; class ShapeListener;
class ShapeStyleListener;
class Style; class Style;
class StyleListItem; class StyleListItem;
+2
View File
@@ -24,6 +24,8 @@
#include "SetGradientCommand.h" #include "SetGradientCommand.h"
#include "Style.h" #include "Style.h"
using std::nothrow;
enum { enum {
MSG_SET_COLOR = 'stcl', MSG_SET_COLOR = 'stcl',
@@ -22,6 +22,8 @@
#include "Document.h" #include "Document.h"
#include "Icon.h" #include "Icon.h"
using std::nothrow;
// constructor // constructor
Exporter::Exporter() Exporter::Exporter()
: fDocument(NULL), : fDocument(NULL),
@@ -235,7 +235,7 @@ FlatIconExporter::_WriteStyles(LittleEndianBuffer& buffer,
if (styleType == STYLE_TYPE_SOLID_COLOR) { if (styleType == STYLE_TYPE_SOLID_COLOR) {
// solid color // solid color
uint32 color = (uint32&)style->Color(); uint32 color = *(uint32*)&style->Color();
if (!buffer.Write(color)) if (!buffer.Write(color))
return B_NO_MEMORY; return B_NO_MEMORY;
} else if (styleType == STYLE_TYPE_SOLID_COLOR_NO_ALPHA) { } else if (styleType == STYLE_TYPE_SOLID_COLOR_NO_ALPHA) {
@@ -28,6 +28,10 @@ class VectorPath;
# include <Point.h> # include <Point.h>
# include <hash_set> # include <hash_set>
#if __GNUC__ >= 4
using __gnu_cxx::hash_set;
#endif
class PointHash { class PointHash {
public: public:
int operator()(const BPoint& point) const int operator()(const BPoint& point) const
@@ -183,7 +183,7 @@ DocumentBuilder::curve4(double x2, double y2, // S, s
void void
DocumentBuilder::elliptical_arc(double rx, double ry, double angle, DocumentBuilder::elliptical_arc(double rx, double ry, double angle,
bool large_arc_flag, bool sweep_flag, bool large_arc_flag, bool sweep_flag,
double x, double y, bool rel = false) double x, double y, bool rel)
{ {
angle = angle / 180.0 * pi; angle = angle / 180.0 * pi;
if (rel) { if (rel) {
@@ -531,7 +531,10 @@ DocumentBuilder::StartGradient(bool radial)
"previous gradient (%s) not finished!\n", fCurrentGradient->ID()); "previous gradient (%s) not finished!\n", fCurrentGradient->ID());
} }
fCurrentGradient = radial ? new SVGRadialGradient() : new SVGLinearGradient(); if (radial)
fCurrentGradient = new SVGRadialGradient();
else
fCurrentGradient = new SVGLinearGradient();
_AddGradient(fCurrentGradient); _AddGradient(fCurrentGradient);
} }
@@ -14,6 +14,8 @@
#include "ChannelTransform.h" #include "ChannelTransform.h"
#include "VectorPath.h" #include "VectorPath.h"
using std::nothrow;
// constructor // constructor
TransformPointsCommand::TransformPointsCommand( TransformPointsCommand::TransformPointsCommand(
TransformBox* box, TransformBox* box,
@@ -34,7 +34,7 @@ SetColorCommand::~SetColorCommand()
status_t status_t
SetColorCommand::InitCheck() SetColorCommand::InitCheck()
{ {
return fStyle && (uint32&)fStyle->Color() != (uint32&)fColor ? return fStyle && *(uint32*)&fStyle->Color() != *(uint32*)&fColor ?
B_OK : B_NO_INIT; B_OK : B_NO_INIT;
} }
@@ -13,6 +13,8 @@
#include "ChannelTransform.h" #include "ChannelTransform.h"
using std::nothrow;
// constructor // constructor
ResetTransformationCommand::ResetTransformationCommand( ResetTransformationCommand::ResetTransformationCommand(
Transformable** const objects, Transformable** const objects,
@@ -13,6 +13,8 @@
#include "ChannelTransform.h" #include "ChannelTransform.h"
using std::nothrow;
// constructor // constructor
TransformObjectsCommand::TransformObjectsCommand( TransformObjectsCommand::TransformObjectsCommand(
TransformBox* box, TransformBox* box,
+2
View File
@@ -13,6 +13,8 @@
#include "ViewLayoutItem.h" #include "ViewLayoutItem.h"
using std::nothrow;
using std::swap;
enum { enum {
MAX_COLUMN_ROW_COUNT = 1024, MAX_COLUMN_ROW_COUNT = 1024,
+2 -2
View File
@@ -111,7 +111,7 @@ BGroupLayoutBuilder::Add(BLayoutItem* item, float weight)
// AddGroup // AddGroup
BGroupLayoutBuilder& BGroupLayoutBuilder&
BGroupLayoutBuilder::AddGroup(enum orientation orientation, BGroupLayoutBuilder::AddGroup(enum orientation orientation,
float spacing = 0.0f, float weight = 1.0f) float spacing, float weight)
{ {
if (BGroupLayout* layout = TopLayout()) { if (BGroupLayout* layout = TopLayout()) {
BGroupView* group = new(nothrow) BGroupView(orientation, spacing); BGroupView* group = new(nothrow) BGroupView(orientation, spacing);
@@ -136,7 +136,7 @@ BGroupLayoutBuilder::End()
// AddGlue // AddGlue
BGroupLayoutBuilder& BGroupLayoutBuilder&
BGroupLayoutBuilder::AddGlue(float weight = 1.0f) BGroupLayoutBuilder::AddGlue(float weight)
{ {
if (BGroupLayout* layout = TopLayout()) if (BGroupLayout* layout = TopLayout())
layout->AddItem(BSpaceLayoutItem::CreateGlue(), weight); layout->AddItem(BSpaceLayoutItem::CreateGlue(), weight);
+2
View File
@@ -16,6 +16,8 @@
#include <new> #include <new>
using std::nothrow;
struct popup_menu_data { struct popup_menu_data {
BPopUpMenu *object; BPopUpMenu *object;
BWindow *window; BWindow *window;
+5 -1
View File
@@ -3,7 +3,11 @@
#include <vector.h> #include <vector.h>
template <class T, class Alloc = alloc> #if __GNUC__ >= 4
template <class T, class Alloc = std::allocator<T> >
#else
template <class T, class Alloc = alloc>
#endif
class QcUnsortedListSet class QcUnsortedListSet
{ {
public: public:
+4 -2
View File
@@ -33,14 +33,16 @@ class QcUtility
{ {
#if NUMT_IS_DOUBLE #if NUMT_IS_DOUBLE
private: private:
static double const qcEps = 2.273736754432321e-13; // 2 ** -42 #define _QC_EPS 2.273736754432321e-13 // 2 ** -42
static double const qcEps = _QC_EPS;
static double const qcNearEps = 9.313225746154785e-10; // 2 ** -30 static double const qcNearEps = 9.313225746154785e-10; // 2 ** -30
static double const qcVaguelyNearEps = 9.5367431640625e-7; // 2 ** -20 static double const qcVaguelyNearEps = 9.5367431640625e-7; // 2 ** -20
public: public:
/** Highest <tt>numT</tt> <var>x</var> s.t.&nbsp;<tt>IsZero(x)</tt>. /** Highest <tt>numT</tt> <var>x</var> s.t.&nbsp;<tt>IsZero(x)</tt>.
This is a positive (non-zero) number iff numT is floating point. */ This is a positive (non-zero) number iff numT is floating point. */
static double const qcMaxZeroVal = qcEps * (1 - DBL_EPSILON / 2); static double const qcMaxZeroVal = _QC_EPS * (1 - DBL_EPSILON / 2);
#undef _QC_EPS
public: public:
//-----------------------------------------------------------------------// //-----------------------------------------------------------------------//
@@ -10,6 +10,7 @@
#include <malloc.h> #include <malloc.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <ByteOrder.h> #include <ByteOrder.h>
+1 -1
View File
@@ -16,7 +16,7 @@
# include <Archivable.h> # include <Archivable.h>
# include "Observable.h" # include "Observable.h"
#endif ICON_O_MATIC #endif // ICON_O_MATIC
#include "Transformable.h" #include "Transformable.h"