diff --git a/package/source/zipapi/ByteChucker.cxx b/package/source/zipapi/ByteChucker.cxx index e64de97dba34..d5dbbbfa6672 100644 --- a/package/source/zipapi/ByteChucker.cxx +++ b/package/source/zipapi/ByteChucker.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ByteChucker.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,7 +102,7 @@ sal_Int64 SAL_CALL ByteChucker::seek( sal_Int64 location ) { if (xSeek.is() ) { - sal_Int32 nLen = xSeek->getLength(); + sal_Int64 nLen = xSeek->getLength(); if (location > nLen ) location = nLen; xSeek->seek( location ); @@ -172,10 +172,10 @@ ByteChucker& ByteChucker::operator << (sal_uInt16 nuInt16) ByteChucker& ByteChucker::operator << (sal_uInt32 nuInt32) { uno::Sequence< sal_Int8 > aSequence (4); - aSequence[0] = (nuInt32 >> 0 ) & 0xFF; - aSequence[1] = (nuInt32 >> 8 ) & 0xFF; - aSequence[2] = (nuInt32 >> 16 ) & 0xFF; - aSequence[3] = (nuInt32 >> 24 ) & 0xFF; + aSequence[0] = static_cast < sal_Int8 > (nuInt32 >> 0 ) & 0xFF; + aSequence[1] = static_cast < sal_Int8 > (nuInt32 >> 8 ) & 0xFF; + aSequence[2] = static_cast < sal_Int8 > (nuInt32 >> 16 ) & 0xFF; + aSequence[3] = static_cast < sal_Int8 > (nuInt32 >> 24 ) & 0xFF; xStream->writeBytes(aSequence); return *this; } diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 113c407df9f9..04d675d54f52 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ByteGrabber.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,7 +114,7 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) { if (xSeek.is() ) { - sal_Int32 nLen = xSeek->getLength(); + sal_Int64 nLen = xSeek->getLength(); if (location > nLen ) location = nLen; xSeek->seek( location ); diff --git a/package/source/zipapi/EntryInputStream.cxx b/package/source/zipapi/EntryInputStream.cxx index e2cebf0fb8bf..9b2db8274454 100644 --- a/package/source/zipapi/EntryInputStream.cxx +++ b/package/source/zipapi/EntryInputStream.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EntryInputStream.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mba $ $Date: 2000-11-30 13:47:49 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,10 +85,10 @@ EntryInputStream::EntryInputStream( uno::Reference < io::XInputStream > xNewInpu , nBegin( 0 ) , nCurrent( 0 ) , nEnd(nUncompressedSize) -, aSequence ( nNewEnd - nNewBegin ) +, aSequence ( static_cast < sal_Int32 > (nNewEnd - nNewBegin) ) , bReachEOF ( sal_False ) , aInflater( sal_True ) -, aBuffer( nUncompressedSize ) +, aBuffer( static_cast < sal_Int32 > (nUncompressedSize) ) { if (nCompEnd - nCompBegin < nUncompressedSize) bDeflated = sal_True; @@ -97,14 +97,14 @@ EntryInputStream::EntryInputStream( uno::Reference < io::XInputStream > xNewInpu if (bDeflated) { xSeek->seek(nNewBegin); - xStream->readBytes(aSequence, nNewEnd - nNewBegin); - aInflater.setInputSegment(aSequence, 0, nNewEnd - nNewBegin ); + xStream->readBytes(aSequence, static_cast < sal_Int32 > (nNewEnd - nNewBegin)); + aInflater.setInputSegment(aSequence, 0, static_cast < sal_Int32 > (nNewEnd - nNewBegin) ); aInflater.doInflate(aBuffer); } else { xSeek->seek(nNewBegin); - xStream->readBytes(aBuffer, nUncompressedSize); + xStream->readBytes(aBuffer, static_cast < sal_Int32 > (nUncompressedSize)); } } @@ -113,15 +113,15 @@ EntryInputStream::~EntryInputStream( void ) } void EntryInputStream::fill(void) { - sal_Int32 nLength, nBytesToRead = aSequence.getLength(); + sal_Int64 nLength, nBytesToRead = aSequence.getLength(); if (nBytesToRead + nCompCurrent> nCompEnd) nBytesToRead = nCompEnd - nCompCurrent; if (xSeek.is()) xSeek->seek( nCompCurrent ); else throw (io::IOException()); - nLength = xStream->readBytes(aSequence, nBytesToRead); - aInflater.setInputSegment(aSequence, 0, nLength); + nLength = xStream->readBytes(aSequence, static_cast < sal_Int32> (nBytesToRead)); + aInflater.setInputSegment(aSequence, 0, static_cast < sal_Int32> (nLength)); } sal_Int32 SAL_CALL EntryInputStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) @@ -134,14 +134,13 @@ sal_Int32 SAL_CALL EntryInputStream::readBytes( uno::Sequence< sal_Int8 >& aData { if (nCurrent > nEnd) return 0; - nBytesToRead = nEnd - nCurrent; + nBytesToRead = static_cast < sal_Int32> (nEnd - nCurrent); } aData.realloc( nBytesToRead ); - sal_Int64 nDataLen = aData.getLength(); - for ( sal_Int64 i = 0; i< nBytesToRead;i++,nCurrent++) - aData[i] = aBuffer[nCurrent]; + for ( sal_Int32 i = 0; i< nBytesToRead;i++,nCurrent++) + aData[i] = aBuffer[static_cast < sal_Int32 > (nCurrent)]; return nBytesToRead; /* @@ -193,7 +192,7 @@ void SAL_CALL EntryInputStream::skipBytes( sal_Int32 nBytesToSkip ) if (nBytesToSkip == 0) return; if (nBytesToSkip + nCurrent > nEnd ) - nBytesToSkip = nEnd - nCurrent; + nBytesToSkip = static_cast < sal_Int32 > (nEnd - nCurrent); nCurrent+=nBytesToSkip; /* @@ -231,7 +230,7 @@ void SAL_CALL EntryInputStream::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL EntryInputStream::available( ) throw(io::NotConnectedException, io::IOException, uno::RuntimeException) { - return aBuffer.getLength() - nCurrent; + return aBuffer.getLength() - static_cast < sal_Int32> (nCurrent); /* if (!bDeflated) return nCompEnd - nCompCurrent; diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index ff0fb86c603b..85414f7b06de 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipFile.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -221,7 +221,7 @@ sal_Bool ZipFile::readLOC(const package::ZipEntry &rEntry) aGrabber >> nNameLen; aGrabber >> nExtraLen; package::ZipEntry *pNonConstEntry = const_cast < package::ZipEntry* > (&rEntry); - pNonConstEntry->nOffset = aGrabber.getPosition() + nNameLen + nExtraLen; + pNonConstEntry->nOffset = static_cast < sal_Int8 > (aGrabber.getPosition()) + nNameLen + nExtraLen; return sal_True; /* @@ -251,9 +251,9 @@ sal_Bool ZipFile::readLOC(const package::ZipEntry &rEntry) sal_Int32 ZipFile::findEND( ) { - sal_uInt32 nLength=0, nPos=0; + sal_Int32 nLength=0, nPos=0; uno::Sequence < sal_Int8 > aByteSeq; - nLength = nPos = aGrabber.getLength(); + nLength = nPos = static_cast (aGrabber.getLength()); if (nLength == 0) return -1; aGrabber.seek( nLength ); @@ -273,7 +273,7 @@ sal_Int32 ZipFile::findEND( ) if (nTest == ENDSIG) { sal_uInt16 nCommentLength; - sal_uInt32 nEndPos = nPos + i; + sal_Int32 nEndPos = nPos + i; aGrabber.seek(nEndPos+ENDCOM); aGrabber >> nCommentLength; if (nEndPos + ENDHDR + nCommentLength == nLength) @@ -319,9 +319,9 @@ void ZipFile::addEntryComment( int nIndex, ByteSequence &rComment) sal_Int32 ZipFile::readCEN() { - sal_uInt32 nEndPos, nLocPos; + sal_Int32 nEndPos, nLocPos; sal_Int16 nCount, nTotal; - sal_uInt32 nCenLen, nCenPos, nCenOff; + sal_Int32 nCenLen, nCenPos, nCenOff; nEndPos = findEND(); if (nEndPos == -1) diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 9642b5426c7f..cea7fd7914eb 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipOutputStream.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 03:14:55 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,7 +91,7 @@ void SAL_CALL ZipOutputStream::setComment( const ::rtl::OUString& rComment ) void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod ) throw(uno::RuntimeException) { - nMethod = nNewMethod; + nMethod = static_cast < sal_Int16 > (nNewMethod); } void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel ) throw(uno::RuntimeException) @@ -121,7 +121,7 @@ void SAL_CALL ZipOutputStream::putNextEntry( const package::ZipEntry& rEntry ) pNonConstEntry->nCrc != -1) pNonConstEntry->nFlag = 0; - pNonConstEntry->nOffset = aChucker.getPosition(); + pNonConstEntry->nOffset = static_cast < sal_Int32 > (aChucker.getPosition()); writeLOC(rEntry); aZipList.push_back(pNonConstEntry); pCurrentEntry=pNonConstEntry; @@ -229,10 +229,10 @@ void SAL_CALL ZipOutputStream::finish( ) // boom VOS_DEBUG_ONLY("Zip file must have at least one entry!\n"); } - sal_Int32 nOffset= aChucker.getPosition(); + sal_Int32 nOffset= static_cast < sal_Int32 > (aChucker.getPosition()); for (int i =0, nEnd = aZipList.size(); i < nEnd; i++) writeCEN(*aZipList[i]); - writeEND( nOffset, aChucker.getPosition() - nOffset); + writeEND( nOffset, static_cast < sal_Int32 > (aChucker.getPosition()) - nOffset); bFinished = sal_True; } void ZipOutputStream::doDeflate() @@ -250,7 +250,7 @@ void ZipOutputStream::doDeflate() } void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength) { - sal_Int16 i=0, nCommentLength = sComment.getLength(); + sal_Int16 i=0, nCommentLength = static_cast < sal_Int16 > (sComment.getLength()); const sal_Unicode *pChar = sComment.getStr(); uno::Sequence < sal_Int8 > aSequence (nCommentLength); for ( ; i < nCommentLength; i++) @@ -271,9 +271,10 @@ void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength) } void ZipOutputStream::writeCEN( const package::ZipEntry &rEntry ) { - sal_Int16 nNameLength = rEntry.sName.getLength(), - nCommentLength = rEntry.sComment.getLength(), - nExtraLength = rEntry.extra.getLength(), i = 0; + sal_Int16 nNameLength = static_cast < sal_Int16 > ( rEntry.sName.getLength() ) , + nCommentLength = static_cast < sal_Int16 > ( rEntry.sComment.getLength() ) , + nExtraLength = static_cast < sal_Int16 > ( rEntry.extra.getLength() ); + sal_Int16 i = 0; aChucker << CENSIG; aChucker << rEntry.nVersion; @@ -331,7 +332,8 @@ void ZipOutputStream::writeEXT( const package::ZipEntry &rEntry ) void ZipOutputStream::writeLOC( const package::ZipEntry &rEntry ) { - sal_Int16 nNameLength = rEntry.sName.getLength(), i=0; + sal_Int16 nNameLength = static_cast < sal_Int16 > (rEntry.sName.getLength()); + sal_Int16 i=0; aChucker << LOCSIG; aChucker << rEntry.nVersion; aChucker << rEntry.nFlag; diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 58619712d0af..23d0b7678368 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackage.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 13:47:18 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -468,14 +468,14 @@ void SAL_CALL ZipPackage::commitChanges( ) ManifestWriter aWriter ( xManOutStream, xFactory, aManList); aWriter.Write(); - pManifestStream->aEntry.nSize = pManifestStream->aEntry.nCompressedSize = pBuffer->getPosition(); - pBuffer->aBuffer.realloc(pBuffer->getPosition()); + pManifestStream->aEntry.nSize = pManifestStream->aEntry.nCompressedSize = static_cast < sal_Int32 > (pBuffer->getPosition()); + pBuffer->aBuffer.realloc(static_cast < sal_Int32 > (pBuffer->getPosition())); CRC32 aCRC; aCRC.update(pBuffer->aBuffer); pManifestStream->aEntry.nCrc = aCRC.getValue(); pZipOut->putNextEntry(pManifestStream->aEntry); - pZipOut->write(pBuffer->aBuffer, 0, pBuffer->getPosition()); + pZipOut->write(pBuffer->aBuffer, 0, static_cast < sal_Int32 > (pBuffer->getPosition())); pZipOut->closeEntry(); pZipOut->finish(); @@ -485,7 +485,7 @@ void SAL_CALL ZipPackage::commitChanges( ) xMetaFolder->insertByName(OUString::createFromAscii("manifest.xml"), aAny); pZipFile->updateFromManList( aManList ); - for (sal_Int32 i=0 ; i < aManList.size(); i++) + for (sal_uInt32 i=0 ; i < aManList.size(); i++) { ZipEntry * pEntry = aManList[i]->pEntry; pEntry->sName = aManList[i]->sShortName; diff --git a/package/source/zippackage/ZipPackageBuffer.cxx b/package/source/zippackage/ZipPackageBuffer.cxx index 05f97d025a9f..ded6c6321be1 100644 --- a/package/source/zippackage/ZipPackageBuffer.cxx +++ b/package/source/zippackage/ZipPackageBuffer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackageBuffer.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mtg $ $Date: 2000-11-27 16:55:07 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,7 +67,7 @@ using namespace com::sun::star::io; ZipPackageBuffer::ZipPackageBuffer(sal_Int64 nNewBufferSize) : nBufferSize (nNewBufferSize) -, aBuffer (nNewBufferSize) +, aBuffer (static_cast < sal_Int32 > (nNewBufferSize)) , nCurrent(0) , nEnd(0) { @@ -101,11 +101,11 @@ sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToRead + nCurrent > nEnd) - nBytesToRead = nEnd - nCurrent; + nBytesToRead = static_cast < sal_Int32 > (nEnd - nCurrent); sal_Int64 nEndRead = nBytesToRead+nCurrent; - for (sal_Int64 i =0; nCurrent < nEndRead; nCurrent++, i++) - aData[i] = aBuffer[nCurrent]; + for (sal_Int32 i =0; nCurrent < nEndRead; nCurrent++, i++) + aData[i] = aBuffer[static_cast < sal_Int32 > (nCurrent)]; return nBytesToRead; } sal_Int32 SAL_CALL ZipPackageBuffer::readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) @@ -130,7 +130,7 @@ void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL ZipPackageBuffer::available( ) throw(NotConnectedException, IOException, RuntimeException) { - return nEnd - nCurrent; + return static_cast < sal_Int32 > (nEnd - nCurrent); } void SAL_CALL ZipPackageBuffer::closeInput( ) throw(NotConnectedException, IOException, RuntimeException) @@ -143,10 +143,10 @@ void SAL_CALL ZipPackageBuffer::writeBytes( const Sequence< sal_Int8 >& aData ) if (nEnd + nDataLen > nBufferSize) { nBufferSize *=2; - aBuffer.realloc(nBufferSize); + aBuffer.realloc(static_cast < sal_Int32 > (nBufferSize)); } - for (sal_Int64 i=0; i (nCurrent) ] = aData[i]; if (nCurrent>nEnd) nEnd = nCurrent; } diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 9aee87cfa9b1..7b144699e367 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackageFolder.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: mtg $ $Date: 2000-11-29 14:09:05 $ + * last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -332,7 +332,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath, std::vector < Manifest xSeek->seek(0); if (pStream->aEntry.nMethod == STORED) { - pStream->aEntry.nSize = pStream->aEntry.nCompressedSize = xSeek->getLength(); + pStream->aEntry.nSize = pStream->aEntry.nCompressedSize = static_cast < sal_Int32 > (xSeek->getLength()); bTrackLength = sal_False; } } @@ -341,7 +341,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath, std::vector < Manifest while (1) { uno::Sequence < sal_Int8 > aSeq (65535); - sal_Int64 nLength; + sal_Int32 nLength; nLength = xStream->readBytes(aSeq, 65535); if (nLength < 65535) aSeq.realloc(nLength);