Review Request: value.cpp: 224: comparison between signed and unsigned integer

David Jarvie djarvie at kde.org
Mon Oct 12 09:55:49 BST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1830/#review2611
-----------------------------------------------------------


Always use static_cast<unsigned>() etc. rather than the C-style (unsigned) cast. This is safer in that it only allows casts between compatible types, and has the advantage that it is clearer to people reading the code later that it has been done in a safe way.

- David


On 2009-10-11 16:27:00, Guy Maurel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1830/
> -----------------------------------------------------------
> 
> (Updated 2009-10-11 16:27:00)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> The kdelibs-Dashboard reports:
> /.../kdelibs/kjs/value.cpp:224: warning: comparison between signed and unsigned integer expressions
> 
> at
> Value* JSValue::getByIndex(ExecState* exec, unsigned propertyName) const
> 
> my proposal is to make a little change, a cast
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/kjs/value.cpp 1033934 
> 
> Diff: http://reviewboard.kde.org/r/1830/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Guy
> 
>





More information about the kde-core-devel mailing list