1
0
Fork 0

old autoconf check, fixed warnings

This commit is contained in:
Frank Celler 2012-01-11 16:34:23 +01:00
parent 7d09436be1
commit 56b18fc2f8
10 changed files with 39 additions and 37 deletions

View File

@ -146,10 +146,15 @@ unsigned int TRI_ProcessSize (TRI_pid_t pid) {
if (fd > 0) {
char str[1024];
process_state_t st;
size_t n;
read(fd, str, 1024);
n = read(fd, str, 1024);
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,
(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,

View File

@ -398,7 +398,6 @@ namespace triagens {
basics::Dictionary<char const*>::KeyValue const* begin;
basics::Dictionary<char const*>::KeyValue const* end;
bool seenContentLength = false;
bool seenTransferEncoding = false;
string transferEncoding;
@ -409,8 +408,8 @@ namespace triagens {
continue;
}
// ignore content-length
if (strcmp(key, "content-length") == 0) {
seenContentLength = true;
continue;
}

View File

@ -234,7 +234,6 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
TRI_shape_size_t e;
TRI_shape_size_t pos;
TRI_shape_size_t* offsetsV;
TRI_shape_t const* shape;
void* const* ops;
if (accessor->_shape == NULL) {
@ -242,7 +241,6 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
}
ops = accessor->_code;
shape = NULL;
while (true) {
TRI_shape_ac_bc_e op;
@ -255,7 +253,7 @@ static bool ExecuteBytecodeShapeAccessor (TRI_shape_access_t const* accessor,
return true;
case TRI_SHAPE_AC_SHAPE_PTR:
shape = *ops++;
ops++;
break;
case TRI_SHAPE_AC_OFFSET_FIX:

View File

@ -1961,6 +1961,10 @@ bool TRI_AtHomogeneousListShapedJson (TRI_homogeneous_list_shape_t const* shape,
ptr = json->_data.data;
n = * (TRI_shape_length_list_t*) ptr;
if (n <= position) {
return false;
}
ptr += sizeof(TRI_shape_length_list_t);
offsets = (TRI_shape_size_t*) ptr;
@ -1994,6 +1998,10 @@ bool TRI_AtHomogeneousSizedListShapedJson (TRI_homogeneous_sized_list_shape_t co
ptr = json->_data.data;
n = * (TRI_shape_length_list_t*) ptr;
if (n <= position) {
return false;
}
ptr += sizeof(TRI_shape_length_list_t);
result->_sid = shape->_sidEntry;

View File

@ -508,7 +508,7 @@ HttpResponse* TRI_ExecuteActionVocBase (TRI_vocbase_t* vocbase,
v8::Handle<v8::Object> res = v8::Object::New();
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
if (tryCatch.HasCaught()) {

View File

@ -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,
const v8::AccessorInfo& info) {
TRI_v8_global_t* v8g;
v8::HandleScope scope;
v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
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,
const v8::AccessorInfo& info) {
TRI_v8_global_t* v8g;
v8::HandleScope scope;
v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
TRI_vocbase_t* vocbase = UnwrapClass<TRI_vocbase_t>(info.Holder());
if (vocbase == 0) {

View File

@ -905,7 +905,14 @@ bool TRI_SealDatafile (TRI_datafile_t* datafile) {
// truncate datafile
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->_state = TRI_DF_STATE_READ;

View File

@ -253,10 +253,8 @@ static void CreateHeader (TRI_doc_collection_t* c,
size_t markerSize,
TRI_doc_mptr_t* header,
void const* additional) {
TRI_sim_collection_t* collection;
TRI_doc_document_marker_t const* marker;
collection = (TRI_sim_collection_t*) c;
marker = (TRI_doc_document_marker_t const*) m;
header->_did = marker->_did;
@ -347,10 +345,8 @@ static void UpdateHeader (TRI_doc_collection_t* c,
size_t markerSize,
TRI_doc_mptr_t const* header,
TRI_doc_mptr_t* update) {
TRI_sim_collection_t* collection;
TRI_doc_document_marker_t const* marker;
collection = (TRI_sim_collection_t*) c;
marker = (TRI_doc_document_marker_t const*) m;
*update = *header;
@ -632,12 +628,10 @@ static void DebugDatafileInfoDocCollection (TRI_doc_collection_t* collection) {
////////////////////////////////////////////////////////////////////////////////
static void DebugHeaderSimCollection (TRI_sim_collection_t* collection) {
size_t n;
void** end;
void** ptr;
// update index
n = collection->_primaryIndex._nrUsed;
ptr = collection->_primaryIndex._table;
end = collection->_primaryIndex._table + collection->_primaryIndex._nrAlloc;

View File

@ -47,7 +47,6 @@
static bool CheckSyncSimCollection (TRI_sim_collection_t* collection) {
TRI_collection_t* base;
TRI_datafile_t* journal;
TRI_voc_size_t nSynced;
TRI_voc_size_t nWritten;
bool ok;
bool worked;
@ -73,7 +72,6 @@ static bool CheckSyncSimCollection (TRI_sim_collection_t* collection) {
TRI_LockCondition(&collection->_journalsCondition);
synced = journal->_synced;
nSynced = journal->_nSynced;
written = journal->_written;
nWritten = journal->_nWritten;
@ -177,7 +175,6 @@ static bool CheckJournalSimCollection (TRI_sim_collection_t* collection) {
static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
TRI_collection_t* base;
TRI_datafile_t* journal;
TRI_voc_size_t nSynced;
TRI_voc_size_t nWritten;
bool ok;
bool worked;
@ -203,7 +200,6 @@ static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
TRI_LockCondition(&collection->_journalsCondition);
synced = journal->_synced;
nSynced = journal->_nSynced;
written = journal->_written;
nWritten = journal->_nWritten;
@ -219,7 +215,6 @@ static bool CheckSyncCompactorSimCollection (TRI_sim_collection_t* collection) {
if (ok) {
journal->_synced = written;
journal->_nSynced = nWritten;
journal->_lastSynced = ti;
}
else {

View File

@ -72,10 +72,7 @@ dnl grep libev version number
dnl -----------------------------------------------------------------------------------------
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$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; }
AC_MSG_WARN([cannot compute V8 version number when cross compiling])
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -87,14 +84,19 @@ int main (int, char**) {
}
_ACEOF
AC_MSG_CHECKING([V8 version])
if ac_fn_cxx_try_run "$LINENO" >conftest.output; then
TRI_V8_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_V8_VERSION])
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([Please install the V8 library from Google])
fi
if test "x`type ac_fn_cxx_try_run`" = "xfunction"; then
AC_MSG_CHECKING([V8 version])
if ac_fn_cxx_try_run "$LINENO" >conftest.output; then
TRI_V8_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_V8_VERSION])
else
AC_MSG_RESULT([failed])
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
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.beam conftest.$ac_ext conftest.output