Hi Tobias, On Wed, Jan 21, 2015 at 05:06:25AM -0800, Tobias Madl <tobias.madl.dev@gmail.com> wrote:
enum class IdlePriority { - VCL_IDLE_PRIORITY_STARVATIONPROTECTION = -1, // Do not use this for normal prioritizing! - - VCL_IDLE_PRIORITY_HIGHEST = 0, // -> 0ms - VCL_IDLE_PRIORITY_HIGH = 1, // -> 1ms - VCL_IDLE_PRIORITY_DEFAULT = 1, // -> 1ms - VCL_IDLE_PRIORITY_REPAINT = 2, // -> 30ms - VCL_IDLE_PRIORITY_RESIZE = 3, // -> 50ms - VCL_IDLE_PRIORITY_MEDIUM = 3, // -> 50ms - VCL_IDLE_PRIORITY_LOW = 4, // -> 100ms - VCL_IDLE_PRIORITY_LOWER = 5, // -> 200ms - VCL_IDLE_PRIORITY_LOWEST = 6 // -> 400ms + VCL_IDLE_PRIORITY_HIGHEST, + VCL_IDLE_PRIORITY_HIGH, + VCL_IDLE_PRIORITY_REPAINT, + VCL_IDLE_PRIORITY_RESIZE, + VCL_IDLE_PRIORITY_MEDIUM, + VCL_IDLE_PRIORITY_LOW, + VCL_IDLE_PRIORITY_LOWER, + VCL_IDLE_PRIORITY_LOWEST
What's the benefit of still having the VCL_IDLE_PRIORITY_ prefix here if the scope name already includes IdlePriority?
+inline sal_Int32 convertToInt( IdlePriority ePriority ) +{ + switch (ePriority) + { + case IdlePriority::VCL_IDLE_PRIORITY_HIGHEST: + return 0; + case IdlePriority::VCL_IDLE_PRIORITY_HIGH: + return 1;
Can't you just use static_cast<sal_Int32>(ePriority) and avoid hand-coding this method?
+ return 42; // Should not happen
If you still consider convertToInt() necessary, what about including an assert(false) here before returning a random value? Regards, Miklos
Attachment:
signature.asc
Description: Digital signature