Browse Source

style

cl-refactor
arkpar 10 years ago
parent
commit
d8673daa5b
  1. 3
      mix/ClientModel.cpp
  2. 25
      mix/CodeModel.cpp
  3. 5
      mix/CodeModel.h

3
mix/ClientModel.cpp

@ -394,14 +394,13 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t)
QStringList storage;
for(auto st: s.storage)
{
if (st.first < std::numeric_limits<unsigned>::max())
{
auto storageIter = contract->storage().find(static_cast<unsigned>(st.first));
if (storageIter != contract->storage().end())
storage.push_back(storageIter.value().name + "\t" + formatValue(storageIter.value().type, st.second));
}
}
prevInstructionIndex = instructionIndex;
solState = new QSolState(debugData, storage, solCallStack, locals, instruction.getLocation().start, instruction.getLocation().end);
}

25
mix/CodeModel.cpp

@ -49,19 +49,13 @@ const std::set<std::string> c_predefinedContracts =
namespace
{
using namespace dev::solidity;
class CollectDeclarationsVisitor: public ASTConstVisitor
{
public:
using namespace dev::solidity;
class CollectDeclarationsVisitor: public ASTConstVisitor
{
public:
CollectDeclarationsVisitor(QHash<LocationPair, QString>* _functions, QHash<LocationPair, SolidityDeclaration>* _locals, QHash<unsigned, SolidityDeclaration>* _storage):
m_functions(_functions), m_locals(_locals), m_storage(_storage), m_functionScope(false), m_storageSlot(0) {}
private:
QHash<LocationPair, QString>* m_functions;
QHash<LocationPair, SolidityDeclaration>* m_locals;
QHash<unsigned, SolidityDeclaration>* m_storage;
bool m_functionScope;
uint m_storageSlot;
private:
LocationPair nodeLocation(ASTNode const& _node)
{
return LocationPair(_node.getLocation().start, _node.getLocation().end);
@ -128,7 +122,14 @@ namespace
m_storage->insert(m_storageSlot++, decl);
return true;
}
};
private:
QHash<LocationPair, QString>* m_functions;
QHash<LocationPair, SolidityDeclaration>* m_locals;
QHash<unsigned, SolidityDeclaration>* m_storage;
bool m_functionScope;
uint m_storageSlot;
};
}
void BackgroundWorker::queueCodeChange(int _jobId)

5
mix/CodeModel.h

@ -37,10 +37,7 @@ class QTextDocument;
namespace dev
{
namespace solidity
{
class CompilerStack;
}
namespace solidity { class CompilerStack; }
namespace mix
{

Loading…
Cancel
Save