3590 John David Duncan 2011-10-02
one more warning
modified:
storage/ndb/memcache/unit/test_workqueue.c
3589 John David Duncan 2011-10-02
another stab at warnings / __func__
modified:
storage/ndb/memcache/CMakeLists.txt
storage/ndb/memcache/include/debug.h
storage/ndb/memcache/include/ndbmemcache_config.in
3588 John David Duncan 2011-10-02
virtual destructor for Scheduler
modified:
storage/ndb/memcache/include/Scheduler.h
3587 John David Duncan 2011-10-01
edit ifdef
modified:
storage/ndb/memcache/include/debug.h
=== modified file 'storage/ndb/memcache/CMakeLists.txt'
--- a/storage/ndb/memcache/CMakeLists.txt 2011-10-02 00:07:37 +0000
+++ b/storage/ndb/memcache/CMakeLists.txt 2011-10-02 23:08:15 +0000
@@ -106,9 +106,6 @@ set(NDB_MEMCACHE_SOURCE_FILES
)
-# Define DEBUG_OUTPUT by default (enables runtime "debug" option in memcached)
-add_definitions(-DDEBUG_OUTPUT)
-
# Set extra flags for the C compiler
IF(${CMAKE_COMPILER_IS_GNUCC})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=gnu99 -Wall -Wredundant-decls")
@@ -122,6 +119,8 @@ IF(${CMAKE_COMPILER_IS_GNUCXX})
ENDIF()
+########## ENVIRONMENT TESTS #########
+
# Checks for system headers
CHECK_INCLUDE_FILE("mach/mach_time.h" HAVE_MACH_MACH_TIME_H)
@@ -132,6 +131,20 @@ CHECK_FUNCTION_EXISTS(gethrvtime HAVE_GE
CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
# Also: log in libm, dlsym in libdl?
+CHECK_CXX_SOURCE_RUNS("
+ main() {
+ const char * f = __func__;
+ return 0;
+ }"
+ HAVE_FUNC_IN_CXX)
+
+# Define DEBUG_OUTPUT by default (enables runtime "debug" option in memcached)
+if(HAVE_FUNC_IN_CXX)
+ add_definitions(-DDEBUG_OUTPUT)
+endif()
+
+########### GENERATED FILES #############
+
# Build ndbmemcache_config.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ndbmemcache_config.in
${CMAKE_CURRENT_SOURCE_DIR}/include/ndbmemcache_config.h)
@@ -143,10 +156,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DI
# Build the perl include file used by mtr
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/memcached_path.pl.in
${CMAKE_CURRENT_SOURCE_DIR}/memcached_path.pl)
-
-# memcached_path.pl is also installed, for use by installed mtr
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/memcached_path.pl
- DESTINATION ${INSTALL_MYSQLTESTDIR}/lib)
######### TARGETS ############
# Build the convenience library
@@ -194,6 +203,11 @@ install(PROGRAMS sandbox.sh DESTINATION
install(FILES README DESTINATION memcache-api)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ndb_memcache_metadata.sql
DESTINATION memcache-api)
+
+# memcached_path.pl is also installed, for use by installed mtr
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/memcached_path.pl
+ DESTINATION ${INSTALL_MYSQLTESTDIR}/lib)
+
########################################################
=== modified file 'storage/ndb/memcache/include/Scheduler.h'
--- a/storage/ndb/memcache/include/Scheduler.h 2011-10-02 02:58:36 +0000
+++ b/storage/ndb/memcache/include/Scheduler.h 2011-10-02 22:32:09 +0000
@@ -35,7 +35,7 @@
class Scheduler {
protected:
- ~Scheduler() {};
+ virtual ~Scheduler() {};
public:
/* Public Interface */
=== modified file 'storage/ndb/memcache/include/debug.h'
--- a/storage/ndb/memcache/include/debug.h 2011-10-02 06:00:45 +0000
+++ b/storage/ndb/memcache/include/debug.h 2011-10-02 23:08:15 +0000
@@ -44,9 +44,13 @@
#ifdef DEBUG_OUTPUT
-/* Some Sun compilers do not have __func__ */
-#if(defined __SUNPRO_C && \
- ! ((__STDC_VERSION__ >= 199901L) || defined(__C99FEATURES__)))
+/* Sometimes __func__ is not available in C++ */
+#if (defined(__cplusplus) && ! defined(HAVE_FUNC_IN_CXX))
+ #define __func__ "?"
+#endif
+
+/* Some Sun compilers also do not have __func__ */
+#if defined(__SUNPRO_C) && ! ((__STDC_VERSION__ >= 199901L) || defined(__C99FEATURES__))
#define __func__ "?"
#endif
=== modified file 'storage/ndb/memcache/include/ndbmemcache_config.in'
--- a/storage/ndb/memcache/include/ndbmemcache_config.in 2011-09-27 19:36:26 +0000
+++ b/storage/ndb/memcache/include/ndbmemcache_config.in 2011-10-02 23:08:15 +0000
@@ -39,6 +39,7 @@
#define PRIu64 "llu"
#endif
+#cmakedefine HAVE_FUNC_IN_CXX
#endif
=== modified file 'storage/ndb/memcache/unit/test_workqueue.c'
--- a/storage/ndb/memcache/unit/test_workqueue.c 2011-10-02 02:58:36 +0000
+++ b/storage/ndb/memcache/unit/test_workqueue.c 2011-10-02 23:25:02 +0000
@@ -131,9 +131,9 @@ int run_test(struct threadinfo *params)
pthread_join(producer_thd_id, NULL);
for(i = 0; i < params->nconsumers; i++) {
- struct threadreturn *ret;
+ void *ret;
pthread_join(consumer_thd_ids[i], &ret);
- total_consumed += ret->nrecv;
+ total_consumed += ((struct threadreturn *) ret)->nrecv;
}
workqueue_destroy(params->q);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster branch (john.duncan:3587 to 3590) | John David Duncan | 3 Oct |