[haiku-commits] r38269 - haiku/trunk/src/apps/diskusage

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 19 Aug 2010 18:28:42 +0200 (CEST)

Author: zooey
Date: 2010-08-19 18:28:42 +0200 (Thu, 19 Aug 2010)
New Revision: 38269
Changeset: http://dev.haiku-os.org/changeset/38269

Modified:
   haiku/trunk/src/apps/diskusage/Common.cpp
   haiku/trunk/src/apps/diskusage/Common.h
   haiku/trunk/src/apps/diskusage/MainWindow.cpp
   haiku/trunk/src/apps/diskusage/StatusView.cpp
   haiku/trunk/src/apps/diskusage/StatusView.h
Log:
* fix warnings in diskusage

Modified: haiku/trunk/src/apps/diskusage/Common.cpp
===================================================================
--- haiku/trunk/src/apps/diskusage/Common.cpp   2010-08-19 15:59:50 UTC (rev 
38268)
+++ haiku/trunk/src/apps/diskusage/Common.cpp   2010-08-19 16:28:42 UTC (rev 
38269)
@@ -10,6 +10,7 @@
 
 #define ASSIGN_RESOURCES
 #include "Common.h"
+#undef ASSIGN_RESOURCES
 
 #include <stdio.h>
 #include <string.h>
@@ -21,6 +22,34 @@
 #include <Path.h>
 
 
+const char*    kAppSignature           = "application/x-vnd.Haiku-DiskUsage";
+const char*    kHelpFileName           = 
"userguide/en/applications/diskusage.html";
+const char*    kPieRectAttrName        = "mainrect";
+
+const char*    kHelpBtnLabel           = "?";
+const char*    kEmptyStr                       = "";
+const char*    kNameVolPtr                     = "vol";
+const char*    kNameFilePtr            = "file";
+
+const float    kSmallHMargin           = 5.0;
+const float    kSmallVMargin           = 2.0;
+const float    kButtonMargin           = 20.0;
+const float    kMinButtonWidth         = 60.0;
+
+const float    kProgBarWidth           = 150.0;
+const float    kProgBarHeight          = 16.0;
+const float    kReportInterval         = 2.5;
+
+const float    kDefaultPieSize         = 400.0;
+const float    kPieCenterSize          = 80.0;
+const float    kPieRingSize            = 20.0;
+const float    kPieInnerMargin         = 10.0;
+const float    kPieOuterMargin         = 10.0;
+const float    kMinSegmentSpan         = 2.0;
+const int      kLightenFactor          = 0x12;
+const float    kDragThreshold          = 5.0;
+
+
 BResources*
 read_resources(const char* appSignature)
 {
@@ -30,7 +59,7 @@
                        strerror(ret));
                exit(1);
        }
-       
+
        BFile file(&kAppInfo.ref, O_RDONLY);
        ret = file.InitCheck();
        if (ret != B_OK) {

Modified: haiku/trunk/src/apps/diskusage/Common.h
===================================================================
--- haiku/trunk/src/apps/diskusage/Common.h     2010-08-19 15:59:50 UTC (rev 
38268)
+++ haiku/trunk/src/apps/diskusage/Common.h     2010-08-19 16:28:42 UTC (rev 
38269)
@@ -18,13 +18,13 @@
 
 #ifdef ASSIGN_RESOURCES
 #   define EXTERN
-#   define EQ(x) =x
+#   define EQ(x)
 #else
 #   define EXTERN extern
 #   define EQ(x)
 #endif
 
-#define PUBLIC_CONST extern const
+#define EXTERN_CONST extern const
 
 
 // Resources
@@ -56,32 +56,32 @@
 EXTERN rgb_color *kBasePieColor;
 
 // Non-resources :)
-PUBLIC_CONST char*     kAppSignature           
EQ("application/x-vnd.Haiku-DiskUsage");
-PUBLIC_CONST char*     kHelpFileName           
EQ("userguide/en/applications/diskusage.html");
-PUBLIC_CONST char*     kPieRectAttrName        EQ("mainrect");
+EXTERN_CONST char*     kAppSignature;
+EXTERN_CONST char*     kHelpFileName;
+EXTERN_CONST char*     kPieRectAttrName;
 
-PUBLIC_CONST char*     kHelpBtnLabel           EQ("?");
-PUBLIC_CONST char*     kEmptyStr                       EQ("");
-PUBLIC_CONST char*     kNameVolPtr                     EQ("vol");
-PUBLIC_CONST char*     kNameFilePtr            EQ("file");
+EXTERN_CONST char*     kHelpBtnLabel;
+EXTERN_CONST char*     kEmptyStr;
+EXTERN_CONST char*     kNameVolPtr;
+EXTERN_CONST char*     kNameFilePtr;
 
-PUBLIC_CONST float     kSmallHMargin           EQ(5.0);
-PUBLIC_CONST float     kSmallVMargin           EQ(2.0);
-PUBLIC_CONST float     kButtonMargin           EQ(20.0);
-PUBLIC_CONST float     kMinButtonWidth         EQ(60.0);
+EXTERN_CONST float     kSmallHMargin;
+EXTERN_CONST float     kSmallVMargin;
+EXTERN_CONST float     kButtonMargin;
+EXTERN_CONST float     kMinButtonWidth;
 
-PUBLIC_CONST float     kProgBarWidth           EQ(150.0);
-PUBLIC_CONST float     kProgBarHeight          EQ(16.0);
-PUBLIC_CONST float     kReportInterval         EQ(2.5);
+EXTERN_CONST float     kProgBarWidth;
+EXTERN_CONST float     kProgBarHeight;
+EXTERN_CONST float     kReportInterval;
 
-PUBLIC_CONST float     kDefaultPieSize         EQ(400.0);
-PUBLIC_CONST float     kPieCenterSize          EQ(80.0);
-PUBLIC_CONST float     kPieRingSize            EQ(20.0);
-PUBLIC_CONST float     kPieInnerMargin         EQ(10.0);
-PUBLIC_CONST float     kPieOuterMargin         EQ(10.0);
-PUBLIC_CONST float     kMinSegmentSpan         EQ(2.0);
-PUBLIC_CONST int       kLightenFactor          EQ(0x12);
-PUBLIC_CONST float     kDragThreshold          EQ(5.0);
+EXTERN_CONST float     kDefaultPieSize;
+EXTERN_CONST float     kPieCenterSize;
+EXTERN_CONST float     kPieRingSize;
+EXTERN_CONST float     kPieInnerMargin;
+EXTERN_CONST float     kPieOuterMargin;
+EXTERN_CONST float     kMinSegmentSpan;
+EXTERN_CONST int       kLightenFactor;
+EXTERN_CONST float     kDragThreshold;
 
 EXTERN app_info kAppInfo;
 EXTERN entry_ref kHelpFileRef;
@@ -100,4 +100,5 @@
 BResources* read_resources(const char* appSignature);
 void size_to_string(off_t byteCount, char* name);
 
+
 #endif // COMMON_H

Modified: haiku/trunk/src/apps/diskusage/MainWindow.cpp
===================================================================
--- haiku/trunk/src/apps/diskusage/MainWindow.cpp       2010-08-19 15:59:50 UTC 
(rev 38268)
+++ haiku/trunk/src/apps/diskusage/MainWindow.cpp       2010-08-19 16:28:42 UTC 
(rev 38269)
@@ -89,7 +89,7 @@
                case kBtnHelp:
                        be_roster->Launch(&kHelpFileRef);
                        break;
-                       
+
                default:
                        BWindow::MessageReceived(message);
                        break;
@@ -111,7 +111,7 @@
 void
 MainWindow::ShowInfo(const FileInfo* info)
 {
-       fStatusView->Show(info);
+       fStatusView->ShowInfo(info);
 }
 
 

Modified: haiku/trunk/src/apps/diskusage/StatusView.cpp
===================================================================
--- haiku/trunk/src/apps/diskusage/StatusView.cpp       2010-08-19 15:59:50 UTC 
(rev 38268)
+++ haiku/trunk/src/apps/diskusage/StatusView.cpp       2010-08-19 16:28:42 UTC 
(rev 38269)
@@ -90,7 +90,7 @@
 
 
 void
-StatusView::Show(const FileInfo* info)
+StatusView::ShowInfo(const FileInfo* info)
 {
        if (info == fCurrentFileInfo)
                return;

Modified: haiku/trunk/src/apps/diskusage/StatusView.h
===================================================================
--- haiku/trunk/src/apps/diskusage/StatusView.h 2010-08-19 15:59:50 UTC (rev 
38268)
+++ haiku/trunk/src/apps/diskusage/StatusView.h 2010-08-19 16:28:42 UTC (rev 
38269)
@@ -22,7 +22,7 @@
                                                                
StatusView(BRect frame);
        virtual                                         ~StatusView();
 
-                       void                            Show(const FileInfo* 
info);
+                       void                            ShowInfo(const 
FileInfo* info);
 
 private:
                        BStringView*            fPathView;


Other related posts:

  • » [haiku-commits] r38269 - haiku/trunk/src/apps/diskusage - zooey