Png: avoid multiplication at int precision, then converting to long
Change-Id: Id05d1db07ae7e8978b2a6b989b6366ae66d0e9de
This commit is contained in:
parent
d4d4a11750
commit
6a08b44433
2 changed files with 3 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
||||||
Checks: 'clang-diagnostic-*,performance-*,unused-*,misc-*,-misc-macro-parentheses,readability-redundant-*'
|
Checks: 'clang-diagnostic-*,performance-*,unused-*,misc-*,-misc-macro-parentheses,readability-redundant-*,-readability-redundant-declaration'
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
|
|
||||||
|
|
|
@ -160,14 +160,14 @@ bool encodeBufferToPNG(unsigned char* pixmap, int width, int height,
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint64_t hashBuffer(unsigned char* pixmap, int width, int height)
|
uint64_t hashBuffer(unsigned char* pixmap, long width, long height)
|
||||||
{
|
{
|
||||||
return SpookyHash::Hash64(pixmap, width * height * 4, 1073741789);
|
return SpookyHash::Hash64(pixmap, width * height * 4, 1073741789);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint64_t hashSubBuffer(unsigned char* pixmap, size_t startX, size_t startY,
|
uint64_t hashSubBuffer(unsigned char* pixmap, size_t startX, size_t startY,
|
||||||
int width, int height, int bufferWidth, int bufferHeight)
|
long width, long height, int bufferWidth, int bufferHeight)
|
||||||
{
|
{
|
||||||
if (bufferWidth < width || bufferHeight < height)
|
if (bufferWidth < width || bufferHeight < height)
|
||||||
return 0; // magic invalid hash.
|
return 0; // magic invalid hash.
|
||||||
|
|
Loading…
Reference in a new issue