Browse Source

- Coding standards

cl-refactor
yann300 10 years ago
parent
commit
827de531b9
  1. 4
      mix/AssemblyDebuggerModel.cpp
  2. 2
      mix/AssemblyDebuggerModel.h
  3. 1
      mix/CodeEditorExtensionManager.cpp
  4. 8
      mix/DebuggingStateWrapper.cpp
  5. 2
      mix/MixApplication.cpp

4
mix/AssemblyDebuggerModel.cpp

@ -102,9 +102,9 @@ DebuggingContent AssemblyDebuggerModel::getContractInitiationDebugStates(dev::u2
return getContractInitiationDebugStates(bytesRef); return getContractInitiationDebugStates(bytesRef);
} }
bool AssemblyDebuggerModel::compile(QString code) bool AssemblyDebuggerModel::compile(QString _code)
{ {
ConstantCompilationModel compiler; ConstantCompilationModel compiler;
CompilerResult res = compiler.compile(code); CompilerResult res = compiler.compile(_code);
return res.success; return res.success;
} }

2
mix/AssemblyDebuggerModel.h

@ -38,7 +38,7 @@ public:
AssemblyDebuggerModel(); AssemblyDebuggerModel();
DebuggingContent getContractInitiationDebugStates(dev::u256, dev::u256, dev::u256, QString, KeyPair); DebuggingContent getContractInitiationDebugStates(dev::u256, dev::u256, dev::u256, QString, KeyPair);
DebuggingContent getContractInitiationDebugStates(dev::bytesConstRef); DebuggingContent getContractInitiationDebugStates(dev::bytesConstRef);
bool compile(QString code); bool compile(QString);
private: private:
std::unique_ptr<dev::eth::Executive> m_currentExecution; std::unique_ptr<dev::eth::Executive> m_currentExecution;

1
mix/CodeEditorExtensionManager.cpp

@ -28,7 +28,6 @@
#include <libevm/VM.h> #include <libevm/VM.h>
#include "ConstantCompilationCtrl.h" #include "ConstantCompilationCtrl.h"
#include "AssemblyDebuggerCtrl.h" #include "AssemblyDebuggerCtrl.h"
#include "features.h"
#include "ApplicationCtx.h" #include "ApplicationCtx.h"
#include "CodeEditorExtensionManager.h" #include "CodeEditorExtensionManager.h"
using namespace dev::mix; using namespace dev::mix;

8
mix/DebuggingStateWrapper.cpp

@ -31,13 +31,13 @@ using namespace dev;
using namespace dev::eth; using namespace dev::eth;
using namespace dev::mix; using namespace dev::mix;
std::tuple<QList<QObject*>, QQMLMap*> DebuggingStateWrapper::getHumanReadableCode(const bytes& code, QObject* _objUsedAsParent) std::tuple<QList<QObject*>, QQMLMap*> DebuggingStateWrapper::getHumanReadableCode(const bytes& _code, QObject* _objUsedAsParent)
{ {
QList<QObject*> codeStr; QList<QObject*> codeStr;
QMap<int, int> codeMapping; QMap<int, int> codeMapping;
for (unsigned i = 0; i <= code.size(); ++i) for (unsigned i = 0; i <= _code.size(); ++i)
{ {
byte b = i < code.size() ? code[i] : 0; byte b = i < _code.size() ? _code[i] : 0;
try try
{ {
QString s = QString::fromStdString(instructionInfo((Instruction)b).name); QString s = QString::fromStdString(instructionInfo((Instruction)b).name);
@ -48,7 +48,7 @@ std::tuple<QList<QObject*>, QQMLMap*> DebuggingStateWrapper::getHumanReadableCod
if (b >= (byte)Instruction::PUSH1 && b <= (byte)Instruction::PUSH32) if (b >= (byte)Instruction::PUSH1 && b <= (byte)Instruction::PUSH32)
{ {
unsigned bc = b - (byte)Instruction::PUSH1 + 1; unsigned bc = b - (byte)Instruction::PUSH1 + 1;
s = "PUSH 0x" + QString::fromStdString(toHex(bytesConstRef(&code[i + 1], bc))); s = "PUSH 0x" + QString::fromStdString(toHex(bytesConstRef(&_code[i + 1], bc)));
i += bc; i += bc;
} }
HumanReadableCode* humanCode = new HumanReadableCode(QString::fromStdString(out.str()) + " " + s, line, _objUsedAsParent); HumanReadableCode* humanCode = new HumanReadableCode(QString::fromStdString(out.str()) + " " + s, line, _objUsedAsParent);

2
mix/MixApplication.cpp

@ -23,7 +23,7 @@
#include "MixApplication.h" #include "MixApplication.h"
using namespace dev::mix; using namespace dev::mix;
MixApplication::MixApplication(int _argc, char *_argv[]): QApplication(_argc, _argv) MixApplication::MixApplication(int _argc, char* _argv[]): QApplication(_argc, _argv)
{ {
} }

Loading…
Cancel
Save