From 2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 11 Oct 2006 15:50:15 +0000 Subject: Turned up gcc warnings, fixed warnings in code, enabled -Werror. Note: #include "qpid_test_plugin.h" instead of Works around warning from a cppunit macro. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@462834 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/common/concurrent/src/APRBase.cpp | 3 +-- cpp/common/concurrent/src/APRThread.cpp | 2 +- cpp/common/concurrent/src/APRThreadPool.cpp | 6 ++---- cpp/common/concurrent/src/Runnable.cpp | 19 +++++++++++++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 cpp/common/concurrent/src/Runnable.cpp (limited to 'cpp/common/concurrent/src') diff --git a/cpp/common/concurrent/src/APRBase.cpp b/cpp/common/concurrent/src/APRBase.cpp index f87ea9e25f..f9b34b9333 100644 --- a/cpp/common/concurrent/src/APRBase.cpp +++ b/cpp/common/concurrent/src/APRBase.cpp @@ -91,7 +91,6 @@ void qpid::concurrent::check(apr_status_t status, const std::string& file, const std::string qpid::concurrent::get_desc(apr_status_t status){ const int size = 50; char tmp[size]; - std::string msg(apr_strerror(status, tmp, size)); - return msg; + return std::string(apr_strerror(status, tmp, size)); } diff --git a/cpp/common/concurrent/src/APRThread.cpp b/cpp/common/concurrent/src/APRThread.cpp index 4202fe81b6..4167fb76ff 100644 --- a/cpp/common/concurrent/src/APRThread.cpp +++ b/cpp/common/concurrent/src/APRThread.cpp @@ -27,7 +27,7 @@ void* APR_THREAD_FUNC ExecRunnable(apr_thread_t* thread, void *data){ return NULL; } -APRThread::APRThread(apr_pool_t* _pool, Runnable* _runnable) : pool(_pool), runnable(_runnable){} +APRThread::APRThread(apr_pool_t* _pool, Runnable* _runnable) : runnable(_runnable), pool(_pool) {} APRThread::~APRThread(){ } diff --git a/cpp/common/concurrent/src/APRThreadPool.cpp b/cpp/common/concurrent/src/APRThreadPool.cpp index e0fcb804e6..8518d98b67 100644 --- a/cpp/common/concurrent/src/APRThreadPool.cpp +++ b/cpp/common/concurrent/src/APRThreadPool.cpp @@ -22,13 +22,11 @@ using namespace qpid::concurrent; -APRThreadPool::APRThreadPool(int _size) : size(_size), factory(new APRThreadFactory()), - deleteFactory(true), running(false){ +APRThreadPool::APRThreadPool(int _size) : deleteFactory(true), size(_size), factory(new APRThreadFactory()), running(false){ worker = new Worker(this); } -APRThreadPool::APRThreadPool(int _size, ThreadFactory* _factory) : size(_size), factory(_factory), - deleteFactory(false), running(false){ +APRThreadPool::APRThreadPool(int _size, ThreadFactory* _factory) : deleteFactory(false), size(_size), factory(_factory), running(false){ worker = new Worker(this); } diff --git a/cpp/common/concurrent/src/Runnable.cpp b/cpp/common/concurrent/src/Runnable.cpp new file mode 100644 index 0000000000..cf9b8d586f --- /dev/null +++ b/cpp/common/concurrent/src/Runnable.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "Runnable.h" +qpid::concurrent::Runnable::~Runnable() {} -- cgit v1.2.1