Skip to content

Commit

Permalink
Fix type narrowing
Browse files Browse the repository at this point in the history
According to documentation `_mm_getcsr` return type is `unsigned int`.
Some GCC versions emit an error for this kind or type narrowing.
  • Loading branch information
bader authored and keryell committed Aug 15, 2019
1 parent 593b050 commit 887b75f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oclmath/rounding_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void *FlushToZero( void )
{
#if defined( __APPLE__ ) || defined(__linux__) || defined (_WIN32)
#if defined( __i386__ ) || defined( __x86_64__ ) || defined(_MSC_VER)
union{ int i; void *p; }u = { _mm_getcsr() };
union{ unsigned int i; void *p; }u = { _mm_getcsr() };
_mm_setcsr( u.i | 0x8040 );
return u.p;
#elif defined( __arm__ )
Expand Down

0 comments on commit 887b75f

Please sign in to comment.