summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2003-09-04 09:53:33 +0000
committerOliver Bolte <obo@openoffice.org>2003-09-04 09:53:33 +0000
commit5d2fcc016741e1d56fc62285a3ac4b7582753a48 (patch)
treea204240f1b74f6e4d92c1f6556f579e3463ace3b /cppu
parent144abce8a39eeb875b7e7ac8ddc8c5621700ee21 (diff)
INTEGRATION: CWS cliuno01 (1.12.6); FILE MERGED
2003/07/24 15:19:05 dbo 1.12.6.1: - sequence reallocation fix - more code cleanup - test code
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/uno/prim.hxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/cppu/source/uno/prim.hxx b/cppu/source/uno/prim.hxx
index 0e90fd4ef855..2ef5674f901b 100644
--- a/cppu/source/uno/prim.hxx
+++ b/cppu/source/uno/prim.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prim.hxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: vg $ $Date: 2003-04-15 16:38:04 $
+ * last change: $Author: obo $ $Date: 2003-09-04 10:53:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -164,8 +164,21 @@ inline void _release( void * p, uno_ReleaseFunc release ) SAL_THROW( () )
}
}
+//------------------------------------------------------------------------------
+inline sal_uInt32 calcSeqMemSize(
+ sal_Int32 nElementSize, sal_Int32 nElements )
+{
+ sal_uInt64 nSize =
+ (sal_uInt64) SAL_SEQUENCE_HEADER_SIZE +
+ ((sal_uInt64) nElementSize * (sal_uInt64) nElements);
+ if (nSize > 0xffffffffU)
+ return 0;
+ else
+ return (sal_uInt32) nSize;
+}
+
//--------------------------------------------------------------------------------------------------
-inline uno_Sequence * _getEmptySequence() SAL_THROW( () )
+inline uno_Sequence * createEmptySequence() SAL_THROW( () )
{
::osl_incrementInterlockedCount( &g_emptySeq.nRefCount );
return &g_emptySeq;