Skip to content

Commit

Permalink
Remove implicit narrowing conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasMagnus committed Nov 16, 2023
1 parent 8cc4341 commit 531f3a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/include/CL/SDK/InteropWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

// STL includes
#include <type_traits>

namespace cl {
namespace sdk {
class SDKCPP_EXPORT InteropWindow : public sf::Window {
public:
explicit InteropWindow(
sf::VideoMode mode, const sf::String& title,
sf::Uint32 style = sf::Style::Default,
decltype(sf::Style::Default) style = sf::Style::Default,
const sf::ContextSettings& settings = sf::ContextSettings{},
cl_uint platform_id = 0, cl_uint device_id = 0,
cl_bitfield device_type = CL_DEVICE_TYPE_DEFAULT);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/SDK/Image.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cl_sdk_image cl_sdk_read_image(const char* const file_name, cl_int* const error)

static char* to_lowercase(const char* const s, char* const d, const size_t n)
{
for (size_t i = 0; i < n; ++i) d[i] = tolower(s[i]);
for (size_t i = 0; i < n; ++i) d[i] = (char)tolower(s[i]);
return d;
}

Expand Down
7 changes: 4 additions & 3 deletions lib/src/SDK/InteropWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#include <CL/SDK/InteropContext.hpp>

cl::sdk::InteropWindow::InteropWindow(sf::VideoMode mode,
const sf::String& title, sf::Uint32 style,
const sf::String& title,
decltype(sf::Style::Default) style,
const sf::ContextSettings& settings,
cl_uint platform_id, cl_uint device_id,
cl_bitfield device_type)
: sf::Window{ mode, title, style, settings }, plat_id{ platform_id },
dev_id{ device_id }, dev_type{ device_type }
: sf::Window{ mode, title, static_cast<sf::Uint32>(style), settings },
plat_id{ platform_id }, dev_id{ device_id }, dev_type{ device_type }
{}

void cl::sdk::InteropWindow::run()
Expand Down

0 comments on commit 531f3a4

Please sign in to comment.