diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c index 4b73a5fe80c..1a2c0e29dde 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -4294,7 +4294,11 @@ struct ct_color | |||
| 4294 | 4294 | ||
| 4295 | /* Value is a hash of the RGB color given by R, G, and B. */ | 4295 | /* Value is a hash of the RGB color given by R, G, and B. */ |
| 4296 | 4296 | ||
| 4297 | #define CT_HASH_RGB(R, G, B) (((R) << 16) ^ ((G) << 8) ^ (B)) | 4297 | static unsigned |
| 4298 | ct_hash_rgb (unsigned r, unsigned g, unsigned b) | ||
| 4299 | { | ||
| 4300 | return (r << 16) ^ (g << 8) ^ b; | ||
| 4301 | } | ||
| 4298 | 4302 | ||
| 4299 | /* The color hash table. */ | 4303 | /* The color hash table. */ |
| 4300 | 4304 | ||
| @@ -4349,7 +4353,7 @@ free_color_table (void) | |||
| 4349 | static unsigned long | 4353 | static unsigned long |
| 4350 | lookup_rgb_color (struct frame *f, int r, int g, int b) | 4354 | lookup_rgb_color (struct frame *f, int r, int g, int b) |
| 4351 | { | 4355 | { |
| 4352 | unsigned hash = CT_HASH_RGB (r, g, b); | 4356 | unsigned hash = ct_hash_rgb (r, g, b); |
| 4353 | int i = hash % CT_SIZE; | 4357 | int i = hash % CT_SIZE; |
| 4354 | struct ct_color *p; | 4358 | struct ct_color *p; |
| 4355 | Display_Info *dpyinfo; | 4359 | Display_Info *dpyinfo; |