summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2016-06-16 13:32:31 +0200
committerGitHub <noreply@github.com>2016-06-16 13:32:31 +0200
commita46f6dcc87f07996fbd32ecc07b4253bd563b840 (patch)
treee55e45be370d77ae3b7db5fc25638ec8de261164
parentfa0c1fd54301974aba4024efe7baf320b9a0766e (diff)
parentdf4ffdb221f28eab6245ff5280b5c0f3acb4d96d (diff)
Merge pull request #10 from yahoo/balder/gc-some-defines
Balder/gc some defines
-rw-r--r--document/src/vespa/document/fieldvalue/serializablearray.cpp2
-rw-r--r--fastos/src/vespa/fastos/autoconf.h24
-rw-r--r--fastos/src/vespa/fastos/serversocket.cpp4
-rw-r--r--fastos/src/vespa/fastos/socket.cpp25
-rw-r--r--fastos/src/vespa/fastos/thread.h6
-rw-r--r--fastos/src/vespa/fastos/types.h300
-rw-r--r--fastos/src/vespa/fastos/unix_process.cpp1
-rw-r--r--fastos/src/vespa/fastos/version.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedstate.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedstates.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/predicate/document_features_store.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_index.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/simple_index.cpp3
-rw-r--r--vespalib/src/vespa/vespalib/util/atomic.h4
-rw-r--r--vespamalloc/src/tests/allocfree/allocfree.cpp8
-rw-r--r--vespamalloc/src/tests/allocfree/linklist.cpp10
21 files changed, 63 insertions, 369 deletions
diff --git a/document/src/vespa/document/fieldvalue/serializablearray.cpp b/document/src/vespa/document/fieldvalue/serializablearray.cpp
index a2d92100dde..6309338eb3b 100644
--- a/document/src/vespa/document/fieldvalue/serializablearray.cpp
+++ b/document/src/vespa/document/fieldvalue/serializablearray.cpp
@@ -191,7 +191,7 @@ SerializableArray::deCompress() // throw (DeserializeException)
if (unCompressed.getDataLen() != (size_t)_uncompressedLength) {
throw DeserializeException(
vespalib::make_string(
- "Did not decompress to the expected length: had %" PRIu64 ", wanted %" PRId32 ", got %" PRIu64,
+ "Did not decompress to the expected length: had %" PRIu64 ", wanted %d, got %" PRIu64,
_compSerData->getRemaining(), _uncompressedLength, unCompressed.getDataLen()),
VESPA_STRLOC);
}
diff --git a/fastos/src/vespa/fastos/autoconf.h b/fastos/src/vespa/fastos/autoconf.h
deleted file mode 100644
index f5093cdb153..00000000000
--- a/fastos/src/vespa/fastos/autoconf.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-/* Last autogenerated file */
-
-#pragma once
-
-#define FASTOS_64BIT_LONG 1
-#define FASTOS_HAVE_INTTYPES_H 1
-#define FASTOS_HAVE_INT64_T 1
-#define FASTOS_HAVE_UINT64_T 1
-#define FASTOS_HAVE_INT32_T 1
-#define FASTOS_HAVE_UINT32_T 1
-#define FASTOS_HAVE_INT16_T 1
-#define FASTOS_HAVE_UINT16_T 1
-#define FASTOS_HAVE_INT8_T 1
-#define FASTOS_HAVE_UINT8_T 1
-#define FASTOS_HAVE_INT64_T 1
-#define FASTOS_HAVE_SYS_TIME_H 1
-#define FASTOS_HAVE_SOCKLEN_T 1
-#define FASTOS_HAVE_HSTRERROR 1
-#define FASTOS_HAVE_GETPAGESIZE 1
-#define FASTOS_HAVE_GETOPT_LONG 1
-#define FASTOS_ICONV_NOT_CONST 1
-
-
diff --git a/fastos/src/vespa/fastos/serversocket.cpp b/fastos/src/vespa/fastos/serversocket.cpp
index eb4a737683a..15f52e83bc1 100644
--- a/fastos/src/vespa/fastos/serversocket.cpp
+++ b/fastos/src/vespa/fastos/serversocket.cpp
@@ -43,7 +43,7 @@ FastOS_SocketInterface *FastOS_ServerSocket::Accept()
int handlerSocketHandle;
struct sockaddr_storage clientAddress;
- FastOS_SocketLen clientAddressLength = sizeof(clientAddress);
+ socklen_t clientAddressLength = sizeof(clientAddress);
memset(&clientAddress, 0, sizeof(clientAddress));
@@ -71,7 +71,7 @@ FastOS_Socket *FastOS_ServerSocket::AcceptPlain()
int handlerSocketHandle;
struct sockaddr_storage clientAddress;
- FastOS_SocketLen clientAddressLength = sizeof(clientAddress);
+ socklen_t clientAddressLength = sizeof(clientAddress);
memset(&clientAddress, 0, sizeof(clientAddress));
diff --git a/fastos/src/vespa/fastos/socket.cpp b/fastos/src/vespa/fastos/socket.cpp
index c7ec605d524..4e30a9216ea 100644
--- a/fastos/src/vespa/fastos/socket.cpp
+++ b/fastos/src/vespa/fastos/socket.cpp
@@ -156,9 +156,7 @@ bool FastOS_SocketInterface::SetSoLinger( bool doLinger, int seconds )
lingerTime.l_linger = seconds;
if (CreateIfNoSocketYet()) {
- rc = (0 == setsockopt(_socketHandle, SOL_SOCKET, SO_LINGER,
- reinterpret_cast<FastOS_SockOptValP>(&lingerTime),
- sizeof(lingerTime)));
+ rc = (0 == setsockopt(_socketHandle, SOL_SOCKET, SO_LINGER, &lingerTime, sizeof(lingerTime)));
}
return rc;
@@ -171,9 +169,7 @@ FastOS_SocketInterface::SetNoDelay(bool noDelay)
int noDelayInt = noDelay ? 1 : 0;
if (CreateIfNoSocketYet()) {
- rc = (setsockopt(_socketHandle, IPPROTO_TCP, TCP_NODELAY,
- reinterpret_cast<FastOS_SockOptValP>(&noDelayInt),
- sizeof(noDelayInt)) == 0);
+ rc = (setsockopt(_socketHandle, IPPROTO_TCP, TCP_NODELAY, &noDelayInt, sizeof(noDelayInt)) == 0);
}
return rc;
}
@@ -187,10 +183,9 @@ int FastOS_SocketInterface::GetSoError ()
int lastError = FastOS_Socket::GetLastError();
int soError = 0;
- FastOS_SocketLen soErrorLen = sizeof(soError);
+ socklen_t soErrorLen = sizeof(soError);
- if (getsockopt(_socketHandle, SOL_SOCKET, SO_ERROR,
- reinterpret_cast<FastOS_SockOptValP>(&soError), &soErrorLen) != 0) {
+ if (getsockopt(_socketHandle, SOL_SOCKET, SO_ERROR, &soError, &soErrorLen) != 0) {
return lastError;
}
@@ -206,9 +201,7 @@ bool FastOS_SocketInterface::SetSoIntOpt (int option, int value)
bool rc=false;
if (CreateIfNoSocketYet()) {
- rc = (0 == setsockopt(_socketHandle, SOL_SOCKET, option,
- reinterpret_cast<FastOS_SockOptValP>(&value),
- sizeof(value)));
+ rc = (0 == setsockopt(_socketHandle, SOL_SOCKET, option, &value, sizeof(value)));
}
return rc;
@@ -219,11 +212,9 @@ bool FastOS_SocketInterface::GetSoIntOpt(int option, int &value)
bool rc=false;
if (CreateIfNoSocketYet()) {
- FastOS_SocketLen len = sizeof(value);
+ socklen_t len = sizeof(value);
- int retval = getsockopt(_socketHandle, SOL_SOCKET, option,
- reinterpret_cast<FastOS_SockOptValP>(&value),
- &len);
+ int retval = getsockopt(_socketHandle, SOL_SOCKET, option, &value, &len);
if (len != sizeof(value)) {
// FIX! - What about GetLastError() in this case?
@@ -262,7 +253,7 @@ int FastOS_SocketInterface::GetLocalPort ()
{
int result = -1;
sockaddr_storage addr;
- FastOS_SocketLen len = sizeof(addr);
+ socklen_t len = sizeof(addr);
if(getsockname(_socketHandle, reinterpret_cast<struct sockaddr *>(&addr), &len) == 0) {
if ((addr.ss_family == AF_INET) && (len == sizeof(sockaddr_in))) {
const sockaddr_in *my_addr = reinterpret_cast<const sockaddr_in *>(&addr);
diff --git a/fastos/src/vespa/fastos/thread.h b/fastos/src/vespa/fastos/thread.h
index db0baf7e3d9..a6ef359342a 100644
--- a/fastos/src/vespa/fastos/thread.h
+++ b/fastos/src/vespa/fastos/thread.h
@@ -15,6 +15,7 @@
#include <vespa/fastos/mutex.h>
#include <vespa/fastos/cond.h>
+typedef pthread_t FastOS_ThreadId;
class FastOS_Runnable;
class FastOS_ThreadInterface;
@@ -207,10 +208,9 @@ public:
// Operating system thread entry point
-FASTOS_EXTERNC
-{
+extern "C" {
void *FastOS_ThreadHook (void *arg);
-};
+}
/**
* This class controls each operating system thread.
diff --git a/fastos/src/vespa/fastos/types.h b/fastos/src/vespa/fastos/types.h
index 5e2b0e68f1d..72c7cbd7cf8 100644
--- a/fastos/src/vespa/fastos/types.h
+++ b/fastos/src/vespa/fastos/types.h
@@ -10,10 +10,6 @@
#pragma once
-#ifndef FASTOS_AUTOCONF /* Are we in the autoconf stage? */
-#include <vespa/fastos/autoconf.h>
-#endif
-
/**
* @def __STDC_LIMIT_MACROS
* According to C99, C++ implementations will only define UINT64_MAX
@@ -23,10 +19,13 @@
* below, we define the behaviour here.
*/
#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
+ #define __STDC_LIMIT_MACROS 1
#endif
#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS 1
+ #define __STDC_CONSTANT_MACROS 1
+#endif
+#ifndef __STDC_FORMAT_MACROS
+ #define __STDC_FORMAT_MACROS
#endif
#include <assert.h>
@@ -60,10 +59,6 @@
#include <sys/socket.h>
-#ifndef SHUT_RDWR
-#define SHUT_RDWR 2
-#endif
-
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -74,18 +69,6 @@
#include <sys/time.h>
#include <time.h>
-#define FASTOS_EMFILE_VERIFIED (-1)
-#ifdef EMFILE
-#undef FASTOS_EMFILE_VERIFIED
-#define FASTOS_EMFILE_VERIFIED EMFILE
-#endif
-
-#define FASTOS_ENFILE_VERIFIED (-1)
-#ifdef ENFILE
-#undef FASTOS_ENFILE_VERIFIED
-#define FASTOS_ENFILE_VERIFIED ENFILE
-#endif
-
#ifndef __USE_GNU
#define __USE_GNU /* for O_DIRECT define */
#define __TYPES_H_DIRECTIO_GNU
@@ -97,17 +80,6 @@
#undef __USE_GNU /* for O_DIRECT define */
#endif
-typedef caddr_t FastOS_SockOptValP;
-
-#ifndef FASTOS_AUTOCONF
-#if defined(FASTOS_HAVE_SOCKLEN_T)
-typedef socklen_t FastOS_SocketLen;
-#else
-typedef int FastOS_SocketLen;
-#endif
-#endif /* FASTOS_AUTOCONF */
-
-
#include <stdio.h>
#include <stdlib.h>
@@ -116,264 +88,26 @@ typedef int FastOS_SocketLen;
#include <sys/stat.h>
#include <limits.h>
#include <float.h>
-
#include <netinet/tcp.h>
-
-#define FASTOS_PREFIX(a) FastOS_##a
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef FASTOS_AUTOCONF
-
#include <inttypes.h>
-
-/**
- * On UNIX we use the [long long] type for 64bit integers.
- */
-#ifndef FASTOS_HAVE_INT64_T
-typedef long long int64_t;
-#endif
-
-#ifndef FASTOS_HAVE_UINT64_T
-typedef unsigned long long uint64_t;
-#endif
-
-#ifndef FASTOS_HAVE_INT32_T
-typedef int int32_t;
-#endif
-
-#ifndef FASTOS_HAVE_UINT32_T
-typedef unsigned int uint32_t;
-#endif
-
-#ifndef FASTOS_HAVE_INT16_T
-typedef short int int16_t;
-#endif
-
-#ifndef FASTOS_HAVE_UINT16_T
-typedef unsigned short int uint16_t;
-#endif
-
-#ifndef FASTOS_HAVE_INT8_T
-typedef signed char int8_t;
-#endif
-
-#ifndef FASTOS_HAVE_UINT8_T
-typedef unsigned char uint8_t;
-#endif
-
-#ifndef INT64_C
-#ifdef FASTOS_64BIT_LONG
-#define INT64_C(c) c ## L
-#else
-# warning "You need to define INT64_C or find a header that defines this macro"
-#endif
-#endif /* INT64_C */
-
-#ifndef UINT64_C
-#ifdef FASTOS_64BIT_LONG
-#define UINT64_C(c) c ## UL
-#else
-#define UINT64_C(c) c ## ULL
-#endif
-#endif /* UINT64_C */
-
-
-#ifndef INT8_MIN
-#define INT8_MIN (-128)
-#endif
-
-#ifndef INT16_MIN
-#define INT16_MIN (-32767-1)
-#endif
-
-#ifndef INT32_MIN
-#define INT32_MIN (-2147483647-1)
-#endif
-
-#ifndef INT64_MIN
-#define INT64_MIN (-INT64_C(9223372036854775807)-1)
-#endif
-
-#ifndef INT8_MAX
-#define INT8_MAX (127)
-#endif
-
-#ifndef INT16_MAX
-#define INT16_MAX (32767)
-#endif
-
-#ifndef INT32_MAX
-#define INT32_MAX (2147483647)
-#endif
-
-#ifndef INT64_MAX
-#define INT64_MAX (INT64_C(9223372036854775807))
-#endif
-
-#ifndef UINT8_MAX
-#define UINT8_MAX (255U)
-#endif
-
-#ifndef UINT16_MAX
-#define UINT16_MAX (65535U)
-#endif
-
-#ifndef UINT32_MAX
-#define UINT32_MAX (4294967295U)
-#endif
-
-#ifndef UINT64_MAX
-#define UINT64_MAX (UINT64_C(18446744073709551615))
-#endif
-
#include <getopt.h>
-#endif /* FASTOS_AUTOCONF */
-
-#ifndef SHUT_WR
-#define SHUT_WR 1
-#endif
-
-/* 64bit printf specifiers */
-#ifdef FASTOS_64BIT_LONG
-#ifndef PRId64
-#define PRId64 "ld"
-#endif
-
-#ifndef PRIu64
-#define PRIu64 "lu"
-#endif
-
-#ifndef PRIo64
-#define PRIo64 "lo"
-#endif
-
-#ifndef PRIx64
-#define PRIx64 "lx"
-#endif
-
-#ifndef PRIX64
-#define PRIX64 "lX"
-#endif
-
-#ifndef SCNd64
-#define SCNd64 "ld"
-#endif
-
-#ifndef SCNu64
-#define SCNu64 "lu"
-#endif
-
-#ifndef SCNo64
-#define SCNo64 "lo"
-#endif
-
-#ifndef SCNx64
-#define SCNx64 "lx"
-#endif
-
-#ifndef SCNX64
-#define SCNX64 "lX"
-#endif
-
-#else /* ! FASTOS_64BIT_LONG */
-
-#ifndef PRId64
-#define PRId64 "lld"
-#endif
-
-#ifndef PRIu64
-#define PRIu64 "llu"
-#endif
-
-#ifndef PRIo64
-#define PRIo64 "llo"
-#endif
-
-#ifndef PRIx64
-#define PRIx64 "llx"
-#endif
-
-#ifndef PRIX64
-#define PRIX64 "llX"
-#endif
-
-#ifndef SCNd64
-#define SCNd64 "lld"
-#endif
-
-#ifndef SCNu64
-#define SCNu64 "llu"
-#endif
+#if (__WORDSIZE == 64)
-#ifndef SCNo64
-#define SCNo64 "llo"
-#endif
-
-#ifndef SCNx64
-#define SCNx64 "llx"
-#endif
-
-#ifndef SCNX64
-#define SCNX64 "llX"
-#endif
-
-#endif /* FASTOS_64BIT_LONG */
-
-#ifndef PRId32
-#define PRId32 "d"
-#endif
-
-#ifndef PRIu32
-#define PRIu32 "u"
-#endif
-
-#ifndef PRIo32
-#define PRIo32 "o"
-#endif
-
-#ifndef PRIx32
-#define PRIx32 "x"
-#endif
-
-#ifndef PRIX32
-#define PRIX32 "X"
-#endif
-
-#ifndef SCNd32
-#define SCNd32 "d"
-#endif
-
-#ifndef SCNu32
-#define SCNu32 "u"
-#endif
-
-#ifndef SCNo32
-#define SCNo32 "o"
+#else
+ #error "Only LP 64 environments are supported."
#endif
-#ifndef SCNx32
-#define SCNx32 "x"
-#endif
+#define FASTOS_PREFIX(a) FastOS_##a
-#ifndef SCNX32
-#define SCNX32 "X"
+#define FASTOS_EMFILE_VERIFIED (-1)
+#ifdef EMFILE
+#undef FASTOS_EMFILE_VERIFIED
+#define FASTOS_EMFILE_VERIFIED EMFILE
#endif
-
-typedef pthread_t FastOS_ThreadId;
-
-#define FASTOS_EXTERNC extern "C"
-#define FASTOS_KLASS class
-
-#define FASTOS_IPCMSGBUF_MAXSIZE (200)
-
-#if defined(FASTOS_ICONV_NOT_CONST)
-#define LIBICONV_CONST
-#else
-#define LIBICONV_CONST const
+#define FASTOS_ENFILE_VERIFIED (-1)
+#ifdef ENFILE
+#undef FASTOS_ENFILE_VERIFIED
+#define FASTOS_ENFILE_VERIFIED ENFILE
#endif
-
diff --git a/fastos/src/vespa/fastos/unix_process.cpp b/fastos/src/vespa/fastos/unix_process.cpp
index 96074cd07b0..394b41eb986 100644
--- a/fastos/src/vespa/fastos/unix_process.cpp
+++ b/fastos/src/vespa/fastos/unix_process.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/autoconf.h>
#include <vespa/fastos/process.h>
#include <vespa/fastos/app.h>
#include <vespa/fastos/unix_ipc.h>
diff --git a/fastos/src/vespa/fastos/version.h b/fastos/src/vespa/fastos/version.h
deleted file mode 100644
index 18c0a64184a..00000000000
--- a/fastos/src/vespa/fastos/version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#define FASTOS_VERSIONSTRING "fastos 1.9.1 (current)"
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstate.cpp b/searchcore/src/vespa/searchcore/proton/server/feedstate.cpp
index 275b8006be2..6cd4df5c571 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedstate.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/feedstate.cpp
@@ -1,11 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include <vespa/log/log.h>
-LOG_SETUP(".feedstate");
#include <vespa/fastos/fastos.h>
-
-#include "feedstate.h"
#include <vespa/document/bucket/bucketid.h>
+#include "feedstate.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".feedstate");
using document::BucketId;
using vespalib::IllegalStateException;
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
index d20fe9f093a..6ded3dd7879 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp
@@ -1,9 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.server.feedstates");
#include <vespa/fastos/fastos.h>
-
#include "feedstates.h"
#include "feedconfigstore.h"
#include "ireplaypackethandler.h"
@@ -11,6 +7,8 @@ LOG_SETUP(".proton.server.feedstates");
#include <vespa/searchcore/proton/common/eventlogger.h>
#include <vespa/vespalib/util/closuretask.h>
#include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".proton.server.feedstates");
using search::transactionlog::Packet;
using search::transactionlog::RPC;
diff --git a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp
index db5f1611d0a..5e5e1617c10 100644
--- a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".document_features_store");
#include <vespa/fastos/fastos.h>
#include "document_features_store.h"
@@ -13,6 +11,8 @@ LOG_SETUP(".document_features_store");
#include <unordered_map>
#include <vector>
+#include <vespa/log/log.h>
+LOG_SETUP(".document_features_store");
using search::btree::BTreeNoLeafData;
using search::btree::EntryRef;
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
index 5ca00d1863f..81533c36951 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_index");
#include <vespa/fastos/fastos.h>
#include "predicate_index.h"
@@ -10,6 +8,8 @@ LOG_SETUP(".predicate_index");
#include <vespa/searchlib/btree/entryref.h>
#include "predicate_hash.h"
#include <algorithm>
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_index");
using search::btree::EntryRef;
using vespalib::MMapDataBuffer;
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp
index b4204010eec..57b260d7a15 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_interval_store.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_interval_store");
#include <vespa/fastos/fastos.h>
#include "predicate_interval_store.h"
@@ -10,6 +8,8 @@ LOG_SETUP(".predicate_interval_store");
#include <vespa/searchlib/btree/bufferstate.h>
#include <vespa/searchlib/btree/datastore.hpp>
#include <vespa/searchlib/btree/entryref.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_interval_store");
using search::btree::BufferState;
using search::btree::EntryRef;
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp
index bb7e26f168f..16052ec41d0 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_range_expander.cpp
@@ -1,10 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_range_expander");
#include <vespa/fastos/fastos.h>
#include "predicate_range_expander.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_range_expander");
namespace search {
namespace predicate {
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp
index 21878d5ca9e..e35928e3edc 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_tree_analyzer.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_tree_analyzer");
#include <vespa/fastos/fastos.h>
#include "predicate_tree_analyzer.h"
@@ -9,6 +7,8 @@ LOG_SETUP(".predicate_tree_analyzer");
#include <algorithm>
#include <iostream>
#include <cmath>
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_tree_analyzer");
using document::Predicate;
using std::map;
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp
index c97f1f73848..84df5adc9d4 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_tree_annotator");
#include <vespa/fastos/fastos.h>
#include "predicate_tree_annotator.h"
@@ -16,6 +14,9 @@ LOG_SETUP(".predicate_tree_annotator");
#include <map>
#include <string>
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_tree_annotator");
+
using document::Predicate;
using std::map;
using std::string;
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp
index ca08d65b82f..4ca88d5b4b8 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_zero_constraint_posting_list.cpp
@@ -1,10 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".predicate_zero_constraint_posting_list");
#include <vespa/fastos/fastos.h>
#include "predicate_zero_constraint_posting_list.h"
+#include <vespa/log/log.h>
+LOG_SETUP(".predicate_zero_constraint_posting_list");
namespace search {
namespace predicate {
diff --git a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
index 829423bdc86..98bf03c1e7c 100644
--- a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
@@ -1,7 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
+#include <vespa/fastos/fastos.h>
#include "simple_index.hpp"
+#include <vespa/log/log.h>
LOG_SETUP(".searchlib.simple_index");
namespace search {
diff --git a/vespalib/src/vespa/vespalib/util/atomic.h b/vespalib/src/vespa/vespalib/util/atomic.h
index 77f1f7554ae..c9259671cae 100644
--- a/vespalib/src/vespa/vespalib/util/atomic.h
+++ b/vespalib/src/vespa/vespalib/util/atomic.h
@@ -67,7 +67,7 @@ public:
static inline int64_t postDec(volatile int64_t *data);
static inline bool cmpSwap(volatile int64_t * dest, int64_t newVal, int64_t oldVal);
-#if defined(FASTOS_64BIT_LONG)
+#if defined(__x86_64__)
static inline bool cmpSwap(volatile long long * dest, long long newVal, long long oldVal);
static inline bool cmpSwap(volatile unsigned long long * dest, unsigned long long newVal, unsigned long long oldVal);
#endif
@@ -75,8 +75,6 @@ public:
#if defined(__x86_64__)
#define VESPALIB_ATOMIC_TAGGEDPTR_ALIGNMENT __attribute__ ((aligned (16)))
-#elif defined(__i386__)
- #define VESPALIB_ATOMIC_TAGGEDPTR_ALIGNMENT
#else
#error "VESPALIB_ATOMIC_TAGGEDPTR_ALIGNMENT can not be defined."
#endif
diff --git a/vespamalloc/src/tests/allocfree/allocfree.cpp b/vespamalloc/src/tests/allocfree/allocfree.cpp
index 0f7b4d53c6f..f1ecb74754b 100644
--- a/vespamalloc/src/tests/allocfree/allocfree.cpp
+++ b/vespamalloc/src/tests/allocfree/allocfree.cpp
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
#include <vespa/fastos/fastos.h>
+#include <vespa/log/log.h>
#include <vespa/vespalib/testkit/testapp.h>
#include "producerconsumer.h"
#include <map>
@@ -107,9 +107,9 @@ int Test::Main() {
EXPECT_EQUAL(numFreeOperations, numMallocOperations);
const size_t numCrossThreadMallocFreeOperations(numMallocOperations);
- fprintf(stderr, "Did %" PRIu64 " Cross thread malloc/free operations\n", numCrossThreadMallocFreeOperations);
- fprintf(stderr, "Did %" PRIu64 " Same thread malloc/free operations\n", numSameThreadMallocFreeOperations);
- fprintf(stderr, "Did %" PRIu64 " Total operations\n", numCrossThreadMallocFreeOperations + numSameThreadMallocFreeOperations);
+ fprintf(stderr, "Did %lu Cross thread malloc/free operations\n", numCrossThreadMallocFreeOperations);
+ fprintf(stderr, "Did %lu Same thread malloc/free operations\n", numSameThreadMallocFreeOperations);
+ fprintf(stderr, "Did %lu Total operations\n", numCrossThreadMallocFreeOperations + numSameThreadMallocFreeOperations);
TEST_DONE();
}
diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp
index 5ad31d481f9..39cd237420b 100644
--- a/vespamalloc/src/tests/allocfree/linklist.cpp
+++ b/vespamalloc/src/tests/allocfree/linklist.cpp
@@ -1,10 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/testkit/testapp.h>
#include "producerconsumer.h"
#include <vespamalloc/malloc/allocchunk.h>
#include <vespamalloc/util/callstack.h>
+#include <vespa/log/log.h>
using vespalib::Consumer;
using vespalib::Producer;
@@ -169,13 +169,13 @@ int Test::Main() {
FastOS_Thread::Sleep(1000);
}
pool.Close();
- fprintf(stderr, "Did (%" PRIu64 " + %" PRIu64 ") = %" PRIu64 " linkIn operations\n",
+ fprintf(stderr, "Did (%lu + %lu) = %lu linkIn operations\n",
c1.operations(), c2.operations(), c1.operations() + c2.operations());
- fprintf(stderr, "Did (%" PRIu64 " + %" PRIu64 ") = %" PRIu64 " linkOut operations\n",
+ fprintf(stderr, "Did (%lu + %lu) = %lu linkOut operations\n",
p1.operations(), p2.operations(), p1.operations() + p2.operations());
- fprintf(stderr, "Did (%" PRIu64 " + %" PRIu64 ") = %" PRIu64 " linkInOut operations\n",
+ fprintf(stderr, "Did (%lu + %lu) = %lu linkInOut operations\n",
pc1.operationsConsumed(), pc2.operationsConsumed(), pc1.operationsConsumed() + pc2.operationsConsumed());
- fprintf(stderr, "Did %" PRIu64 " Total operations\n",
+ fprintf(stderr, "Did %lu Total operations\n",
c1.operations() + c2.operations() + p1.operations() + p2.operations() + pc1.operationsConsumed() + pc2.operationsConsumed());
fprintf(stderr, "Start verifying result 2.\n");
for (size_t i=0; i < NumBlocks; i++) {