diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 19:13:33 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 20:59:06 +0100 |
commit | 14cd32a043552d39738ae0e84e4ef8ab93783296 (patch) | |
tree | 829845243215ed3fd96ff8fd6d6f324c35a60b3e /src/Log.cpp | |
parent | 88dff1aabd3c81d1d81ac256e0061b98e0d24cec (diff) | |
download | ingen-14cd32a043552d39738ae0e84e4ef8ab93783296.tar.gz ingen-14cd32a043552d39738ae0e84e4ef8ab93783296.tar.bz2 ingen-14cd32a043552d39738ae0e84e4ef8ab93783296.zip |
Cleanup: Use "auto" to avoid repeating type names
Diffstat (limited to 'src/Log.cpp')
-rw-r--r-- | src/Log.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Log.cpp b/src/Log.cpp index 756bb8c3..cf18b58c 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -120,8 +120,8 @@ Log::vtprintf(LV2_URID type, const char* fmt, va_list args) static int log_vprintf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, va_list args) { - Log::Feature::Handle* f = (Log::Feature::Handle*)handle; - va_list noargs; + auto* f = static_cast<Log::Feature::Handle*>(handle); + va_list noargs = {}; int ret = f->log->vtprintf(type, f->node->path().c_str(), noargs); ret += f->log->vtprintf(type, ": ", noargs); @@ -143,7 +143,7 @@ log_printf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...) static void free_log_feature(LV2_Feature* feature) { - LV2_Log_Log* lv2_log = (LV2_Log_Log*)feature->data; + auto* lv2_log = static_cast<LV2_Log_Log*>(feature->data); free(lv2_log->handle); free(feature); } @@ -151,14 +151,14 @@ free_log_feature(LV2_Feature* feature) { SPtr<LV2_Feature> Log::Feature::feature(World& world, Node* block) { - Handle* handle = (Handle*)calloc(1, sizeof(Handle)); + auto* handle = static_cast<Handle*>(calloc(1, sizeof(Handle))); handle->lv2_log.handle = handle; handle->lv2_log.printf = log_printf; handle->lv2_log.vprintf = log_vprintf; handle->log = &world.log(); handle->node = block; - LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); + auto* f = static_cast<LV2_Feature*>(malloc(sizeof(LV2_Feature))); f->URI = LV2_LOG__log; f->data = &handle->lv2_log; |