From 8afb3fa896bb5a23f1570a0c21441f74338dd746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu> Date: Fri, 22 Jul 2011 06:41:49 +0000 Subject: [PATCH] Modified the main CMakeLists.txt to set the compiler flags for the C++ compiler instead of the C compiler. Solved some compilation warnings that appeared. --- CMakeLists.txt | 4 ++-- src/examples/test_threads.cpp | 1 + src/examples/test_threadserver.cpp | 1 + src/logs/log.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10cdcea..cdd9be8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ IF (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "DEBUG") ENDIF (NOT CMAKE_BUILD_TYPE) -SET(CMAKE_C_FLAGS_DEBUG "-g -Wall") -SET(CMAKE_C_FLAGS_RELEASE "-O3") +SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall") +SET(CMAKE_CXX_FLAGS_RELEASE "-O3") ADD_SUBDIRECTORY(src) diff --git a/src/examples/test_threads.cpp b/src/examples/test_threads.cpp index 63c2754..1b21c7e 100644 --- a/src/examples/test_threads.cpp +++ b/src/examples/test_threads.cpp @@ -61,6 +61,7 @@ void *my_thread_function2(void *param) i++; sleep(1); } + pthread_exit(NULL); } /// Function with parameters diff --git a/src/examples/test_threadserver.cpp b/src/examples/test_threadserver.cpp index 8ee5ac1..db2e1ba 100644 --- a/src/examples/test_threadserver.cpp +++ b/src/examples/test_threadserver.cpp @@ -52,6 +52,7 @@ void *my_thread_function1(void *param) i++; sleep(1); } + pthread_exit(NULL); } /** diff --git a/src/logs/log.h b/src/logs/log.h index 719a5ea..8214581 100644 --- a/src/logs/log.h +++ b/src/logs/log.h @@ -233,7 +233,7 @@ class CLog template<class T> void log_vector(const std::vector<T>& values) { - int i=0; + unsigned int i=0; this->access.enter(); this->time_stamp.set(); -- GitLab