Commit 5e1fe821 by maarten

type rename for ints

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@411 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 29ebdcf7
......@@ -10,7 +10,7 @@
namespace mmcif
{
enum AtomType : uint8
enum AtomType : uint8_t
{
Nn = 0, // Unknown
......
......@@ -24,8 +24,8 @@ class BondMap
bool is1_4(const Atom& a, const Atom& b) const
{
uint32 ixa = index.at(a.id());
uint32 ixb = index.at(b.id());
uint32_t ixa = index.at(a.id());
uint32_t ixb = index.at(b.id());
return bond_1_4.count(key(ixa, ixb));
}
......@@ -35,29 +35,29 @@ class BondMap
private:
bool isBonded(uint32 ai, uint32 bi) const
bool isBonded(uint32_t ai, uint32_t bi) const
{
return bond.count(key(ai, bi)) != 0;
}
uint64 key(uint32 a, uint32 b) const
uint64_t key(uint32_t a, uint32_t b) const
{
if (a > b)
std::swap(a, b);
return static_cast<uint64>(a) | (static_cast<uint64>(b) << 32);
return static_cast<uint64_t>(a) | (static_cast<uint64_t>(b) << 32);
}
std::tuple<uint32,uint32> dekey(uint64 k) const
std::tuple<uint32_t,uint32_t> dekey(uint64_t k) const
{
return std::make_tuple(
static_cast<uint32>(k >> 32),
static_cast<uint32>(k)
static_cast<uint32_t>(k >> 32),
static_cast<uint32_t>(k)
);
}
uint32 dim;
std::unordered_map<std::string,uint32> index;
std::set<uint64> bond, bond_1_4;
uint32_t dim;
std::unordered_map<std::string,uint32_t> index;
std::set<uint64_t> bond, bond_1_4;
std::map<std::string,std::set<std::string>> link;
};
......
......@@ -462,8 +462,8 @@ class Row
operator bool() const { return mData != nullptr; }
// for debugging
uint32 lineNr() const;
void lineNr(uint32 l);
uint32_t lineNr() const;
void lineNr(uint32_t l);
bool empty() const;
const_iterator begin() const;
......@@ -539,7 +539,7 @@ class Row
size_t ColumnForItemTag(const char* itemTag) const;
ItemRow* mData;
uint32 mLineNr = 0;
uint32_t mLineNr = 0;
bool mCascadeUpdate = true;
bool mCascadeDelete = true;
};
......
......@@ -12,16 +12,16 @@ namespace cif
class CifParserError : public std::runtime_error
{
public:
CifParserError(uint32 lineNr, const std::string& message);
CifParserError(uint32_t lineNr, const std::string& message);
};
// --------------------------------------------------------------------
extern const uint32 kMaxLineLength;
extern const uint32_t kMaxLineLength;
extern const uint8 kCharTraitsTable[128];
extern const uint8_t kCharTraitsTable[128];
enum CharTraitsMask: uint8 {
enum CharTraitsMask: uint8_t {
kOrdinaryMask = 1 << 0,
kNonBlankMask = 1 << 1,
kTextLeadMask = 1 << 2,
......@@ -157,7 +157,7 @@ class SacParser
// Parser state
bool mValidate;
uint32 mLineNr;
uint32_t mLineNr;
bool mBol;
int mState, mStart;
CIFToken mLookahead;
......
......@@ -37,11 +37,11 @@ typedef std::set<std::string, iless> iset;
// --------------------------------------------------------------------
// This really makes a difference, having our own tolower routines
extern const uint8 kCharToLowerMap[256];
extern const uint8_t kCharToLowerMap[256];
inline char tolower(char ch)
{
return static_cast<char>(kCharToLowerMap[static_cast<uint8>(ch)]);
return static_cast<char>(kCharToLowerMap[static_cast<uint8_t>(ch)]);
}
// --------------------------------------------------------------------
......@@ -56,7 +56,7 @@ std::vector<std::string> wordWrap(const std::string& text, unsigned int width);
// --------------------------------------------------------------------
// Code helping with terminal i/o
uint32 get_terminal_width();
uint32_t get_terminal_width();
// --------------------------------------------------------------------
// some manipulators to write coloured text to terminals
......@@ -135,11 +135,11 @@ inline auto coloured(std::basic_string<CharT, Traits, Alloc>& s, StringColour fo
class Progress
{
public:
Progress(int64 inMax, const std::string& inAction);
Progress(int64_t inMax, const std::string& inAction);
virtual ~Progress();
void consumed(int64 inConsumed); // consumed is relative
void progress(int64 inProgress); // progress is absolute
void consumed(int64_t inConsumed); // consumed is relative
void progress(int64_t inProgress); // progress is absolute
void message(const std::string& inMessage);
......
......@@ -162,7 +162,7 @@ class Validator
std::string mName;
std::string mVersion;
bool mStrict = false;
// std::set<uint32> mSubCategories;
// std::set<uint32_t> mSubCategories;
std::set<ValidateType> mTypeValidators;
std::set<ValidateCategory> mCategoryValidators;
std::vector<ValidateLink> mLinkValidators;
......
......@@ -3,6 +3,7 @@
#pragma once
#include <string>
#include <cstdint>
#define HAVE_CPP0X_TEMPLATE_ALIASES 1
#define HAVE_CPP0X_VARIADIC_TEMPLATES 1
......@@ -20,15 +21,3 @@
#pragma warning (disable : 4996)
#pragma warning (disable : 4355)
#endif
#include <boost/version.hpp>
#include <boost/cstdint.hpp>
typedef int8_t int8;
typedef uint8_t uint8;
typedef int16_t int16;
typedef uint16_t uint16;
typedef int32_t int32;
typedef uint32_t uint32;
typedef int64_t int64;
typedef uint64_t uint64;
......@@ -32,9 +32,9 @@ class DistanceMap
private:
typedef std::map<std::tuple<size_t,size_t>,std::tuple<float,int32>> DistMap;
typedef std::map<std::tuple<size_t,size_t>,std::tuple<float,int32_t>> DistMap;
void AddDistancesForAtoms(const Residue& a, const Residue& b, DistMap& dm, int32 rtix);
void AddDistancesForAtoms(const Residue& a, const Residue& b, DistMap& dm, int32_t rtix);
const Structure& structure;
size_t dim;
......@@ -43,7 +43,7 @@ class DistanceMap
float mMaxDistance, mMaxDistanceSQ;
std::vector<std::tuple<float,int32>> mA;
std::vector<std::tuple<float,int32_t>> mA;
std::vector<size_t> mIA, mJA;
Point mD; // needed to move atoms to center
std::vector<clipper::RTop_orth> mRtOrth;
......
......@@ -7,12 +7,12 @@
struct PDBRecord
{
PDBRecord* mNext;
uint32 mLineNr;
uint32_t mLineNr;
char mName[11];
size_t mVlen;
char mValue[0];
PDBRecord(uint32 lineNr, const std::string& name, const std::string& value);
PDBRecord(uint32_t lineNr, const std::string& name, const std::string& value);
~PDBRecord();
void* operator new(size_t);
......
......@@ -19,7 +19,7 @@ class Remark3Parser
protected:
Remark3Parser(const std::string& name, const std::string& expMethod, PDBRecord* r, cif::Datablock& db,
const TemplateLine templatelines[], uint32 templateLineCount, std::regex programVersion);
const TemplateLine templatelines[], uint32_t templateLineCount, std::regex programVersion);
virtual float parse();
std::string nextLine();
......@@ -37,10 +37,10 @@ class Remark3Parser
cif::Datablock mDb;
std::string mLine;
std::smatch mM;
uint32 mState;
uint32_t mState;
const TemplateLine* mTemplate;
uint32 mTemplateCount;
uint32_t mTemplateCount;
std::regex mProgramVersion;
};
......
......@@ -339,7 +339,7 @@ class SphericalDots
}
size_t size() const { return mPoints.size(); }
const Point operator[](uint32 inIx) const { return mPoints[inIx]; }
const Point operator[](uint32_t inIx) const { return mPoints[inIx]; }
iterator begin() const { return mPoints.begin(); }
iterator end() const { return mPoints.end(); }
......@@ -356,7 +356,7 @@ class SphericalDots
auto p = mPoints.begin();
for (int32 i = -N; i <= N; ++i)
for (int32_t i = -N; i <= N; ++i)
{
double lat = std::asin((2.0 * i) / P);
double lon = std::fmod(i, kGoldenRatio) * 2 * kPI / kGoldenRatio;
......
......@@ -246,8 +246,8 @@ class Monomer : public Residue
Monomer(Monomer&& rhs);
Monomer& operator=(Monomer&& rhs);
// Monomer(const Polymer& polymer, uint32 index);
Monomer(const Polymer& polymer, uint32 index, int seqID,
// Monomer(const Polymer& polymer, uint32_t index);
Monomer(const Polymer& polymer, uint32_t index, int seqID,
const std::string& compoundID);
// Assuming this is really an amino acid...
......@@ -275,7 +275,7 @@ class Monomer : public Residue
private:
const Polymer* mPolymer;
uint32 mIndex;
uint32_t mIndex;
};
// --------------------------------------------------------------------
......@@ -345,7 +345,7 @@ class File : public std::enable_shared_from_this<File>
class Structure
{
public:
Structure(File& p, uint32 modelNr = 1);
Structure(File& p, uint32_t modelNr = 1);
Structure& operator=(const Structure&) = delete;
~Structure();
......@@ -470,7 +470,7 @@ class Structure
void updateAtomIndex();
File& mFile;
uint32 mModelNr;
uint32_t mModelNr;
AtomView mAtoms;
std::vector<size_t> mAtomIndex;
std::list<Polymer> mPolymers;
......
......@@ -136,7 +136,7 @@ const AtomTypeInfo kKnownAtoms[] =
{ Og, "Oganesson", "Og", 294, true, { kNA, kNA, kNA, 157, kNA, kNA, kNA } } // 118 Og Oga­nesson
};
uint32 kKnownAtomsCount = sizeof(kKnownAtoms) / sizeof(AtomTypeInfo);
uint32_t kKnownAtomsCount = sizeof(kKnownAtoms) / sizeof(AtomTypeInfo);
// --------------------------------------------------------------------
// The coefficients from Waasmaier & Kirfel (1995), Acta Cryst. A51, 416-431.
......@@ -144,7 +144,7 @@ uint32 kKnownAtomsCount = sizeof(kKnownAtoms) / sizeof(AtomTypeInfo);
struct SFDataArrayElement
{
AtomType symbol;
int8 charge;
int8_t charge;
AtomTypeTraits::SFData sf;
};
......
......@@ -29,8 +29,8 @@ BondMap::BondMap(const Structure& p)
auto bindAtoms = [this](const string& a, const string& b)
{
uint32 ixa = index[a];
uint32 ixb = index[b];
uint32_t ixa = index[a];
uint32_t ixb = index[b];
bond.insert(key(ixa, ixb));
};
......@@ -174,9 +174,9 @@ BondMap::BondMap(const Structure& p)
copy_if(atoms.begin(), atoms.end(), back_inserter(rAtoms),
[&](auto& a) { return a.labelAsymId() == asymId and a.labelSeqId() == seqId; });
for (uint32 i = 0; i + 1 < rAtoms.size(); ++i)
for (uint32_t i = 0; i + 1 < rAtoms.size(); ++i)
{
for (uint32 j = i + 1; j < rAtoms.size(); ++j)
for (uint32_t j = i + 1; j < rAtoms.size(); ++j)
{
if (compound->atomsBonded(rAtoms[i].labelAtomId(), rAtoms[j].labelAtomId()))
bindAtoms(rAtoms[i].id(), rAtoms[j].id());
......@@ -196,14 +196,14 @@ BondMap::BondMap(const Structure& p)
// for (auto a: db["atom_site"].find(cif::Key("label_asym_id") == asymId))
// rAtoms.push_back(p.getAtomById(a["id"].as<string>()));
for (uint32 i = 0; i + 1 < rAtoms.size(); ++i)
for (uint32_t i = 0; i + 1 < rAtoms.size(); ++i)
{
for (uint32 j = i + 1; j < rAtoms.size(); ++j)
for (uint32_t j = i + 1; j < rAtoms.size(); ++j)
{
if (compound->atomsBonded(rAtoms[i].labelAtomId(), rAtoms[j].labelAtomId()))
{
uint32 ixa = index[rAtoms[i].id()];
uint32 ixb = index[rAtoms[j].id()];
uint32_t ixa = index[rAtoms[i].id()];
uint32_t ixb = index[rAtoms[j].id()];
bond.insert(key(ixa, ixb));
}
......@@ -217,10 +217,10 @@ BondMap::BondMap(const Structure& p)
//cout << "Maken van b1_2 voor " << bond.size() << " bindingen" << endl;
multimap<uint32,uint32> b1_2;
multimap<uint32_t,uint32_t> b1_2;
for (auto& bk: bond)
{
uint32 a, b;
uint32_t a, b;
tie(a, b) = dekey(bk);
b1_2.insert({ a, b });
......@@ -229,12 +229,12 @@ BondMap::BondMap(const Structure& p)
//cout << "Afmeting b1_2: " << b1_2.size() << endl;
multimap<uint32,uint32> b1_3;
for (uint32 i = 0; i < dim; ++i)
multimap<uint32_t,uint32_t> b1_3;
for (uint32_t i = 0; i < dim; ++i)
{
auto a = b1_2.equal_range(i);
vector<uint32> s;
vector<uint32_t> s;
for (auto j = a.first; j != a.second; ++j)
s.push_back(j->second);
......@@ -242,8 +242,8 @@ BondMap::BondMap(const Structure& p)
{
for (size_t si2 = si1 + 1; si2 < s.size(); ++si2)
{
uint32 x = s[si1];
uint32 y = s[si2];
uint32_t x = s[si1];
uint32_t y = s[si2];
if (isBonded(x, y))
continue;
......@@ -256,7 +256,7 @@ BondMap::BondMap(const Structure& p)
//cout << "Afmeting b1_3: " << b1_3.size() << endl;
for (uint32 i = 0; i < dim; ++i)
for (uint32_t i = 0; i < dim; ++i)
{
auto a1 = b1_2.equal_range(i);
auto a2 = b1_3.equal_range(i);
......@@ -265,8 +265,8 @@ BondMap::BondMap(const Structure& p)
{
for (auto ai2 = a2.first; ai2 != a2.second; ++ai2)
{
uint32 b1 = ai1->second;
uint32 b2 = ai2->second;
uint32_t b1 = ai1->second;
uint32_t b2 = ai2->second;
if (isBonded(b1, b2))
continue;
......
......@@ -44,10 +44,10 @@ static const char* kEmptyResult = "";
struct ItemValue
{
ItemValue* mNext;
uint32 mColumnIndex;
uint32_t mColumnIndex;
char mText[0];
ItemValue(const char* v, uint32 columnIndex);
ItemValue(const char* v, uint32_t columnIndex);
~ItemValue();
void* operator new(size_t size, size_t dataSize);
......@@ -56,7 +56,7 @@ struct ItemValue
// --------------------------------------------------------------------
ItemValue::ItemValue(const char* value, uint32 columnIndex)
ItemValue::ItemValue(const char* value, uint32_t columnIndex)
: mNext(nullptr), mColumnIndex(columnIndex)
{
strcpy(mText, value);
......@@ -100,8 +100,8 @@ struct ItemRow
{
~ItemRow();
void drop(uint32 columnIx);
const char* c_str(uint32 columnIx) const;
void drop(uint32_t columnIx);
const char* c_str(uint32_t columnIx) const;
string str() const
{
......@@ -124,7 +124,7 @@ struct ItemRow
ItemRow* mNext;
Category* mCategory;
ItemValue* mValues;
uint32 mLineNr = 0;
uint32_t mLineNr = 0;
};
ostream& operator<<(ostream& os, const ItemRow& r)
......@@ -157,7 +157,7 @@ ItemRow::~ItemRow()
delete mValues;
}
void ItemRow::drop(uint32 columnIx)
void ItemRow::drop(uint32_t columnIx)
{
if (mValues != nullptr and mValues->mColumnIndex == columnIx)
{
......@@ -188,7 +188,7 @@ void ItemRow::drop(uint32 columnIx)
#endif
}
const char* ItemRow::c_str(uint32 columnIx) const
const char* ItemRow::c_str(uint32_t columnIx) const
{
const char* result = kEmptyResult;
......@@ -661,7 +661,7 @@ class CatIndex
entry* insert(entry* h, ItemRow* v);
entry* erase(entry* h, ItemRow* k);
// void validate(entry* h, bool isParentRed, uint32 blackDepth, uint32& minBlack, uint32& maxBlack) const;
// void validate(entry* h, bool isParentRed, uint32_t blackDepth, uint32_t& minBlack, uint32_t& maxBlack) const;
entry* rotateLeft(entry* h)
{
......@@ -1006,8 +1006,8 @@ size_t CatIndex::size() const
//
// if (mRoot != nullptr)
// {
// uint32 minBlack = numeric_limits<uint32>::max();
// uint32 maxBlack = 0;
// uint32_t minBlack = numeric_limits<uint32_t>::max();
// uint32_t maxBlack = 0;
//
// assert(not mRoot->mRed);
//
......@@ -1018,7 +1018,7 @@ size_t CatIndex::size() const
// return result;
//}
//
//bool CatIndex::validate(entry* h, bool isParentRed, uint32 blackDepth, uint32& minBlack, uint32& maxBlack) const
//bool CatIndex::validate(entry* h, bool isParentRed, uint32_t blackDepth, uint32_t& minBlack, uint32_t& maxBlack) const
//{
// bool result = true;
//
......@@ -1287,7 +1287,7 @@ void Category::drop(const string& field)
if (ci != mColumns.end())
{
uint32 columnIx = ci - mColumns.begin();
uint32_t columnIx = ci - mColumns.begin();
for (auto pi = mHead; pi != nullptr; pi = pi->mNext)
pi->drop(columnIx);
......@@ -2344,12 +2344,12 @@ auto Row::end() const -> const_iterator
return const_iterator(mData, nullptr);
}
uint32 Row::lineNr() const
uint32_t Row::lineNr() const
{
return mData ? mData->mLineNr : 0;
}
void Row::lineNr(uint32 l)
void Row::lineNr(uint32_t l)
{
if (mData)
mData->mLineNr = l;
......
......@@ -16,9 +16,9 @@ extern int VERBOSE;
namespace cif
{
const uint32 kMaxLineLength = 132;
const uint32_t kMaxLineLength = 132;
const uint8 kCharTraitsTable[128] = {
const uint8_t kCharTraitsTable[128] = {
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
14, 15, 14, 14, 14, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, // 2
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 15, 15, 15, 15, // 3
......@@ -30,7 +30,7 @@ const uint8 kCharTraitsTable[128] = {
// --------------------------------------------------------------------
CifParserError::CifParserError(uint32 lineNr, const string& message)
CifParserError::CifParserError(uint32_t lineNr, const string& message)
: runtime_error("parse error at line " + to_string(lineNr) + ": " + message)
{
}
......
......@@ -31,7 +31,7 @@ namespace cif
// --------------------------------------------------------------------
// This really makes a difference, having our own tolower routines
const uint8 kCharToLowerMap[256] =
const uint8_t kCharToLowerMap[256] =
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
......@@ -254,7 +254,7 @@ string::const_iterator nextLineBreak(string::const_iterator text, string::const_
/* JT */ { DBK, PBK, PBK, IBK, IBK, IBK, PBK, PBK, PBK, DBK, IBK, DBK, DBK, DBK, IBK, IBK, IBK, DBK, DBK, PBK, CIB, PBK, DBK, DBK, DBK, DBK, IBK },
};
uint8 ch = static_cast<uint8>(*text);
uint8_t ch = static_cast<uint8_t>(*text);
LineBreakClass cls;
......@@ -387,12 +387,12 @@ vector<string> wordWrap(const string& text, unsigned int width)
// --------------------------------------------------------------------
#ifdef _MSC_VER
uint32 get_terminal_width()
uint32_t get_terminal_width()
{
return TERM_WIDTH;
}
#else
uint32 get_terminal_width()
uint32_t get_terminal_width()
{
struct winsize w;
ioctl(0, TIOCGWINSZ, &w);
......@@ -404,7 +404,7 @@ uint32 get_terminal_width()
struct ProgressImpl
{
ProgressImpl(int64 inMax, const string& inAction)
ProgressImpl(int64_t inMax, const string& inAction)
: mMax(inMax), mConsumed(0), mAction(inAction), mMessage(inAction)
, mThread(boost::bind(&ProgressImpl::Run, this)) {}
......@@ -413,9 +413,9 @@ struct ProgressImpl
void PrintProgress();
void PrintDone();
int64 mMax;
atomic<int64> mConsumed;
int64 mLastConsumed = 0;
int64_t mMax;
atomic<int64_t> mConsumed;
int64_t mLastConsumed = 0;
int mSpinnerIndex = 0;
string mAction, mMessage;
boost::mutex mMutex;
......@@ -477,7 +477,7 @@ void ProgressImpl::PrintProgress()
"=", // 8
};
uint32 width = get_terminal_width();
uint32_t width = get_terminal_width();
string msg;
msg.reserve(width + 1);
......@@ -492,7 +492,7 @@ void ProgressImpl::PrintProgress()
msg += " |";
int64 consumed = mConsumed;
int64_t consumed = mConsumed;
float progress = static_cast<float>(consumed) / mMax;
int pi = static_cast<int>(ceil(progress * 33 * 8));
// int tw = width - 28;
......@@ -542,7 +542,7 @@ void ProgressImpl::PrintDone()
{
string msg = mAction + " done in " + mTimer.format(0, "%ts cpu / %ws wall");
uint32 width = get_terminal_width();
uint32_t width = get_terminal_width();
if (msg.length() < width)
msg += string(width - msg.length(), ' ');
......@@ -550,7 +550,7 @@ void ProgressImpl::PrintDone()
cout << '\r' << msg << endl;
}
Progress::Progress(int64 inMax, const string& inAction)
Progress::Progress(int64_t inMax, const string& inAction)
: mImpl(nullptr)
{
if (isatty(STDOUT_FILENO))
......@@ -568,7 +568,7 @@ Progress::~Progress()
delete mImpl;
}
void Progress::consumed(int64 inConsumed)
void Progress::consumed(int64_t inConsumed)
{
if (mImpl != nullptr and
(mImpl->mConsumed += inConsumed) >= mImpl->mMax and
......@@ -579,7 +579,7 @@ void Progress::consumed(int64 inConsumed)
}
}
void Progress::progress(int64 inProgress)
void Progress::progress(int64_t inProgress)
{
if (mImpl != nullptr and
(mImpl->mConsumed = inProgress) >= mImpl->mMax and
......
......@@ -430,7 +430,7 @@ string Compound::formula() const
{
string result;
map<string,uint32> atoms;
map<string,uint32_t> atoms;
float chargeSum = 0;
for (auto r: mAtoms)
......@@ -1212,7 +1212,7 @@ Compound* CompoundFactoryImpl::create(std::string id)
auto row = rs.front();
string name, group;
uint32 numberAtomsAll, numberAtomsNh;
uint32_t numberAtomsAll, numberAtomsNh;
cif::tie(name, group, numberAtomsAll, numberAtomsNh) =
row.get("name", "group", "number_atoms_all", "number_atoms_nh");
......
......@@ -195,8 +195,8 @@ DistanceMap::DistanceMap(const Structure& p, const clipper::Spacegroup& spacegro
auto minR2 = d;
int32 kbest = 0;
for (int32 k = 1; k < static_cast<int32>(mRtOrth.size()); ++k)
int32_t kbest = 0;
for (int32_t k = 1; k < static_cast<int32_t>(mRtOrth.size()); ++k)
{
auto& rt = mRtOrth[k];
......@@ -247,7 +247,7 @@ DistanceMap::DistanceMap(const Structure& p, const clipper::Spacegroup& spacegro
// --------------------------------------------------------------------
void DistanceMap::AddDistancesForAtoms(const Residue& a, const Residue& b, DistMap& dm, int32 rtix)
void DistanceMap::AddDistancesForAtoms(const Residue& a, const Residue& b, DistMap& dm, int32_t rtix)
{
for (auto& aa: a.atoms())
{
......@@ -343,7 +343,7 @@ vector<Atom> DistanceMap::near(const Atom& a, float maxDistance) const
for (size_t i = mIA[ixa]; i < mIA[ixa + 1]; ++i)
{
float d;
int32 rti;
int32_t rti;
tie(d, rti) = mA[i];
if (d > maxDistance)
......
......@@ -89,31 +89,31 @@ namespace mmcif
// 56 NLABL Number of labels being used
// 57-256 LABEL(20,10) 10 80 character text labels (ie. A4 format)
enum CCP4MapFileMode : uint32
enum CCP4MapFileMode : uint32_t
{
AS_REALS = 2 // do not support anything else for now...
};
struct CCP4MapFileHeader
{
uint32 NC, NR, NS;
uint32_t NC, NR, NS;
CCP4MapFileMode MODE;
int32 NCSTART, NRSTART, NSSTART;
uint32 NX, NY, NZ;
int32_t NCSTART, NRSTART, NSSTART;
uint32_t NX, NY, NZ;
float cellLengths[3];
float cellAngles[3];
uint32 MAPC, MAPR, MAPS;
uint32_t MAPC, MAPR, MAPS;
float AMIN, AMAX, AMEAN;
uint32 ISPG;
uint32 NSYMBT;
uint32 LSKFLG;
uint32_t ISPG;
uint32_t NSYMBT;
uint32_t LSKFLG;
float SKWMAT[9];
float SKWTRN[3];
uint32 UNUSED[15];
uint32_t UNUSED[15];
char MAP[4] = { 'M', 'A', 'P', ' ' };
uint32 MACHST = 0x00004144;
uint32_t MACHST = 0x00004144;
float ARMS;
uint32 NLABL = 1;
uint32_t NLABL = 1;
char LABEL[200 * 4];
};
......@@ -229,7 +229,7 @@ void writeCCP4MapFile(ostream& os, clipper::Xmap<FTYPE>& xmap, clipper::Grid_ran
}
clipper::Xmap_base::Map_reference_coord c(xmap);
const uint32 kSectionLength = dim[0] * dim[1];
const uint32_t kSectionLength = dim[0] * dim[1];
vector<float> section(kSectionLength);
int g[3];
......
......@@ -122,7 +122,7 @@ bool isWater(const string& resname)
// data. Therefore we first obtain all records where a record has the
// value flattened out for continuation.
PDBRecord::PDBRecord(uint32 lineNr, const string& name, const string& value)
PDBRecord::PDBRecord(uint32_t lineNr, const string& name, const string& value)
: mNext(nullptr), mLineNr(lineNr), mVlen(value.length())
{
assert(name.length() <= 10);
......@@ -949,7 +949,7 @@ void PDBFileParser::MapChainID2AsymIDS(char chainID, vector<string>& asymIds)
void PDBFileParser::PreParseInput(istream& is)
{
string lookahead;
uint32 lineNr = 1;
uint32_t lineNr = 1;
getline(is, lookahead);
// if (ba::starts_with(lookahead, "HEADER") == false)
......@@ -995,7 +995,7 @@ void PDBFileParser::PreParseInput(istream& is)
if (lookahead.length() > 6)
value = ba::trim_right_copy(lookahead.substr(6));
uint32 curLineNr = lineNr;
uint32_t curLineNr = lineNr;
getline(is, lookahead);
++lineNr;
......@@ -3612,7 +3612,7 @@ void PDBFileParser::ConstructEntities()
}
// We have now created all compounds, write them out
uint32 structRefId = 0, structRefSeqAlignId = 0;
uint32_t structRefId = 0, structRefSeqAlignId = 0;
for (auto& cmp: mCompounds)
{
......@@ -5249,7 +5249,7 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
ParseCrystallographic();
ParseCoordinateTransformation();
uint32 modelNr = 1;
uint32_t modelNr = 1;
bool hasAtoms = false;
while (mRec->is("MODEL ") or mRec->is("ATOM ") or mRec->is("HETATM"))
......@@ -5371,7 +5371,7 @@ int PDBFileParser::PDBChain::AlignResToSeqRes()
throw runtime_error(string("Number of residues in ATOM records for chain ") + mDbref.chainID + " is zero");
matrix<float> B(dimX, dimY), Ix(dimX, dimY), Iy(dimX, dimY);
matrix<int8> tb(dimX, dimY);
matrix<int8_t> tb(dimX, dimY);
int x, y;
......
......@@ -915,7 +915,7 @@ class XPLOR_Remark3Parser : public Remark3Parser
// --------------------------------------------------------------------
Remark3Parser::Remark3Parser(const std::string& name, const std::string& expMethod, PDBRecord* r, cif::Datablock& db,
const TemplateLine templatelines[], uint32 templateLineCount, std::regex programversion)
const TemplateLine templatelines[], uint32_t templateLineCount, std::regex programversion)
: mName(name), mExpMethod(expMethod), mRec(r), mDb(db.getName())
, mTemplate(templatelines), mTemplateCount(templateLineCount), mProgramVersion(programversion)
{
......
......@@ -94,7 +94,7 @@ Point Centroid(vector<Point>& Points)
double RMSd(const vector<Point>& a, const vector<Point>& b)
{
double sum = 0;
for (uint32 i = 0; i < a.size(); ++i)
for (uint32_t i = 0; i < a.size(); ++i)
{
valarray<double> d(3);
......@@ -154,7 +154,7 @@ double LargestDepressedQuarticSolution(double a, double b, double c)
// // First calculate M, a 3x3 matrix containing the sums of products of the coordinates of A and B
// matrix<double> M(3, 3, 0);
//
// for (uint32 i = 0; i < pa.size(); ++i)
// for (uint32_t i = 0; i < pa.size(); ++i)
// {
// const Point& a = pa[i];
// const Point& b = pb[i];
......@@ -220,7 +220,7 @@ double LargestDepressedQuarticSolution(double a, double b, double c)
// // calculate a matrix of cofactors for t
// matrix<double> cf(4, 4);
//
// const uint32 ixs[4][3] =
// const uint32_t ixs[4][3] =
// {
// { 1, 2, 3 },
// { 0, 2, 3 },
......@@ -228,14 +228,14 @@ double LargestDepressedQuarticSolution(double a, double b, double c)
// { 0, 1, 2 }
// };
//
// uint32 maxR = 0;
// for (uint32 r = 0; r < 4; ++r)
// uint32_t maxR = 0;
// for (uint32_t r = 0; r < 4; ++r)
// {
// const uint32* ir = ixs[r];
// const uint32_t* ir = ixs[r];
//
// for (uint32 c = 0; c < 4; ++c)
// for (uint32_t c = 0; c < 4; ++c)
// {
// const uint32* ic = ixs[c];
// const uint32_t* ic = ixs[c];
//
// cf(r, c) =
// t(ir[0], ic[0]) * t(ir[1], ic[1]) * t(ir[2], ic[2]) +
......
......@@ -815,7 +815,7 @@ tuple<Point,float> Residue::centerAndRadius() const
//{
//}
Monomer::Monomer(const Polymer& polymer, uint32 index, int seqID, const string& compoundID)
Monomer::Monomer(const Polymer& polymer, uint32_t index, int seqID, const string& compoundID)
: Residue(*polymer.structure(), compoundID, polymer.asymID(), seqID)
, mPolymer(&polymer)
, mIndex(index)
......@@ -1008,7 +1008,7 @@ bool Monomer::isCis(const mmcif::Monomer& a, const mmcif::Monomer& b)
// --------------------------------------------------------------------
// polymer
//
//Polymer::iterator::iterator(const Polymer& p, uint32 index)
//Polymer::iterator::iterator(const Polymer& p, uint32_t index)
// : mPolymer(&p), mIndex(index), mCurrent(p, index)
//{
// auto& polySeq = mPolymer->mPolySeq;
......@@ -1100,7 +1100,7 @@ Polymer::Polymer(const Structure& s, const string& entityID, const string& asymI
: mStructure(const_cast<Structure*>(&s)), mEntityID(entityID), mAsymID(asymID)
, mPolySeq(s.category("pdbx_poly_seq_scheme").find(cif::Key("asym_id") == mAsymID and cif::Key("entity_id") == mEntityID))
{
map<uint32,uint32> ix;
map<uint32_t,uint32_t> ix;
reserve(mPolySeq.size());
......@@ -1270,7 +1270,7 @@ cif::File& File::file()
// --------------------------------------------------------------------
// Structure
Structure::Structure(File& f, uint32 modelNr)
Structure::Structure(File& f, uint32_t modelNr)
: mFile(f), mModelNr(modelNr)
{
auto& db = *mFile.impl().mDb;
......@@ -1280,7 +1280,7 @@ Structure::Structure(File& f, uint32 modelNr)
{
auto modelNr = a["pdbx_PDB_model_num"];
if (modelNr.empty() or modelNr.as<uint32>() == mModelNr)
if (modelNr.empty() or modelNr.as<uint32_t>() == mModelNr)
mAtoms.emplace_back(new AtomImpl(f, a["id"].as<string>(), a));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment