1
0
Fork 0

Merge branch 'devel' of ssh://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Max Neunhoeffer 2014-04-03 16:22:20 +02:00
commit eb6b74f18a
17 changed files with 120 additions and 119 deletions

View File

@ -878,7 +878,7 @@ static void BitarrayIndex_extendMaskSet(TRI_bitarray_mask_set_t* maskSet, const
TRI_bitarray_mask_t* newArray;
if (nSize <= 0) {
newSize = (increaseBy * maskSet->_arraySize) + 1;
newSize = (size_t) ((increaseBy * maskSet->_arraySize) + 1);
}
else {
newSize = nSize;
@ -1062,7 +1062,7 @@ int BitarrayIndex_generateInsertBitMask (BitarrayIndex* baIndex,
mask->_mask = mask->_mask | (tempMask << shiftLeft);
shiftLeft += valueList->_value._objects._length;
shiftLeft += (int) valueList->_value._objects._length;
}
return TRI_ERROR_NO_ERROR;
@ -1121,7 +1121,7 @@ int BitarrayIndex_generateEqualBitMask(BitarrayIndex* baIndex, const TRI_relatio
valueList = (TRI_json_t*)(TRI_AtVector(&(baIndex->_values),j));
ignoreShiftLeft += valueList->_value._objects._length;
ignoreShiftLeft += (int) valueList->_value._objects._length;
// .........................................................................
// client did not send us this attribute (hence undefined value), therefore
@ -1195,7 +1195,7 @@ int BitarrayIndex_generateEqualBitMask(BitarrayIndex* baIndex, const TRI_relatio
mask->_mask = mask->_mask | (tempMask << shiftLeft);
shiftLeft += valueList->_value._objects._length;
shiftLeft += (int) valueList->_value._objects._length;
}
// ................................................................................

View File

@ -192,8 +192,8 @@ static TRI_json_t* JsonCapConstraint (TRI_index_t* idx) {
return NULL;
}
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "size", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, cap->_count));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "byteSize", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, cap->_size));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "size", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, (double) cap->_count));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "byteSize", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, (double) cap->_size));
return json;
}

View File

@ -2084,7 +2084,7 @@ int ClusterInfo::getResponsibleShard (CollectionID const& collectionID,
int error;
uint64_t hash = TRI_HashJsonByAttributes(json, shardKeys,
shardKeysPtr->size(),
(int) shardKeysPtr->size(),
docComplete, &error);
static char const* magicPhrase
= "Foxx you have stolen the goose, give she back again!";

View File

@ -243,7 +243,7 @@ namespace triagens {
int numberOfShards () const {
TRI_json_t* const node = triagens::basics::JsonHelper::getArrayElement(_json, "shards");
if (TRI_IsArrayJson(node)) {
return (node->_value._objects._length / 2);
return (int) (node->_value._objects._length / 2);
}
return 0;
}

View File

@ -232,7 +232,7 @@ int usersOnCoordinator (std::string const& dbname,
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code == triagens::rest::HttpResponse::OK ||
@ -312,7 +312,7 @@ int revisionOnCoordinator (std::string const& dbname,
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code == triagens::rest::HttpResponse::OK) {
@ -394,7 +394,7 @@ int figuresOnCoordinator (string const& dbname,
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code == triagens::rest::HttpResponse::OK) {
@ -486,7 +486,7 @@ int countOnCoordinator (
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait("", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code == triagens::rest::HttpResponse::OK) {
@ -737,7 +737,7 @@ int deleteDocumentOnCoordinator (
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code != triagens::rest::HttpResponse::NOT_FOUND ||
@ -870,7 +870,7 @@ int getDocumentOnCoordinator (
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code != triagens::rest::HttpResponse::NOT_FOUND ||
@ -935,7 +935,7 @@ int getAllDocumentsOnCoordinator (
resultBody += "{ \"documents\" : [\n";
char const* p;
char const* q;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_TIMEOUT) {
delete res;
@ -1116,7 +1116,7 @@ int modifyDocumentOnCoordinator (
// Now listen to the results:
int count;
int nrok = 0;
for (count = shards.size(); count > 0; count--) {
for (count = (int) shards.size(); count > 0; count--) {
res = cc->wait( "", coordTransactionID, 0, "", 0.0);
if (res->status == CL_COMM_RECEIVED) {
if (res->answer_code != triagens::rest::HttpResponse::NOT_FOUND ||

View File

@ -57,7 +57,7 @@ static v8::Handle<v8::Value> CreateAgencyException (AgencyCommResult const& resu
TRI_v8_global_t* v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
const std::string errorDetails = result.errorDetails();
v8::Handle<v8::String> errorMessage = v8::String::New(errorDetails.c_str(), errorDetails.size());
v8::Handle<v8::String> errorMessage = v8::String::New(errorDetails.c_str(), (int) errorDetails.size());
v8::Handle<v8::Object> errorObject = v8::Exception::Error(errorMessage)->ToObject();
errorObject->Set(v8::String::New("code"), v8::Number::New(result.httpCode()));
@ -235,9 +235,9 @@ static v8::Handle<v8::Value> JS_GetAgency (v8::Arguments const& argv) {
v8::Handle<v8::Object> sub = v8::Object::New();
sub->Set(v8::String::New("value"), TRI_ObjectJson(json));
sub->Set(v8::String::New("index"), v8::String::New(idx.c_str(), idx.size()));
sub->Set(v8::String::New("index"), v8::String::New(idx.c_str(), (int) idx.size()));
l->Set(v8::String::New(key.c_str(), key.size()), sub);
l->Set(v8::String::New(key.c_str(), (int) key.size()), sub);
}
++it;
@ -252,7 +252,7 @@ static v8::Handle<v8::Value> JS_GetAgency (v8::Arguments const& argv) {
TRI_json_t const* json = (*it).second._json;
if (json != 0) {
l->Set(v8::String::New(key.c_str(), key.size()), TRI_ObjectJson(json));
l->Set(v8::String::New(key.c_str(), (int) key.size()), TRI_ObjectJson(json));
}
++it;
@ -308,7 +308,7 @@ static v8::Handle<v8::Value> JS_ListAgency (v8::Arguments const& argv) {
while (it != result._values.end()) {
const std::string key = (*it).first;
l->Set(i++, v8::String::New(key.c_str(), key.size()));
l->Set(i++, v8::String::New(key.c_str(), (int) key.size()));
++it;
}
return scope.Close(l);
@ -321,7 +321,7 @@ static v8::Handle<v8::Value> JS_ListAgency (v8::Arguments const& argv) {
const std::string key = (*it).first;
const bool isDirectory = (*it).second._isDir;
l->Set(v8::String::New(key.c_str(), key.size()), v8::Boolean::New(isDirectory));
l->Set(v8::String::New(key.c_str(), (int) key.size()), v8::Boolean::New(isDirectory));
++it;
}
return scope.Close(l);
@ -554,7 +554,7 @@ static v8::Handle<v8::Value> JS_WatchAgency (v8::Arguments const& argv) {
TRI_json_t* json = (*it).second._json;
if (json != 0) {
l->Set(v8::String::New(key.c_str(), key.size()), TRI_ObjectJson(json));
l->Set(v8::String::New(key.c_str(), (int) key.size()), TRI_ObjectJson(json));
}
++it;
@ -584,7 +584,7 @@ static v8::Handle<v8::Value> JS_EndpointsAgency (v8::Arguments const& argv) {
for (size_t i = 0; i < endpoints.size(); ++i) {
const std::string endpoint = endpoints[i];
l->Set((uint32_t) i, v8::String::New(endpoint.c_str(), endpoint.size()));
l->Set((uint32_t) i, v8::String::New(endpoint.c_str(), (int) endpoint.size()));
}
return scope.Close(l);
@ -609,10 +609,10 @@ static v8::Handle<v8::Value> JS_PrefixAgency (v8::Arguments const& argv) {
const std::string prefix = AgencyComm::prefix();
if (strip && prefix.size() > 2) {
return scope.Close(v8::String::New(prefix.c_str() + 1, prefix.size() - 2));
return scope.Close(v8::String::New(prefix.c_str() + 1, (int) prefix.size() - 2));
}
return scope.Close(v8::String::New(prefix.c_str(), prefix.size()));
return scope.Close(v8::String::New(prefix.c_str(), (int) prefix.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -667,7 +667,7 @@ static v8::Handle<v8::Value> JS_UniqidAgency (v8::Arguments const& argv) {
const std::string value = StringUtils::itoa(result._index);
return scope.Close(v8::String::New(value.c_str(), value.size()));
return scope.Close(v8::String::New(value.c_str(), (int) value.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -684,7 +684,7 @@ static v8::Handle<v8::Value> JS_VersionAgency (v8::Arguments const& argv) {
AgencyComm comm;
const std::string version = comm.getVersion();
return scope.Close(v8::String::New(version.c_str(), version.size()));
return scope.Close(v8::String::New(version.c_str(), (int) version.size()));
}
// -----------------------------------------------------------------------------
@ -719,11 +719,11 @@ static v8::Handle<v8::Value> JS_ListDatabases (v8::Arguments const& argv) {
}
vector<DatabaseID> res = ClusterInfo::instance()->listDatabases(true);
v8::Handle<v8::Array> a = v8::Array::New(res.size());
v8::Handle<v8::Array> a = v8::Array::New((int) res.size());
vector<DatabaseID>::iterator it;
int count = 0;
for (it = res.begin(); it != res.end(); ++it) {
a->Set(count++, v8::String::New(it->c_str(), it->size()));
a->Set(count++, v8::String::New(it->c_str(), (int) it->size()));
}
return scope.Close(a);
}
@ -762,14 +762,14 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoClusterInfo (v8::Arguments cons
v8::Handle<v8::Object> result = v8::Object::New();
const std::string cid = triagens::basics::StringUtils::itoa(ci->id());
const std::string& name = ci->name();
result->Set(v8::String::New("id"), v8::String::New(cid.c_str(), cid.size()));
result->Set(v8::String::New("name"), v8::String::New(name.c_str(), name.size()));
result->Set(v8::String::New("id"), v8::String::New(cid.c_str(), (int) cid.size()));
result->Set(v8::String::New("name"), v8::String::New(name.c_str(), (int) name.size()));
result->Set(v8::String::New("type"), v8::Number::New((int) ci->type()));
result->Set(v8::String::New("status"), v8::Number::New((int) ci->status()));
const string statusString = ci->statusString();
result->Set(v8::String::New("statusString"),
v8::String::New(statusString.c_str(), statusString.size()));
v8::String::New(statusString.c_str(), (int) statusString.size()));
result->Set(v8::String::New("deleted"), v8::Boolean::New(ci->deleted()));
result->Set(v8::String::New("doCompact"), v8::Boolean::New(ci->doCompact()));
@ -779,9 +779,9 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoClusterInfo (v8::Arguments cons
result->Set(v8::String::New("journalSize"), v8::Number::New(ci->journalSize()));
const std::vector<std::string>& sks = ci->shardKeys();
v8::Handle<v8::Array> shardKeys = v8::Array::New(sks.size());
for (uint32_t i = 0, n = sks.size(); i < n; ++i) {
shardKeys->Set(i, v8::String::New(sks[i].c_str(), sks[i].size()));
v8::Handle<v8::Array> shardKeys = v8::Array::New((int) sks.size());
for (uint32_t i = 0, n = (uint32_t) sks.size(); i < n; ++i) {
shardKeys->Set(i, v8::String::New(sks[i].c_str(), (int) sks[i].size()));
}
result->Set(v8::String::New("shardKeys"), shardKeys);
@ -789,8 +789,8 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoClusterInfo (v8::Arguments cons
v8::Handle<v8::Object> shardIds = v8::Object::New();
std::map<std::string, std::string>::const_iterator it = sis.begin();
while (it != sis.end()) {
shardIds->Set(v8::String::New((*it).first.c_str(), (*it).first.size()),
v8::String::New((*it).second.c_str(), (*it).second.size()));
shardIds->Set(v8::String::New((*it).first.c_str(), (int) (*it).first.size()),
v8::String::New((*it).second.c_str(), (int) (*it).second.size()));
++it;
}
result->Set(v8::String::New("shards"), shardIds);
@ -822,8 +822,8 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoCurrentClusterInfo (v8::Argumen
// First some stuff from Plan for which Current does not make sense:
const std::string cid = triagens::basics::StringUtils::itoa(ci->id());
const std::string& name = ci->name();
result->Set(v8::String::New("id"), v8::String::New(cid.c_str(), cid.size()));
result->Set(v8::String::New("name"), v8::String::New(name.c_str(), name.size()));
result->Set(v8::String::New("id"), v8::String::New(cid.c_str(), (int) cid.size()));
result->Set(v8::String::New("name"), v8::String::New(name.c_str(), (int) name.size()));
TRI_shared_ptr<CollectionInfoCurrent> cic
= ClusterInfo::instance()->getCollectionCurrent(
@ -838,7 +838,7 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoCurrentClusterInfo (v8::Argumen
}
const string statusString = TRI_GetStatusStringCollectionVocBase(s);
result->Set(v8::String::New("statusString"),
v8::String::New(statusString.c_str(), statusString.size()));
v8::String::New(statusString.c_str(), (int) statusString.size()));
result->Set(v8::String::New("deleted"), v8::Boolean::New(cic->deleted(shardID)));
result->Set(v8::String::New("doCompact"), v8::Boolean::New(cic->doCompact(shardID)));
@ -847,7 +847,7 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoCurrentClusterInfo (v8::Argumen
result->Set(v8::String::New("waitForSync"), v8::Boolean::New(cic->waitForSync(shardID)));
result->Set(v8::String::New("journalSize"), v8::Number::New(cic->journalSize(shardID)));
const std::string serverID = cic->responsibleServer(shardID);
result->Set(v8::String::New("DBServer"), v8::String::New(serverID.c_str(), serverID.size()));
result->Set(v8::String::New("DBServer"), v8::String::New(serverID.c_str(), (int) serverID.size()));
// TODO: fill "indexes"
v8::Handle<v8::Array> indexes = v8::Array::New();
@ -860,7 +860,7 @@ static v8::Handle<v8::Value> JS_GetCollectionInfoCurrentClusterInfo (v8::Argumen
result->Set(v8::String::New("errorNum"), v8::Number::New(cic->errorNum(shardID)));
const string errorMessage = cic->errorMessage(shardID);
result->Set(v8::String::New("errorMessage"),
v8::String::New(errorMessage.c_str(), errorMessage.size()));
v8::String::New(errorMessage.c_str(), (int) errorMessage.size()));
}
return scope.Close(result);
@ -879,7 +879,7 @@ static v8::Handle<v8::Value> JS_GetResponsibleServerClusterInfo (v8::Arguments c
const std::string result = ClusterInfo::instance()->getResponsibleServer(TRI_ObjectToString(argv[0]));
return scope.Close(v8::String::New(result.c_str(), result.size()));
return scope.Close(v8::String::New(result.c_str(), (int) result.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -895,7 +895,7 @@ static v8::Handle<v8::Value> JS_GetServerEndpointClusterInfo (v8::Arguments cons
const std::string result = ClusterInfo::instance()->getServerEndpoint(TRI_ObjectToString(argv[0]));
return scope.Close(v8::String::New(result.c_str(), result.size()));
return scope.Close(v8::String::New(result.c_str(), (int) result.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -916,7 +916,7 @@ static v8::Handle<v8::Value> JS_GetDBServers (v8::Arguments const& argv) {
for (size_t i = 0; i < DBServers.size(); ++i) {
ServerID const sid = DBServers[i];
l->Set((uint32_t) i, v8::String::New(sid.c_str(), sid.size()));
l->Set((uint32_t) i, v8::String::New(sid.c_str(), (int) sid.size()));
}
return scope.Close(l);
@ -965,7 +965,7 @@ static v8::Handle<v8::Value> JS_UniqidClusterInfo (v8::Arguments const& argv) {
const std::string id = StringUtils::itoa(value);
return scope.Close(v8::String::New(id.c_str(), id.size()));
return scope.Close(v8::String::New(id.c_str(), (int) id.size()));
}
// -----------------------------------------------------------------------------
@ -984,7 +984,7 @@ static v8::Handle<v8::Value> JS_AddressServerState (v8::Arguments const& argv) {
}
const std::string address = ServerState::instance()->getAddress();
return scope.Close(v8::String::New(address.c_str(), address.size()));
return scope.Close(v8::String::New(address.c_str(), (int) address.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1015,7 +1015,7 @@ static v8::Handle<v8::Value> JS_IdServerState (v8::Arguments const& argv) {
}
const std::string id = ServerState::instance()->getId();
return scope.Close(v8::String::New(id.c_str(), id.size()));
return scope.Close(v8::String::New(id.c_str(), (int) id.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1030,7 +1030,7 @@ static v8::Handle<v8::Value> JS_DataPathServerState (v8::Arguments const& argv)
}
const std::string path = ServerState::instance()->getDataPath();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1045,7 +1045,7 @@ static v8::Handle<v8::Value> JS_LogPathServerState (v8::Arguments const& argv) {
}
const std::string path = ServerState::instance()->getLogPath();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1060,7 +1060,7 @@ static v8::Handle<v8::Value> JS_AgentPathServerState (v8::Arguments const& argv)
}
const std::string path = ServerState::instance()->getAgentPath();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1075,7 +1075,7 @@ static v8::Handle<v8::Value> JS_ArangodPathServerState (v8::Arguments const& arg
}
const std::string path = ServerState::instance()->getArangodPath();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1090,7 +1090,7 @@ static v8::Handle<v8::Value> JS_JavaScriptPathServerState (v8::Arguments const&
}
const std::string path = ServerState::instance()->getJavaScriptPath();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1105,7 +1105,7 @@ static v8::Handle<v8::Value> JS_DBserverConfigServerState (v8::Arguments const&
}
const std::string path = ServerState::instance()->getDBserverConfig();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1120,7 +1120,7 @@ static v8::Handle<v8::Value> JS_CoordinatorConfigServerState (v8::Arguments cons
}
const std::string path = ServerState::instance()->getCoordinatorConfig();
return scope.Close(v8::String::New(path.c_str(), path.size()));
return scope.Close(v8::String::New(path.c_str(), (int) path.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1192,7 +1192,7 @@ static v8::Handle<v8::Value> JS_RoleServerState (v8::Arguments const& argv) {
const std::string role = ServerState::roleToString(ServerState::instance()->getRole());
return scope.Close(v8::String::New(role.c_str(), role.size()));
return scope.Close(v8::String::New(role.c_str(), (int) role.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1248,7 +1248,7 @@ static v8::Handle<v8::Value> JS_StatusServerState (v8::Arguments const& argv) {
const std::string state = ServerState::stateToString(ServerState::instance()->getState());
return scope.Close(v8::String::New(state.c_str(), state.size()));
return scope.Close(v8::String::New(state.c_str(), (int) state.size()));
}
////////////////////////////////////////////////////////////////////////////////
@ -1358,17 +1358,17 @@ v8::Handle<v8::Object> PrepareClusterCommResultForJS(
} else {
r->Set(v8g->ClientTransactionIDKey,
v8::String::New(res->clientTransactionID.c_str(),
res->clientTransactionID.size()));
(int) res->clientTransactionID.size()));
// convert the ids to strings as uint64_t might be too big for JavaScript numbers
std::string id = StringUtils::itoa(res->coordTransactionID);
r->Set(v8g->CoordTransactionIDKey, v8::String::New(id.c_str(), id.size()));
r->Set(v8g->CoordTransactionIDKey, v8::String::New(id.c_str(), (int) id.size()));
id = StringUtils::itoa(res->operationID);
r->Set(v8g->OperationIDKey, v8::String::New(id.c_str(), id.size()));
r->Set(v8g->OperationIDKey, v8::String::New(id.c_str(), (int) id.size()));
r->Set(v8g->ShardIDKey,
v8::String::New(res->shardID.c_str(), res->shardID.size()));
v8::String::New(res->shardID.c_str(), (int) res->shardID.size()));
if (res->status == CL_COMM_SUBMITTED) {
r->Set(v8g->StatusKey, v8::String::New("SUBMITTED"));
}
@ -1390,7 +1390,7 @@ v8::Handle<v8::Object> PrepareClusterCommResultForJS(
v8::Handle<v8::Object> details = v8::Object::New();
details->Set(v8::String::New("code"), v8::Number::New(res->result->getHttpReturnCode()));
details->Set(v8::String::New("message"), v8::String::New(res->result->getHttpReturnMessage().c_str()));
details->Set(v8::String::New("body"), v8::String::New(res->result->getBody().str().c_str(), res->result->getBody().str().length()));
details->Set(v8::String::New("body"), v8::String::New(res->result->getBody().str().c_str(), (int) res->result->getBody().str().length()));
r->Set(v8::String::New("details"), details);
r->Set(v8g->ErrorMessageKey,
@ -1422,7 +1422,7 @@ v8::Handle<v8::Object> PrepareClusterCommResultForJS(
// The body:
if (0 != res->answer->body()) {
r->Set(v8::String::New("body"), v8::String::New(res->answer->body(),
res->answer->bodySize()));
(int) res->answer->bodySize()));
}
}
}

View File

@ -201,7 +201,7 @@ void ApplicationV8::V8Context::handleGlobalContextMethods () {
LOG_DEBUG("executing global context methods '%s' for context %d", func.c_str(), (int) _id);
TRI_ExecuteJavaScriptString(_context,
v8::String::New(func.c_str(), func.size()),
v8::String::New(func.c_str(), (int) func.size()),
v8::String::New("global context method"),
false);
}
@ -808,8 +808,8 @@ bool ApplicationV8::prepareV8Instance (const size_t i) {
char const* logfile = TRI_GetFilenameLogging();
TRI_AddGlobalVariableVocbase(context->_context, "LOGFILE_PATH", logfile != 0 ? v8::String::New(logfile) : v8::Null());
TRI_AddGlobalVariableVocbase(context->_context, "APP_PATH", v8::String::New(_appPath.c_str(), _appPath.size()));
TRI_AddGlobalVariableVocbase(context->_context, "DEV_APP_PATH", v8::String::New(_devAppPath.c_str(), _devAppPath.size()));
TRI_AddGlobalVariableVocbase(context->_context, "APP_PATH", v8::String::New(_appPath.c_str(), (int) _appPath.size()));
TRI_AddGlobalVariableVocbase(context->_context, "DEV_APP_PATH", v8::String::New(_devAppPath.c_str(), (int) _devAppPath.size()));
TRI_AddGlobalVariableVocbase(context->_context, "DEVELOPMENT_MODE", v8::Boolean::New(_developmentMode));
TRI_AddGlobalVariableVocbase(context->_context, "FE_DEVELOPMENT_MODE", v8::Boolean::New(_frontendDevelopmentMode));

View File

@ -264,7 +264,7 @@ static void AddCookie (TRI_v8_global_t const* v8g,
}
if (data->Has(v8g->LifeTimeKey)) {
v8::Handle<v8::Value> v = data->Get(v8g->LifeTimeKey);
lifeTimeSeconds = TRI_ObjectToInt64(v);
lifeTimeSeconds = (int) TRI_ObjectToInt64(v);
}
if (data->Has(v8g->PathKey) && ! data->Get(v8g->PathKey)->IsUndefined()) {
v8::Handle<v8::Value> v = data->Get(v8g->PathKey);
@ -334,40 +334,40 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
req->Set(v8g->UserKey, v8::Null());
}
else {
req->Set(v8g->UserKey, v8::String::New(user.c_str(), user.size()));
req->Set(v8g->UserKey, v8::String::New(user.c_str(), (int) user.size()));
}
// create database attribute
string const& database = request->databaseName();
assert(! database.empty());
req->Set(v8g->DatabaseKey, v8::String::New(database.c_str(), database.size()));
req->Set(v8g->DatabaseKey, v8::String::New(database.c_str(), (int) database.size()));
// set the full url
string const& fullUrl = request->fullUrl();
req->Set(v8g->UrlKey, v8::String::New(fullUrl.c_str(), fullUrl.size()));
req->Set(v8g->UrlKey, v8::String::New(fullUrl.c_str(), (int) fullUrl.size()));
// set the protocol
string const& protocol = request->protocol();
req->Set(v8g->ProtocolKey, v8::String::New(protocol.c_str(), protocol.size()));
req->Set(v8g->ProtocolKey, v8::String::New(protocol.c_str(), (int) protocol.size()));
// set the connection info
const ConnectionInfo& info = request->connectionInfo();
v8::Handle<v8::Object> serverArray = v8::Object::New();
serverArray->Set(v8g->AddressKey, v8::String::New(info.serverAddress.c_str(), info.serverAddress.size()));
serverArray->Set(v8g->AddressKey, v8::String::New(info.serverAddress.c_str(), (int) info.serverAddress.size()));
serverArray->Set(v8g->PortKey, v8::Number::New(info.serverPort));
req->Set(v8g->ServerKey, serverArray);
v8::Handle<v8::Object> clientArray = v8::Object::New();
clientArray->Set(v8g->AddressKey, v8::String::New(info.clientAddress.c_str(), info.clientAddress.size()));
clientArray->Set(v8g->AddressKey, v8::String::New(info.clientAddress.c_str(), (int) info.clientAddress.size()));
clientArray->Set(v8g->PortKey, v8::Number::New(info.clientPort));
req->Set(v8g->ClientKey, clientArray);
// copy prefix
string path = request->prefix();
req->Set(v8g->PrefixKey, v8::String::New(path.c_str(), path.size()));
req->Set(v8g->PrefixKey, v8::String::New(path.c_str(), (int) path.size()));
// copy header fields
v8::Handle<v8::Object> headerFields = v8::Object::New();
@ -377,9 +377,9 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
for (; iter != headers.end(); ++iter) {
headerFields->Set(v8::String::New(iter->first.c_str(),
iter->first.size()),
(int) iter->first.size()),
v8::String::New(iter->second.c_str(),
iter->second.size()));
(int) iter->second.size()));
}
req->Set(v8g->HeadersKey, headerFields);
@ -389,19 +389,19 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
case HttpRequest::HTTP_REQUEST_POST:
req->Set(v8g->RequestTypeKey, v8g->PostConstant);
req->Set(v8g->RequestBodyKey, v8::String::New(request->body(),
request->bodySize()));
(int) request->bodySize()));
break;
case HttpRequest::HTTP_REQUEST_PUT:
req->Set(v8g->RequestTypeKey, v8g->PutConstant);
req->Set(v8g->RequestBodyKey, v8::String::New(request->body(),
request->bodySize()));
(int) request->bodySize()));
break;
case HttpRequest::HTTP_REQUEST_PATCH:
req->Set(v8g->RequestTypeKey, v8g->PatchConstant);
req->Set(v8g->RequestBodyKey, v8::String::New(request->body(),
request->bodySize()));
(int) request->bodySize()));
break;
case HttpRequest::HTTP_REQUEST_OPTIONS:
@ -431,8 +431,8 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
string const& k = i->first;
string const& v = i->second;
valuesObject->Set(v8::String::New(k.c_str(), k.size()),
v8::String::New(v.c_str(), v.size()));
valuesObject->Set(v8::String::New(k.c_str(), (int) k.size()),
v8::String::New(v.c_str(), (int) v.size()));
}
// copy request array parameter (a[]=1&a[]=2&...)
@ -446,10 +446,10 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
v8::Handle<v8::Array> list = v8::Array::New();
for (size_t i = 0; i < v->size(); ++i) {
list->Set(i, v8::String::New(v->at(i)));
list->Set((uint32_t) i, v8::String::New(v->at(i)));
}
valuesObject->Set(v8::String::New(k.c_str(), k.size()), list);
valuesObject->Set(v8::String::New(k.c_str(), (int) k.size()), list);
}
req->Set(v8g->ParametersKey, valuesObject);
@ -462,9 +462,9 @@ static v8::Handle<v8::Object> RequestCppToV8 ( TRI_v8_global_t const* v8g,
for (; iter != cookies.end(); ++iter) {
cookiesObject->Set(v8::String::New(iter->first.c_str(),
iter->first.size()),
(int) iter->first.size()),
v8::String::New(iter->second.c_str(),
iter->second.size()));
(int) iter->second.size()));
}
req->Set(v8g->CookiesKey, cookiesObject);
@ -639,7 +639,7 @@ static TRI_action_result_t ExecuteActionVocbase (TRI_vocbase_t* vocbase,
for (size_t s = action->_urlParts; s < suffix.size(); ++s) {
suffixArray->Set(index++, v8::String::New(suffix[s].c_str(),
suffix[s].size()));
(int) suffix[s].size()));
path += sep + suffix[s];
sep = "/";
@ -648,7 +648,7 @@ static TRI_action_result_t ExecuteActionVocbase (TRI_vocbase_t* vocbase,
req->Set(v8g->SuffixKey, suffixArray);
// copy full path
req->Set(v8g->PathKey, v8::String::New(path.c_str(), path.size()));
req->Set(v8g->PathKey, v8::String::New(path.c_str(), (int) path.size()));
// execute the callback
v8::Handle<v8::Object> res = v8::Object::New();
@ -962,7 +962,7 @@ static v8::Handle<v8::Value> JS_ClusterTest (v8::Arguments const& argv) {
v8::String::New(res->result->getHttpReturnMessage().c_str()));
details->Set(v8::String::New("body"),
v8::String::New(res->result->getBody().str().c_str(),
res->result->getBody().str().length()));
(int) res->result->getBody().str().length()));
r->Set(v8::String::New("details"), details);
r->Set(v8g->ErrorMessageKey,
@ -994,7 +994,7 @@ static v8::Handle<v8::Value> JS_ClusterTest (v8::Arguments const& argv) {
// The body:
if (0 != res->answer->body()) {
r->Set(v8::String::New("body"), v8::String::New(res->answer->body(),
res->answer->bodySize()));
(int) res->answer->bodySize()));
}
LOG_DEBUG("JS_ClusterTest: success");
}
@ -1041,7 +1041,7 @@ static v8::Handle<v8::Value> JS_ClusterTest (v8::Arguments const& argv) {
// The body:
string theBody = res->result->getBody().str();
r->Set(v8::String::New("body"), v8::String::New(theBody.c_str(),
theBody.size()));
(int) theBody.size()));
LOG_DEBUG("JS_ClusterTest: success");
}

View File

@ -368,7 +368,7 @@ static int CloneDocumentMarker (TRI_voc_tid_t tid,
}
// calculate the total size for the marker (= marker base size + key(s) + shaped json)
*totalSize = baseLength + shaped->_data.length;
*totalSize = (TRI_voc_size_t) (baseLength + shaped->_data.length);
mem = (char*) TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, *totalSize, false);
@ -385,7 +385,7 @@ static int CloneDocumentMarker (TRI_voc_tid_t tid,
}
// copy non-changed data (e.g. key(s)) from old marker into new marker
TRI_CloneMarker(&marker->base, original, baseLength, *totalSize);
TRI_CloneMarker(&marker->base, original, baseLength, (TRI_voc_size_t) *totalSize);
assert(marker->_rid != 0);
// the new revision must be greater than the old one
@ -485,7 +485,7 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
// document marker
fromSize = 0;
toSize = 0;
keyBodySize = TRI_DF_ALIGN_BLOCK(keySize);
keyBodySize = (TRI_voc_size_t) TRI_DF_ALIGN_BLOCK(keySize);
markerSize = sizeof(TRI_doc_document_key_marker_t);
}
else if (markerType == TRI_DOC_MARKER_KEY_EDGE) {
@ -495,7 +495,7 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
fromSize = strlen(edge->_fromKey) + 1;
toSize = strlen(edge->_toKey) + 1;
keyBodySize = TRI_DF_ALIGN_BLOCK(keySize + fromSize + toSize);
keyBodySize = (TRI_voc_size_t) TRI_DF_ALIGN_BLOCK(keySize + fromSize + toSize);
markerSize = sizeof(TRI_doc_edge_key_marker_t);
}
else {
@ -505,7 +505,7 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
// calculate the total size for the marker (= marker base size + key(s) + shaped json)
*totalSize = markerSize + keyBodySize + shaped->_data.length;
*totalSize = (TRI_voc_size_t) (markerSize + keyBodySize + shaped->_data.length);
mem = (char*) TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, *totalSize, false);
@ -545,8 +545,8 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
position += toSize;
TRI_CopyString(position, (char*) edge->_fromKey, fromSize);
edgeMarker->_offsetToKey = markerSize + keySize;
edgeMarker->_offsetFromKey = markerSize + keySize + toSize;
edgeMarker->_offsetToKey = (uint16_t) markerSize + keySize;
edgeMarker->_offsetFromKey = (uint16_t) markerSize + keySize + toSize;
edgeMarker->_fromCid = edge->_fromCid;
edgeMarker->_toCid = edge->_toCid;
}
@ -556,8 +556,8 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
memcpy(position, (char*) shaped->_data.data, shaped->_data.length);
// set the offsets for _key and shaped json
marker->_offsetKey = markerSize;
marker->_offsetJson = markerSize + keyBodySize;
marker->_offsetKey = (uint16_t) markerSize;
marker->_offsetJson = (uint16_t) markerSize + keyBodySize;
*result = marker;
@ -2685,7 +2685,7 @@ static bool OpenIterator (TRI_df_marker_t const* marker,
/// currently, this will only fill edge indexes
////////////////////////////////////////////////////////////////////////////////
static bool FillInternalIndexes (TRI_document_collection_t* document) {
static int FillInternalIndexes (TRI_document_collection_t* document) {
int res = TRI_ERROR_NO_ERROR;
for (size_t i = 0; i < document->_allIndexes._length; ++i) {

View File

@ -172,7 +172,7 @@ char* Logfile::reserve (size_t size) {
char* result = _df->_next;
_df->_next += size;
_df->_currentSize += size;
_df->_currentSize += (TRI_voc_size_t) size;
return result;
}
@ -187,7 +187,7 @@ TRI_df_header_marker_t Logfile::getHeaderMarker () const {
TRI_InitMarker((char*) &header, TRI_DF_MARKER_HEADER, size);
header._version = TRI_DF_VERSION;
header._maximalSize = allocatedSize();
header._maximalSize = static_cast<TRI_voc_size_t>(allocatedSize());
header._fid = static_cast<TRI_voc_fid_t>(_id);
return header;

View File

@ -155,7 +155,7 @@ bool LogfileManager::prepare () {
LOG_FATAL_AND_EXIT("invalid logfile size. Please use a value of at least %lu", (unsigned long) MinFilesize);
}
_filesize = ((_filesize + PageSize - 1) / PageSize) * PageSize;
_filesize = (uint32_t) (((_filesize + PageSize - 1) / PageSize) * PageSize);
return true;
}

View File

@ -79,6 +79,7 @@ std::string Slot::statusText () const {
// stop stelling me that the control flow will reach the end of a non-void
// function. this cannot happen!!!!!
assert(false);
return "unknown";
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -490,7 +490,7 @@ void ArangoClient::printErrLine (const string& s) {
void ArangoClient::_printLine(const string &s) {
#ifdef _WIN32
LPWSTR wBuf = (LPWSTR)TRI_Allocate(TRI_CORE_MEM_ZONE, (sizeof WCHAR)* (s.size() + 1), true);
int wLen = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wBuf, (sizeof WCHAR)* (s.size() + 1));
int wLen = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wBuf, (int) ((sizeof WCHAR) * (s.size() + 1)));
if (wLen) {
DWORD n;
@ -499,7 +499,7 @@ void ArangoClient::_printLine(const string &s) {
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &bufferInfo);
pos = bufferInfo.dwCursorPosition;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
WriteConsoleOutputCharacterW(GetStdHandle(STD_OUTPUT_HANDLE), wBuf, s.size(), pos, &n);
WriteConsoleOutputCharacterW(GetStdHandle(STD_OUTPUT_HANDLE), wBuf, (DWORD) s.size(), pos, &n);
// Workaround recomended by
// http://social.msdn.microsoft.com/Forums/de-DE/c16846a3-eb27-4698-80a5-6c4ecf92a799/aus-der-msdnhotline-deutsche-umlaute-in-der-console-anzeigen-standard-c?forum=visualcplusde
// but it does not work

View File

@ -163,7 +163,7 @@ int TRI_InitAssociativeArray (TRI_associative_array_t* array,
array->isEqualElementElement = isEqualElementElement;
array->_memoryZone = zone;
array->_elementSize = elementSize;
array->_elementSize = (uint32_t) elementSize;
array->_nrAlloc = 0;
array->_nrUsed = 0;

View File

@ -75,6 +75,6 @@ uint32_t fasthash32(const void *buf, size_t len, uint32_t seed)
// the following trick converts the 64-bit hashcode to Fermat
// residue, which shall retain information from both the higher
// and lower parts of hashcode.
uint64_t h = fasthash64(buf, len, seed);
uint64_t h = fasthash64(buf, len, seed);
return h - (h >> 32);
}

View File

@ -1053,7 +1053,7 @@ bool TRI_PrintJson (int fd, TRI_json_t const* object) {
n = TRI_LengthStringBuffer(&buffer);
while (0 < n) {
ssize_t m = TRI_WRITE(fd, p, n);
ssize_t m = TRI_WRITE(fd, p, (unsigned int) n);
if (m <= 0) {
TRI_AnnihilateStringBuffer(&buffer);

View File

@ -347,10 +347,10 @@ static void CreateFlagOption (po_flag_t * desc, const void * input, void * outpu
po = (TRI_program_options_t*) (output);
if (desc->_value == 0) {
InitOptionStructure(&flagOpt, desc->base._name, 0, 0, po->_longopts._length);
InitOptionStructure(&flagOpt, desc->base._name, 0, 0, (int) po->_longopts._length);
}
else {
InitOptionStructure(&flagOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&flagOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
}
memset(&item, 0, sizeof(item));
@ -396,7 +396,7 @@ void CreateInt16Option (po_int16_t * desc, const void * input, void * output) {
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -436,7 +436,7 @@ void CreateInt32Option (po_int32_t * desc, const void * input, void * output) {
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -476,7 +476,7 @@ static void CreateInt64Option (po_int64_t * desc, const void * input, void * out
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -533,7 +533,7 @@ static void CreateStringOption (TRI_PO_string_t * desc, const void * input, void
po = (TRI_program_options_t *) output;
InitOptionStructure(&stringOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&stringOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -578,7 +578,7 @@ static void CreateUInt16Option (po_uint16_t * desc, const void * input, void * o
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -618,7 +618,7 @@ static void CreateUInt32Option (po_uint32_t * desc, const void * input, void * o
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -658,7 +658,7 @@ static void CreateUInt64Option (po_uint64_t * desc, const void * input, void * o
po = (TRI_program_options_t*) (output);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&intOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));
@ -695,7 +695,7 @@ static void CreateVectorStringOption (TRI_PO_vector_string_t * desc, const void
po = (TRI_program_options_t*) (output);
InitOptionStructure(&vectorOpt, desc->base._name, 1, 0, po->_longopts._length);
InitOptionStructure(&vectorOpt, desc->base._name, 1, 0, (int) po->_longopts._length);
memset(&item, 0, sizeof(item));