mirror of https://gitee.com/bigwinds/arangodb
please the VisualStudio compiler
This commit is contained in:
parent
13204298d9
commit
30a9f44e64
|
@ -2232,8 +2232,8 @@ static void JS_PropertiesVocbaseCol (const v8::FunctionCallbackInfo<v8::Value>&
|
||||||
}
|
}
|
||||||
|
|
||||||
if (po->Has(TRI_V8_ASCII_STRING("indexBuckets"))) {
|
if (po->Has(TRI_V8_ASCII_STRING("indexBuckets"))) {
|
||||||
indexBuckets = TRI_ObjectToUInt64(
|
indexBuckets = static_cast<uint32_t>(TRI_ObjectToUInt64(
|
||||||
po->Get(TRI_V8_ASCII_STRING("indexBuckets")), true);
|
po->Get(TRI_V8_ASCII_STRING("indexBuckets")), true));
|
||||||
if (indexBuckets == 0 || indexBuckets > 1024) {
|
if (indexBuckets == 0 || indexBuckets > 1024) {
|
||||||
ReleaseCollection(collection);
|
ReleaseCollection(collection);
|
||||||
TRI_V8_THROW_EXCEPTION_PARAMETER("indexBuckets must be a two-power between 1 and 1024");
|
TRI_V8_THROW_EXCEPTION_PARAMETER("indexBuckets must be a two-power between 1 and 1024");
|
||||||
|
|
|
@ -1707,7 +1707,7 @@ static void CreateVocBase (const v8::FunctionCallbackInfo<v8::Value>& args,
|
||||||
|
|
||||||
if (p->Has(TRI_V8_ASCII_STRING("indexBuckets"))) {
|
if (p->Has(TRI_V8_ASCII_STRING("indexBuckets"))) {
|
||||||
parameters._indexBuckets
|
parameters._indexBuckets
|
||||||
= TRI_ObjectToUInt64(p->Get(TRI_V8_ASCII_STRING("indexBuckets")), true);
|
= static_cast<uint32_t>(TRI_ObjectToUInt64(p->Get(TRI_V8_ASCII_STRING("indexBuckets")), true));
|
||||||
if (parameters._indexBuckets < 1 ||
|
if (parameters._indexBuckets < 1 ||
|
||||||
parameters._indexBuckets > 1024) {
|
parameters._indexBuckets > 1024) {
|
||||||
TRI_FreeCollectionInfoOptions(¶meters);
|
TRI_FreeCollectionInfoOptions(¶meters);
|
||||||
|
|
|
@ -939,7 +939,7 @@ static int SizeHintEdge (TRI_index_t* idx,
|
||||||
|
|
||||||
// set an initial size for the index for some new nodes to be created
|
// set an initial size for the index for some new nodes to be created
|
||||||
// without resizing
|
// without resizing
|
||||||
int err = edgesIndex->resize(size + 2049);
|
int err = edgesIndex->resize(static_cast<uint32_t>(size + 2049));
|
||||||
|
|
||||||
if (err != TRI_ERROR_NO_ERROR) {
|
if (err != TRI_ERROR_NO_ERROR) {
|
||||||
return err;
|
return err;
|
||||||
|
@ -953,7 +953,7 @@ static int SizeHintEdge (TRI_index_t* idx,
|
||||||
|
|
||||||
// set an initial size for the index for some new nodes to be created
|
// set an initial size for the index for some new nodes to be created
|
||||||
// without resizing
|
// without resizing
|
||||||
return edgesIndex->resize(size + 2049);
|
return edgesIndex->resize(static_cast<uint32_t>(size + 2049));
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
@ -764,14 +764,14 @@ namespace triagens {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int resize (IndexType size) throw() {
|
int resize (IndexType size) throw() {
|
||||||
size /= _buckets.size();
|
size /= static_cast<IndexType>(_buckets.size());
|
||||||
for (auto& b : _buckets) {
|
for (auto& b : _buckets) {
|
||||||
if (2 * (2*size+1) < 3 * b._nrUsed) {
|
if (2 * (2 * size + 1) < 3 * b._nrUsed) {
|
||||||
return TRI_ERROR_BAD_PARAMETER;
|
return TRI_ERROR_BAD_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resizeInternal(b, 2*size+1);
|
resizeInternal(b, 2 * size + 1);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
return TRI_ERROR_OUT_OF_MEMORY;
|
return TRI_ERROR_OUT_OF_MEMORY;
|
||||||
|
@ -842,7 +842,7 @@ namespace triagens {
|
||||||
Entry* oldTable = b._table;
|
Entry* oldTable = b._table;
|
||||||
IndexType oldAlloc = b._nrAlloc;
|
IndexType oldAlloc = b._nrAlloc;
|
||||||
|
|
||||||
b._nrAlloc = TRI_NearPrime(size);
|
b._nrAlloc = static_cast<IndexType>(TRI_NearPrime(size));
|
||||||
try {
|
try {
|
||||||
b._table = new Entry[b._nrAlloc];
|
b._table = new Entry[b._nrAlloc];
|
||||||
IndexType i;
|
IndexType i;
|
||||||
|
@ -1145,7 +1145,7 @@ namespace triagens {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
inline IndexType hashToIndex (uint64_t const h) const {
|
inline IndexType hashToIndex (uint64_t const h) const {
|
||||||
return sizeof(IndexType) == 8 ? h : TRI_64to32(h);
|
return static_cast<IndexType>(sizeof(IndexType) == 8 ? h : TRI_64to32(h));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue