浏览代码

[rtextures] Fix Undefined behaviour in ColorToInt (#3996)

pull/3999/head
OetkenPurveyorOfCode 10 个月前
committed by GitHub
父节点
当前提交
9ef29aff9a
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. +1
    -3
      src/rtextures.c

+ 1
- 3
src/rtextures.c 查看文件

@ -4510,9 +4510,7 @@ Color Fade(Color color, float alpha)
// Get hexadecimal value for a Color // Get hexadecimal value for a Color
int ColorToInt(Color color) int ColorToInt(Color color)
{ {
int result = (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a);
return result;
return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a);
} }
// Get color normalized as float [0..1] // Get color normalized as float [0..1]

正在加载...
取消
保存