Aufgrund eines Security Updates wird GitLab heute zwischen 14:30 und 15:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a security update GitLab will be temporarily unavailable between 2:30 and 3 today.

Commit c684d74b authored by Fabian Schlieper's avatar Fabian Schlieper

odroid changes

parent fc7518ee
...@@ -116,6 +116,10 @@ set( ITABaseSources ...@@ -116,6 +116,10 @@ set( ITABaseSources
if( WIN32 ) if( WIN32 )
list( APPEND ITABaseHeader "include/ITAHPT.h" "include/ITAMutex.h" "include/ITATimer.h" ) list( APPEND ITABaseHeader "include/ITAHPT.h" "include/ITAMutex.h" "include/ITATimer.h" )
list( APPEND ITABaseSources "src/ITAHPT.cpp" "src/ITAMutex.cpp" "src/ITATimer.cpp" ) list( APPEND ITABaseSources "src/ITAHPT.cpp" "src/ITAMutex.cpp" "src/ITATimer.cpp" )
else( WIN32)
add_definitions( -DUSE_SIMPLEINI )
list( APPEND ITABaseSources "src/ITAPosixRealtimeClock.cpp" "src/simpleini/SimpleIni.h" "src/simpleini/ConvertUTF.h" "src/simpleini/ConvertUTF.c" )
list( APPEND ITABaseSources "src/ITAConfigUtilsSimpleIniImpl.cpp" )
endif( WIN32 ) endif( WIN32 )
...@@ -162,15 +166,10 @@ if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) ...@@ -162,15 +166,10 @@ if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS )
list( APPEND ITABaseSources "src/ITAConfigUtils.cpp" "src/ITAStringUtilsPCRE.cpp" ) list( APPEND ITABaseSources "src/ITAConfigUtils.cpp" "src/ITAStringUtilsPCRE.cpp" )
add_definitions( -DPCRE_STATIC ) add_definitions( -DPCRE_STATIC )
else( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) else( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS )
list( APPEND ITABaseSources "src/ITAStringUtils.cpp" ) list( APPEND ITABaseSources "src/ITAConfigUtils.cpp" "src/ITAStringUtils.cpp" )
endif( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) endif( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS )
if( VSIMPLEINI_FOUND AND ITA_BASE_WITH_CONFIG_SIMPLE_INI )
if( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS )
message( FATAL_ERROR "ITABase old config implementation requires regular expressions. Please activate." )
endif( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS )
list( APPEND ITABaseSources "src/ITAConfigUtilsSimpleIniImpl.cpp" )
endif( VSIMPLEINI_FOUND AND ITA_BASE_WITH_CONFIG_SIMPLE_INI )
if( ITA_BASE_WITH_CONFIG_OLD_IMPL AND NOT ITA_BASE_WITH_CONFIG_SIMPLE_INI ) if( ITA_BASE_WITH_CONFIG_OLD_IMPL AND NOT ITA_BASE_WITH_CONFIG_SIMPLE_INI )
if( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS ) if( NOT ITA_BASE_WITH_REGULAR_EXPRESSIONS )
...@@ -197,6 +196,10 @@ else( NOT ITA_CORE_LIBS_BUILD_STATIC ) ...@@ -197,6 +196,10 @@ else( NOT ITA_CORE_LIBS_BUILD_STATIC )
endif( NOT ITA_CORE_LIBS_BUILD_STATIC ) endif( NOT ITA_CORE_LIBS_BUILD_STATIC )
if( NOT WIN32 )
add_definitions( -std=gnu++11 )
endif()
# linker # linker
add_library( ITABase ${ITABaseHeader} ${ITABaseSources} ) add_library( ITABase ${ITABaseHeader} ${ITABaseSources} )
target_link_libraries( ITABase ${VISTA_USE_PACKAGE_LIBRARIES} ) target_link_libraries( ITABase ${VISTA_USE_PACKAGE_LIBRARIES} )
......
...@@ -201,6 +201,12 @@ ITA_BASE_API std::string INIFileReadString(const std::string& sINIFilename, ...@@ -201,6 +201,12 @@ ITA_BASE_API std::string INIFileReadString(const std::string& sINIFilename,
const std::string& sKey, const std::string& sKey,
std::string sDefaultValue=""); std::string sDefaultValue="");
//! Mit Kommas getrennte Liste von Strings aus INI-Datei lesen
ITA_BASE_API std::vector<std::string> INIFileReadStringList(const std::string& sINIFilename,
const std::string& sSection,
const std::string& sKey,
char cSeparator=',');
//! Mit Kommas getrennte Liste von int-Werten aus INI-Datei lesen und in template Enum-Typ konvertieren //! Mit Kommas getrennte Liste von int-Werten aus INI-Datei lesen und in template Enum-Typ konvertieren
template <typename TEnum> template <typename TEnum>
std::vector<TEnum> INIFileReadEnumList(const std::string& sINIFilename, std::vector<TEnum> INIFileReadEnumList(const std::string& sINIFilename,
...@@ -241,11 +247,7 @@ ITA_BASE_API std::vector<double> INIFileReadDoubleList(const std::string& sINIFi ...@@ -241,11 +247,7 @@ ITA_BASE_API std::vector<double> INIFileReadDoubleList(const std::string& sINIFi
const std::string& sKey, const std::string& sKey,
char cSeparator=','); char cSeparator=',');
//! Mit Kommas getrennte Liste von Strings aus INI-Datei lesen
ITA_BASE_API std::vector<std::string> INIFileReadStringList(const std::string& sINIFilename,
const std::string& sSection,
const std::string& sKey,
char cSeparator=',');
/* +-----------------------------------------------------------------------------------------+ /* +-----------------------------------------------------------------------------------------+
* | | * | |
......
...@@ -134,8 +134,7 @@ template <class T> void ITABufferedDataLogger<T>::log(const T& oLogItem) { ...@@ -134,8 +134,7 @@ template <class T> void ITABufferedDataLogger<T>::log(const T& oLogItem) {
m_vLogItems.push_back(oLogItem); m_vLogItems.push_back(oLogItem);
} }
template <class T> void ITABufferedDataLogger<T>::store(std::string sFilename) template <class T> void ITABufferedDataLogger<T>::store(const std::string& sFilename) {
{
std::ofstream os(sFilename.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); std::ofstream os(sFilename.c_str(), std::ios::out | std::ios::trunc | std::ios::binary);
if (!os.is_open()) if (!os.is_open())
ITA_EXCEPT1(IO_ERROR, std::string("Could not create log output file \"") + sFilename + std::string("\"")); ITA_EXCEPT1(IO_ERROR, std::string("Could not create log output file \"") + sFilename + std::string("\""));
......
...@@ -27,7 +27,13 @@ ...@@ -27,7 +27,13 @@
#endif #endif
#include <string> #include <string>
#ifdef WIN32
#include <windows.h> #include <windows.h>
#else
#include <stdio.h>
#include <linux/types.h>
#define __int64 int64_t
#endif
// Definition des Datentyps für Timerticks // Definition des Datentyps für Timerticks
typedef __int64 ITATimerTicks; typedef __int64 ITATimerTicks;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <sstream>
// Konvertierungsklasse // Konvertierungsklasse
class ITA_BASE_API ITAConversion class ITA_BASE_API ITAConversion
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <algorithm>
#include <ITAStringUtils.h> #include <ITAStringUtils.h>
......
/* /*
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
| | | |
| ITAToolkit | | ITAToolkit |
| | | |
| (c) Copyright Institut für technische Akustik (ITA) | | (c) Copyright Institut für technische Akustik (ITA) |
| Aachen university of technology (RWTH), 2005-2008 | | Aachen university of technology (RWTH), 2005-2008 |
| | | |
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
| | | |
| File: ITAAtomicOps.cpp | | File: ITAAtomicOps.cpp |
| Purpose: Atomare Grundfunktionen für non-blocking concurrency | | Purpose: Atomare Grundfunktionen für non-blocking concurrency |
| Authors: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de | | Authors: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de |
| | | |
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
*/ */
// $Id: ITAAtomicOpsGCCBuiltinsImpl.cpp 3454 2013-08-21 14:40:16Z stienen $ // $Id: ITAAtomicOpsGCCBuiltinsImpl.cpp 3454 2013-08-21 14:40:16Z stienen $
#include "ITAAtomicOps.h" #include "ITAAtomicOps.h"
#include <stdint.h> #include <stdint.h>
typedef union { typedef union {
int32_t i32Value; int32_t i32Value;
float floatValue; float floatValue;
} ConvI32Float; } ConvI32Float;
int atomic_read_int(volatile const int* src) int atomic_read_int(volatile const int* src)
{ {
/* /*
* Trick: Realisierung mittels CAS! * Trick: Realisierung mittels CAS!
* Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht... * Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht...
* Also keine Änderung! * Also keine Änderung!
*/ */
return __sync_val_compare_and_swap( (int*) src, 0, 0 ); return __sync_val_compare_and_swap( (int*) src, 0, 0 );
} }
float atomic_read_float(volatile const float* src) { float atomic_read_float(volatile const float* src) {
/* /*
* Trick: Realisierung mittels CAS! * Trick: Realisierung mittels CAS!
* Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht... * Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht...
* Also keine �nderung! * Also keine �nderung!
* *
* Info: Auf manchen Architekturen ist InterlockedAdd(src, 0) schneller. * Info: Auf manchen Architekturen ist InterlockedAdd(src, 0) schneller.
* Leider steht InterlockedAdd nur auf Itanium-Arch. zur Verf�gung. * Leider steht InterlockedAdd nur auf Itanium-Arch. zur Verf�gung.
*/ */
ConvI32Float c; ConvI32Float c;
c.i32Value = __sync_val_compare_and_swap((volatile int32_t*) src, 0, 0); c.i32Value = __sync_val_compare_and_swap((volatile int32_t*) src, 0, 0);
return c.floatValue; return c.floatValue;
} }
void* atomic_read_ptr(volatile const void** src) { void* atomic_read_ptr(volatile const void** src) {
/* /*
* Trick: Realisierung mittels CAS! * Trick: Realisierung mittels CAS!
* Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht... * Falls der Wert schon 0, dann wird er gegen 0 ausgetauscht...
* Also keine Änderung! * Also keine Änderung!
*/ */
return __sync_val_compare_and_swap((void**) src, 0, 0); return __sync_val_compare_and_swap((void**) src, 0, 0);
} }
void atomic_write_int(volatile int* dest, int value) { void atomic_write_int(volatile int* dest, int value) {
__sync_lock_test_and_set(dest, value); __sync_lock_test_and_set(dest, value);
} }
void atomic_write_float(volatile float* dest, float value) { void atomic_write_float(volatile float* dest, float value) {
ConvI32Float c; ConvI32Float c;
c.floatValue = value; c.floatValue = value;
__sync_lock_test_and_set((volatile int32_t*) dest, c.i32Value); __sync_lock_test_and_set((volatile int32_t*) dest, c.i32Value);
} }
void atomic_write_ptr(volatile void** dest, void* value) { void atomic_write_ptr(volatile void** dest, void* value) {
__sync_lock_test_and_set(dest, value); __sync_lock_test_and_set(dest, value);
} }
bool atomic_cas_int(volatile int* dest, int expected_value, int new_value) { bool atomic_cas_int(volatile int* dest, int expected_value, int new_value) {
return __sync_bool_compare_and_swap(dest, expected_value, new_value); return __sync_bool_compare_and_swap(dest, expected_value, new_value);
} }
/* /*
bool atomic_cas_double(volatile double* dest, double expected_value, double new_value) { bool atomic_cas_double(volatile double* dest, double expected_value, double new_value) {
return __sync_bool_compare_and_swap(dest, expected_value, new_value); return __sync_bool_compare_and_swap(dest, expected_value, new_value);
} }
*/ */
bool atomic_cas_ptr(volatile void** dest, void* expected_value, void* new_value) { bool atomic_cas_ptr(volatile void** dest, void* expected_value, void* new_value) {
return __sync_bool_compare_and_swap(dest, expected_value, new_value); return __sync_bool_compare_and_swap(dest, expected_value, new_value);
} }
void atomic_read32(volatile void* src, void* dest) { void atomic_read32(volatile void* src, void* dest) {
*((int32_t*) dest) = __sync_val_compare_and_swap((volatile int32_t*) src, 0, 0); *((int32_t*) dest) = __sync_val_compare_and_swap((volatile int32_t*) src, 0, 0);
} }
bool atomic_cas32(volatile void* dest, void* expected_value, void* new_value) bool atomic_cas32(volatile void* dest, void* expected_value, void* new_value) {
{ return __sync_bool_compare_and_swap((volatile int32_t*)dest, *(int32_t*)expected_value, *(int32_t*)new_value);
return __sync_bool_compare_and_swap( &dest, expected_value, new_value ); }
//return __sync_bool_compare_and_swap( (volatile int32_t*)dest, (int32_t*)expected_value, (int32_t*)new_value );
} int atomic_inc_int(volatile int* dest) {
return __sync_fetch_and_add(dest, 1);
int atomic_inc_int(volatile int* dest) { }
return __sync_fetch_and_add(dest, 1);
} int atomic_dec_int(volatile int* dest) {
return __sync_fetch_and_sub(dest, 1);
int atomic_dec_int(volatile int* dest) { }
return __sync_fetch_and_sub(dest, 1);
}
#include "ITAAudiofileCommon.h" #include "ITAAudiofileCommon.h"
#include <cstdio> #include <cstdio>
std::string toString( ITAQuantization eQuantization ) std::string toString( ITAQuantization eQuantization )
{ {
switch( eQuantization ) switch( eQuantization )
{ {
case ITAQuantization::ITA_INT16: return "Integer with 16-Bit"; case ITAQuantization::ITA_INT16: return "Integer with 16-Bit";
case ITAQuantization::ITA_INT20: return "Integer with 20-Bit"; case ITAQuantization::ITA_INT20: return "Integer with 20-Bit";
case ITAQuantization::ITA_INT24: return "Integer with 24-Bit"; case ITAQuantization::ITA_INT24: return "Integer with 24-Bit";
case ITAQuantization::ITA_INT32: return "Integer with 32-Bit"; case ITAQuantization::ITA_INT32: return "Integer with 32-Bit";
case ITAQuantization::ITA_FLOAT: return "Floating point with 32-Bit"; case ITAQuantization::ITA_FLOAT: return "Floating point with 32-Bit";
case ITAQuantization::ITA_DOUBLE: return "Floating point with 64-Bit"; case ITAQuantization::ITA_DOUBLE: return "Floating point with 64-Bit";
default: return "Unkown"; default: return "Unkown";
} }
} }
std::string toString( ITADomain eDomain ) std::string toString( ITADomain eDomain )
{ {
return ( eDomain == ITADomain::ITA_TIME_DOMAIN ? "Zeitbereich" : "Frequenzbereich" ); return ( eDomain == ITADomain::ITA_TIME_DOMAIN ? "time domain" : "frequency domain" );
} }
void print( const ITAAudiofileProperties& props ) void print( const ITAAudiofileProperties& props )
{ {
printf( "%s | %0.1f Hz | %i channels | %s | length: %i Samples", printf( "%s | %0.1f Hz | %i channels | %s | length: %i Samples",
toString( props.eDomain ).c_str(), toString( props.eDomain ).c_str(),
props.dSampleRate, props.dSampleRate,
props.iChannels, props.iChannels,
toString( props.eQuantization ).c_str(), toString( props.eQuantization ).c_str(),
props.iLength ); props.iLength );
if( !props.sComment.empty() ) if( !props.sComment.empty() )
printf( " | Comment: \"%s\"", props.sComment.c_str() ); printf( " | Comment: \"%s\"", props.sComment.c_str() );
printf( "\n" ); printf( "\n" );
} }
This diff is collapsed.
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#ifdef USE_SIMPLEINI #ifdef USE_SIMPLEINI
#include <ITAException.h> #include <ITAException.h>
#include <ITAFilesystemUtils.h> #include <ITAFileSystemUtils.h>
#include "../3rdParty/SimpleIni/SimpleIni.h" #include "simpleini/SimpleIni.h"
// //
//// Bugfix (fwe): Falls kein Pfad und nur ein Dateinamen angebenen ist, muss .\ vorne angeh�ngt werden //// Bugfix (fwe): Falls kein Pfad und nur ein Dateinamen angebenen ist, muss .\ vorne angeh�ngt werden
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
class ITACriticalSectionPosixImpl : public ITACriticalSectionImpl { class ITACriticalSectionPosixImpl : public ITACriticalSectionImpl {
public: public:
ITACriticalSectionPosixImpl() : mutex(PTHREAD_MUTEX_INITIALIZER) { ITACriticalSectionPosixImpl() : mutex(PTHREAD_MUTEX_INITIALIZER) {
pthread_mutexattr_init(&mutexattr);
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP); pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&mutex, &mutexattr); pthread_mutex_init(&mutex, &mutexattr);
pthread_mutexattr_destroy( &mutexattr );
} }
~ITACriticalSectionPosixImpl() { ~ITACriticalSectionPosixImpl() {
......
...@@ -93,7 +93,7 @@ void SetThreadName(long lThreadID, const char* szThreadName) { ...@@ -93,7 +93,7 @@ void SetThreadName(long lThreadID, const char* szThreadName) {
void DEBUG_PRINTF(const char * format, ... ) { void DEBUG_PRINTF(const char * format, ... ) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
printf(format, args); vprintf(format, args);
va_end(args); va_end(args);
} }
#endif // Linux #endif // Linux
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment