// Write block to history file
if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK, CLIENT_VERSION)))
return error("AcceptBlock() : out of disk space");
- unsigned int nFile = UINT_MAX;
+ unsigned int nFile = std::numeric_limits<unsigned int>::max();
unsigned int nBlockPos = 0;
if (!WriteToDisk(nFile, nBlockPos))
return error("AcceptBlock() : WriteToDisk failed");
OBJS += scrypt-asm/obj/scrypt-arm.o scrypt-asm/obj/scrypt-x86.o scrypt-asm/obj/scrypt-x86_64.o scrypt-asm/obj/asm-wrapper.o
scrypt-asm/obj/scrypt-x86.o: scrypt-asm/scrypt-x86.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/scrypt-x86_64.o: scrypt-asm/scrypt-x86_64.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/scrypt-arm.o: scrypt-asm/scrypt-arm.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/asm-wrapper.o: scrypt-asm/asm-wrapper.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
else
ifeq (${USE_SSE2}, 1)
# Intrinsic implementation
OBJS += scrypt-intrin/obj/scrypt-sse2.o
scrypt-intrin/obj/scrypt-sse2.o: scrypt-intrin/scrypt-sse2.cpp $(HEADERS)
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
else
ifneq (${USE_ASM}, 1)
# Generic implementation
OBJS += obj/scrypt-generic.o
obj/scrypt-generic.o: scrypt-generic.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
endif
endif
endif
OBJS += scrypt-asm/obj/scrypt-arm.o scrypt-asm/obj/scrypt-x86.o scrypt-asm/obj/scrypt-x86_64.o scrypt-asm/obj/asm-wrapper.o
scrypt-asm/obj/scrypt-x86.o: scrypt-asm/scrypt-x86.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/scrypt-x86_64.o: scrypt-asm/scrypt-x86_64.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/scrypt-arm.o: scrypt-asm/scrypt-arm.S
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
scrypt-asm/obj/asm-wrapper.o: scrypt-asm/asm-wrapper.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
else
ifdef USE_SSE2
# Intrinsic implementation
OBJS += scrypt-intrin/obj/scrypt-sse2.o
scrypt-intrin/obj/scrypt-sse2.o: scrypt-intrin/scrypt-sse2.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
else
# Generic implementation
OBJS += obj/scrypt-generic.o
obj/scrypt-generic.o: scrypt-generic.cpp
- $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
endif
endif
bool GetMyExternalIP(CNetAddr& ipRet)
{
struct sockaddr_in mapped;
- uint64_t rnd = UINT64_MAX;
+ uint64_t rnd = std::numeric_limits<uint64_t>::max();
const char *srv;
int rc = GetExternalIPbySTUN(rnd, &mapped, &srv);
if(rc >= 0) {
#ifndef BITCOIN_NET_H
#define BITCOIN_NET_H
+#include <limits>
#include <deque>
#ifndef Q_MOC_RUN
#include <boost/array.hpp>
nLastSendEmpty = GetTime();
nTimeConnected = GetTime();
nHeaderStart = -1;
- nMessageStart = UINT_MAX;
+ nMessageStart = std::numeric_limits<uint32_t>::max();
addr = addrIn;
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
nVersion = 0;
return;
vSend.resize(nHeaderStart);
nHeaderStart = -1;
- nMessageStart = UINT_MAX;
+ nMessageStart = std::numeric_limits<uint32_t>::max();
LEAVE_CRITICAL_SECTION(cs_vSend);
if (fDebug)
}
nHeaderStart = -1;
- nMessageStart = UINT_MAX;
+ nMessageStart = std::numeric_limits<uint32_t>::max();
LEAVE_CRITICAL_SECTION(cs_vSend);
}
memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
memset(pchCommand, 0, sizeof(pchCommand));
pchCommand[1] = 1;
- nMessageSize = UINT_MAX;
+ nMessageSize = std::numeric_limits<uint32_t>::max();
nChecksum = 0;
}
#include "serialize.h"
#include "netbase.h"
#include <string>
+#include <limits>
#include "uint256.h"
extern bool fTestNet;
* Of course all fields are in network format.
*/
-#define __STDC_LIMIT_MACROS
-
#include <stdio.h>
-#include <stdint.h>
+#include <inttypes.h>
+#include <limits>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
}
/* helper function to generate a random request id */
-static uint64_t randfiller = GetRand(UINT64_MAX);
+static uint64_t randfiller = GetRand(std::numeric_limits<uint64_t>::max());
static void stun_req_id(struct stun_header *req)
{
const uint64_t *S_block = (const uint64_t *)StunSrvList;
- req->id.id[0] = GetRandInt(INT32_MAX);
- req->id.id[1] = GetRandInt(INT32_MAX);
- req->id.id[2] = GetRandInt(INT32_MAX);
- req->id.id[3] = GetRandInt(INT32_MAX);
+ req->id.id[0] = GetRandInt(std::numeric_limits<int32_t>::max());
+ req->id.id[1] = GetRandInt(std::numeric_limits<int32_t>::max());
+ req->id.id[2] = GetRandInt(std::numeric_limits<int32_t>::max());
+ req->id.id[3] = GetRandInt(std::numeric_limits<int32_t>::max());
req->id.id[0] |= 0x55555555;
req->id.id[1] &= 0x55555555;
{
// Restart the file with some of the end
char pch[200000];
- fseek(file, -sizeof(pch), SEEK_END);
+ fseek(file, (long long)-sizeof(pch), SEEK_END);
int nBytes = fread(pch, 1, sizeof(pch), file);
fclose(file);