54 unsigned int mask = ~inc; |
55 unsigned int mask = ~inc; |
55 unsigned int val = (unsigned int)v; |
56 unsigned int val = (unsigned int)v; |
56 unsigned int res = (val+inc) & mask; |
57 unsigned int res = (val+inc) & mask; |
57 return (T)res; |
58 return (T)res; |
58 } |
59 } |
59 |
|
60 // Need a default constructor for TVersion, but don't want all the other stuff in h_utl.cpp |
|
61 /** |
|
62 Default constructor for TVersion class. |
|
63 @internalComponent |
|
64 @released |
|
65 */ |
|
66 TVersion::TVersion(){} |
|
67 |
|
68 /** |
|
69 Constructor for TVersion class. |
|
70 @internalComponent |
|
71 @released |
|
72 */ |
|
73 TVersion::TVersion(TInt aMajor, TInt aMinor, TInt aBuild): |
|
74 iMajor((TInt8)aMajor), iMinor((TInt8)aMinor), iBuild((TInt16)aBuild) |
|
75 { |
|
76 } |
|
77 |
|
78 |
60 |
79 /** |
61 /** |
80 Constructor for E32ImageChunkDesc class. |
62 Constructor for E32ImageChunkDesc class. |
81 @internalComponent |
63 @internalComponent |
82 @released |
64 @released |
1434 { |
1416 { |
1435 size_t aHeaderSize = GetExtendedE32ImageHeaderSize(); |
1417 size_t aHeaderSize = GetExtendedE32ImageHeaderSize(); |
1436 os->write(iE32Image, aHeaderSize); |
1418 os->write(iE32Image, aHeaderSize); |
1437 |
1419 |
1438 // Compress and write out code part |
1420 // Compress and write out code part |
|
1421 CBytePair bpe; |
1439 int srcStart = GetExtendedE32ImageHeaderSize(); |
1422 int srcStart = GetExtendedE32ImageHeaderSize(); |
1440 CompressPages( (TUint8*)iE32Image + srcStart, iHdr->iCodeSize, *os); |
1423 CompressPages( (TUint8*)iE32Image + srcStart, iHdr->iCodeSize, *os, &bpe); |
1441 |
1424 |
1442 |
1425 |
1443 // Compress and write out data part |
1426 // Compress and write out data part |
1444 srcStart += iHdr->iCodeSize; |
1427 srcStart += iHdr->iCodeSize; |
1445 int srcLen = GetE32ImageSize() - srcStart; |
1428 int srcLen = GetE32ImageSize() - srcStart; |
1446 |
1429 |
1447 CompressPages((TUint8*)iE32Image + srcStart, srcLen, *os); |
1430 CompressPages((TUint8*)iE32Image + srcStart, srcLen, *os, &bpe); |
1448 |
1431 |
1449 } |
1432 } |
1450 else if (compression == 0) |
1433 else if (compression == 0) |
1451 { |
1434 { |
1452 os->write(iE32Image, GetE32ImageSize()); // image not compressed |
1435 os->write(iE32Image, GetE32ImageSize()); // image not compressed |
1771 if (aImage.iData==NULL) |
1754 if (aImage.iData==NULL) |
1772 return is; |
1755 return is; |
1773 oh = aImage.iOrigHdr; |
1756 oh = aImage.iOrigHdr; |
1774 |
1757 |
1775 // Read and decompress code part of the image |
1758 // Read and decompress code part of the image |
1776 |
1759 CBytePair bpe; |
1777 unsigned int uncompressedCodeSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz), is); |
1760 unsigned int uncompressedCodeSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz), is, &bpe); |
1778 |
1761 |
1779 |
1762 |
1780 // Read and decompress data part of the image |
1763 // Read and decompress data part of the image |
1781 |
1764 |
1782 unsigned int uncompressedDataSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz + uncompressedCodeSize), is); |
1765 unsigned int uncompressedDataSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz + uncompressedCodeSize), is, &bpe); |
1783 |
1766 |
1784 if (uncompressedCodeSize + uncompressedDataSize != uncompsize) |
1767 if (uncompressedCodeSize + uncompressedDataSize != uncompsize) |
1785 MessageHandler::GetInstance()->ReportMessage(WARNING, BYTEPAIRINCONSISTENTSIZEERROR); |
1768 MessageHandler::GetInstance()->ReportMessage(WARNING, BYTEPAIRINCONSISTENTSIZEERROR); |
1786 |
1769 |
1787 if ((TUint)orighdrsz > oh->iCodeOffset) |
1770 if ((TUint)orighdrsz > oh->iCodeOffset) |