fix MSVC compilation/build issues
This commit is contained in:
parent
1d7a512fd4
commit
cda6673f85
@ -63,7 +63,7 @@ namespace imc
|
||||
std::cout<<"WARNING: invalid length parameter in "<<thekey_.name_<<"-block "
|
||||
<<"(block-end:"<<end_<<",buffer-size:"<<buffer_->size()<<")"
|
||||
<<" => resetting block-end to buffer-size\n";
|
||||
end_ = buffer_->size();
|
||||
end_ = (unsigned long int)(buffer_->size());
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -215,7 +215,7 @@ namespace imc
|
||||
// xname_ = std::string("time");
|
||||
|
||||
// find appropriate precision for "xdata_" by means of "xstepwidth_"
|
||||
xprec_ = (xstepwidth_ > 0 ) ? ceil(fabs(log10(xstepwidth_))) : 10;
|
||||
xprec_ = (xstepwidth_ > 0 ) ? (int)ceil(fabs(log10(xstepwidth_))) : 10;
|
||||
}
|
||||
|
||||
// extract associated CP data
|
||||
@ -296,7 +296,7 @@ namespace imc
|
||||
buffer_->begin()+buffstrt+buffer_size_+1 );
|
||||
|
||||
// determine number of values in buffer
|
||||
unsigned long int num_values = CSbuffer.size()/(signbits_/8);
|
||||
unsigned long int num_values = (unsigned long int)(CSbuffer.size()/(signbits_/8));
|
||||
if ( num_values*(signbits_/8) != CSbuffer.size() )
|
||||
{
|
||||
throw std::runtime_error("CSbuffer and significant bits of datatype don't match");
|
||||
|
@ -48,7 +48,7 @@ namespace imc
|
||||
public:
|
||||
datatype(): ubyte_(0), sbyte_(0),
|
||||
ushort_(0), sshort_(0),
|
||||
ulint_(0.0), slint_(0.0),
|
||||
ulint_(0), slint_(0),
|
||||
sfloat_(0.0), sdouble_(0.0),
|
||||
sdigital_(0),
|
||||
dtidx_(0) { };
|
||||
@ -61,10 +61,10 @@ namespace imc
|
||||
datatype(imc_Slongint num): slint_(num), dtidx_(5) {};
|
||||
datatype(imc_float num): sfloat_(num), dtidx_(6) {};
|
||||
datatype(imc_double num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
||||
ulint_(0.0), slint_(0.0), sfloat_(0.0), sdouble_(num),
|
||||
ulint_(0), slint_(0), sfloat_(0.0), sdouble_(num),
|
||||
sdigital_(0), dtidx_(7) {};
|
||||
datatype(imc_digital num): ubyte_(0), sbyte_(0), ushort_(0), sshort_(0),
|
||||
ulint_(0.0), slint_(0.0), sfloat_(0.0), sdouble_(num),
|
||||
ulint_(0), slint_(0), sfloat_(0.0), sdouble_(num),
|
||||
sdigital_(num), dtidx_(10) {};
|
||||
|
||||
// identify type
|
||||
|
@ -500,22 +500,22 @@ namespace imc
|
||||
minute_ = std::stoi( get_parameter(buffer,¶meters[6]) );
|
||||
second_ = std::stod( get_parameter(buffer,¶meters[7]) );
|
||||
|
||||
time_t rawtime;
|
||||
struct tm ts;
|
||||
time(&rawtime);
|
||||
localtime_r(&rawtime,&ts);
|
||||
ts.tm_mday = day_;
|
||||
ts.tm_mon = month_-1;
|
||||
ts.tm_year = year_-1900;
|
||||
ts.tm_hour = hour_;
|
||||
ts.tm_min = minute_;
|
||||
ts.tm_sec = (int)second_;
|
||||
asctime_r(&ts,×tamp_[0]);
|
||||
// timestamp_ = std::to_string(year_) + std::string("-") + std::to_string(month_)
|
||||
// + std::string("-") + std::to_string(day_)
|
||||
// + std::string("T") + std::to_string(hour_)
|
||||
// + std::string(":") + std::to_string(minute_)
|
||||
// + std::string(":") + std::to_string(second_);
|
||||
//time_t rawtime;
|
||||
//struct tm ts;
|
||||
//time(&rawtime);
|
||||
//localtime_r(&rawtime,&ts);
|
||||
//ts.tm_mday = day_;
|
||||
//ts.tm_mon = month_-1;
|
||||
//ts.tm_year = year_-1900;
|
||||
//ts.tm_hour = hour_;
|
||||
//ts.tm_min = minute_;
|
||||
//ts.tm_sec = (int)second_;
|
||||
//asctime_r(&ts,×tamp_[0]);
|
||||
timestamp_ = std::to_string(year_) + std::string("-") + std::to_string(month_)
|
||||
+ std::string("-") + std::to_string(day_)
|
||||
+ std::string("T") + std::to_string(hour_)
|
||||
+ std::string(":") + std::to_string(minute_)
|
||||
+ std::string(":") + std::to_string(second_);
|
||||
}
|
||||
|
||||
// get info string
|
||||
|
@ -123,20 +123,20 @@ namespace imc
|
||||
leng.push_back((char)*(it+pos));
|
||||
pos++;
|
||||
}
|
||||
unsigned long length = std::stoul(leng);
|
||||
unsigned long int length = std::stoul(leng);
|
||||
|
||||
// declare and initialize corresponding key and block
|
||||
// imc::key bkey( *(it+1)==imc::key_crit_ , newkey,
|
||||
// imc::keys.at(newkey).description_, version );
|
||||
imc::block blk(itkey,it-buffer_.begin(),
|
||||
it-buffer_.begin()+pos+1+length,
|
||||
imc::block blk(itkey,(unsigned long int)(it-buffer_.begin()),
|
||||
(unsigned long int)(it-buffer_.begin()+pos+1+length),
|
||||
raw_file_, &buffer_);
|
||||
|
||||
// add block to list
|
||||
rawblocks_.push_back(blk);
|
||||
|
||||
// skip the remaining block according to its length
|
||||
if ( it-buffer_.begin()+length < buffer_.size() )
|
||||
if ( (unsigned long int)(it-buffer_.begin()+length) < (unsigned long int)(buffer_.size()) )
|
||||
{
|
||||
std::advance(it,length);
|
||||
}
|
||||
@ -253,7 +253,7 @@ namespace imc
|
||||
// provide buffer size
|
||||
unsigned long int buffer_size()
|
||||
{
|
||||
return buffer_.size();
|
||||
return (unsigned long int)buffer_.size();
|
||||
}
|
||||
|
||||
// get blocks
|
||||
@ -377,7 +377,7 @@ namespace imc
|
||||
std::filesystem::path pf = pd / filenam;
|
||||
|
||||
// and print the channel
|
||||
it->second.print(pf,sep);
|
||||
it->second.print(pf.u8string(),sep);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user