summaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-09-14 01:42:30 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-09-14 03:49:21 -0500
commitb42094b2b06f4837a6df65e6b87caf8139fc0d0d (patch)
tree134a3f25c7e676e092a7ac5c3b29f78b98dbc301 /registry
parente50ab7bb891cbd7b5f95c124ce29a3e595b599ee (diff)
remove use of SAL_MIN() macro
Change-Id: Ia91118388240c9a54d010b94aef34ad528ce5761
Diffstat (limited to 'registry')
-rw-r--r--registry/source/reflcnst.hxx6
-rw-r--r--registry/source/reflwrit.cxx13
2 files changed, 15 insertions, 4 deletions
diff --git a/registry/source/reflcnst.hxx b/registry/source/reflcnst.hxx
index fa53d8efe70d..009dcdb90fec 100644
--- a/registry/source/reflcnst.hxx
+++ b/registry/source/reflcnst.hxx
@@ -258,7 +258,11 @@ inline sal_uInt32 writeUtf8(sal_uInt8* buffer, const sal_Char* v)
inline sal_uInt32 readUtf8(const sal_uInt8* buffer, sal_Char* v, sal_uInt32 maxSize)
{
- sal_uInt32 size = SAL_MIN(strlen((const sal_Char*) buffer) + 1, maxSize);
+ sal_uInt32 size = strlen((const sal_Char*) buffer) + 1;
+ if(size > maxSize)
+ {
+ size = maxSize;
+ }
memcpy(v, buffer, size);
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index 1c644e956eee..25fbef6e50c0 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -116,10 +116,15 @@ sal_uInt32 writeString(sal_uInt8* buffer, const sal_Unicode* v)
sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSize)
{
- sal_uInt32 len = SAL_MIN(UINT16StringLen(buffer) + 1, maxSize / 2);
+ sal_uInt32 len = UINT16StringLen(buffer) + 1;
sal_uInt32 i;
sal_uInt8* buff = (sal_uInt8*)buffer;
+ if(len > maxSize / 2)
+ {
+ len = maxSize / 2;
+ }
+
for (i = 0; i < (len - 1); i++)
{
sal_uInt16 aChar;
@@ -615,8 +620,9 @@ void MethodEntry::reallocParams(sal_uInt16 size)
if (m_paramCount)
{
sal_uInt16 i;
+ sal_uInt16 mn = size < m_paramCount ? size : m_paramCount;
- for (i = 0; i < SAL_MIN(size, m_paramCount); i++)
+ for (i = 0; i < mn; i++)
{
newParams[i].setData(m_params[i].m_typeName, m_params[i].m_name, m_params[i].m_mode);
}
@@ -638,8 +644,9 @@ void MethodEntry::reallocExcs(sal_uInt16 size)
newExcNames = NULL;
sal_uInt16 i;
+ sal_uInt16 mn = size < m_excCount ? size : m_excCount;
- for (i = 0; i < SAL_MIN(size, m_excCount); i++)
+ for (i = 0; i < mn; i++)
{
newExcNames[i] = m_excNames[i];
}