mirror of https://gitee.com/bigwinds/arangodb
old autoconf check, fixed warnings
This commit is contained in:
parent
7d09436be1
commit
56b18fc2f8
|
@ -146,10 +146,15 @@ unsigned int TRI_ProcessSize (TRI_pid_t pid) {
|
||||||
if (fd > 0) {
|
if (fd > 0) {
|
||||||
char str[1024];
|
char str[1024];
|
||||||
process_state_t st;
|
process_state_t st;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
read(fd, str, 1024);
|
n = read(fd, str, 1024);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
if (n < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sscanf(str, "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %llu %lu", &st.pid,
|
sscanf(str, "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %llu %lu", &st.pid,
|
||||||
(char*) &st.comm, &st.state, &st.ppid, &st.pgrp, &st.session, &st.tty_nr, &st.tpgid,
|
(char*) &st.comm, &st.state, &st.ppid, &st.pgrp, &st.session, &st.tty_nr, &st.tpgid,
|
||||||
&st.flags, &st.minflt, &st.cminflt, &st.majflt, &st.cmajflt, &st.utime, &st.stime,
|
&st.flags, &st.minflt, &st.cminflt, &st.majflt, &st.cmajflt, &st.utime, &st.stime,
|
||||||
|
|
|
@ -398,7 +398,6 @@ namespace triagens {
|
||||||
basics::Dictionary<char const*>::KeyValue const* begin;
|
basics::Dictionary<char const*>::KeyValue const* begin;
|
||||||
basics::Dictionary<char const*>::KeyValue const* end;
|
basics::Dictionary<char const*>::KeyValue const* end;
|
||||||
|
|
||||||
bool seenContentLength = false;
|
|
||||||
bool seenTransferEncoding = false;
|
bool seenTransferEncoding = false;
|
||||||
string transferEncoding;
|
string transferEncoding;
|
||||||
|
|
||||||
|
@ -409,8 +408,8 @@ namespace triagens {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore content-length
|
||||||
if (strcmp(key, "content-length") == 0) {
|
if (strcmp(key, "content-length") == 0) {
|
||||||
seenContentLength = true;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,6 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
|
||||||
TRI_shape_size_t e;
|
TRI_shape_size_t e;
|
||||||
TRI_shape_size_t pos;
|
TRI_shape_size_t pos;
|
||||||
TRI_shape_size_t* offsetsV;
|
TRI_shape_size_t* offsetsV;
|
||||||
TRI_shape_t const* shape;
|
|
||||||
void* const* ops;
|
void* const* ops;
|
||||||
|
|
||||||
if (accessor->_shape == NULL) {
|
if (accessor->_shape == NULL) {
|
||||||
|
@ -242,7 +241,6 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
|
||||||
}
|
}
|
||||||
|
|
||||||
ops = accessor->_code;
|
ops = accessor->_code;
|
||||||
shape = NULL;
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
TRI_shape_ac_bc_e op;
|
TRI_shape_ac_bc_e op;
|
||||||
|
@ -255,7 +253,7 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case TRI_SHAPE_AC_SHAPE_PTR:
|
case TRI_SHAPE_AC_SHAPE_PTR:
|
||||||
shape = *ops++;
|
ops++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TRI_SHAPE_AC_OFFSET_FIX:
|
case TRI_SHAPE_AC_OFFSET_FIX:
|
||||||
|
|
|
@ -1961,6 +1961,10 @@ bool TRI_AtHomogeneousListShapedJson (TRI_homogeneous_list_shape_t const* shape,
|
||||||
ptr = json->_data.data;
|
ptr = json->_data.data;
|
||||||
n = * (TRI_shape_length_list_t*) ptr;
|
n = * (TRI_shape_length_list_t*) ptr;
|
||||||
|
|
||||||
|
if (n <= position) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ptr += sizeof(TRI_shape_length_list_t);
|
ptr += sizeof(TRI_shape_length_list_t);
|
||||||
offsets = (TRI_shape_size_t*) ptr;
|
offsets = (TRI_shape_size_t*) ptr;
|
||||||
|
|
||||||
|
@ -1994,6 +1998,10 @@ bool TRI_AtHomogeneousSizedListShapedJson (TRI_homogeneous_sized_list_shape_t co
|
||||||
ptr = json->_data.data;
|
ptr = json->_data.data;
|
||||||
n = * (TRI_shape_length_list_t*) ptr;
|
n = * (TRI_shape_length_list_t*) ptr;
|
||||||
|
|
||||||
|
if (n <= position) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ptr += sizeof(TRI_shape_length_list_t);
|
ptr += sizeof(TRI_shape_length_list_t);
|
||||||
|
|
||||||
result->_sid = shape->_sidEntry;
|
result->_sid = shape->_sidEntry;
|
||||||
|
|
|
@ -508,7 +508,7 @@ HttpResponse* TRI_ExecuteActionVocBase (TRI_vocbase_t* vocbase,
|
||||||
v8::Handle<v8::Object> res = v8::Object::New();
|
v8::Handle<v8::Object> res = v8::Object::New();
|
||||||
v8::Handle<v8::Value> args[2] = { req, res };
|
v8::Handle<v8::Value> args[2] = { req, res };
|
||||||
|
|
||||||
v8::Handle<v8::Value> result = cb->_callback->Call(cb->_callback, 2, args);
|
cb->_callback->Call(cb->_callback, 2, args);
|
||||||
|
|
||||||
// convert the result
|
// convert the result
|
||||||
if (tryCatch.HasCaught()) {
|
if (tryCatch.HasCaught()) {
|
||||||
|
|
|
@ -2422,11 +2422,8 @@ static v8::Handle<v8::Value> JS_SaveEdgesCol (v8::Arguments const& argv) {
|
||||||
|
|
||||||
static v8::Handle<v8::Value> MapGetVocBase (v8::Local<v8::String> name,
|
static v8::Handle<v8::Value> MapGetVocBase (v8::Local<v8::String> name,
|
||||||
const v8::AccessorInfo& info) {
|
const v8::AccessorInfo& info) {
|
||||||
TRI_v8_global_t* v8g;
|
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
|
|
||||||
v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
|
|
||||||
|
|
||||||
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
|
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
|
||||||
|
|
||||||
if (vocbase == 0) {
|
if (vocbase == 0) {
|
||||||
|
@ -2522,11 +2519,8 @@ static v8::Handle<v8::Value> JS_CollectionsVocBase (v8::Arguments const& argv) {
|
||||||
|
|
||||||
static v8::Handle<v8::Value> MapGetEdges (v8::Local<v8::String> name,
|
static v8::Handle<v8::Value> MapGetEdges (v8::Local<v8::String> name,
|
||||||
const v8::AccessorInfo& info) {
|
const v8::AccessorInfo& info) {
|
||||||
TRI_v8_global_t* v8g;
|
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
|
|
||||||
v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
|
|
||||||
|
|
||||||
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
|
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
|
||||||
|
|
||||||
if (vocbase == 0) {
|
if (vocbase == 0) {
|
||||||
|
|
|
@ -905,7 +905,14 @@ bool TRI_SealDatafile (TRI_datafile_t* datafile) {
|
||||||
|
|
||||||
// truncate datafile
|
// truncate datafile
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ftruncate(datafile->_fd, datafile->_currentSize);
|
int res;
|
||||||
|
|
||||||
|
res = ftruncate(datafile->_fd, datafile->_currentSize);
|
||||||
|
|
||||||
|
if (res < 0) {
|
||||||
|
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||||
|
LOG_ERROR("cannot truncate datafile '%s': %s", datafile->_filename, TRI_last_error());
|
||||||
|
}
|
||||||
|
|
||||||
datafile->_isSealed = true;
|
datafile->_isSealed = true;
|
||||||
datafile->_state = TRI_DF_STATE_READ;
|
datafile->_state = TRI_DF_STATE_READ;
|
||||||
|
|
|
@ -253,10 +253,8 @@ static void CreateHeader (TRI_doc_collection_t* c,
|
||||||
size_t markerSize,
|
size_t markerSize,
|
||||||
TRI_doc_mptr_t* header,
|
TRI_doc_mptr_t* header,
|
||||||
void const* additional) {
|
void const* additional) {
|
||||||
TRI_sim_collection_t* collection;
|
|
||||||
TRI_doc_document_marker_t const* marker;
|
TRI_doc_document_marker_t const* marker;
|
||||||
|
|
||||||
collection = (TRI_sim_collection_t*) c;
|
|
||||||
marker = (TRI_doc_document_marker_t const*) m;
|
marker = (TRI_doc_document_marker_t const*) m;
|
||||||
|
|
||||||
header->_did = marker->_did;
|
header->_did = marker->_did;
|
||||||
|
@ -347,10 +345,8 @@ static void UpdateHeader (TRI_doc_collection_t* c,
|
||||||
size_t markerSize,
|
size_t markerSize,
|
||||||
TRI_doc_mptr_t const* header,
|
TRI_doc_mptr_t const* header,
|
||||||
TRI_doc_mptr_t* update) {
|
TRI_doc_mptr_t* update) {
|
||||||
TRI_sim_collection_t* collection;
|
|
||||||
TRI_doc_document_marker_t const* marker;
|
TRI_doc_document_marker_t const* marker;
|
||||||
|
|
||||||
collection = (TRI_sim_collection_t*) c;
|
|
||||||
marker = (TRI_doc_document_marker_t const*) m;
|
marker = (TRI_doc_document_marker_t const*) m;
|
||||||
*update = *header;
|
*update = *header;
|
||||||
|
|
||||||
|
@ -632,12 +628,10 @@ static void DebugDatafileInfoDocCollection (TRI_doc_collection_t* collection) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static void DebugHeaderSimCollection (TRI_sim_collection_t* collection) {
|
static void DebugHeaderSimCollection (TRI_sim_collection_t* collection) {
|
||||||
size_t n;
|
|
||||||
void** end;
|
void** end;
|
||||||
void** ptr;
|
void** ptr;
|
||||||
|
|
||||||
// update index
|
// update index
|
||||||
n = collection->_primaryIndex._nrUsed;
|
|
||||||
ptr = collection->_primaryIndex._table;
|
ptr = collection->_primaryIndex._table;
|
||||||
end = collection->_primaryIndex._table + collection->_primaryIndex._nrAlloc;
|
end = collection->_primaryIndex._table + collection->_primaryIndex._nrAlloc;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
static bool CheckSyncSimCollection (TRI_sim_collection_t* collection) {
|
static bool CheckSyncSimCollection (TRI_sim_collection_t* collection) {
|
||||||
TRI_collection_t* base;
|
TRI_collection_t* base;
|
||||||
TRI_datafile_t* journal;
|
TRI_datafile_t* journal;
|
||||||
TRI_voc_size_t nSynced;
|
|
||||||
TRI_voc_size_t nWritten;
|
TRI_voc_size_t nWritten;
|
||||||
bool ok;
|
bool ok;
|
||||||
bool worked;
|
bool worked;
|
||||||
|
@ -73,7 +72,6 @@ static bool CheckSyncSimCollection (TRI_sim_collection_t* collection) {
|
||||||
TRI_LockCondition(&collection->_journalsCondition);
|
TRI_LockCondition(&collection->_journalsCondition);
|
||||||
|
|
||||||
synced = journal->_synced;
|
synced = journal->_synced;
|
||||||
nSynced = journal->_nSynced;
|
|
||||||
|
|
||||||
written = journal->_written;
|
written = journal->_written;
|
||||||
nWritten = journal->_nWritten;
|
nWritten = journal->_nWritten;
|
||||||
|
@ -177,7 +175,6 @@ static bool CheckJournalSimCollection (TRI_sim_collection_t* collection) {
|
||||||
static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
|
static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
|
||||||
TRI_collection_t* base;
|
TRI_collection_t* base;
|
||||||
TRI_datafile_t* journal;
|
TRI_datafile_t* journal;
|
||||||
TRI_voc_size_t nSynced;
|
|
||||||
TRI_voc_size_t nWritten;
|
TRI_voc_size_t nWritten;
|
||||||
bool ok;
|
bool ok;
|
||||||
bool worked;
|
bool worked;
|
||||||
|
@ -203,7 +200,6 @@ static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
|
||||||
TRI_LockCondition(&collection->_journalsCondition);
|
TRI_LockCondition(&collection->_journalsCondition);
|
||||||
|
|
||||||
synced = journal->_synced;
|
synced = journal->_synced;
|
||||||
nSynced = journal->_nSynced;
|
|
||||||
|
|
||||||
written = journal->_written;
|
written = journal->_written;
|
||||||
nWritten = journal->_nWritten;
|
nWritten = journal->_nWritten;
|
||||||
|
@ -219,7 +215,6 @@ static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
journal->_synced = written;
|
journal->_synced = written;
|
||||||
journal->_nSynced = nWritten;
|
|
||||||
journal->_lastSynced = ti;
|
journal->_lastSynced = ti;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -72,10 +72,7 @@ dnl grep libev version number
|
||||||
dnl -----------------------------------------------------------------------------------------
|
dnl -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
if test "$cross_compiling" = yes; then :
|
if test "$cross_compiling" = yes; then :
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
AC_MSG_WARN([cannot compute V8 version number when cross compiling])
|
||||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
|
||||||
as_fn_error $? "cannot run test program while cross compiling
|
|
||||||
See \`config.log' for more details" "$LINENO" 5; }
|
|
||||||
else
|
else
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
@ -87,14 +84,19 @@ int main (int, char**) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_ACEOF
|
_ACEOF
|
||||||
AC_MSG_CHECKING([V8 version])
|
if test "x`type ac_fn_cxx_try_run`" = "xfunction"; then
|
||||||
if ac_fn_cxx_try_run "$LINENO" >conftest.output; then
|
AC_MSG_CHECKING([V8 version])
|
||||||
TRI_V8_VERSION=`cat conftest.output`
|
if ac_fn_cxx_try_run "$LINENO" >conftest.output; then
|
||||||
AC_MSG_RESULT([$TRI_V8_VERSION])
|
TRI_V8_VERSION=`cat conftest.output`
|
||||||
else
|
AC_MSG_RESULT([$TRI_V8_VERSION])
|
||||||
AC_MSG_RESULT([failed])
|
else
|
||||||
AC_MSG_ERROR([Please install the V8 library from Google])
|
AC_MSG_RESULT([failed])
|
||||||
fi
|
AC_MSG_ERROR([Please install the V8 library from Google])
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
TRI_V8_VERSION="V8"
|
||||||
|
AC_MSG_WARN([cannot compute V8 version number, old autoconf version])
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.beam conftest.$ac_ext conftest.output
|
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.beam conftest.$ac_ext conftest.output
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue