[Libreoffice-commits] core.git: 5 commits - include/osl sal/osl sal/rtl solenv/gbuild
Tor Lillqvist
tml at iki.fi
Fri Aug 30 02:14:11 PDT 2013
include/osl/profile.hxx | 12 ++++++------
sal/osl/w32/security.c | 4 ++--
sal/rtl/alloc_arena.cxx | 8 ++++----
sal/rtl/alloc_cache.cxx | 6 +++---
solenv/gbuild/platform/com_MSC_defs.mk | 9 +++++++++
5 files changed, 24 insertions(+), 15 deletions(-)
New commits:
commit 3a8f35042594fe0d91c6e41565437727cf5ee896
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Aug 30 12:07:24 2013 +0300
Er, I meant gb_CXXFLAGS
Change-Id: Ia68105056fb483b30a985da3b53f85c8a0b5d869
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index f5fa7e7..2cca886 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -151,13 +151,6 @@ gb_CFLAGS := \
-Zc:wchar_t- \
-Zm500 \
-ifeq ($(CPUNAME),X86_64)
-
-gb_CFLAGS += \
- -wd4267 \
-
-endif
-
gb_CXXFLAGS := \
-Gd \
-GR \
@@ -203,6 +196,13 @@ ifeq ($(VCVER),100)
endif
+ifeq ($(CPUNAME),X86_64)
+
+gb_CXXFLAGS += \
+ -wd4267 \
+
+endif
+
ifneq ($(VCVER),100)
# rc.exe does not support -nologo in 6.1.6723.1 that is in the Windows SDK 6.0A
gb_RCFLAGS += -nologo
commit 16a4b7ad733f179498e39eac3d4092c55e6c0a07
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Aug 30 12:04:15 2013 +0300
WaE: C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits
1UL is not a portable way to get a size_t -sized one.
Change-Id: I8fac16b7e1f1b8bbccb4bd11eacc9449fc3f8c33
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 9017a5a..f37d512 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -452,7 +452,7 @@ rtl_arena_segment_alloc (
}
/* roundup to next power of 2 */
- size = (1UL << msb);
+ size = (((sal_Size)1) << msb);
}
index = lowbit(RTL_MEMORY_P2ALIGN(arena->m_freelist_bitmap, size));
@@ -619,7 +619,7 @@ rtl_arena_constructor (void * obj)
head = &(arena->m_freelist_head[i]);
rtl_arena_segment_constructor (head);
- head->m_size = (1UL << i);
+ head->m_size = (((sal_Size)1) << i);
head->m_type = RTL_ARENA_SEGMENT_TYPE_HEAD;
}
@@ -658,7 +658,7 @@ rtl_arena_destructor (void * obj)
{
head = &(arena->m_freelist_head[i]);
- assert(head->m_size == (1UL << i));
+ assert(head->m_size == (((sal_Size)1) << i));
assert(head->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD);
rtl_arena_segment_destructor (head);
@@ -694,7 +694,7 @@ rtl_arena_activate (
if (!RTL_MEMORY_ISP2(quantum))
{
/* roundup to next power of 2 */
- quantum = (1UL << highbit(quantum));
+ quantum = (((sal_Size)1) << highbit(quantum));
}
quantum_cache_max = RTL_MEMORY_P2ROUNDUP(quantum_cache_max, quantum);
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index d514cfc..1383155 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -859,9 +859,9 @@ rtl_cache_activate (
if (flags & RTL_CACHE_FLAG_QUANTUMCACHE)
{
/* next power of 2 above 3 * qcache_max */
- if(slabsize < (1UL << highbit(3 * source->m_qcache_max)))
+ if(slabsize < (((sal_Size)1) << highbit(3 * source->m_qcache_max)))
{
- slabsize = (1UL << highbit(3 * source->m_qcache_max));
+ slabsize = (((sal_Size)1) << highbit(3 * source->m_qcache_max));
}
}
else
@@ -875,7 +875,7 @@ rtl_cache_activate (
slabsize = RTL_MEMORY_P2ROUNDUP(slabsize, source->m_quantum);
if (!RTL_MEMORY_ISP2(slabsize))
- slabsize = 1UL << highbit(slabsize);
+ slabsize = (((sal_Size)1) << highbit(slabsize));
cache->m_slab_size = slabsize;
if (cache->m_slab_size > source->m_quantum)
commit fb30ed471eb88870c53c882d623c4f9a7cb0a938
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Aug 30 11:55:41 2013 +0300
Ignore C4267: possible loss of data, there are too many of them
Change-Id: I4b01c9398c9c697cff63226269e7c7a3f5a5c9dd
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 81f20da..f5fa7e7 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -87,6 +87,8 @@ gb_AFLAGS := $(AFLAGS)
# C4251: 'identifier' : class 'type' needs to have dll-interface to be
# used by clients of class 'type2'
+# C4267: conversion from 'size_t' to 'type', possible loss of data
+
# C4275: non-DLL-interface classkey 'identifier' used as base for
# DLL-interface classkey 'identifier'
@@ -149,6 +151,13 @@ gb_CFLAGS := \
-Zc:wchar_t- \
-Zm500 \
+ifeq ($(CPUNAME),X86_64)
+
+gb_CFLAGS += \
+ -wd4267 \
+
+endif
+
gb_CXXFLAGS := \
-Gd \
-GR \
commit 9c1be36c41a7006760ddcd73eec96a82a87316f2
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Aug 30 11:54:42 2013 +0300
WaE: possible loss of data
Change-Id: I2a1d47cc3eca40ddd7e9502ffe71337ab2268858
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index f72132e..84d01bb 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -661,7 +661,7 @@ static sal_Bool GetSpecialFolder(rtl_uString **strPath, int nFolder)
{
if (pSHGetSpecialFolderPathA(GetActiveWindow(), PathA, nFolder, TRUE))
{
- rtl_string2UString( strPath, PathA, strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
+ rtl_string2UString( strPath, PathA, (sal_Int32) strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
OSL_ASSERT(*strPath != NULL);
bRet = sal_True;
}
@@ -747,7 +747,7 @@ static sal_Bool GetSpecialFolder(rtl_uString **strPath, int nFolder)
if (_access(PathA, 0) < 0)
CreateDirectoryA(PathA, NULL);
- rtl_string2UString( strPath, PathA, strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
+ rtl_string2UString( strPath, PathA, (sal_Int32) strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
OSL_ASSERT(*strPath != NULL);
bRet = sal_True;
}
commit 760bba09f02aa1a2b07289a55c73f6a8b80ca4fc
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Aug 30 11:54:13 2013 +0300
WaE: possible loss of data
Change-Id: Ib442a7cae9f4c9bc5e32c20f1e1844a191f5b057
diff --git a/include/osl/profile.hxx b/include/osl/profile.hxx
index 452a37c..9197067 100644
--- a/include/osl/profile.hxx
+++ b/include/osl/profile.hxx
@@ -87,7 +87,7 @@ namespace osl {
sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings,
sal_uInt32 nDefault)
{
- int nItems = rStrings.size();
+ size_t nItems = rStrings.size();
const sal_Char** pStrings = new const sal_Char*[ nItems+1 ];
std::list< rtl::OString >::const_iterator it = rStrings.begin();
nItems = 0;
@@ -117,7 +117,7 @@ namespace osl {
sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings,
sal_uInt32 nValue)
{
- int nItems = rStrings.size();
+ size_t nItems = rStrings.size();
const sal_Char** pStrings = new const sal_Char*[ nItems+1 ];
std::list< rtl::OString >::const_iterator it = rStrings.begin();
nItems = 0;
@@ -152,12 +152,12 @@ namespace osl {
std::list< rtl::OString > aEntries;
// count buffer size necessary
- int n = osl_getProfileSectionEntries( profile, rSection.getStr(), NULL, 0 );
+ size_t n = osl_getProfileSectionEntries( profile, rSection.getStr(), NULL, 0 );
if( n > 1 )
{
sal_Char* pBuf = new sal_Char[ n+1 ];
osl_getProfileSectionEntries( profile, rSection.getStr(), pBuf, n+1 );
- int nLen;
+ size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aEntries.push_back( rtl::OString( pBuf+n ) );
delete pBuf;
@@ -174,12 +174,12 @@ namespace osl {
std::list< rtl::OString > aSections;
// count buffer size necessary
- int n = osl_getProfileSections( profile, NULL, 0 );
+ size_t n = osl_getProfileSections( profile, NULL, 0 );
if( n > 1 )
{
sal_Char* pBuf = new sal_Char[ n+1 ];
osl_getProfileSections( profile, pBuf, n+1 );
- int nLen;
+ size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aSections.push_back( rtl::OString( pBuf+n ) );
delete pBuf;
More information about the Libreoffice-commits
mailing list