diff options
author | William Todd Stinson <stinson@lindenlab.com> | 2012-08-28 12:41:57 -0700 |
---|---|---|
committer | William Todd Stinson <stinson@lindenlab.com> | 2012-08-28 12:41:57 -0700 |
commit | 11e9f66e6217c22373f5d47518f6d1f9885f1793 (patch) | |
tree | d8a2bd8a03b88a6822502ef7508343ee8afdf06e /indra | |
parent | d4ee17e533d652e90989e60bcbc097c81e73d081 (diff) |
BUILDFIX: Correcting a linux build error.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterconversationpreview.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 2c34029c5c..ae6f1441eb 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -88,8 +88,13 @@ void LLFloaterConversationPreview::showHistory() int delta = 0; if (mCurrentPage) { - double num_of_pages = (double)mMessages.size() / mPageSize; - delta = (ceil(num_of_pages) - num_of_pages) * mPageSize; + // stinson 08/28/2012 : This operation could be simplified using integer math with the mod (%) operator. + // e.g. The following code should give the same output. + // int remainder = mMessages.size() % mPageSize; + // delta = (remainder == 0) ? 0 : (mPageSize - remainder); + // Though without examining further, the remainder might be a more appropriate value. + double num_of_pages = static_cast<double>(mMessages.size()) / static_cast<double>(mPageSize); + delta = static_cast<int>((ceil(num_of_pages) - num_of_pages) * static_cast<double>(mPageSize)); } std::advance(iter, (mCurrentPage * mPageSize) - delta); |