Changeset 1586


Ignore:
Timestamp:
28/04/2007 18:13:34 (5 years ago)
Author:
chris
Message:

Fix inability to handle streams over 2GB properly. (refs #3)

Location:
box/chris/merge/lib/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • box/chris/merge/lib/common/PartialReadStream.cpp

    r217 r1586  
    1717// 
    1818// Function 
    19 //              Name:    PartialReadStream::PartialReadStream(IOStream &, int) 
    20 //              Purpose: Constructor, taking another stream and the number of bytes 
    21 //                               to be read from it. 
     19//              Name:    PartialReadStream::PartialReadStream(IOStream &, 
     20//                       pos_type) 
     21//              Purpose: Constructor, taking another stream and the number of 
     22//                       bytes to be read from it. 
    2223//              Created: 2003/08/26 
    2324// 
    2425// -------------------------------------------------------------------------- 
    25 PartialReadStream::PartialReadStream(IOStream &rSource, int BytesToRead) 
     26PartialReadStream::PartialReadStream(IOStream &rSource, 
     27        pos_type BytesToRead) 
    2628        : mrSource(rSource), 
    2729          mBytesLeft(BytesToRead) 
  • box/chris/merge/lib/common/PartialReadStream.h

    r217 r1586  
    2424{ 
    2525public: 
    26         PartialReadStream(IOStream &rSource, int BytesToRead); 
     26        PartialReadStream(IOStream &rSource, pos_type BytesToRead); 
    2727        ~PartialReadStream(); 
    2828private: 
     
    4040private: 
    4141        IOStream &mrSource; 
    42         int mBytesLeft; 
     42        pos_type mBytesLeft; 
    4343}; 
    4444 
  • box/chris/merge/lib/common/ReadGatherStream.cpp

    r217 r1586  
    6060// Function 
    6161//              Name:    ReadGatherStream::AddComponent(IOStream *) 
    62 //              Purpose: Add a component to this stream, returning the index of this component 
    63 //                               in the internal list. Use this with AddBlock() 
     62//              Purpose: Add a component to this stream, returning the index 
     63//                       of this component in the internal list. Use this 
     64//                       with AddBlock() 
    6465//              Created: 10/12/03 
    6566// 
     
    146147                { 
    147148                        // Read! 
    148                         int s = mBlocks[mCurrentBlock].mLength - mPositionInCurrentBlock; 
     149                        pos_type s = mBlocks[mCurrentBlock].mLength - mPositionInCurrentBlock; 
    149150                        if(s > bytesToRead) s = bytesToRead; 
    150151                         
    151                         int r = mComponents[mBlocks[mCurrentBlock].mComponent]->Read(buffer, s, Timeout); 
     152                        pos_type r = mComponents[mBlocks[mCurrentBlock].mComponent]->Read(buffer, s, Timeout); 
    152153                         
    153154                        // update variables 
Note: See TracChangeset for help on using the changeset viewer.