Cycles: Cleanup, don't use strict C prototypes
Those are more like a legacy of language, which is not needed in C++.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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<void(void)> bind_display_space_shader_cb;
|
||||
function<void(void)> unbind_display_space_shader_cb;
|
||||
function<void()> bind_display_space_shader_cb;
|
||||
function<void()> unbind_display_space_shader_cb;
|
||||
};
|
||||
|
||||
class Device {
|
||||
|
||||
@@ -1065,7 +1065,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
|
||||
devices.insert(devices.begin(), info);
|
||||
}
|
||||
|
||||
string device_cpu_capabilities(void)
|
||||
string device_cpu_capabilities()
|
||||
{
|
||||
string capabilities = "";
|
||||
capabilities += system_cpu_support_sse2() ? "SSE2 " : "";
|
||||
|
||||
@@ -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<DeviceInfo>& 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) {
|
||||
|
||||
@@ -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<DeviceInfo>& devices);
|
||||
void device_cuda_info(vector<DeviceInfo>& devices);
|
||||
void device_network_info(vector<DeviceInfo>& 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
|
||||
|
||||
|
||||
@@ -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<DeviceInfo>& devices)
|
||||
}
|
||||
}
|
||||
|
||||
string device_opencl_capabilities(void)
|
||||
string device_opencl_capabilities()
|
||||
{
|
||||
if(OpenCLInfo::device_type() == 0) {
|
||||
return "All OpenCL devices are forced to be OFF";
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
function<void(long, int)> update_progress_sample;
|
||||
function<void(RenderTile&)> update_tile_sample;
|
||||
function<void(RenderTile&)> release_tile;
|
||||
function<bool(void)> get_cancel;
|
||||
function<bool()> get_cancel;
|
||||
function<void(RenderTile*, Device*)> map_neighbor_tiles;
|
||||
function<void(RenderTile*, Device*)> unmap_neighbor_tiles;
|
||||
|
||||
|
||||
@@ -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)) {}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
return cancel_message;
|
||||
}
|
||||
|
||||
void set_cancel_callback(function<void(void)> function)
|
||||
void set_cancel_callback(function<void()> function)
|
||||
{
|
||||
cancel_cb = function;
|
||||
}
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void set_update_callback(function<void(void)> function)
|
||||
void set_update_callback(function<void()> function)
|
||||
{
|
||||
update_cb = function;
|
||||
}
|
||||
@@ -331,8 +331,8 @@ public:
|
||||
protected:
|
||||
thread_mutex progress_mutex;
|
||||
thread_mutex update_mutex;
|
||||
function<void(void)> update_cb;
|
||||
function<void(void)> cancel_cb;
|
||||
function<void()> update_cb;
|
||||
function<void()> 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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
thread::thread(function<void(void)> run_cb, int group)
|
||||
thread::thread(function<void()> run_cb, int group)
|
||||
: run_cb_(run_cb),
|
||||
joined_(false),
|
||||
group_(group)
|
||||
|
||||
@@ -46,14 +46,14 @@ typedef std::condition_variable thread_condition_variable;
|
||||
|
||||
class thread {
|
||||
public:
|
||||
thread(function<void(void)> run_cb, int group = -1);
|
||||
thread(function<void()> run_cb, int group = -1);
|
||||
~thread();
|
||||
|
||||
static void *run(void *arg);
|
||||
bool join();
|
||||
|
||||
protected:
|
||||
function<void(void)> run_cb_;
|
||||
function<void()> run_cb_;
|
||||
std::thread thread_;
|
||||
bool joined_;
|
||||
int group_;
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user