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