0004-Fix-build-with-gcc-10.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. From 78b760eae21d7b340c69e8abab8ca706e1e00adc Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Stefan=20S=C3=B8rensen?= <stefan.sorensen@spectralink.com>
  3. Date: Mon, 4 May 2020 09:19:46 +0200
  4. Subject: [PATCH] Fix build with gcc 10.
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Add cast to code that mixes HRESULT (aka long) and DWORD (aka unsigned
  9. int) which causes an narrowing error with gcc 10.
  10. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  11. ---
  12. CPP/Windows/ErrorMsg.cpp | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp
  15. index 99684ae..ab48352 100644
  16. --- a/CPP/Windows/ErrorMsg.cpp
  17. +++ b/CPP/Windows/ErrorMsg.cpp
  18. @@ -13,7 +13,7 @@ UString MyFormatMessage(DWORD errorCode)
  19. const char * txt = 0;
  20. AString msg;
  21. - switch(errorCode) {
  22. + switch((HRESULT)errorCode) {
  23. case ERROR_NO_MORE_FILES : txt = "No more files"; break ;
  24. case E_NOTIMPL : txt = "E_NOTIMPL"; break ;
  25. case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ;
  26. --
  27. 2.26.2