Commit dc9f0a97 authored by Yang Tse's avatar Yang Tse
Browse files

fix compiler warning
parent 10affed0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ static void decodeQuantum(unsigned char *dest, const char *src)
      x = (x << 6);
  }

  dest[2] = (unsigned char)(x & 0xFFUL);
  dest[2] = Curl_ultouc(x);
  x >>= 8;
  dest[1] = (unsigned char)(x & 0xFFUL);
  dest[1] = Curl_ultouc(x);
  x >>= 8;
  dest[0] = (unsigned char)(x & 0xFFUL);
  dest[0] = Curl_ultouc(x);
}

/*
+14 −0
Original line number Diff line number Diff line
@@ -38,3 +38,17 @@ unsigned short Curl_ultous(unsigned long ulnum)
#  pragma warning(pop)
#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
}
+2 −0
Original line number Diff line number Diff line
@@ -25,4 +25,6 @@

unsigned short Curl_ultous(unsigned long ulnum);

unsigned char Curl_ultouc(unsigned long ulnum);

#endif /* HEADER_CURL_WARNLESS_H */