diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-14 01:42:30 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-14 03:49:21 -0500 |
commit | b42094b2b06f4837a6df65e6b87caf8139fc0d0d (patch) | |
tree | 134a3f25c7e676e092a7ac5c3b29f78b98dbc301 /sal | |
parent | e50ab7bb891cbd7b5f95c124ce29a3e595b599ee (diff) |
remove use of SAL_MIN() macro
Change-Id: Ia91118388240c9a54d010b94aef34ad528ce5761
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/sal/macros.h | 4 | ||||
-rw-r--r-- | sal/osl/unx/pipe.c | 2 | ||||
-rw-r--r-- | sal/osl/unx/security.c | 2 | ||||
-rw-r--r-- | sal/rtl/source/alloc_cache.cxx | 7 | ||||
-rw-r--r-- | sal/rtl/source/alloc_global.cxx | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/sal/inc/sal/macros.h b/sal/inc/sal/macros.h index fb52d3c686a6..6f10585c542e 100644 --- a/sal/inc/sal/macros.h +++ b/sal/inc/sal/macros.h @@ -32,10 +32,6 @@ #include <stddef.h> -#ifndef SAL_MIN -# define SAL_MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef SAL_N_ELEMENTS # if defined(__cplusplus) && ( defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L ) /* diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c index 48b3f3817197..518559058f27 100644 --- a/sal/osl/unx/pipe.c +++ b/sal/osl/unx/pipe.c @@ -179,7 +179,7 @@ cpyBootstrapSocketPath(sal_Char *name, size_t len) OUSTRING_TO_OSTRING_CVTFLAGS); if (pStrValue && pStrValue->length > 0) { - size_t nCopy = SAL_MIN (len-1, (size_t)pStrValue->length); + size_t nCopy = (len-1 < (size_t)pStrValue->length) ? len-1 : (size_t)pStrValue->length; strncpy (name, pStrValue->buffer, nCopy); name[nCopy] = '\0'; bRet = (size_t)pStrValue->length < len; diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c index 96605fc1739c..e138ba8272da 100644 --- a/sal/osl/unx/security.c +++ b/sal/osl/unx/security.c @@ -327,7 +327,7 @@ static sal_Bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszD OUSTRING_TO_OSTRING_CVTFLAGS); if (pStrValue && pStrValue->length > 0) { - sal_Int32 nCopy = SAL_MIN ((sal_Int32)(nMax-1), pStrValue->length); + sal_Int32 nCopy = (sal_Int32)(nMax-1) < pStrValue->length ? (sal_Int32)(nMax-1) : pStrValue->length ; strncpy (pszDirectory, pStrValue->buffer, nCopy); pszDirectory[nCopy] = '\0'; bRet = (size_t)pStrValue->length < nMax; diff --git a/sal/rtl/source/alloc_cache.cxx b/sal/rtl/source/alloc_cache.cxx index 8e6860253448..a29b0785eba0 100644 --- a/sal/rtl/source/alloc_cache.cxx +++ b/sal/rtl/source/alloc_cache.cxx @@ -658,7 +658,10 @@ rtl_cache_depot_dequeue ( /* update depot stats */ depot->m_mag_count--; - depot->m_curr_min = SAL_MIN(depot->m_curr_min, depot->m_mag_count); + if(depot->m_curr_min > depot->m_mag_count) + { + depot->m_curr_min = depot->m_mag_count; + } } return (mag); } @@ -1470,7 +1473,7 @@ rtl_cache_depot_wsupdate ( depot->m_prev_min = depot->m_curr_min; depot->m_curr_min = depot->m_mag_count; - npurge = SAL_MIN(depot->m_curr_min, depot->m_prev_min); + npurge = depot->m_curr_min < depot->m_prev_min ? depot->m_curr_min : depot->m_prev_min; for (; npurge > 0; npurge--) { rtl_cache_magazine_type * mag = rtl_cache_depot_dequeue (depot); diff --git a/sal/rtl/source/alloc_global.cxx b/sal/rtl/source/alloc_global.cxx index 59213a11a8ea..7ac963c1cf2b 100644 --- a/sal/rtl/source/alloc_global.cxx +++ b/sal/rtl/source/alloc_global.cxx @@ -170,7 +170,7 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT p = rtl_allocateMemory (n); if (p != 0) { - memcpy (p, p_old, SAL_MIN(n, n_old)); + memcpy (p, p_old, (n < n_old) ? n : n_old); rtl_freeMemory (p_old); } } |