summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ingen/runtime_paths.hpp2
-rw-r--r--src/ingen/ingen.cpp3
-rw-r--r--src/runtime_paths.cpp4
-rw-r--r--tests/ingen_bench.cpp2
-rw-r--r--tests/ingen_test.cpp2
5 files changed, 7 insertions, 6 deletions
diff --git a/ingen/runtime_paths.hpp b/ingen/runtime_paths.hpp
index a83a81fd..f23c2882 100644
--- a/ingen/runtime_paths.hpp
+++ b/ingen/runtime_paths.hpp
@@ -28,7 +28,7 @@ namespace ingen {
extern const char search_path_separator;
INGEN_API void set_bundle_path(const char* path);
-INGEN_API void set_bundle_path_from_code(void* function);
+INGEN_API void set_bundle_path_from_code(void (*function)());
INGEN_API FilePath
find_in_search_path(const std::string& name,
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index 80f7ab36..fd9a3578 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -90,7 +90,8 @@ print_version()
int
main(int argc, char** argv)
{
- ingen::set_bundle_path_from_code((void*)&print_version);
+ ingen::set_bundle_path_from_code(
+ reinterpret_cast<void (*)()>(&print_version));
// Create world
try {
diff --git a/src/runtime_paths.cpp b/src/runtime_paths.cpp
index db3ccd3f..38eb681f 100644
--- a/src/runtime_paths.cpp
+++ b/src/runtime_paths.cpp
@@ -65,10 +65,10 @@ parse_search_path(const char* search_path, std::vector<FilePath> defaults)
* Passing a function defined in a module etc. will not work!
*/
void
-set_bundle_path_from_code(void* function)
+set_bundle_path_from_code(void (*function)())
{
Dl_info dli;
- dladdr(function, &dli);
+ dladdr(reinterpret_cast<void*>(function), &dli);
#ifdef BUNDLE
char bin_loc[PATH_MAX];
diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp
index e0232b01..0a042f94 100644
--- a/tests/ingen_bench.cpp
+++ b/tests/ingen_bench.cpp
@@ -59,7 +59,7 @@ real_path(const char* path)
int
main(int argc, char** argv)
{
- set_bundle_path_from_code((void*)&ingen_try);
+ set_bundle_path_from_code(reinterpret_cast<void(*)()>(&ingen_try));
// Create world
try {
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index eade1194..4d9823bc 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -74,7 +74,7 @@ real_file_path(const char* path)
int
main(int argc, char** argv)
{
- set_bundle_path_from_code((void*)&ingen_try);
+ set_bundle_path_from_code(reinterpret_cast<void(*)()>(&ingen_try));
// Create world
try {