From b7f3f1b68f7597721347e861df31f07b9b6f0c52 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 21 Nov 2015 11:41:20 +0000 Subject: smb.c: Fixed compilation warnings smb.c:134:3: warning: conversion to 'short unsigned int' from 'int' may alter its value smb.c:146:42: warning: conversion to 'unsigned int' from 'long long unsigned int' may alter its value smb.c:146:65: warning: conversion to 'unsigned int' from 'long long unsigned int' may alter its value --- lib/smb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/smb.c b/lib/smb.c index d461a712c..8e2c1647b 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -131,7 +131,7 @@ const struct Curl_handler Curl_handler_smbs = { defined(__OS400__) static unsigned short smb_swap16(unsigned short x) { - return (x << 8) | ((x >> 8) & 0xff); + return (unsigned short) ((x << 8) | ((x >> 8) & 0xff)); } static unsigned int smb_swap32(unsigned int x) @@ -143,12 +143,14 @@ static unsigned int smb_swap32(unsigned int x) #ifdef HAVE_LONGLONG static unsigned long long smb_swap64(unsigned long long x) { - return ((unsigned long long)smb_swap32(x) << 32) | smb_swap32(x >> 32); + return ((unsigned long long) smb_swap32((unsigned int) x) << 32) | + smb_swap32((unsigned int) (x >> 32)); } #else static unsigned __int64 smb_swap64(unsigned __int64 x) { - return ((unsigned __int64)smb_swap32(x) << 32) | smb_swap32(x >> 32); + return ((unsigned __int64) smb_swap32((unsigned int) x) << 32) | + smb_swap32((unsigned int) (x >> 32)); } #endif #else -- cgit v1.2.3