eliminate compilation warnings

minor

minor

minor
This commit is contained in:
Nomango 2019-08-05 10:00:30 +08:00
parent 22d0fd4e2a
commit 597f33a9fb
28 changed files with 185 additions and 130 deletions

View File

@ -126,7 +126,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -138,7 +138,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -153,7 +153,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -170,7 +170,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@ -80,7 +80,7 @@ namespace kiwano
LPVOID buffer;
DWORD buffer_size;
if (!res.Load(buffer, buffer_size)) { return false; }
if (!res.Load(buffer, buffer_size)) { return E_FAIL; }
stream = kiwano::modules::Shlwapi::Get().SHCreateMemStream(
static_cast<const BYTE*>(buffer),
@ -268,4 +268,4 @@ namespace kiwano
return hr;
}
}
}
}

View File

@ -28,6 +28,8 @@ namespace kiwano
namespace modules
{
XAudio2::XAudio2()
: xaudio2(nullptr)
, XAudio2Create(nullptr)
{
const auto xaudio2_dll_names =
{
@ -55,6 +57,15 @@ namespace kiwano
}
MediaFoundation::MediaFoundation()
: mfplat(nullptr)
, mfreadwrite(nullptr)
, MFStartup(nullptr)
, MFShutdown(nullptr)
, MFCreateMediaType(nullptr)
, MFCreateWaveFormatExFromMFMediaType(nullptr)
, MFCreateSourceReaderFromURL(nullptr)
, MFCreateSourceReaderFromByteStream(nullptr)
, MFCreateMFByteStreamOnStream(nullptr)
{
mfplat = LoadLibraryW(L"Mfplat.dll");
if (mfplat)
@ -97,4 +108,4 @@ namespace kiwano
}
}
}
}
}

View File

@ -135,7 +135,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -147,7 +147,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -162,7 +162,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -179,7 +179,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@ -259,17 +259,25 @@ static void ImGui_ImplDX11_CreateFontsTexture()
subResource.pSysMem = pixels;
subResource.SysMemPitch = desc.Width * 4;
subResource.SysMemSlicePitch = 0;
g_pd3dDevice->CreateTexture2D(&desc, &subResource, &pTexture);
kiwano::ThrowIfFailed(
g_pd3dDevice->CreateTexture2D(&desc, &subResource, &pTexture)
);
// Create texture view
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
ZeroMemory(&srvDesc, sizeof(srvDesc));
srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = desc.MipLevels;
srvDesc.Texture2D.MostDetailedMip = 0;
g_pd3dDevice->CreateShaderResourceView(pTexture, &srvDesc, &g_pFontTextureView);
pTexture->Release();
if (pTexture)
{
// Create texture view
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
ZeroMemory(&srvDesc, sizeof(srvDesc));
srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = desc.MipLevels;
srvDesc.Texture2D.MostDetailedMip = 0;
kiwano::ThrowIfFailed(
g_pd3dDevice->CreateShaderResourceView(pTexture, &srvDesc, &g_pFontTextureView)
);
pTexture->Release();
}
}
// Store our identifier

View File

@ -124,7 +124,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -136,7 +136,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -151,7 +151,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -168,7 +168,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>../</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@ -258,9 +258,7 @@ namespace kiwano
//-------------------------------------------------------
ActionScaleBy::ActionScaleBy(Duration duration, float scale, EaseFunc func)
: ActionTween(duration, func)
, delta_x_(scale)
, delta_y_(scale)
: ActionScaleBy(duration, scale, scale, func)
{
}
@ -268,6 +266,8 @@ namespace kiwano
: ActionTween(duration, func)
, delta_x_(scale_x)
, delta_y_(scale_y)
, start_scale_x_(0.f)
, start_scale_y_(0.f)
{
}
@ -329,6 +329,7 @@ namespace kiwano
ActionFadeTo::ActionFadeTo(Duration duration, float opacity, EaseFunc func)
: ActionTween(duration, func)
, delta_val_(0.f)
, start_val_(0.f)
, end_val_(opacity)
{
}

View File

@ -239,7 +239,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -250,7 +250,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -264,7 +264,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -280,7 +280,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<TreatWarningAsError>true</TreatWarningAsError>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -25,7 +25,8 @@ namespace kiwano
{
Resource::Resource(LPCWSTR file_name)
: type_(Type::File)
, file_name_(nullptr)
, bin_name_(nullptr)
, bin_type_(nullptr)
{
if (file_name)
file_name_ = new (std::nothrow) String(file_name);
@ -33,7 +34,8 @@ namespace kiwano
Resource::Resource(String const& file_name)
: type_(Type::File)
, file_name_(nullptr)
, bin_name_(nullptr)
, bin_type_(nullptr)
{
if (!file_name.empty())
file_name_ = new (std::nothrow) String(file_name);

View File

@ -226,7 +226,7 @@ namespace kiwano
if (callable_) callable_->AddRef();
}
Closure(Closure&& rhs)
Closure(Closure&& rhs) noexcept
: callable_(rhs.callable_)
{
rhs.callable_ = nullptr;

View File

@ -395,14 +395,6 @@ namespace kiwano
difference_type it_;
};
template <typename _BasicJsonTy>
struct internal_iterator
{
typename _BasicJsonTy::array_type::iterator array_iter;
typename _BasicJsonTy::object_type::iterator object_iter;
primitive_iterator original_iter = 0; // for other types
};
template <typename _BasicJsonTy>
struct iterator_impl
{
@ -422,7 +414,38 @@ namespace kiwano
using pointer = value_type*;
using reference = value_type&;
inline iterator_impl(pointer json = nullptr) : data_(json) {}
using array_iterator = typename _BasicJsonTy::array_type::iterator;
using object_iterator = typename _BasicJsonTy::object_type::iterator;
inline iterator_impl(pointer json = nullptr) : data_(json), primitive_iter(0), array_iter(), object_iter() {}
inline iterator_impl(const iterator_impl& rhs) : iterator_impl()
{
operator=(rhs);
}
~iterator_impl() {}
inline iterator_impl& operator=(const iterator_impl& rhs)
{
data_ = rhs.data_;
if (data_)
{
switch (data_->type())
{
case JsonType::Object:
object_iter = rhs.object_iter;
break;
case JsonType::Array:
array_iter = rhs.array_iter;
break;
default:
primitive_iter = rhs.primitive_iter;
break;
}
}
return (*this);
}
inline reference operator*() const
{
@ -431,9 +454,9 @@ namespace kiwano
switch (data_->type())
{
case JsonType::Object:
return (it_.object_iter->second);
return (object_iter->second);
case JsonType::Array:
return (*it_.array_iter);
return (*array_iter);
default:
return *data_;
}
@ -446,9 +469,9 @@ namespace kiwano
switch (data_->type())
{
case JsonType::Object:
return &(it_.object_iter->second);
return &(object_iter->second);
case JsonType::Array:
return &(*it_.array_iter);
return &(*array_iter);
default:
return data_;
}
@ -460,7 +483,7 @@ namespace kiwano
check_iterator();
if (!data_->is_object())
throw json_invalid_iterator("cannot use key() with non-object type");
return it_.object_iter->first;
return object_iter->first;
}
inline reference value() const
@ -476,17 +499,17 @@ namespace kiwano
{
case JsonType::Object:
{
it_.object_iter = data_->value_.data.object->begin();
object_iter = data_->value_.data.object->begin();
break;
}
case JsonType::Array:
{
it_.array_iter = data_->value_.data.vector->begin();
array_iter = data_->value_.data.vector->begin();
break;
}
default:
{
it_.original_iter.set_begin();
primitive_iter.set_begin();
break;
}
}
@ -500,17 +523,17 @@ namespace kiwano
{
case JsonType::Object:
{
it_.object_iter = data_->value_.data.object->end();
object_iter = data_->value_.data.object->end();
break;
}
case JsonType::Array:
{
it_.array_iter = data_->value_.data.vector->end();
array_iter = data_->value_.data.vector->end();
break;
}
default:
{
it_.original_iter.set_end();
primitive_iter.set_end();
break;
}
}
@ -525,17 +548,17 @@ namespace kiwano
{
case JsonType::Object:
{
std::advance(it_.object_iter, 1);
std::advance(object_iter, 1);
break;
}
case JsonType::Array:
{
std::advance(it_.array_iter, 1);
std::advance(array_iter, 1);
break;
}
default:
{
++it_.original_iter;
++primitive_iter;
break;
}
}
@ -551,17 +574,17 @@ namespace kiwano
{
case JsonType::Object:
{
std::advance(it_.object_iter, -1);
std::advance(object_iter, -1);
break;
}
case JsonType::Array:
{
std::advance(it_.array_iter, -1);
std::advance(array_iter, -1);
break;
}
default:
{
--it_.original_iter;
--primitive_iter;
break;
}
}
@ -584,12 +607,12 @@ namespace kiwano
}
case JsonType::Array:
{
std::advance(it_.array_iter, off);
std::advance(array_iter, off);
break;
}
default:
{
it_.original_iter += off;
primitive_iter += off;
break;
}
}
@ -609,15 +632,15 @@ namespace kiwano
{
case JsonType::Object:
{
return it_.object_iter == other.it_.object_iter;
return object_iter == other.object_iter;
}
case JsonType::Array:
{
return it_.array_iter == other.it_.array_iter;
return array_iter == other.array_iter;
}
default:
{
return it_.original_iter == other.it_.original_iter;
return primitive_iter == other.primitive_iter;
}
}
}
@ -638,9 +661,9 @@ namespace kiwano
case JsonType::Object:
throw json_invalid_iterator("cannot compare iterators with object type");
case JsonType::Array:
return it_.array_iter < other.it_.array_iter;
return array_iter < other.array_iter;
default:
return it_.original_iter < other.it_.original_iter;
return primitive_iter < other.primitive_iter;
}
}
@ -658,19 +681,19 @@ namespace kiwano
switch (data_->type())
{
case JsonType::Object:
if (it_.object_iter == data_->value_.data.object->end())
if (object_iter == data_->value_.data.object->end())
{
throw std::out_of_range("iterator out of range");
}
break;
case JsonType::Array:
if (it_.array_iter == data_->value_.data.vector->end())
if (array_iter == data_->value_.data.vector->end())
{
throw std::out_of_range("iterator out of range");
}
break;
default:
if (it_.original_iter == 1)
if (primitive_iter == 1)
{
throw std::out_of_range("iterator out of range");
}
@ -680,7 +703,24 @@ namespace kiwano
private:
pointer data_;
internal_iterator<_BasicJsonTy> it_;
union
{
struct
{
array_iterator array_iter;
};
struct
{
object_iterator object_iter;
};
struct
{
primitive_iterator primitive_iter; // for other types
};
};
};
} // end of namespace __json_detail
@ -2054,7 +2094,7 @@ namespace kiwano
if (is_object())
{
const_iterator iter;
iter.it_.object_iter = value_.data.object->find(std::forward<_Kty>(key));
iter.object_iter = value_.data.object->find(std::forward<_Kty>(key));
return iter;
}
return cend();
@ -2098,13 +2138,13 @@ namespace kiwano
{
case JsonType::Object:
{
result.it_.object_iter = value_.data.object->erase(pos.it_.object_iter);
result.object_iter = value_.data.object->erase(pos.object_iter);
break;
}
case JsonType::Array:
{
result.it_.array_iter = value_.data.vector->erase(pos.it_.array_iter);
result.array_iter = value_.data.vector->erase(pos.array_iter);
break;
}
@ -2129,13 +2169,13 @@ namespace kiwano
{
case JsonType::Object:
{
result.it_.object_iter = value_.data.object->erase(first.it_.object_iter, last.it_.object_iter);
result.object_iter = value_.data.object->erase(first.object_iter, last.object_iter);
break;
}
case JsonType::Array:
{
result.it_.array_iter = value_.data.vector->erase(first.it_.array_iter, last.it_.array_iter);
result.array_iter = value_.data.vector->erase(first.array_iter, last.array_iter);
break;
}

View File

@ -226,7 +226,7 @@ namespace kiwano
if (callable_) callable_->AddRef();
}
Closure(Closure&& rhs)
Closure(Closure&& rhs) noexcept
: callable_(rhs.callable_)
{
rhs.callable_ = nullptr;

View File

@ -26,6 +26,9 @@ namespace kiwano
namespace modules
{
Shlwapi::Shlwapi()
: shlwapi(nullptr)
, PathFileExistsW(nullptr)
, SHCreateMemStream(nullptr)
{
shlwapi = LoadLibraryW(L"shlwapi.dll");
if (shlwapi)
@ -43,4 +46,4 @@ namespace kiwano
}
}
}
}
}

View File

@ -63,10 +63,6 @@ namespace kiwano
_In_ TextStyle const& text_style
) const override;
void ClearImageCache() override;
void DiscardResources() override;
HRESULT SetD2DDevice(
_In_ ComPtr<ID2D1Device> const& device
) override;
@ -77,6 +73,10 @@ namespace kiwano
ID2D1StrokeStyle* GetStrokeStyle(StrokeStyle stroke) const override;
void ClearImageCache() override;
void DiscardResources() override;
public:
unsigned long STDMETHODCALLTYPE AddRef();
@ -297,7 +297,7 @@ namespace kiwano
return hr;
}
HRESULT D2DDeviceResources::SetD2DDevice(ComPtr<ID2D1Device> const& device)
HRESULT D2DDeviceResources::SetD2DDevice(_In_ ComPtr<ID2D1Device> const& device)
{
ComPtr<ID2D1DeviceContext> d2d_device_ctx;
@ -316,14 +316,14 @@ namespace kiwano
return hr;
}
void D2DDeviceResources::SetTargetBitmap(ComPtr<ID2D1Bitmap1> const& target)
void D2DDeviceResources::SetTargetBitmap(_In_ ComPtr<ID2D1Bitmap1> const& target)
{
target_bitmap_ = target;
if (device_context_)
device_context_->SetTarget(target_bitmap_.Get());
}
HRESULT D2DDeviceResources::CreateBitmapFromFile(ComPtr<ID2D1Bitmap> & bitmap, String const & file_path)
HRESULT D2DDeviceResources::CreateBitmapFromFile(_Out_ ComPtr<ID2D1Bitmap> & bitmap, _In_ String const & file_path)
{
if (!imaging_factory_ || !device_context_)
return E_UNEXPECTED;
@ -390,7 +390,7 @@ namespace kiwano
return hr;
}
HRESULT D2DDeviceResources::CreateBitmapFromResource(ComPtr<ID2D1Bitmap> & bitmap, Resource const & res)
HRESULT D2DDeviceResources::CreateBitmapFromResource(_Out_ ComPtr<ID2D1Bitmap> & bitmap, _In_ Resource const & res)
{
if (!imaging_factory_ || !device_context_)
return E_UNEXPECTED;
@ -477,7 +477,8 @@ namespace kiwano
return hr;
}
HRESULT D2DDeviceResources::CreateTextFormat(ComPtr<IDWriteTextFormat> & text_format, Font const & font, TextStyle const & text_style) const
HRESULT D2DDeviceResources::CreateTextFormat(_Out_ ComPtr<IDWriteTextFormat> & text_format,
_In_ Font const & font, _In_ TextStyle const & text_style) const
{
if (!dwrite_factory_)
return E_UNEXPECTED;
@ -515,7 +516,9 @@ namespace kiwano
return hr;
}
HRESULT D2DDeviceResources::CreateTextLayout(ComPtr<IDWriteTextLayout> & text_layout, Size& layout_size, String const & text, ComPtr<IDWriteTextFormat> const& text_format, TextStyle const & text_style) const
HRESULT D2DDeviceResources::CreateTextLayout(_Out_ ComPtr<IDWriteTextLayout> & text_layout,
_Out_ Size& layout_size, _In_ String const & text, _In_ ComPtr<IDWriteTextFormat> const& text_format,
_In_ TextStyle const & text_style) const
{
if (!dwrite_factory_)
return E_UNEXPECTED;

View File

@ -20,8 +20,6 @@
#include "D3D10DeviceResources.h"
#if defined(KGE_USE_DIRECTX10)
#include "../2d/Image.h"
#include "../base/logs.h"
@ -541,5 +539,3 @@ namespace kiwano
}
}
#endif // !KGE_USE_DIRECTX10

View File

@ -22,8 +22,6 @@
#include "../macros.h"
#if defined(KGE_USE_DIRECTX10)
#include "D2DDeviceResources.h"
#include "D3DDeviceResourcesBase.h"
#include <d3d10_1.h>
@ -52,5 +50,3 @@ namespace kiwano
};
}
#endif // !KGE_USE_DIRECTX10

View File

@ -20,8 +20,6 @@
#include "D3D11DeviceResources.h"
#if !defined(KGE_USE_DIRECTX10)
#include "../2d/Image.h"
#include "../base/logs.h"
@ -546,5 +544,3 @@ namespace kiwano
}
}
#endif // !KGE_USE_DIRECTX10

View File

@ -22,8 +22,6 @@
#include "../macros.h"
#if !defined(KGE_USE_DIRECTX10)
#include "D2DDeviceResources.h"
#include "D3DDeviceResourcesBase.h"
#include <d3d11.h>
@ -55,4 +53,3 @@ namespace kiwano
}
#endif // !KGE_USE_DIRECTX10

View File

@ -35,12 +35,12 @@ namespace kiwano
STDMETHOD(CreateDeviceResources)();
STDMETHOD_(void, SetTextStyle)(
FLOAT opacity,
CONST D2D1_COLOR_F &fillColor,
BOOL outline,
CONST D2D1_COLOR_F &outlineColor,
FLOAT outlineWidth,
ID2D1StrokeStyle* outlineJoin
_In_ FLOAT opacity,
_In_ CONST D2D1_COLOR_F &fillColor,
_In_ BOOL outline,
_In_ CONST D2D1_COLOR_F &outlineColor,
_In_ FLOAT outlineWidth,
_In_ ID2D1StrokeStyle* outlineJoin
);
STDMETHOD(DrawGlyphRun)(
@ -115,8 +115,8 @@ namespace kiwano
};
HRESULT ITextRenderer::Create(
ITextRenderer** ppTextRenderer,
ID2D1RenderTarget* pRT)
_Out_ ITextRenderer** ppTextRenderer,
_In_ ID2D1RenderTarget* pRT)
{
HRESULT hr = E_FAIL;
@ -188,12 +188,12 @@ namespace kiwano
}
STDMETHODIMP_(void) TextRenderer::SetTextStyle(
FLOAT opacity,
CONST D2D1_COLOR_F &fillColor,
BOOL outline,
CONST D2D1_COLOR_F &outlineColor,
FLOAT outlineWidth,
ID2D1StrokeStyle* outlineJoin)
_In_ FLOAT opacity,
_In_ CONST D2D1_COLOR_F &fillColor,
_In_ BOOL outline,
_In_ CONST D2D1_COLOR_F &outlineColor,
_In_ FLOAT outlineWidth,
_In_ ID2D1StrokeStyle* outlineJoin)
{
sFillColor_ = fillColor;
bShowOutline_ = outline;

View File

@ -34,11 +34,11 @@ namespace kiwano
);
STDMETHOD_(void, SetTextStyle)(
FLOAT opacity,
CONST D2D1_COLOR_F &fillColor,
BOOL outline,
CONST D2D1_COLOR_F &outlineColor,
FLOAT outlineWidth,
_In_ FLOAT opacity,
_In_ CONST D2D1_COLOR_F &fillColor,
_In_ BOOL outline,
_In_ CONST D2D1_COLOR_F &outlineColor,
_In_ FLOAT outlineWidth,
_In_ ID2D1StrokeStyle* outlineJoin
) PURE;
};

View File

@ -626,7 +626,7 @@ private:
LPVOID vData = malloc(dwSize);
if (vData != NULL)
{
if (GetFileVersionInfoA(szImg, dwHandle, dwSize, vData) != 0)
if (GetFileVersionInfoA(szImg, NULL /* dwHandle reserved */, dwSize, vData) != 0)
{
UINT len;
TCHAR szSubBlock[] = _T("\\");

View File

@ -2419,7 +2419,8 @@ XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :
_textDepth( -1 ),
_processEntities( true ),
_compactMode( compact ),
_buffer()
_buffer(),
_entityFlag{}
{
for( int i=0; i<ENTITY_RANGE; ++i ) {
_entityFlag[i] = false;

View File

@ -212,6 +212,7 @@ class DynArray
{
public:
DynArray() :
_pool{},
_mem( _pool ),
_allocated( INITIAL_SIZE ),
_size( 0 )

View File

@ -53,7 +53,7 @@ namespace kiwano
if (rows || cols)
{
// Image slices
return loader->AddFrames(*id, Resource(gdata->path + (*file)), std::max(cols, 1), std::max(rows, 1));
return !!loader->AddFrames(*id, Resource(gdata->path + (*file)), std::max(cols, 1), std::max(rows, 1));
}
else
{

View File

@ -2,7 +2,7 @@
#include "MainScene.h"
int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
int WINAPI wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PWSTR, _In_ int)
{
try
{

View File

@ -18,7 +18,7 @@ public:
}
};
int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
int WINAPI wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PWSTR, _In_ int)
{
// 创建 Kiwano 程序实例
Application app;

View File

@ -25,7 +25,7 @@ public:
}
};
int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
int WINAPI wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PWSTR, _In_ int)
{
try
{

View File

@ -99,7 +99,7 @@ public:
}
};
int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
int WINAPI wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PWSTR, _In_ int)
{
try
{