*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-08-16 21:55:31 +00:00
parent bb25ef1cb6
commit 8b4928d280
5 changed files with 22 additions and 6 deletions

View File

@ -124,13 +124,15 @@ namespace libtorrent
inline std::istream& operator>>(std::istream& is, big_number& peer)
{
using namespace std;
for (big_number::iterator i = peer.begin();
i != peer.end(); ++i)
{
char c[2];
is >> c[0] >> c[1];
*i = ((std::isdigit(c[0])?c[0]-'0':c[0]-'a'+10) << 4)
+ (std::isdigit(c[1])?c[1]-'0':c[1]-'a'+10);
*i = ((isdigit(c[0])?c[0]-'0':c[0]-'a'+10) << 4)
+ (isdigit(c[1])?c[1]-'0':c[1]-'a'+10);
}
return is;
}

View File

@ -50,6 +50,8 @@ namespace std
{
using ::isprint;
using ::isdigit;
using ::toupper;
using ::isalnum;
}
#endif

View File

@ -19,6 +19,10 @@ changelog at the end of the file.
#include <boost/cstdint.hpp>
#if defined _MSC_VER && _MSC_VER < 1300
#define for if (false) {} else for
#endif
struct SHA1_CTX
{
boost::uint32_t state[5];
@ -74,12 +78,13 @@ namespace
template <class BlkFun>
void SHA1Transform(boost::uint32_t state[5], boost::uint8_t const buffer[64])
{
using namespace std;
boost::uint32_t a, b, c, d, e;
CHAR64LONG16* block;
boost::uint8_t workspace[64];
block = (CHAR64LONG16*)workspace;
std::memcpy(block, buffer, 64);
memcpy(block, buffer, 64);
// Copy context->state[] to working vars
a = state[0];
@ -120,7 +125,8 @@ namespace
void SHAPrintContext(SHA1_CTX *context, char *msg)
{
std::printf("%s (%d,%d) %x %x %x %x %x\n"
using namespace std;
printf("%s (%d,%d) %x %x %x %x %x\n"
, msg, context->count[0], context->count[1]
, context->state[0], context->state[1]
, context->state[2], context->state[3]
@ -130,6 +136,7 @@ namespace
template <class BlkFun>
void internal_update(SHA1_CTX* context, boost::uint8_t const* data, boost::uint32_t len)
{
using namespace std;
boost::uint32_t i, j; // JHB
#ifdef VERBOSE
@ -140,7 +147,7 @@ namespace
context->count[1] += (len >> 29);
if ((j + len) > 63)
{
std::memcpy(&context->buffer[j], data, (i = 64-j));
memcpy(&context->buffer[j], data, (i = 64-j));
SHA1Transform<BlkFun>(context->state, context->buffer);
for ( ; i + 63 < len; i += 64)
{
@ -152,7 +159,7 @@ namespace
{
i = 0;
}
std::memcpy(&context->buffer[j], &data[i], len - i);
memcpy(&context->buffer[j], &data[i], len - i);
#ifdef VERBOSE
SHAPrintContext(context, "after ");
#endif

View File

@ -41,6 +41,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/invariant_check.hpp"
#include <algorithm>
#if defined _MSC_VER && _MSC_VER <= 1200
#define for if (false) {} else for
#endif
using namespace libtorrent;
void libtorrent::stat::second_tick()

View File

@ -66,6 +66,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace std
{
using ::srand;
using ::rename;
}
#endif