Project

General

Profile

RE: mmap and exiv2 ยป asdiel.patch

Robin Mills, 15 Oct 2016 07:08

View differences:

include/exiv2/basicio.hpp (working copy)
559 559
        // Pimpl idiom
560 560
        class Impl;
561 561
        Impl* p_;
562
        
563
        long totalRead_;
562 564

  
563 565
    }; // class FileIo
564 566

  
include/exiv2/config.h (working copy)
214 214
#endif
215 215
//////////////////////////////////////
216 216

  
217
#undef EXV_HAVE_MMAP
218
#undef EXV_HAVE_MUNMAP
217 219

  
220

  
218 221
# include <stdio.h>
219 222
#ifdef   EXV_HAVE_UNISTD_H
220 223
#include <unistd.h>
src/basicio.cpp (working copy)
351 351

  
352 352
    FileIo::FileIo(const std::string& path)
353 353
        : p_(new Impl(path))
354
        , totalRead_(0)
354 355
    {
355 356
    }
356 357

  
......
1048 1049
            if (std::fclose(p_->fp_) != 0) rc |= 1;
1049 1050
            p_->fp_= 0;
1050 1051
        }
1052
        std::cout << "totalRead_ = " << totalRead_ << std::endl;
1051 1053
        return rc;
1052 1054
    }
1053 1055

  
......
1064 1066
    {
1065 1067
        assert(p_->fp_ != 0);
1066 1068
        if (p_->switchMode(Impl::opRead) != 0) return 0;
1069
        totalRead_ += rcount;
1067 1070
        return (long)std::fread(buf, 1, rcount, p_->fp_);
1068 1071
    }
1069 1072

  
    (1-1/1)