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 {
|
||||
public:
|
||||
explicit StdFile(FILE *fp, bool use_stdio)
|
||||
explicit StdFile(std::FILE *fp, bool use_stdio)
|
||||
: fp(fp), use_stdio(use_stdio) {
|
||||
}
|
||||
virtual ~StdFile(void) {
|
||||
@ -180,6 +180,7 @@ InputSplit* InputSplit::Create(const char *uri,
|
||||
unsigned part,
|
||||
unsigned nsplit,
|
||||
const char *type) {
|
||||
using namespace std;
|
||||
using namespace xgboost;
|
||||
const char *msg = "xgboost is compiled in local mode\n"\
|
||||
"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) {
|
||||
using namespace std;
|
||||
using namespace xgboost;
|
||||
const char *msg = "xgboost is compiled in local mode\n"\
|
||||
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
||||
utils::Check(strncmp(fname, "s3://", 5) != 0, msg);
|
||||
utils::Check(strncmp(fname, "hdfs://", 7) != 0, msg);
|
||||
|
||||
FILE *fp = NULL;
|
||||
std::FILE *fp = NULL;
|
||||
bool use_stdio = false;
|
||||
using namespace std;
|
||||
#ifndef XGBOOST_STRICT_CXX98_
|
||||
|
||||
@ -15,6 +15,7 @@ DataMatrix* LoadDataMatrix(const char *fname,
|
||||
bool savebuffer,
|
||||
bool loadsplit,
|
||||
const char *cache_file) {
|
||||
using namespace std;
|
||||
std::string fname_ = fname;
|
||||
|
||||
const char *dlm = strchr(fname, '#');
|
||||
|
||||
@ -111,7 +111,8 @@ class LibSVMPageFactory {
|
||||
*/
|
||||
inline void ParseBlock(char *begin,
|
||||
char *end,
|
||||
LibSVMPage *out) {
|
||||
LibSVMPage *out) {
|
||||
using namespace std;
|
||||
out->Clear();
|
||||
char *p = begin;
|
||||
while (p != end) {
|
||||
|
||||
@ -255,7 +255,7 @@ class FMatrixPage : public IFMatrix {
|
||||
|
||||
protected:
|
||||
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;
|
||||
utils::FileStream fs(fi);
|
||||
LoadMeta(&fs);
|
||||
|
||||
@ -55,8 +55,10 @@ inline void ThreadExit(void *status) {
|
||||
} // namespace xgboost
|
||||
#else
|
||||
// thread interface using g++
|
||||
extern "C" {
|
||||
#include <semaphore.h>
|
||||
#include <pthread.h>
|
||||
}
|
||||
namespace xgboost {
|
||||
namespace utils {
|
||||
/*!\brief semaphore class */
|
||||
@ -120,6 +122,7 @@ class Semaphore {
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/*!\brief simple thread class */
|
||||
class Thread {
|
||||
private:
|
||||
@ -130,7 +133,7 @@ class Thread {
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
|
||||
pthread_create(&thread, &attr, entry, param);
|
||||
}
|
||||
}
|
||||
inline int Join(void) {
|
||||
void *status;
|
||||
return pthread_join(thread, &status);
|
||||
|
||||
@ -31,7 +31,8 @@ class ThreadBuffer {
|
||||
}
|
||||
/*!\brief set parameter, will also pass the parameter to factory */
|
||||
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);
|
||||
}
|
||||
/*!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user