Skip to content

Commit

Permalink
Clean up namespace usage
Browse files Browse the repository at this point in the history
Always use std:: and always omit sf::
  • Loading branch information
ChrisThrasher committed Apr 6, 2023
1 parent f5e6c67 commit 0700119
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/SFML/Audio/Music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void Music::setLoopPoints(TimeSpan timePoints)
// Check our state. This averts a divide-by-zero. GetChannelCount() is cheap enough to use often
if (getChannelCount() == 0 || m_file.getSampleCount() == 0)
{
sf::err() << "Music is not in a valid state to assign Loop Points." << std::endl;
err() << "Music is not in a valid state to assign Loop Points." << std::endl;
return;
}

Expand All @@ -135,12 +135,12 @@ void Music::setLoopPoints(TimeSpan timePoints)
// Validate
if (samplePoints.offset >= m_file.getSampleCount())
{
sf::err() << "LoopPoints offset val must be in range [0, Duration)." << std::endl;
err() << "LoopPoints offset val must be in range [0, Duration)." << std::endl;
return;
}
if (samplePoints.length == 0)
{
sf::err() << "LoopPoints length val must be nonzero." << std::endl;
err() << "LoopPoints length val must be nonzero." << std::endl;
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/SFML/Graphics/VertexBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ VertexBuffer::VertexBuffer(PrimitiveType type) : m_primitiveType(type)


////////////////////////////////////////////////////////////
VertexBuffer::VertexBuffer(VertexBuffer::Usage usage) : m_usage(usage)
VertexBuffer::VertexBuffer(Usage usage) : m_usage(usage)
{
}


////////////////////////////////////////////////////////////
VertexBuffer::VertexBuffer(PrimitiveType type, VertexBuffer::Usage usage) : m_primitiveType(type), m_usage(usage)
VertexBuffer::VertexBuffer(PrimitiveType type, Usage usage) : m_primitiveType(type), m_usage(usage)
{
}

Expand Down Expand Up @@ -314,7 +314,7 @@ PrimitiveType VertexBuffer::getPrimitiveType() const


////////////////////////////////////////////////////////////
void VertexBuffer::setUsage(VertexBuffer::Usage usage)
void VertexBuffer::setUsage(Usage usage)
{
m_usage = usage;
}
Expand Down
8 changes: 4 additions & 4 deletions src/SFML/Main/SFMLActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const char* getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
if (valueString == nullptr)
{
LOGE("No meta-data 'sfml.app.lib_name' found in AndroidManifest.xml file");
exit(1);
std::exit(1);
}

// Convert the application name to a C++ string and return it
Expand All @@ -77,7 +77,7 @@ const char* getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
if (applicationNameLength >= 256)
{
LOGE("The value of 'sfml.app.lib_name' must not be longer than 255 characters.");
exit(1);
std::exit(1);
}

strncpy(name, applicationName, static_cast<std::size_t>(applicationNameLength));
Expand Down Expand Up @@ -123,7 +123,7 @@ void* loadLibrary(const char* libraryName, JNIEnv* lJNIEnv, jobject& ObjectActiv
if (!handle)
{
LOGE("dlopen(\"%s\"): %s", libraryPath, dlerror());
exit(1);
std::exit(1);
}

// Release the Java string
Expand Down Expand Up @@ -217,7 +217,7 @@ JNIEXPORT void ANativeActivity_onCreate(ANativeActivity* activity, void* savedSt
if (!ANativeActivity_onCreate)
{
LOGE("sfml-activity: Undefined symbol ANativeActivity_onCreate");
exit(1);
std::exit(1);
}

ANativeActivity_onCreate(activity, savedState, savedStateSize);
Expand Down

0 comments on commit 0700119

Please sign in to comment.