From 2330cadb0fbdc31b2eed415996e376a830c1e1b9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 9 Nov 2018 12:01:38 +0100 Subject: Cycles: Cleanup, don't use strict C prototypes Those are more like a legacy of language, which is not needed in C++. --- intern/cycles/blender/blender_logging.cpp | 2 +- intern/cycles/device/device.h | 6 +++--- intern/cycles/device/device_cpu.cpp | 2 +- intern/cycles/device/device_cuda.cpp | 8 ++++---- intern/cycles/device/device_intern.h | 10 +++++----- intern/cycles/device/device_opencl.cpp | 4 ++-- intern/cycles/device/device_task.h | 2 +- intern/cycles/util/util_avxf.h | 4 ++-- intern/cycles/util/util_guarded_allocator.cpp | 4 ++-- intern/cycles/util/util_guarded_allocator.h | 4 ++-- intern/cycles/util/util_logging.cpp | 2 +- intern/cycles/util/util_logging.h | 2 +- intern/cycles/util/util_progress.h | 8 ++++---- intern/cycles/util/util_ssef.h | 12 ++++++------ intern/cycles/util/util_thread.cpp | 2 +- intern/cycles/util/util_thread.h | 4 ++-- intern/cycles/util/util_types_float3.h | 4 ++-- intern/cycles/util/util_types_float3_impl.h | 4 ++-- intern/cycles/util/util_types_float4.h | 4 ++-- intern/cycles/util/util_types_float4_impl.h | 4 ++-- intern/cycles/util/util_types_float8.h | 4 ++-- intern/cycles/util/util_types_float8_impl.h | 4 ++-- intern/cycles/util/util_types_int3.h | 4 ++-- intern/cycles/util/util_types_int3_impl.h | 4 ++-- intern/cycles/util/util_types_int4.h | 4 ++-- intern/cycles/util/util_types_int4_impl.h | 4 ++-- intern/cycles/util/util_vector.h | 2 +- intern/cycles/util/util_view.cpp | 2 +- intern/cycles/util/util_view.h | 6 +++--- 29 files changed, 63 insertions(+), 63 deletions(-) (limited to 'intern') diff --git a/intern/cycles/blender/blender_logging.cpp b/intern/cycles/blender/blender_logging.cpp index d0f82e37662..3fca4efd097 100644 --- a/intern/cycles/blender/blender_logging.cpp +++ b/intern/cycles/blender/blender_logging.cpp @@ -22,7 +22,7 @@ void CCL_init_logging(const char *argv0) ccl::util_logging_init(argv0); } -void CCL_start_debug_logging(void) +void CCL_start_debug_logging() { ccl::util_logging_start(); } diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index f49915bc40d..f3fb338e638 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -181,7 +181,7 @@ public: /* Convert the requested features structure to a build options, * which could then be passed to compilers. */ - string get_build_options(void) const + string get_build_options() const { string build_options = ""; if(experimental) { @@ -240,8 +240,8 @@ std::ostream& operator <<(std::ostream &os, /* Device */ struct DeviceDrawParams { - function bind_display_space_shader_cb; - function unbind_display_space_shader_cb; + function bind_display_space_shader_cb; + function unbind_display_space_shader_cb; }; class Device { diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index bb5e9980457..9b37f4773bb 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -1065,7 +1065,7 @@ void device_cpu_info(vector& devices) devices.insert(devices.begin(), info); } -string device_cpu_capabilities(void) +string device_cpu_capabilities() { string capabilities = ""; capabilities += system_cpu_support_sse2() ? "SSE2 " : ""; diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index a52e77f707b..d338a565a02 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -73,12 +73,12 @@ const char *cuewErrorString(CUresult result) return error.c_str(); } -const char *cuewCompilerPath(void) +const char *cuewCompilerPath() { return CYCLES_CUDA_NVCC_EXECUTABLE; } -int cuewCompilerVersion(void) +int cuewCompilerVersion() { return (CUDA_VERSION / 100) + (CUDA_VERSION % 100 / 10); } @@ -2355,7 +2355,7 @@ int2 CUDASplitKernel::split_kernel_global_size(device_memory& kg, device_memory& return global_size; } -bool device_cuda_init(void) +bool device_cuda_init() { #ifdef WITH_CUDA_DYNLOAD static bool initialized = false; @@ -2497,7 +2497,7 @@ void device_cuda_info(vector& devices) devices.insert(devices.end(), display_devices.begin(), display_devices.end()); } -string device_cuda_capabilities(void) +string device_cuda_capabilities() { CUresult result = device_cuda_safe_init(); if(result != CUDA_SUCCESS) { diff --git a/intern/cycles/device/device_intern.h b/intern/cycles/device/device_intern.h index d5a96c2b82b..e6495c2bff3 100644 --- a/intern/cycles/device/device_intern.h +++ b/intern/cycles/device/device_intern.h @@ -22,9 +22,9 @@ CCL_NAMESPACE_BEGIN class Device; Device *device_cpu_create(DeviceInfo& info, Stats &stats, bool background); -bool device_opencl_init(void); +bool device_opencl_init(); Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background); -bool device_cuda_init(void); +bool device_cuda_init(); Device *device_cuda_create(DeviceInfo& info, Stats &stats, bool background); Device *device_network_create(DeviceInfo& info, Stats &stats, const char *address); Device *device_multi_create(DeviceInfo& info, Stats &stats, bool background); @@ -34,9 +34,9 @@ void device_opencl_info(vector& devices); void device_cuda_info(vector& devices); void device_network_info(vector& devices); -string device_cpu_capabilities(void); -string device_opencl_capabilities(void); -string device_cuda_capabilities(void); +string device_cpu_capabilities(); +string device_opencl_capabilities(); +string device_cuda_capabilities(); CCL_NAMESPACE_END diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 036f8a2e6e7..71410f80d57 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -44,7 +44,7 @@ Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background) } } -bool device_opencl_init(void) +bool device_opencl_init() { static bool initialized = false; static bool result = false; @@ -146,7 +146,7 @@ void device_opencl_info(vector& devices) } } -string device_opencl_capabilities(void) +string device_opencl_capabilities() { if(OpenCLInfo::device_type() == 0) { return "All OpenCL devices are forced to be OFF"; diff --git a/intern/cycles/device/device_task.h b/intern/cycles/device/device_task.h index db27470a03f..861014373b3 100644 --- a/intern/cycles/device/device_task.h +++ b/intern/cycles/device/device_task.h @@ -64,7 +64,7 @@ public: function update_progress_sample; function update_tile_sample; function release_tile; - function get_cancel; + function get_cancel; function map_neighbor_tiles; function unmap_neighbor_tiles; diff --git a/intern/cycles/util/util_avxf.h b/intern/cycles/util/util_avxf.h index 0c15ba5cbbd..f00c722f25b 100644 --- a/intern/cycles/util/util_avxf.h +++ b/intern/cycles/util/util_avxf.h @@ -40,8 +40,8 @@ struct avxf __forceinline avxf(const __m256 a) : m256(a) {} __forceinline avxf(const __m256i a) : m256(_mm256_castsi256_ps (a)) {} - __forceinline operator const __m256&(void) const { return m256; } - __forceinline operator __m256&(void) { return m256; } + __forceinline operator const __m256&() const { return m256; } + __forceinline operator __m256&() { return m256; } __forceinline avxf (float a) : m256(_mm256_set1_ps(a)) {} diff --git a/intern/cycles/util/util_guarded_allocator.cpp b/intern/cycles/util/util_guarded_allocator.cpp index 54fa6a80df5..ae1d217c54f 100644 --- a/intern/cycles/util/util_guarded_allocator.cpp +++ b/intern/cycles/util/util_guarded_allocator.cpp @@ -35,12 +35,12 @@ void util_guarded_mem_free(size_t n) /* Public API. */ -size_t util_guarded_get_mem_used(void) +size_t util_guarded_get_mem_used() { return global_stats.mem_used; } -size_t util_guarded_get_mem_peak(void) +size_t util_guarded_get_mem_peak() { return global_stats.mem_peak; } diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h index 87c1526dee4..c02aed93aa2 100644 --- a/intern/cycles/util/util_guarded_allocator.h +++ b/intern/cycles/util/util_guarded_allocator.h @@ -158,8 +158,8 @@ public: }; /* Get memory usage and peak from the guarded STL allocator. */ -size_t util_guarded_get_mem_used(void); -size_t util_guarded_get_mem_peak(void); +size_t util_guarded_get_mem_used(); +size_t util_guarded_get_mem_peak(); /* Call given function and keep track if it runs out of memory. * diff --git a/intern/cycles/util/util_logging.cpp b/intern/cycles/util/util_logging.cpp index f38683bf7de..b0922db32fb 100644 --- a/intern/cycles/util/util_logging.cpp +++ b/intern/cycles/util/util_logging.cpp @@ -45,7 +45,7 @@ void util_logging_init(const char *argv0) #endif } -void util_logging_start(void) +void util_logging_start() { #ifdef WITH_CYCLES_LOGGING using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption; diff --git a/intern/cycles/util/util_logging.h b/intern/cycles/util/util_logging.h index 4a5c3cd15bf..01a9b62ad93 100644 --- a/intern/cycles/util/util_logging.h +++ b/intern/cycles/util/util_logging.h @@ -52,7 +52,7 @@ struct int2; struct float3; void util_logging_init(const char *argv0); -void util_logging_start(void); +void util_logging_start(); void util_logging_verbosity_set(int verbosity); std::ostream& operator <<(std::ostream &os, diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h index 453af7de36b..4ed9ebd60ff 100644 --- a/intern/cycles/util/util_progress.h +++ b/intern/cycles/util/util_progress.h @@ -114,7 +114,7 @@ public: return cancel_message; } - void set_cancel_callback(function function) + void set_cancel_callback(function function) { cancel_cb = function; } @@ -323,7 +323,7 @@ public: } } - void set_update_callback(function function) + void set_update_callback(function function) { update_cb = function; } @@ -331,8 +331,8 @@ public: protected: thread_mutex progress_mutex; thread_mutex update_mutex; - function update_cb; - function cancel_cb; + function update_cb; + function cancel_cb; /* pixel_samples counts how many samples have been rendered over all pixel, not just per pixel. * This makes the progress estimate more accurate when tiles with different sizes are used. diff --git a/intern/cycles/util/util_ssef.h b/intern/cycles/util/util_ssef.h index b5623860e33..66670c9a779 100644 --- a/intern/cycles/util/util_ssef.h +++ b/intern/cycles/util/util_ssef.h @@ -44,8 +44,8 @@ struct ssef __forceinline ssef& operator=(const ssef& other) { m128 = other.m128; return *this; } __forceinline ssef(const __m128 a) : m128(a) {} - __forceinline operator const __m128&(void) const { return m128; } - __forceinline operator __m128&(void) { return m128; } + __forceinline operator const __m128&() const { return m128; } + __forceinline operator __m128&() { return m128; } __forceinline ssef (float a) : m128(_mm_set1_ps(a)) {} __forceinline ssef (float a, float b, float c, float d) : m128(_mm_setr_ps(a, b, c, d)) {} @@ -517,12 +517,12 @@ ccl_device_inline float len3(const ssef& a) /* faster version for SSSE3 */ typedef ssei shuffle_swap_t; -ccl_device_inline shuffle_swap_t shuffle_swap_identity(void) +ccl_device_inline shuffle_swap_t shuffle_swap_identity() { return _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); } -ccl_device_inline shuffle_swap_t shuffle_swap_swap(void) +ccl_device_inline shuffle_swap_t shuffle_swap_swap() { return _mm_set_epi8(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8); } @@ -537,12 +537,12 @@ ccl_device_inline const ssef shuffle_swap(const ssef& a, const shuffle_swap_t& s /* somewhat slower version for SSE2 */ typedef int shuffle_swap_t; -ccl_device_inline shuffle_swap_t shuffle_swap_identity(void) +ccl_device_inline shuffle_swap_t shuffle_swap_identity() { return 0; } -ccl_device_inline shuffle_swap_t shuffle_swap_swap(void) +ccl_device_inline shuffle_swap_t shuffle_swap_swap() { return 1; } diff --git a/intern/cycles/util/util_thread.cpp b/intern/cycles/util/util_thread.cpp index 16a8591a8a9..37d8bdbd4b0 100644 --- a/intern/cycles/util/util_thread.cpp +++ b/intern/cycles/util/util_thread.cpp @@ -21,7 +21,7 @@ CCL_NAMESPACE_BEGIN -thread::thread(function run_cb, int group) +thread::thread(function run_cb, int group) : run_cb_(run_cb), joined_(false), group_(group) diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index f7d2d452d89..6250bb95dcf 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -46,14 +46,14 @@ typedef std::condition_variable thread_condition_variable; class thread { public: - thread(function run_cb, int group = -1); + thread(function run_cb, int group = -1); ~thread(); static void *run(void *arg); bool join(); protected: - function run_cb_; + function run_cb_; std::thread thread_; bool joined_; int group_; diff --git a/intern/cycles/util/util_types_float3.h b/intern/cycles/util/util_types_float3.h index 28146ad04f7..ed2300e7996 100644 --- a/intern/cycles/util/util_types_float3.h +++ b/intern/cycles/util/util_types_float3.h @@ -35,8 +35,8 @@ struct ccl_try_align(16) float3 { __forceinline float3(const float3& a); __forceinline explicit float3(const __m128& a); - __forceinline operator const __m128&(void) const; - __forceinline operator __m128&(void); + __forceinline operator const __m128&() const; + __forceinline operator __m128&(); __forceinline float3& operator =(const float3& a); #else /* __KERNEL_SSE__ */ diff --git a/intern/cycles/util/util_types_float3_impl.h b/intern/cycles/util/util_types_float3_impl.h index 45f61767d3f..2e840a5c399 100644 --- a/intern/cycles/util/util_types_float3_impl.h +++ b/intern/cycles/util/util_types_float3_impl.h @@ -43,12 +43,12 @@ __forceinline float3::float3(const __m128& a) { } -__forceinline float3::operator const __m128&(void) const +__forceinline float3::operator const __m128&() const { return m128; } -__forceinline float3::operator __m128&(void) +__forceinline float3::operator __m128&() { return m128; } diff --git a/intern/cycles/util/util_types_float4.h b/intern/cycles/util/util_types_float4.h index 154391f6881..5c10d483c2e 100644 --- a/intern/cycles/util/util_types_float4.h +++ b/intern/cycles/util/util_types_float4.h @@ -36,8 +36,8 @@ struct ccl_try_align(16) float4 { __forceinline float4(); __forceinline explicit float4(const __m128& a); - __forceinline operator const __m128&(void) const; - __forceinline operator __m128&(void); + __forceinline operator const __m128&() const; + __forceinline operator __m128&(); __forceinline float4& operator =(const float4& a); diff --git a/intern/cycles/util/util_types_float4_impl.h b/intern/cycles/util/util_types_float4_impl.h index a49fac65b10..a83148031f1 100644 --- a/intern/cycles/util/util_types_float4_impl.h +++ b/intern/cycles/util/util_types_float4_impl.h @@ -38,12 +38,12 @@ __forceinline float4::float4(const __m128& a) { } -__forceinline float4::operator const __m128&(void) const +__forceinline float4::operator const __m128&() const { return m128; } -__forceinline float4::operator __m128&(void) +__forceinline float4::operator __m128&() { return m128; } diff --git a/intern/cycles/util/util_types_float8.h b/intern/cycles/util/util_types_float8.h index a91fddb2038..08720b8ff48 100644 --- a/intern/cycles/util/util_types_float8.h +++ b/intern/cycles/util/util_types_float8.h @@ -48,8 +48,8 @@ struct ccl_try_align(32) float8 { __forceinline float8(const float8& a); __forceinline explicit float8(const __m256& a); - __forceinline operator const __m256&(void) const; - __forceinline operator __m256&(void); + __forceinline operator const __m256&() const; + __forceinline operator __m256&(); __forceinline float8& operator =(const float8& a); diff --git a/intern/cycles/util/util_types_float8_impl.h b/intern/cycles/util/util_types_float8_impl.h index ebf8260bc7c..84fe233c334 100644 --- a/intern/cycles/util/util_types_float8_impl.h +++ b/intern/cycles/util/util_types_float8_impl.h @@ -55,12 +55,12 @@ __forceinline float8::float8(const __m256& f) { } -__forceinline float8::operator const __m256&(void) const +__forceinline float8::operator const __m256&() const { return m256; } -__forceinline float8::operator __m256&(void) +__forceinline float8::operator __m256&() { return m256; } diff --git a/intern/cycles/util/util_types_int3.h b/intern/cycles/util/util_types_int3.h index 9d43b201c02..f68074b982b 100644 --- a/intern/cycles/util/util_types_int3.h +++ b/intern/cycles/util/util_types_int3.h @@ -35,8 +35,8 @@ struct ccl_try_align(16) int3 { __forceinline int3(const int3& a); __forceinline explicit int3(const __m128i& a); - __forceinline operator const __m128i&(void) const; - __forceinline operator __m128i&(void); + __forceinline operator const __m128i&() const; + __forceinline operator __m128i&(); __forceinline int3& operator =(const int3& a); #else /* __KERNEL_SSE__ */ diff --git a/intern/cycles/util/util_types_int3_impl.h b/intern/cycles/util/util_types_int3_impl.h index ada50c4812c..1b195ca753f 100644 --- a/intern/cycles/util/util_types_int3_impl.h +++ b/intern/cycles/util/util_types_int3_impl.h @@ -43,12 +43,12 @@ __forceinline int3::int3(const int3& a) { } -__forceinline int3::operator const __m128i&(void) const +__forceinline int3::operator const __m128i&() const { return m128; } -__forceinline int3::operator __m128i&(void) +__forceinline int3::operator __m128i&() { return m128; } diff --git a/intern/cycles/util/util_types_int4.h b/intern/cycles/util/util_types_int4.h index 4ef162f1ac6..52e6fed8c14 100644 --- a/intern/cycles/util/util_types_int4.h +++ b/intern/cycles/util/util_types_int4.h @@ -39,8 +39,8 @@ struct ccl_try_align(16) int4 { __forceinline int4(const int4& a); __forceinline explicit int4(const __m128i& a); - __forceinline operator const __m128i&(void) const; - __forceinline operator __m128i&(void); + __forceinline operator const __m128i&() const; + __forceinline operator __m128i&(); __forceinline int4& operator=(const int4& a); #else /* __KERNEL_SSE__ */ diff --git a/intern/cycles/util/util_types_int4_impl.h b/intern/cycles/util/util_types_int4_impl.h index a62561709de..c058f86c400 100644 --- a/intern/cycles/util/util_types_int4_impl.h +++ b/intern/cycles/util/util_types_int4_impl.h @@ -43,12 +43,12 @@ __forceinline int4::int4(const __m128i& a) { } -__forceinline int4::operator const __m128i&(void) const +__forceinline int4::operator const __m128i&() const { return m128; } -__forceinline int4::operator __m128i&(void) +__forceinline int4::operator __m128i&() { return m128; } diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h index fb9c5784adf..18fa231d6e7 100644 --- a/intern/cycles/util/util_vector.h +++ b/intern/cycles/util/util_vector.h @@ -43,7 +43,7 @@ public: using BaseClass::vector; /* Try as hard as possible to use zero memory. */ - void free_memory(void) + void free_memory() { BaseClass::resize(0); BaseClass::shrink_to_fit(); diff --git a/intern/cycles/util/util_view.cpp b/intern/cycles/util/util_view.cpp index 3836cc86ee0..9dffd7a80bd 100644 --- a/intern/cycles/util/util_view.cpp +++ b/intern/cycles/util/util_view.cpp @@ -215,7 +215,7 @@ static void view_motion(int x, int y) V.mouseY = y; } -static void view_idle(void) +static void view_idle() { if(V.redraw) { V.redraw = false; diff --git a/intern/cycles/util/util_view.h b/intern/cycles/util/util_view.h index a757b56a5d2..ae50b098b39 100644 --- a/intern/cycles/util/util_view.h +++ b/intern/cycles/util/util_view.h @@ -22,10 +22,10 @@ CCL_NAMESPACE_BEGIN -typedef void (*ViewInitFunc)(void); -typedef void (*ViewExitFunc)(void); +typedef void (*ViewInitFunc)(); +typedef void (*ViewExitFunc)(); typedef void (*ViewResizeFunc)(int width, int height); -typedef void (*ViewDisplayFunc)(void); +typedef void (*ViewDisplayFunc)(); typedef void (*ViewKeyboardFunc)(unsigned char key); typedef void (*ViewMotionFunc)(int x, int y, int button); -- cgit v1.2.3