You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pe...@apache.org on 2026/08/14 05:24:55 UTC
(openoffice) 12/31: Change the return type of Get10ThSec() to clock_t, so it works regardless of the size of the integer type.
This is an automated email from the ASF dual-hosted git repository.
leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 117a7a28d565347af6809359bdba8be6314a129c
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Fri Jan 3 07:01:21 2025 +0200
Change the return type of Get10ThSec() to clock_t, so it works
regardless of the size of the integer type.
Patch by: me
(cherry picked from commit 448dc86220cf9531c9c48d1efc4e906d246b1899)
---
main/sfx2/source/bastyp/progress.cxx | 3 +--
main/sfx2/source/view/sfxbasecontroller.cxx | 6 +++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/main/sfx2/source/bastyp/progress.cxx b/main/sfx2/source/bastyp/progress.cxx
index 3e189c066a..f360c0574a 100644
--- a/main/sfx2/source/bastyp/progress.cxx
+++ b/main/sfx2/source/bastyp/progress.cxx
@@ -110,8 +110,7 @@ struct SfxProgress_Impl
#define aTypeLibInfo aProgressTypeLibImpl
//========================================================================
-extern sal_uInt32 Get10ThSec(); // must match the definition in sfxbasecontroller.cxx
- // (sal_uInt32); sal_uIntPtr diverges from it on x64
+extern clock_t Get10ThSec();
// -----------------------------------------------------------------------
diff --git a/main/sfx2/source/view/sfxbasecontroller.cxx b/main/sfx2/source/view/sfxbasecontroller.cxx
index bb174eeeb6..015084586b 100644
--- a/main/sfx2/source/view/sfxbasecontroller.cxx
+++ b/main/sfx2/source/view/sfxbasecontroller.cxx
@@ -220,9 +220,9 @@ sal_Bool SupportsCommandGroup( sal_Int16 nCommandGroup )
return sal_False;
}
-sal_uInt32 Get10ThSec()
+clock_t Get10ThSec()
{
- sal_uInt32 n10Ticks = 10 * (sal_uInt32)clock();
+ clock_t n10Ticks = 10 * clock();
return n10Ticks / CLOCKS_PER_SEC;
}
@@ -246,7 +246,7 @@ friend class SfxBaseController;
SfxWorkWindow* pWorkWindow;
sal_Int32 _nRange;
sal_Int32 _nValue;
- long _nStartTime;
+ clock_t _nStartTime;
public:
SfxStatusIndicator(SfxBaseController* pController, SfxWorkWindow* pWork)
: xOwner( pController )