mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:43:38 +03:00
tests: change from curlx_ultous to util_ultous
Since the former function is getting removed from the lib. Closes #16319
This commit is contained in:
parent
b696fc129b
commit
2e9773b76a
8 changed files with 32 additions and 9 deletions
|
|
@ -899,3 +899,24 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
|
|||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** unsigned long to unsigned short
|
||||
*/
|
||||
#define CURL_MASK_USHORT ((unsigned short)~0)
|
||||
#define CURL_MASK_SSHORT (CURL_MASK_USHORT >> 1)
|
||||
|
||||
unsigned short util_ultous(unsigned long ulnum)
|
||||
{
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:810) /* conversion may lose significant bits */
|
||||
#endif
|
||||
|
||||
DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_USHORT);
|
||||
return (unsigned short)(ulnum & (unsigned long) CURL_MASK_USHORT);
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue