Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b42094b2
Kaydet (Commit)
b42094b2
authored
Eyl 14, 2012
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove use of SAL_MIN() macro
Change-Id: Ia91118388240c9a54d010b94aef34ad528ce5761
üst
e50ab7bb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
21 deletions
+45
-21
reflcnst.hxx
registry/source/reflcnst.hxx
+5
-1
reflwrit.cxx
registry/source/reflwrit.cxx
+10
-3
macros.h
sal/inc/sal/macros.h
+0
-4
pipe.c
sal/osl/unx/pipe.c
+1
-1
security.c
sal/osl/unx/security.c
+1
-1
alloc_cache.cxx
sal/rtl/source/alloc_cache.cxx
+5
-2
alloc_global.cxx
sal/rtl/source/alloc_global.cxx
+1
-1
stordata.hxx
store/source/stordata.hxx
+2
-2
storlckb.cxx
store/source/storlckb.cxx
+16
-5
ucblockbytes.cxx
unotools/source/ucbhelper/ucblockbytes.cxx
+4
-1
No files found.
registry/source/reflcnst.hxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
);
...
...
registry/source/reflwrit.cxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
];
}
...
...
sal/inc/sal/macros.h
Dosyayı görüntüle @
b42094b2
...
...
@@ -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 )
/*
...
...
sal/osl/unx/pipe.c
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
;
...
...
sal/osl/unx/security.c
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
;
...
...
sal/rtl/source/alloc_cache.cxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
);
...
...
sal/rtl/source/alloc_global.cxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -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
);
}
}
...
...
store/source/stordata.hxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -732,11 +732,11 @@ public:
return
rtl_crc32
(
nPath
,
pszName
,
rtl_str_getLength
(
pszName
));
}
sal_Size
getName
(
sal_Char
*
pBuffer
,
sal_Size
nBufsiz
)
const
sal_Size
getName
(
sal_Char
*
pBuffer
,
sal_Size
nBufsiz
e
)
const
{
sal_Char
const
*
pszName
=
PAGE
().
m_aNameBlock
.
m_pData
;
sal_Size
nLength
=
rtl_str_getLength
(
pszName
);
memcpy
(
pBuffer
,
pszName
,
SAL_MIN
(
nLength
,
nBufsiz
)
);
memcpy
(
pBuffer
,
pszName
,
nLength
<
nBufsize
?
nLength
:
nBufsize
);
return
nLength
;
}
...
...
store/source/storlckb.cxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -167,8 +167,10 @@ storeError OStoreLockBytes::readAt (
nOffset
,
m_xNode
->
capacity
());
sal_uInt32
nLength
=
sal_uInt32
(
aDescr
.
m_nLength
);
nLength
=
SAL_MIN
(
nLength
,
nBytes
);
if
(
nLength
>
nBytes
)
{
nLength
=
nBytes
;
}
memcpy
(
&
pData
[
rnDone
],
&
m_xNode
->
m_pData
[
aDescr
.
m_nOffset
],
...
...
@@ -186,7 +188,10 @@ storeError OStoreLockBytes::readAt (
nOffset
-
m_xNode
->
capacity
(),
OStoreDataPageData
::
capacity
(
m_xNode
->
m_aDescr
));
// @@@
sal_uInt32
nLength
=
sal_uInt32
(
aDescr
.
m_nLength
);
nLength
=
SAL_MIN
(
nLength
,
nBytes
);
if
(
nLength
>
nBytes
)
{
nLength
=
nBytes
;
}
storeError
eErrCode
=
aPage
.
read
(
aDescr
.
m_nPage
,
aData
,
*
m_xManager
);
if
(
eErrCode
!=
store_E_None
)
...
...
@@ -259,7 +264,10 @@ storeError OStoreLockBytes::writeAt (
nOffset
,
m_xNode
->
capacity
());
sal_uInt32
nLength
=
sal_uInt32
(
aDescr
.
m_nLength
);
nLength
=
SAL_MIN
(
nLength
,
nBytes
);
if
(
nLength
>
nBytes
)
{
nLength
=
nBytes
;
}
memcpy
(
&
m_xNode
->
m_pData
[
aDescr
.
m_nOffset
],
...
...
@@ -312,7 +320,10 @@ storeError OStoreLockBytes::writeAt (
}
// Modify data page.
nLength
=
SAL_MIN
(
nLength
,
nBytes
);
if
(
nLength
>
nBytes
)
{
nLength
=
nBytes
;
}
memcpy
(
&
xData
->
m_pData
[
aDescr
.
m_nOffset
],
&
pData
[
rnDone
],
nLength
);
...
...
unotools/source/ucbhelper/ucblockbytes.cxx
Dosyayı görüntüle @
b42094b2
...
...
@@ -1415,7 +1415,10 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount,
Sequence
<
sal_Int8
>
aData
;
sal_Int32
nSize
;
nCount
=
SAL_MIN
(
nCount
,
0x7FFFFFFF
);
if
(
nCount
>
0x7FFFFFFF
)
{
nCount
=
0x7FFFFFFF
;
}
try
{
if
(
!
m_bTerminated
&&
!
IsSynchronMode
()
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment