From 8cbbdedaf4dfec9e320e7e2be58b75d256950df1 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 20 Jul 2020 12:16:20 +0200 Subject: Refactor: Update integer type usage This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows. --- source/blender/functions/FN_multi_function.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/functions/FN_multi_function.hh') diff --git a/source/blender/functions/FN_multi_function.hh b/source/blender/functions/FN_multi_function.hh index 35f144368ac..77ab2749377 100644 --- a/source/blender/functions/FN_multi_function.hh +++ b/source/blender/functions/FN_multi_function.hh @@ -63,7 +63,7 @@ class MultiFunction { virtual void call(IndexMask mask, MFParams params, MFContext context) const = 0; - virtual uint32_t hash() const + virtual uint64_t hash() const { return DefaultHash{}(this); } @@ -73,7 +73,7 @@ class MultiFunction { return false; } - uint param_amount() const + int param_amount() const { return signature_.param_types.size(); } @@ -83,12 +83,12 @@ class MultiFunction { return signature_.param_types.index_range(); } - MFParamType param_type(uint param_index) const + MFParamType param_type(int param_index) const { return signature_.param_types[param_index]; } - StringRefNull param_name(uint param_index) const + StringRefNull param_name(int param_index) const { return signature_.param_names[param_index]; } @@ -111,7 +111,7 @@ class MultiFunction { } }; -inline MFParamsBuilder::MFParamsBuilder(const class MultiFunction &fn, uint min_array_size) +inline MFParamsBuilder::MFParamsBuilder(const class MultiFunction &fn, int64_t min_array_size) : MFParamsBuilder(fn.signature(), min_array_size) { } -- cgit v1.2.3