Use std::string_view for parameter type

This commit is contained in:
Chris Thrasher 2022-07-25 23:21:28 -06:00
parent 218fccd926
commit 938e90b7d2
6 changed files with 9 additions and 6 deletions

View File

@ -48,7 +48,7 @@ thread_local ALenum lastError(AL_NO_ERROR);
namespace sf::priv
{
////////////////////////////////////////////////////////////
void alCheckError(const std::filesystem::path& file, unsigned int line, const char* expression)
void alCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression)
{
// Get the last error
ALenum errorCode = alGetError();

View File

@ -30,6 +30,7 @@
#include <SFML/Config.hpp>
#include <filesystem>
#include <string_view>
#if defined(__APPLE__)
#pragma GCC diagnostic push
@ -73,7 +74,7 @@ namespace sf::priv
/// \param expression The evaluated expression as a string
///
////////////////////////////////////////////////////////////
void alCheckError(const std::filesystem::path& file, unsigned int line, const char* expression);
void alCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
////////////////////////////////////////////////////////////

View File

@ -35,7 +35,7 @@
namespace sf::priv
{
////////////////////////////////////////////////////////////
void glCheckError(const std::filesystem::path& file, unsigned int line, const char* expression)
void glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression)
{
// Get the last error
GLenum errorCode = glGetError();

View File

@ -32,6 +32,7 @@
#include <SFML/Graphics/GLExtensions.hpp>
#include <filesystem>
#include <string_view>
namespace sf::priv
@ -65,6 +66,6 @@ namespace sf::priv
/// \param expression The evaluated expression as a string
///
////////////////////////////////////////////////////////////
void glCheckError(const std::filesystem::path& file, unsigned int line, const char* expression);
void glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
} // namespace sf::priv

View File

@ -38,7 +38,7 @@
namespace sf::priv
{
////////////////////////////////////////////////////////////
void eglCheckError(const std::filesystem::path& file, unsigned int line, const char* expression)
void eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression)
{
// Obtain information about the success or failure of the most recent EGL
// function called in the current thread

View File

@ -30,6 +30,7 @@
#include <SFML/Config.hpp>
#include <filesystem>
#include <string_view>
namespace sf::priv
@ -63,6 +64,6 @@ namespace sf::priv
/// \param expression The evaluated expression as a string
///
////////////////////////////////////////////////////////////
void eglCheckError(const std::filesystem::path& file, unsigned int line, const char* expression);
void eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
} // namespace sf::priv