* GCC4 compile fix by Fredrik Ekdahl

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2007-06-10 20:29:44 +00:00
parent a9c2d6b320
commit e31380534b
1 changed files with 13 additions and 12 deletions

View File

@ -24,21 +24,22 @@ constrain(float& value, float min, float max)
// constrain_int32_0_255_asm
inline int32
constrain_int32_0_255_asm(int32 value) {
asm("movl $0, %%ecx;
movl $255, %%edx;
cmpl %%ecx, %%eax;
cmovl %%ecx, %%eax;
cmpl %%edx, %%eax;
cmovg %%edx, %%eax"
: "=a" (value)
: "a" (value)
: "%ecx", "%edx" );
return value;
asm("movl $0, %%ecx\n\t"
"movl $255, %%edx\n\t"
"cmpl %%ecx, %%eax\n\t"
"cmovl %%ecx, %%eax\n\t"
"cmpl %%edx, %%eax\n\t"
"cmovg %%edx, %%eax"
: "=a" (value)
: "a" (value)
: "%ecx", "%edx" );
return value;
}
inline int32
constrain_int32_0_255_c(int32 value) {
return max_c(0, min_c(255, value));
constrain_int32_0_255_c(int32 value)
{
return max_c(0, min_c(255, value));
}
#define constrain_int32_0_255 constrain_int32_0_255_asm