diff --git a/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp b/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp index ebe364b785..8b7772b155 100644 --- a/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp +++ b/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp @@ -39,9 +39,9 @@ KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo) fLastSum = -1; fGrenze1 = -1; fGrenze2 = -1; - fPhysicalMemory = systemInfo.max_pages * B_PAGE_SIZE / 1024LL; - fCommittedMemory = systemInfo.used_pages * B_PAGE_SIZE / 1024LL; - fCachedMemory = systemInfo.cached_pages * B_PAGE_SIZE / 1024LL; + fPhysicalMemory = (int64)systemInfo.max_pages * B_PAGE_SIZE / 1024LL; + fCommittedMemory = (int64)systemInfo.used_pages * B_PAGE_SIZE / 1024LL; + fCachedMemory = (int64)systemInfo.cached_pages * B_PAGE_SIZE / 1024LL; } diff --git a/src/apps/processcontroller/MemoryBarMenu.cpp b/src/apps/processcontroller/MemoryBarMenu.cpp index f773d981dd..cdd8a925b4 100644 --- a/src/apps/processcontroller/MemoryBarMenu.cpp +++ b/src/apps/processcontroller/MemoryBarMenu.cpp @@ -89,8 +89,8 @@ MemoryBarMenu::Pulse() { system_info sinfo; get_system_info(&sinfo); - int committedMemory = int(sinfo.used_pages * B_PAGE_SIZE / 1024); - int cachedMemory = int(sinfo.cached_pages * B_PAGE_SIZE / 1024); + int64 committedMemory = (int64)sinfo.used_pages * B_PAGE_SIZE / 1024; + int64 cachedMemory = (int64)sinfo.cached_pages * B_PAGE_SIZE / 1024; Window()->BeginViewTransaction(); // create the list of items to remove, for their team is gone. Update the old teams. diff --git a/src/apps/processcontroller/MemoryBarMenuItem.cpp b/src/apps/processcontroller/MemoryBarMenuItem.cpp index 34fca14177..bd5ccb7f60 100644 --- a/src/apps/processcontroller/MemoryBarMenuItem.cpp +++ b/src/apps/processcontroller/MemoryBarMenuItem.cpp @@ -55,7 +55,7 @@ MemoryBarMenuItem::Init() fAllMemory = -1; fGrenze1 = -1; fGrenze2 = -1; - fLastCommited = -1; + fLastCommitted = -1; fLastWrite = -1; fLastAll = -1; } @@ -108,7 +108,7 @@ MemoryBarMenuItem::DrawBar(bool force) { // only draw anything if something has changed if (!force && fWriteMemory == fLastWrite && fAllMemory == fLastAll - && fCommitedMemory == fLastCommited) + && fCommittedMemory == fLastCommitted) return; bool selected = IsSelected(); @@ -135,8 +135,10 @@ MemoryBarMenuItem::DrawBar(bool force) rect.InsetBy(1, 1); BRect r = rect; - double grenze1 = rect.left + (rect.right - rect.left) * float(fWriteMemory) / fCommitedMemory; - double grenze2 = rect.left + (rect.right - rect.left) * float(fAllMemory) / fCommitedMemory; + double grenze1 = rect.left + (rect.right - rect.left) * float(fWriteMemory) + / fCommittedMemory; + double grenze2 = rect.left + (rect.right - rect.left) * float(fAllMemory) + / fCommittedMemory; if (grenze1 > rect.right) grenze1 = rect.right; if (grenze2 > rect.right) @@ -188,7 +190,7 @@ MemoryBarMenuItem::DrawBar(bool force) fGrenze1 = grenze1; fGrenze2 = grenze2; - fLastCommited = fCommitedMemory; + fLastCommitted = fCommittedMemory; // Draw the values if necessary; if only fCommitedMemory changes, only // the bar might have to be updated @@ -234,9 +236,9 @@ MemoryBarMenuItem::GetContentSize(float* _width, float* _height) int -MemoryBarMenuItem::UpdateSituation(int64 commitedMemory) +MemoryBarMenuItem::UpdateSituation(int64 committedMemory) { - fCommitedMemory = commitedMemory; + fCommittedMemory = committedMemory; BarUpdate(); return fWriteMemory; } diff --git a/src/apps/processcontroller/MemoryBarMenuItem.h b/src/apps/processcontroller/MemoryBarMenuItem.h index e254b1fc50..586a18b9af 100644 --- a/src/apps/processcontroller/MemoryBarMenuItem.h +++ b/src/apps/processcontroller/MemoryBarMenuItem.h @@ -36,17 +36,17 @@ class MemoryBarMenuItem : public BMenuItem { void DrawIcon(); void DrawBar(bool force); - int UpdateSituation(int64 commitedMemory); + int UpdateSituation(int64 committedMemory); void BarUpdate(); void Init(); void Reset(char* name, team_id team, BBitmap* icon, bool deleteIcon); private: int64 fPhysicalMemory; - int64 fCommitedMemory; + int64 fCommittedMemory; int64 fWriteMemory; int64 fAllMemory; - int64 fLastCommited; + int64 fLastCommitted; int64 fLastWrite; int64 fLastAll; team_id fTeamID; diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp index eadb0c0edb..4925f065f3 100644 --- a/src/apps/processcontroller/ProcessController.cpp +++ b/src/apps/processcontroller/ProcessController.cpp @@ -738,14 +738,14 @@ thread_popup(void *arg) // Memory Usage section MemoryBarMenu* MemoryPopup = new MemoryBarMenu(B_TRANSLATE("Memory usage"), infos, systemInfo); - int commitedMemory = int(systemInfo.used_pages * B_PAGE_SIZE / 1024); + int64 committedMemory = (int64)systemInfo.used_pages * B_PAGE_SIZE / 1024; for (m = 0; m < systemInfo.used_teams; m++) { if (infos[m].team_info.team >= 0) { MemoryBarMenuItem* memoryItem = new MemoryBarMenuItem(infos[m].team_name, infos[m].team_info.team, infos[m].team_icon, false, NULL); MemoryPopup->AddItem(memoryItem); - memoryItem->UpdateSituation(commitedMemory); + memoryItem->UpdateSituation(committedMemory); } }