diff --git a/src/apps/diskusage/Common.h b/src/apps/diskusage/Common.h index 83ce776e42..9489cf60b3 100644 --- a/src/apps/diskusage/Common.h +++ b/src/apps/diskusage/Common.h @@ -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)) diff --git a/src/apps/diskusage/ControlsView.cpp b/src/apps/diskusage/ControlsView.cpp index 1412aee2ea..39b16ea82a 100644 --- a/src/apps/diskusage/ControlsView.cpp +++ b/src/apps/diskusage/ControlsView.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/src/apps/diskusage/InfoWindow.cpp b/src/apps/diskusage/InfoWindow.cpp index 70e64c3dea..d1e1d6bec5 100644 --- a/src/apps/diskusage/InfoWindow.cpp +++ b/src/apps/diskusage/InfoWindow.cpp @@ -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++; } diff --git a/src/apps/diskusage/PieView.cpp b/src/apps/diskusage/PieView.cpp index c6c06afd20..794f46169f 100644 --- a/src/apps/diskusage/PieView.cpp +++ b/src/apps/diskusage/PieView.cpp @@ -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()); } } diff --git a/src/apps/diskusage/PieView.h b/src/apps/diskusage/PieView.h index 92f5afc9a2..7dc5e15f4d 100644 --- a/src/apps/diskusage/PieView.h +++ b/src/apps/diskusage/PieView.h @@ -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); diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index 01dd03c08b..170e39ed0e 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -12,6 +12,7 @@ #include "Common.h" +using std::vector; Scanner::Scanner(BVolume *v, BHandler *handler) : BLooper(), diff --git a/src/apps/diskusage/Scanner.h b/src/apps/diskusage/Scanner.h index 0b0a64f9c6..77c541b3de 100644 --- a/src/apps/diskusage/Scanner.h +++ b/src/apps/diskusage/Scanner.h @@ -21,6 +21,8 @@ class BDirectory; +using std::string; + class Scanner: public BLooper { public: Scanner(BVolume* volume, BHandler* handler); diff --git a/src/apps/diskusage/Snapshot.h b/src/apps/diskusage/Snapshot.h index 691ee35433..f28dfe2b22 100644 --- a/src/apps/diskusage/Snapshot.h +++ b/src/apps/diskusage/Snapshot.h @@ -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 children; + std::vector 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; diff --git a/src/apps/diskusage/StatusView.cpp b/src/apps/diskusage/StatusView.cpp index a43a9cbf37..df93335981 100644 --- a/src/apps/diskusage/StatusView.cpp +++ b/src/apps/diskusage/StatusView.cpp @@ -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;