summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-12-20 17:24:31 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-12-20 17:24:31 +0100
commit64e5faf11c22c8aabf181288293c8ec7964c213d (patch)
treef0669001e9eef2aa883df85f401947d843f684b4 /src
parentb697682bd3c1b9cdfde97cd6a7c9d0f10103f6b4 (diff)
parent0fa481dabf620181c852f43923a3c4b049294ab4 (diff)
Merge remote-tracking branch 'origin/master' into uirefactor
Diffstat (limited to 'src')
-rw-r--r--src/drumkit.h4
-rw-r--r--src/drumkitloader.h8
-rw-r--r--src/instrumentparser.h8
-rw-r--r--src/semaphore.cc6
-rw-r--r--src/semaphore.h4
-rw-r--r--src/thread.h4
6 files changed, 18 insertions, 16 deletions
diff --git a/src/drumkit.h b/src/drumkit.h
index 04b2c56..a9ceb80 100644
--- a/src/drumkit.h
+++ b/src/drumkit.h
@@ -56,13 +56,13 @@ public:
size_t samplerate();
private:
- void *magic;
+ void *magic{nullptr};
std::string _file;
std::string _name;
std::string _description;
- size_t _samplerate;
+ size_t _samplerate{0};
VersionStr _version;
};
diff --git a/src/drumkitloader.h b/src/drumkitloader.h
index 2c0ea8e..b4a0a69 100644
--- a/src/drumkitloader.h
+++ b/src/drumkitloader.h
@@ -89,11 +89,11 @@ private:
Semaphore run_semaphore;
Semaphore semaphore;
Mutex mutex;
- volatile bool running;
+ volatile bool running{false};
std::list<AudioFile*> load_queue;
- size_t total_num_audiofiles;
- size_t fraction;
- size_t loaded;
+ size_t total_num_audiofiles{0};
+ size_t fraction{1};
+ size_t loaded{0};
};
#endif/*__DRUMGIZMO_DRUMKITLOADER_H__*/
diff --git a/src/instrumentparser.h b/src/instrumentparser.h
index 2a7a9c9..60a6261 100644
--- a/src/instrumentparser.h
+++ b/src/instrumentparser.h
@@ -47,14 +47,14 @@ protected:
int readData(char *data, size_t size);
private:
- FILE *fd;
+ FILE *fd{nullptr};
Instrument &instrument;
- Sample *s;
+ Sample *s{nullptr};
std::string path;
- level_t lower;
- level_t upper;
+ level_t lower{0};
+ level_t upper{0};
};
#endif/*__DRUMGIZMO_INSTRUMENTPARSER_H__*/
diff --git a/src/semaphore.cc b/src/semaphore.cc
index 47ce8e0..3f5781f 100644
--- a/src/semaphore.cc
+++ b/src/semaphore.cc
@@ -28,6 +28,8 @@
#include <hugin.hpp>
+#include <limits>
+
#ifdef WIN32
#include <windows.h>
#else
@@ -53,7 +55,7 @@ Semaphore::Semaphore(const char *name)
#ifdef WIN32
prv->semaphore = CreateSemaphore(NULL, // default security attributes
0, // initial count
- 2147483647, // maximum count (Max LONG)
+ std::numeric_limits<LONG>::max(),
NULL); // unnamed semaphore
#else
sem_init(&prv->semaphore, 0, 0);
@@ -70,7 +72,7 @@ Semaphore::~Semaphore()
sem_destroy(&prv->semaphore);
#endif
- if(prv) delete prv;
+ delete prv;
}
void Semaphore::post()
diff --git a/src/semaphore.h b/src/semaphore.h
index 7e39f5a..ed284de 100644
--- a/src/semaphore.h
+++ b/src/semaphore.h
@@ -38,8 +38,8 @@ public:
void wait();
private:
- struct semaphore_private_t *prv;
- const char *name;
+ struct semaphore_private_t *prv{nullptr};
+ const char *name{nullptr};
};
#endif/*__PRACRO_SEMAPHORE_H__*/
diff --git a/src/thread.h b/src/thread.h
index f2c1dd0..33435e6 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -46,10 +46,10 @@ protected:
private:
#ifdef WIN32
- HANDLE tid;
+ HANDLE tid{nullptr};
static DWORD WINAPI
#else
- pthread_t tid;
+ pthread_t tid{0};
static void*
#endif/*WIN32*/
thread_run(void *data);