Created
March 15, 2013 04:56
-
-
Save dcolish/5167591 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/xapian-core/api/registry.cc b/xapian-core/api/registry.cc | |
index c6a0223..1241629 100644 | |
--- a/xapian-core/api/registry.cc | |
+++ b/xapian-core/api/registry.cc | |
@@ -165,7 +165,7 @@ Registry::register_lat_long_metric(const Xapian::LatLongMetric &metric) | |
const Xapian::LatLongMetric * | |
Registry::get_lat_long_metric(const string & name) const | |
{ | |
- LOGCALL(API, const Xapian::MatchSpy *, "Xapian::Registry::get_lat_long_metric", name); | |
+ LOGCALL(API, const Xapian::LatLongMetric *, "Xapian::Registry::get_lat_long_metric", name); | |
RETURN(lookup_object(internal->lat_long_metrics, name)); | |
} | |
@@ -173,6 +173,7 @@ Registry::Internal::Internal() | |
: Xapian::Internal::intrusive_base(), | |
wtschemes(), | |
postingsources(), | |
+ matchspies(), | |
lat_long_metrics() | |
{ | |
add_defaults(); | |
diff --git a/xapian-core/backends/brass/brass_table.cc b/xapian-core/backends/brass/brass_table.cc | |
index 15a949e..4891bc7 100644 | |
--- a/xapian-core/backends/brass/brass_table.cc | |
+++ b/xapian-core/backends/brass/brass_table.cc | |
@@ -451,7 +451,7 @@ BrassTable::alter() | |
int | |
BrassTable::find_in_block(const byte * p, Key key, bool leaf, int c) | |
{ | |
- LOGCALL_STATIC(DB, int, "BrassTable::find_in_block", (void*)p | (const void *)key.get_address() | leaf | c); | |
+ LOGCALL_STATIC(DB, int, "BrassTable::find_in_block", (const void*)p | (const void *)key.get_address() | leaf | c); | |
int i = DIR_START; | |
if (leaf) i -= D2; | |
int j = DIR_END(p); | |
diff --git a/xapian-core/backends/chert/chert_table.cc b/xapian-core/backends/chert/chert_table.cc | |
index cb34127..768abde 100644 | |
--- a/xapian-core/backends/chert/chert_table.cc | |
+++ b/xapian-core/backends/chert/chert_table.cc | |
@@ -452,7 +452,7 @@ ChertTable::alter() | |
int | |
ChertTable::find_in_block(const byte * p, Key key, bool leaf, int c) | |
{ | |
- LOGCALL_STATIC(DB, int, "ChertTable::find_in_block", (void*)p | (const void *)key.get_address() | leaf | c); | |
+ LOGCALL_STATIC(DB, int, "ChertTable::find_in_block", (const void*)p | (const void *)key.get_address() | leaf | c); | |
int i = DIR_START; | |
if (leaf) i -= D2; | |
int j = DIR_END(p); | |
diff --git a/xapian-core/common/debuglog.h b/xapian-core/common/debuglog.h | |
index 02292e2..1e7d954 100644 | |
--- a/xapian-core/common/debuglog.h | |
+++ b/xapian-core/common/debuglog.h | |
@@ -204,6 +204,22 @@ class DebugLogFunc { | |
} | |
} | |
+ /// Constructor called when logging for a "normal" method or function without parameters | |
+ DebugLogFunc(const void * this_ptr_, debuglog_categories category_, | |
+ const char * return_type, const char * func_name) | |
+ : this_ptr(this_ptr_), category(category_), | |
+ uncaught_exception(std::uncaught_exception()) | |
+ { | |
+ if (is_category_wanted()) { | |
+ func.assign(return_type); | |
+ func += ' '; | |
+ func += func_name; | |
+ func += "()"; | |
+ LOGLINE_ALWAYS_(category, '[' << this_ptr << "] " << func); | |
+ xapian_debuglogger_.indent(); | |
+ } | |
+ } | |
+ | |
/// Log the returned value. | |
void log_return_value(const std::string & return_value) { | |
xapian_debuglogger_.outdent(); | |
@@ -351,6 +367,12 @@ class DebugLogFuncVoid { | |
} | |
}; | |
+ | |
+/// Log a call to a parameterless method returning non-void. | |
+#define LOGCALL0(CATEGORY, TYPE, FUNC) \ | |
+ typedef TYPE xapian_logcall_return_type_; \ | |
+ DebugLogFunc xapian_logcall_(static_cast<const void *>(this), DEBUGLOG_CATEGORY_##CATEGORY, #TYPE, FUNC) | |
+ | |
/// Log a call to a method returning non-void. | |
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS) \ | |
typedef TYPE xapian_logcall_return_type_; \ | |
diff --git a/xapian-core/common/pretty.h b/xapian-core/common/pretty.h | |
index 92fbd6c..fff0ea3 100644 | |
--- a/xapian-core/common/pretty.h | |
+++ b/xapian-core/common/pretty.h | |
@@ -45,6 +45,7 @@ struct Literal { | |
const char * _lit; | |
Literal(const char * lit) : _lit(lit) { } | |
Literal(const std::string & s) : _lit(s.c_str()) { } | |
+ | |
}; | |
} | |
@@ -296,6 +297,7 @@ XAPIAN_PRETTY_AS_CLASSNAME(Xapian::ExpandDecider) | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::MatchDecider) | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::Registry) | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::Weight) | |
+XAPIAN_PRETTY_AS_CLASSNAME(Xapian::LatLongMetric) | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::Internal::AndContext); | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::Internal::ExpandStats); | |
XAPIAN_PRETTY_AS_CLASSNAME(Xapian::Internal::ExpandWeight); | |
@@ -310,7 +312,7 @@ XAPIAN_PRETTY_AS_CLASSNAME(ChertTable); | |
template<class S> | |
inline PrettyOStream<S> & | |
operator<<(PrettyOStream<S> &ps, const Xapian::Weight *p) { | |
- ps.os << "(Xapian:Weight*)" << (void*)p; | |
+ ps.os << "(Xapian:Weight*)" << (const void*)p; | |
return ps; | |
} | |
@@ -328,7 +330,7 @@ operator<<(PrettyOStream<S> &ps, const RemoteConnection &) { | |
template<class S> | |
inline PrettyOStream<S> & | |
operator<<(PrettyOStream<S> &ps, const Xapian::Database::Internal *p) { | |
- ps.os << "(Database::Internal*)" << (void*)p; | |
+ ps.os << "(Database::Internal*)" << (const void*)p; | |
return ps; | |
} | |
diff --git a/xapian-core/include/xapian/query.h b/xapian-core/include/xapian/query.h | |
index 0bd75bf..ec9e555 100644 | |
--- a/xapian-core/include/xapian/query.h | |
+++ b/xapian-core/include/xapian/query.h | |
@@ -272,11 +272,11 @@ operator&(const Query & a, const Query & b) | |
return Query(Query::OP_AND, a, b); | |
} | |
-inline const Query | |
-operator|(const Query & a, const Query & b) | |
-{ | |
- return Query(Query::OP_OR, a, b); | |
-} | |
+/* inline const Query */ | |
+/* operator|(const Query & a, const Query & b) */ | |
+/* { */ | |
+/* return Query(Query::OP_OR, a, b); */ | |
+/* } */ | |
inline const Query | |
operator^(const Query & a, const Query & b) | |
diff --git a/xapian-core/matcher/multiandpostlist.cc b/xapian-core/matcher/multiandpostlist.cc | |
index ad49128..0f12284 100644 | |
--- a/xapian-core/matcher/multiandpostlist.cc | |
+++ b/xapian-core/matcher/multiandpostlist.cc | |
@@ -89,6 +89,7 @@ MultiAndPostList::get_termfreq_max() const | |
Xapian::doccount | |
MultiAndPostList::get_termfreq_est() const | |
{ | |
+ LOGCALL0(MATCH, Xapian::doccount, "MultiAndPostList::get_termfreq_est"); | |
if (rare(db_size == 0)) | |
RETURN(0); | |
// We calculate the estimate assuming independence. With this assumption, | |
diff --git a/xapian-core/matcher/multixorpostlist.cc b/xapian-core/matcher/multixorpostlist.cc | |
index 92fe736..8c8c5bd 100644 | |
--- a/xapian-core/matcher/multixorpostlist.cc | |
+++ b/xapian-core/matcher/multixorpostlist.cc | |
@@ -82,6 +82,7 @@ MultiXorPostList::get_termfreq_max() const | |
Xapian::doccount | |
MultiXorPostList::get_termfreq_est() const | |
{ | |
+ LOGCALL0(MATCH, Xapian::doccount, "MultiXorPostList::get_termfreq_est"); | |
if (rare(db_size == 0)) | |
RETURN(0); | |
// We calculate the estimate assuming independence. The simplest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment