Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: fpdfsdk/pdfwindow/PWL_ScrollBar.cpp

Issue 2340513002: Remove more strcmp/memcmp usage. (Closed)
Patch Set: Nit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_ScrollBar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 1789d15764ccbdebf852a049be4923cc5b7a751d..17f62f58d69cff34545cf6d0f3d74405d1a72004 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -818,15 +818,14 @@ void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
}
break;
case PNM_SETSCROLLINFO: {
- if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam) {
- if (FXSYS_memcmp(&m_OriginInfo, pInfo, sizeof(PWL_SCROLL_INFO)) != 0) {
- m_OriginInfo = *pInfo;
- FX_FLOAT fMax =
- pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
- fMax = fMax > 0.0f ? fMax : 0.0f;
- SetScrollRange(0, fMax, pInfo->fPlateWidth);
- SetScrollStep(pInfo->fBigStep, pInfo->fSmallStep);
- }
+ PWL_SCROLL_INFO* pInfo = reinterpret_cast<PWL_SCROLL_INFO*>(lParam);
+ if (pInfo && *pInfo != m_OriginInfo) {
+ m_OriginInfo = *pInfo;
+ FX_FLOAT fMax =
+ pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
+ fMax = fMax > 0.0f ? fMax : 0.0f;
+ SetScrollRange(0, fMax, pInfo->fPlateWidth);
+ SetScrollStep(pInfo->fBigStep, pInfo->fSmallStep);
}
} break;
case PNM_SETSCROLLPOS: {
@@ -1183,13 +1182,12 @@ void CPWL_ScrollBar::CreateChildWnd(const PWL_CREATEPARAM& cp) {
void CPWL_ScrollBar::TimerProc() {
PWL_SCROLL_PRIVATEDATA sTemp = m_sData;
-
if (m_bMinOrMax)
m_sData.SubSmall();
else
m_sData.AddSmall();
- if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) {
+ if (sTemp != m_sData) {
MovePosButton(TRUE);
NotifyScrollWindow();
}
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_ScrollBar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698