Browse Source

remove linux build warnings

cl-refactor
Genoil 9 years ago
parent
commit
63acddf812
  1. 6
      ethminer/MinerAux.h
  2. 2
      libdevcore/Common.cpp
  3. 2
      libdevcore/TransientDirectory.cpp
  4. 3
      libethash-cl/ethash_cl_miner.cpp
  5. 23
      libstratum/EthStratumClient.cpp

6
ethminer/MinerAux.h

@ -912,11 +912,17 @@ private:
h256 hh(v[0].asString()); h256 hh(v[0].asString());
h256 newSeedHash(v[1].asString()); h256 newSeedHash(v[1].asString());
if (current.seedHash != newSeedHash) if (current.seedHash != newSeedHash)
{
minelog << "Grabbing DAG for" << newSeedHash; minelog << "Grabbing DAG for" << newSeedHash;
}
if (!(dag = EthashAux::full(newSeedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; }))) if (!(dag = EthashAux::full(newSeedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; })))
{
BOOST_THROW_EXCEPTION(DAGCreationFailure()); BOOST_THROW_EXCEPTION(DAGCreationFailure());
}
if (m_precompute) if (m_precompute)
{
EthashAux::computeFull(sha3(newSeedHash), true); EthashAux::computeFull(sha3(newSeedHash), true);
}
if (hh != current.headerHash) if (hh != current.headerHash)
{ {
current.headerHash = hh; current.headerHash = hh;

2
libdevcore/Common.cpp

@ -54,7 +54,9 @@ TimerHelper::~TimerHelper()
{ {
auto e = std::chrono::high_resolution_clock::now() - m_t; auto e = std::chrono::high_resolution_clock::now() - m_t;
if (!m_ms || e > chrono::milliseconds(m_ms)) if (!m_ms || e > chrono::milliseconds(m_ms))
{
clog(TimerChannel) << m_id << chrono::duration_cast<chrono::milliseconds>(e).count() << "ms"; clog(TimerChannel) << m_id << chrono::duration_cast<chrono::milliseconds>(e).count() << "ms";
}
} }
} }

2
libdevcore/TransientDirectory.cpp

@ -60,5 +60,7 @@ TransientDirectory::~TransientDirectory()
ec.clear(); ec.clear();
fs::remove_all(m_path, ec); fs::remove_all(m_path, ec);
if (!ec) if (!ec)
{
cwarn << "Failed to delete directory '" << m_path << "': " << ec.message(); cwarn << "Failed to delete directory '" << m_path << "': " << ec.message();
}
} }

3
libethash-cl/ethash_cl_miner.cpp

@ -379,7 +379,7 @@ bool ethash_cl_miner::init(
sprintf(options, "-cl-nv-maxrregcount=%d", maxregs);// , computeCapability); sprintf(options, "-cl-nv-maxrregcount=%d", maxregs);// , computeCapability);
} }
else { else {
sprintf(options, ""); sprintf(options, "%s", "");
} }
// create context // create context
@ -493,7 +493,6 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook
uint64_t start_nonce = uniform_int_distribution<uint64_t>()(engine); uint64_t start_nonce = uniform_int_distribution<uint64_t>()(engine);
for (;; start_nonce += m_globalWorkSize) for (;; start_nonce += m_globalWorkSize)
{ {
auto t = chrono::high_resolution_clock::now();
// supply output buffer to kernel // supply output buffer to kernel
m_searchKernel.setArg(0, m_searchBuffer[buf]); m_searchKernel.setArg(0, m_searchBuffer[buf]);
m_searchKernel.setArg(3, start_nonce); m_searchKernel.setArg(3, start_nonce);

23
libstratum/EthStratumClient.cpp

@ -144,11 +144,11 @@ void EthStratumClient::resolve_handler(const boost::system::error_code& ec, tcp:
void EthStratumClient::connect_handler(const boost::system::error_code& ec, tcp::resolver::iterator i) void EthStratumClient::connect_handler(const boost::system::error_code& ec, tcp::resolver::iterator i)
{ {
dev::setThreadName("stratum"); dev::setThreadName("stratum");
if (!ec) if (!ec)
{ {
m_connected = true; m_connected = true;
cnote << "Connected to stratum server " << p_active->host << ":" << p_active->port; cnote << "Connected to stratum server " << i->host_name() << ":" << p_active->port;
if (!p_farm->isMining()) if (!p_farm->isMining())
{ {
cnote << "Starting farm"; cnote << "Starting farm";
@ -207,7 +207,7 @@ void EthStratumClient::readResponse(const boost::system::error_code& ec, std::si
m_pending = m_pending > 0 ? m_pending - 1 : 0; m_pending = m_pending > 0 ? m_pending - 1 : 0;
x_pending.unlock(); x_pending.unlock();
if (!ec) if (!ec && bytes_transferred)
{ {
std::istream is(&m_responseBuffer); std::istream is(&m_responseBuffer);
std::string response; std::string response;
@ -294,12 +294,13 @@ void EthStratumClient::processReponse(Json::Value& responseObject)
string sHeaderHash = params.get((Json::Value::ArrayIndex)1, "").asString(); string sHeaderHash = params.get((Json::Value::ArrayIndex)1, "").asString();
string sSeedHash = params.get((Json::Value::ArrayIndex)2, "").asString(); string sSeedHash = params.get((Json::Value::ArrayIndex)2, "").asString();
string sShareTarget = params.get((Json::Value::ArrayIndex)3, "").asString(); string sShareTarget = params.get((Json::Value::ArrayIndex)3, "").asString();
bool cleanJobs = params.get((Json::Value::ArrayIndex)4, "").asBool(); //bool cleanJobs = params.get((Json::Value::ArrayIndex)4, "").asBool();
if (sShareTarget.length() < 66) // coinmine.pl fix
sShareTarget = "0x" + string(66 - sShareTarget.length(), '0') + sShareTarget.substr(2);
int l = sShareTarget.length(); int l = sShareTarget.length();
if (l < 66)
sShareTarget = "0x" + string(66 - l, '0') + sShareTarget.substr(2);
if (sHeaderHash != "" && sSeedHash != "" && sShareTarget != "") if (sHeaderHash != "" && sSeedHash != "" && sShareTarget != "")
{ {
@ -314,11 +315,17 @@ void EthStratumClient::processReponse(Json::Value& responseObject)
if (seedHash != m_current.seedHash) if (seedHash != m_current.seedHash)
{
cnote << "Grabbing DAG for" << seedHash; cnote << "Grabbing DAG for" << seedHash;
}
if (!(dag = EthashAux::full(seedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; }))) if (!(dag = EthashAux::full(seedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; })))
{
BOOST_THROW_EXCEPTION(DAGCreationFailure()); BOOST_THROW_EXCEPTION(DAGCreationFailure());
}
if (m_precompute) if (m_precompute)
{
EthashAux::computeFull(sha3(seedHash), true); EthashAux::computeFull(sha3(seedHash), true);
}
if (headerHash != m_current.headerHash) if (headerHash != m_current.headerHash)
{ {
x_current.lock(); x_current.lock();

Loading…
Cancel
Save