some strict cxx98 check
This commit is contained in:
parent
48bcc021f7
commit
279758a92e
@ -141,7 +141,7 @@ class SingleFileSplit : public dmlc::InputSplit {
|
|||||||
|
|
||||||
class StdFile : public dmlc::Stream {
|
class StdFile : public dmlc::Stream {
|
||||||
public:
|
public:
|
||||||
explicit StdFile(FILE *fp, bool use_stdio)
|
explicit StdFile(std::FILE *fp, bool use_stdio)
|
||||||
: fp(fp), use_stdio(use_stdio) {
|
: fp(fp), use_stdio(use_stdio) {
|
||||||
}
|
}
|
||||||
virtual ~StdFile(void) {
|
virtual ~StdFile(void) {
|
||||||
@ -180,6 +180,7 @@ InputSplit* InputSplit::Create(const char *uri,
|
|||||||
unsigned part,
|
unsigned part,
|
||||||
unsigned nsplit,
|
unsigned nsplit,
|
||||||
const char *type) {
|
const char *type) {
|
||||||
|
using namespace std;
|
||||||
using namespace xgboost;
|
using namespace xgboost;
|
||||||
const char *msg = "xgboost is compiled in local mode\n"\
|
const char *msg = "xgboost is compiled in local mode\n"\
|
||||||
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
||||||
@ -190,13 +191,14 @@ InputSplit* InputSplit::Create(const char *uri,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Stream *Stream::Create(const char *fname, const char * const mode, bool allow_null) {
|
Stream *Stream::Create(const char *fname, const char * const mode, bool allow_null) {
|
||||||
|
using namespace std;
|
||||||
using namespace xgboost;
|
using namespace xgboost;
|
||||||
const char *msg = "xgboost is compiled in local mode\n"\
|
const char *msg = "xgboost is compiled in local mode\n"\
|
||||||
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
||||||
utils::Check(strncmp(fname, "s3://", 5) != 0, msg);
|
utils::Check(strncmp(fname, "s3://", 5) != 0, msg);
|
||||||
utils::Check(strncmp(fname, "hdfs://", 7) != 0, msg);
|
utils::Check(strncmp(fname, "hdfs://", 7) != 0, msg);
|
||||||
|
|
||||||
FILE *fp = NULL;
|
std::FILE *fp = NULL;
|
||||||
bool use_stdio = false;
|
bool use_stdio = false;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#ifndef XGBOOST_STRICT_CXX98_
|
#ifndef XGBOOST_STRICT_CXX98_
|
||||||
|
|||||||
@ -15,6 +15,7 @@ DataMatrix* LoadDataMatrix(const char *fname,
|
|||||||
bool savebuffer,
|
bool savebuffer,
|
||||||
bool loadsplit,
|
bool loadsplit,
|
||||||
const char *cache_file) {
|
const char *cache_file) {
|
||||||
|
using namespace std;
|
||||||
std::string fname_ = fname;
|
std::string fname_ = fname;
|
||||||
|
|
||||||
const char *dlm = strchr(fname, '#');
|
const char *dlm = strchr(fname, '#');
|
||||||
|
|||||||
@ -112,6 +112,7 @@ class LibSVMPageFactory {
|
|||||||
inline void ParseBlock(char *begin,
|
inline void ParseBlock(char *begin,
|
||||||
char *end,
|
char *end,
|
||||||
LibSVMPage *out) {
|
LibSVMPage *out) {
|
||||||
|
using namespace std;
|
||||||
out->Clear();
|
out->Clear();
|
||||||
char *p = begin;
|
char *p = begin;
|
||||||
while (p != end) {
|
while (p != end) {
|
||||||
|
|||||||
@ -255,7 +255,7 @@ class FMatrixPage : public IFMatrix {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline bool TryLoadColData(void) {
|
inline bool TryLoadColData(void) {
|
||||||
FILE *fi = fopen64(col_meta_name_.c_str(), "rb");
|
std::FILE *fi = fopen64(col_meta_name_.c_str(), "rb");
|
||||||
if (fi == NULL) return false;
|
if (fi == NULL) return false;
|
||||||
utils::FileStream fs(fi);
|
utils::FileStream fs(fi);
|
||||||
LoadMeta(&fs);
|
LoadMeta(&fs);
|
||||||
|
|||||||
@ -55,8 +55,10 @@ inline void ThreadExit(void *status) {
|
|||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
#else
|
#else
|
||||||
// thread interface using g++
|
// thread interface using g++
|
||||||
|
extern "C" {
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
}
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace utils {
|
namespace utils {
|
||||||
/*!\brief semaphore class */
|
/*!\brief semaphore class */
|
||||||
@ -120,6 +122,7 @@ class Semaphore {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!\brief simple thread class */
|
/*!\brief simple thread class */
|
||||||
class Thread {
|
class Thread {
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -31,7 +31,8 @@ class ThreadBuffer {
|
|||||||
}
|
}
|
||||||
/*!\brief set parameter, will also pass the parameter to factory */
|
/*!\brief set parameter, will also pass the parameter to factory */
|
||||||
inline void SetParam(const char *name, const char *val) {
|
inline void SetParam(const char *name, const char *val) {
|
||||||
if (!std::strcmp( name, "buffer_size")) buf_size = atoi(val);
|
using namespace std;
|
||||||
|
if (!strcmp( name, "buffer_size")) buf_size = atoi(val);
|
||||||
factory.SetParam(name, val);
|
factory.SetParam(name, val);
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user