gcc4 build fixes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2008-09-08 13:49:54 +00:00
parent 6f3ee1f167
commit fc60ab16f5
9 changed files with 23 additions and 15 deletions
-4
View File
@@ -93,10 +93,6 @@ EXTERN bool kFoundHelpFile;
#define kScanProgress 'gSPR'
#define kScanDone 'gSDN'
// support functions
#define max(x, y) ((x) > (y) ? (x) : (y))
#define min(x, y) ((x) < (y) ? (x) : (y))
#define deg2rad(x) (2.0 * M_PI * (x) / 360.0)
#define rad2deg(x) (360.0 * (x) / (2.0 * M_PI))
+3 -2
View File
@@ -14,6 +14,7 @@
#include <MenuItem.h>
#include <NodeMonitor.h>
#include <PopUpMenu.h>
#include <SupportDefs.h>
#include <Volume.h>
#include <VolumeRoster.h>
#include <Window.h>
@@ -72,7 +73,7 @@ VolumeMenuItem::GetContentSize(float* width, float* height)
be_plain_font->GetHeight(&fh);
float fontHeight = fh.ascent + fh.descent + fh.leading;
if (fIcon) {
*height = max(fontHeight, fIcon->Bounds().Height());
*height = max_c(fontHeight, fIcon->Bounds().Height());
*width += fIcon->Bounds().Width() + kSmallHMargin;
} else
*height = fontHeight;
@@ -260,7 +261,7 @@ ControlsView::ControlsView(BRect r)
r.right = r.left - kSmallHMargin;
buttonWidth = kButtonMargin + StringWidth(kStrRescan);
r.left = r.right - max(kMinButtonWidth, buttonWidth);
r.left = r.right - max_c(kMinButtonWidth, buttonWidth);
fRescanButton = new BButton(r, NULL, kStrRescan, new BMessage(kBtnRescan),
B_FOLLOW_RIGHT);
+4 -2
View File
@@ -20,6 +20,8 @@
#include "Common.h"
#include "Snapshot.h"
using std::string;
using std::vector;
LeftView::LeftView(BRect frame, BBitmap* icon)
: BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW),
@@ -115,9 +117,9 @@ InfoWin::InfoWin(BPoint p, FileInfo *f, BWindow* parent)
InfoList::iterator i = info.begin();
while (i != info.end()) {
float w = smallFont.StringWidth((*i).first.c_str()) + 2.0 * kSmallHMargin;
leftWidth = max(leftWidth, w);
leftWidth = max_c(leftWidth, w);
w = smallFont.StringWidth((*i).second.c_str()) + 2.0 * kSmallHMargin;
rightWidth = max(rightWidth, w);
rightWidth = max_c(rightWidth, w);
i++;
}
+1 -1
View File
@@ -94,7 +94,7 @@ AppMenuItem::GetContentSize(float* _width, float* _height)
be_plain_font->GetHeight(&fh);
float fontHeight = ceilf(fh.ascent) + ceilf(fh.descent)
+ ceilf(fh.leading);
*_height = max(fontHeight, fIcon->Bounds().Height());
*_height = max_c(fontHeight, fIcon->Bounds().Height());
}
}
+3
View File
@@ -25,6 +25,9 @@ struct FileInfo;
class Scanner;
class MainWindow;
using std::map;
using std::vector;
class PieView: public BView {
public:
PieView(BRect frame, MainWindow* window);
+1
View File
@@ -12,6 +12,7 @@
#include "Common.h"
using std::vector;
Scanner::Scanner(BVolume *v, BHandler *handler)
: BLooper(),
+2
View File
@@ -21,6 +21,8 @@
class BDirectory;
using std::string;
class Scanner: public BLooper {
public:
Scanner(BVolume* volume, BHandler* handler);
+6 -3
View File
@@ -18,11 +18,14 @@
class BMimeType;
class BVolume;
using std::string;
using std::vector;
struct FileInfo {
FileInfo();
~FileInfo();
void GetPath(string& path) const;
void GetPath(std::string& path) const;
FileInfo* FindChild(const char* name) const;
BMimeType* Type() const;
@@ -31,7 +34,7 @@ struct FileInfo {
off_t size;
int count;
FileInfo* parent;
vector<FileInfo*> children;
std::vector<FileInfo*> children;
};
@@ -39,7 +42,7 @@ struct VolumeSnapshot {
VolumeSnapshot(const BVolume* volume);
~VolumeSnapshot();
string name;
std::string name;
off_t capacity;
off_t freeBytes;
FileInfo* rootDir;
+3 -3
View File
@@ -20,8 +20,8 @@
#include "Scanner.h"
StatusView::StatusView(BRect r)
: BView(r, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW),
StatusView::StatusView(BRect rect)
: BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW),
fCurrentFileInfo(NULL)
{
SetViewColor(kWindowColor);
@@ -33,7 +33,7 @@ StatusView::StatusView(BRect r)
float fixedHeight = ceilf(fh.ascent) + ceilf(fh.descent)
+ ceilf(fh.leading);
ResizeTo(Bounds().Width(),
2.0 * kSmallVMargin + max(plainHeight, fixedHeight));
2.0 * kSmallVMargin + max_c(plainHeight, fixedHeight));
BRect r = Bounds();
r.top += kSmallVMargin;