Commit 8ef6863a authored by Davis King's avatar Davis King

Switched randomly_color_image() to use the non-pointer based version of

murmur_hash3() to avoid violation of the strict aliasing rule.  In particular,
the previous version didn't work correctly in gcc 4.7.2 when optimizations were
enabled.
parent bba96f36
......@@ -33,7 +33,7 @@ namespace dlib
const unsigned long gray = get_pixel_intensity(img[r][c]);
if (gray != 0)
{
const uint32 h = murmur_hash3(&gray, sizeof(gray));
const uint32 h = murmur_hash3_2(gray,0);
rgb_pixel pix;
pix.red = static_cast<unsigned char>(h)%200 + 55;
pix.green = static_cast<unsigned char>(h>>8)%200 + 55;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment