From 7ce807c817345967db78943b9cabcfc50de1eb85 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 17 Mar 2010 16:02:19 +0100 Subject: [PATCH] Reduce compiler warnings on Windows build --- bacula/src/baconfig.h | 3 +++ bacula/src/lib/alist.c | 4 +--- bacula/src/lib/alist.h | 4 +--- bacula/src/win32/compat/compat.cpp | 12 +++++++----- bacula/src/win32/filed/vss.cpp | 8 +++++++- bacula/src/win32/filed/vss.h | 3 +++ bacula/src/win32/filed/vss_generic.cpp | 1 + 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 3bf4b52342..5d3036a942 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -83,6 +83,9 @@ #define WIN32_REPARSE_POINT 1 #define WIN32_MOUNT_POINT 2 +/* Reduce compiler warnings from Windows vss code */ +#define uuid(x) + void InitWinAPIWrapper(); #define OSDependentInit() InitWinAPIWrapper() diff --git a/bacula/src/lib/alist.c b/bacula/src/lib/alist.c index 7b53dfe8bc..71befece8d 100644 --- a/bacula/src/lib/alist.c +++ b/bacula/src/lib/alist.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2003-2008 Free Software Foundation Europe e.V. + Copyright (C) 2003-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -34,8 +34,6 @@ * * Kern Sibbald, June MMIII * - * Version $Id$ - * */ #include "bacula.h" diff --git a/bacula/src/lib/alist.h b/bacula/src/lib/alist.h index d19bf5393c..73154c437c 100644 --- a/bacula/src/lib/alist.h +++ b/bacula/src/lib/alist.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2003-2008 Free Software Foundation Europe e.V. + Copyright (C) 2003-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -26,8 +26,6 @@ Switzerland, email:ftf@fsfeurope.org. */ /* - * Version $Id$ - * * Kern Sibbald, June MMIII */ diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index e36763584c..3c8811051d 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -45,11 +45,12 @@ #define MAX_PATHLENGTH 1024 -/* UTF-8 to UCS2 path conversion is expensive, +/** + UTF-8 to UCS2 path conversion is expensive, so we cache the conversion. During backup the conversion is called 3 times (lstat, attribs, open), - by using the cache this is reduced to 1 time */ - + by using the cache this is reduced to 1 time + */ static POOLMEM *g_pWin32ConvUTF8Cache = NULL; static POOLMEM *g_pWin32ConvUCS2Cache = NULL; static DWORD g_dwWin32ConvUTF8strlen = 0; @@ -161,8 +162,9 @@ static void conv_unix_to_vss_win32_path(const char *name, char *win32_name, DWOR } name++; } - /** Strip any trailing slash, if we stored something */ - /** but leave "c:\" with backslash (root directory case */ + /** Strip any trailing slash, if we stored something + * but leave "c:\" with backslash (root directory case + */ if (*fname != 0 && win32_name[-1] == '\\' && strlen (fname) != 3) { win32_name[-1] = 0; } else { diff --git a/bacula/src/win32/filed/vss.cpp b/bacula/src/win32/filed/vss.cpp index 5e78ef8ce9..45ce160c69 100644 --- a/bacula/src/win32/filed/vss.cpp +++ b/bacula/src/win32/filed/vss.cpp @@ -215,7 +215,13 @@ const char* VSSClient::GetWriterInfo(int nIndex) const int VSSClient::GetWriterState(int nIndex) { alist* pV = m_pAlistWriterState; - return (int64_t)pV->get(nIndex); + void *item = pV->get(nIndex); +/* Eliminate compiler warnings */ +#ifdef HAVE_VSS64 + return (int64_t)(char *)item; +#else + return (int)(char *)item; +#endif } void VSSClient::AppendWriterInfo(int nState, const char* pszInfo) diff --git a/bacula/src/win32/filed/vss.h b/bacula/src/win32/filed/vss.h index 04ea7acc65..9a0192eae5 100644 --- a/bacula/src/win32/filed/vss.h +++ b/bacula/src/win32/filed/vss.h @@ -146,6 +146,9 @@ private: extern VSSClient *g_pVSSClient; +BOOL VSSPathConvert(const char *szFilePath, char *szShadowPath, int nBuflen); +BOOL VSSPathConvertW(const wchar_t *szFilePath, wchar_t *szShadowPath, int nBuflen); + #endif /* WIN32_VSS */ #endif /* __VSS_H_ */ diff --git a/bacula/src/win32/filed/vss_generic.cpp b/bacula/src/win32/filed/vss_generic.cpp index 034113e42f..4719994547 100644 --- a/bacula/src/win32/filed/vss_generic.cpp +++ b/bacula/src/win32/filed/vss_generic.cpp @@ -81,6 +81,7 @@ class IXMLDOMDocument; #endif /* Reduce compiler warnings from Windows vss code */ +#undef uuid #define uuid(x) #ifdef B_VSS_XP -- 2.39.5