windows check

This commit is contained in:
Tianqi Chen
2014-08-29 21:27:03 -07:00
parent 9830674b75
commit 366ac95ad3
6 changed files with 17 additions and 15 deletions

View File

@@ -50,13 +50,13 @@ struct RowBatchPage {
std::vector<size_t> &rptr = *p_rptr;
rptr.resize(this->Size() + 1);
for (size_t i = 0; i < rptr.size(); ++i) {
rptr[i] = static_cast<size_t>(this->row_ptr(i));
rptr[i] = static_cast<size_t>(this->row_ptr(static_cast<int>(i)));
}
batch.ind_ptr = &rptr[0];
return batch;
}
/*! \brief get i-th row from the batch */
inline RowBatch::Inst operator[](size_t i) {
inline RowBatch::Inst operator[](int i) {
return RowBatch::Inst(data_ptr(0) + row_ptr(i),
static_cast<bst_uint>(row_ptr(i+1) - row_ptr(i)));
}
@@ -173,7 +173,7 @@ class ThreadRowPageIterator: public utils::IIterator<RowBatch> {
// loader factory for page
struct Factory {
public:
size_t file_begin_;
long file_begin_;
utils::FileStream fi;
Factory(void) {}
inline void SetFile(const utils::FileStream &fi) {

View File

@@ -92,9 +92,9 @@ class IStream {
class ISeekStream: public IStream {
public:
/*! \brief seek to certain position of the file */
virtual void Seek(size_t pos) = 0;
virtual void Seek(long pos) = 0;
/*! \brief tell the position of the stream */
virtual size_t Tell(void) = 0;
virtual long Tell(void) = 0;
};
/*! \brief implementation of file i/o stream */
@@ -112,11 +112,11 @@ class FileStream : public ISeekStream {
virtual void Write(const void *ptr, size_t size) {
fwrite(ptr, size, 1, fp);
}
virtual void Seek(size_t pos) {
virtual void Seek(long pos) {
fseek(fp, pos, SEEK_SET);
}
virtual size_t Tell(void) {
return static_cast<size_t>(ftell(fp));
virtual long Tell(void) {
return ftell(fp);
}
inline void Close(void) {
if (fp != NULL){