back to polygonf

git-svn-id: svn://db.shs.com.ru/pip@105 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-17 07:19:36 +00:00
parent 022b76bc29
commit 353dbedf77
25 changed files with 143 additions and 106 deletions

View File

@@ -91,7 +91,7 @@ public:
void operator =(const ullong & val) {resize(sizeof(val) * 8); memcpy(data(), &val, sizeof(val));}
private:
uint bytesInBits(const uint & bits) const {return (bits + 7) / 8;}
static uint bytesInBits(const uint & bits) {return (bits + 7) / 8;}
PIVector<uchar> data_;
uint size_;

View File

@@ -154,7 +154,7 @@ PICout PICout::operator <<(const PICoutAction v) {
memset(line, ' ', dx);
line[dx] = 0;
printf("%s", line);
delete line;
delete[] line;
}
SetConsoleCursorPosition(__Private__::hOut, coord);
#else

View File

@@ -175,7 +175,7 @@ public:
PICout operator <<(const PICoutManipulators::PICoutSpecialChar v);
//! Output operator for \a PIFlags<PICoutFormat> values
PICout operator <<(const PIFlags<PICoutManipulators::PICoutFormat> v) {
PICout operator <<(const PIFlags<PICoutManipulators::PICoutFormat> & v) {
if (v[PICoutManipulators::Bin]) cnb_ = 2;
if (v[PICoutManipulators::Oct]) cnb_ = 8;
if (v[PICoutManipulators::Dec]) cnb_ = 10;

View File

@@ -110,7 +110,7 @@ void PIString::appendFromChars(const char * c, int s, const char * cp) {
//printf("appendFromChars %d -> %d\n", s, rs);
for (int i = 0; i < rs; ++i)
push_back(PIChar(ucs[i]));
delete ucs;
delete[] ucs;
ucnv_close(cc);
return;
}
@@ -510,7 +510,7 @@ int PIString::find(const char str, const int start) const {
}
int PIString::find(const PIString str, const int start) const {
int PIString::find(const PIString & str, const int start) const {
int l = str.length();
for (int i = start; i < length() - l + 1; ++i)
if (mid(i, l) == str)
@@ -527,7 +527,7 @@ int PIString::findLast(const char str, const int start) const {
}
int PIString::findLast(const PIString str, const int start) const {
int PIString::findLast(const PIString & str, const int start) const {
int l = str.length();
for (int i = length() - l; i >= start; --i)
if (mid(i, l) == str)

View File

@@ -529,7 +529,7 @@ public:
//! \brief Search substring "str" from symbol at index "start" and return first occur position
//! \details Example: \snippet pistring.cpp PIString::find
int find(const PIString str, const int start = 0) const;
int find(const PIString & str, const int start = 0) const;
//! \brief Search substring "str" from symbol at index "start" and return first occur position
//! \details Example: \snippet pistring.cpp PIString::find
@@ -541,7 +541,7 @@ public:
//! \brief Search substring "str" from symbol at index "start" and return last occur position
//! \details Example: \snippet pistring.cpp PIString::findLast
int findLast(const PIString str, const int start = 0) const;
int findLast(const PIString & str, const int start = 0) const;
//! \brief Search substring "str" from symbol at index "start" and return last occur position
//! \details Example: \snippet pistring.cpp PIString::findLast

View File

@@ -208,7 +208,7 @@ PISystemTime::PISystemTime(const FILETIME & t) {
PISystemTime PISystemTime::abs() const {
if (seconds < 0)
return PISystemTime(piAbsl(seconds) - 1, 1e+9 - piAbsl(nanoseconds));
return PISystemTime(piAbsl(seconds) - 1, 1000000000l - piAbsl(nanoseconds));
else
return PISystemTime(piAbsl(seconds), piAbsl(nanoseconds));
}

View File

@@ -298,10 +298,10 @@ public:
//! \brief Returns PISystemTime elapsed from last \a reset() execution or from timer measurer creation.
PISystemTime elapsed();
double reset_time_n() {return t_st.toNanoseconds();}
double reset_time_u() {return t_st.toMicroseconds();}
double reset_time_m() {return t_st.toMilliseconds();}
double reset_time_s() {return t_st.toSeconds();}
double reset_time_n() const {return t_st.toNanoseconds();}
double reset_time_u() const {return t_st.toMicroseconds();}
double reset_time_m() const {return t_st.toMilliseconds();}
double reset_time_s() const {return t_st.toSeconds();}
//! \brief Returns time mark of last \a reset() execution or timer measurer creation.
PISystemTime reset_time() {return t_st;}