1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

fix compiler warning

This commit is contained in:
Yang Tse 2010-02-22 02:37:13 +00:00
parent 10affed097
commit dc9f0a9758
3 changed files with 19 additions and 3 deletions

View File

@ -70,11 +70,11 @@ static void decodeQuantum(unsigned char *dest, const char *src)
x = (x << 6); x = (x << 6);
} }
dest[2] = (unsigned char)(x & 0xFFUL); dest[2] = Curl_ultouc(x);
x >>= 8; x >>= 8;
dest[1] = (unsigned char)(x & 0xFFUL); dest[1] = Curl_ultouc(x);
x >>= 8; x >>= 8;
dest[0] = (unsigned char)(x & 0xFFUL); dest[0] = Curl_ultouc(x);
} }
/* /*

View File

@ -38,3 +38,17 @@ unsigned short Curl_ultous(unsigned long ulnum)
# pragma warning(pop) # pragma warning(pop)
#endif #endif
} }
unsigned char Curl_ultouc(unsigned long ulnum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
return (unsigned char)(ulnum & 0xFFUL);
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
}

View File

@ -25,4 +25,6 @@
unsigned short Curl_ultous(unsigned long ulnum); unsigned short Curl_ultous(unsigned long ulnum);
unsigned char Curl_ultouc(unsigned long ulnum);
#endif /* HEADER_CURL_WARNLESS_H */ #endif /* HEADER_CURL_WARNLESS_H */