Fix whitespace: Convert tabs to spaces and remove trailing whitespace.

This commit is contained in:
binary1248 2015-04-01 04:08:23 +02:00 committed by Lukas Dürrenberger
parent 075d7b3b50
commit e80bf0ba92
54 changed files with 262 additions and 262 deletions

View file

@ -70,7 +70,7 @@ SoundBuffer::~SoundBuffer()
// called which removes the sound from the internal list.
SoundList sounds;
sounds.swap(m_sounds);
// Detach the buffer from the sounds that use it (to avoid OpenAL errors)
for (SoundList::const_iterator it = sounds.begin(); it != sounds.end(); ++it)
(*it)->resetBuffer();

View file

@ -74,9 +74,9 @@ bool SoundFileWriterFlac::open(const std::string& filename, unsigned int sampleR
}
// Setup the encoder
FLAC__stream_encoder_set_channels(m_encoder, channelCount);
FLAC__stream_encoder_set_bits_per_sample(m_encoder, 16);
FLAC__stream_encoder_set_sample_rate(m_encoder, sampleRate);
FLAC__stream_encoder_set_channels(m_encoder, channelCount);
FLAC__stream_encoder_set_bits_per_sample(m_encoder, 16);
FLAC__stream_encoder_set_sample_rate(m_encoder, sampleRate);
// Initialize the output stream
if (FLAC__stream_encoder_init_file(m_encoder, filename.c_str(), NULL, NULL) != FLAC__STREAM_ENCODER_INIT_STATUS_OK)

View file

@ -81,7 +81,7 @@ a((color & 0x000000ff) >> 0 )
////////////////////////////////////////////////////////////
Uint32 Color::toInteger()
{
return (r << 24) | (g << 16) | (b << 8) | a;
return (r << 24) | (g << 16) | (b << 8) | a;
}

View file

@ -33,5 +33,5 @@ install(TARGETS sfml-main ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel)
# from depending on shared libraries), we need a boostrap activity which
# will load our shared libraries manually
if(SFML_OS_ANDROID)
sfml_add_library(sfml-activity SOURCES ${PROJECT_SOURCE_DIR}/src/SFML/Main/SFMLActivity.cpp)
sfml_add_library(sfml-activity SOURCES ${PROJECT_SOURCE_DIR}/src/SFML/Main/SFMLActivity.cpp)
endif()

View file

@ -68,13 +68,13 @@ const char *getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
// Convert the application name to a C++ string and return it
const jsize applicationNameLength = lJNIEnv->GetStringUTFLength(valueString);
const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, NULL);
if (applicationNameLength >= 256)
{
LOGE("The value of 'sfml.app.lib_name' must not be longer than 255 characters.");
exit(1);
}
strncpy(name, applicationName, applicationNameLength);
name[applicationNameLength] = '\0';
lJNIEnv->ReleaseStringUTFChars(valueString, applicationName);

View file

@ -38,7 +38,7 @@ class DefaultErrStreamBuf : public std::streambuf
{
public:
DefaultErrStreamBuf()
DefaultErrStreamBuf()
{
// Allocate the write buffer
static const int size = 64;
@ -46,7 +46,7 @@ public:
setp(buffer, buffer + size);
}
~DefaultErrStreamBuf()
~DefaultErrStreamBuf()
{
// Synchronize
sync();

View file

@ -47,15 +47,15 @@ namespace
#if defined(SFML_SYSTEM_LINUX)
static EGLDisplay display = EGL_NO_DISPLAY;
if (display == EGL_NO_DISPLAY)
{
display = eglCheck(eglGetDisplay(EGL_DEFAULT_DISPLAY));
eglCheck(eglInitialize(display, NULL, NULL));
}
return display;
#elif defined(SFML_SYSTEM_ANDROID)
// On Android, its native activity handles this for us
@ -63,7 +63,7 @@ namespace
sf::Lock lock(states->mutex);
return states->display;
#endif
}
}
@ -85,10 +85,10 @@ m_config (NULL)
// Get the best EGL config matching the default video settings
m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
// Note: The EGL specs say that attrib_list can be NULL when passed to eglCreatePbufferSurface,
// but this is resulting in a segfault. Bug in Android?
EGLint attrib_list[] = {
EGLint attrib_list[] = {
EGL_WIDTH, 1,
EGL_HEIGHT,1,
EGL_NONE
@ -120,15 +120,15 @@ m_config (NULL)
// Get the initialized EGL display
m_display = getInitializedDisplay();
// Get the best EGL config matching the requested video settings
m_config = getBestConfig(m_display, bitsPerPixel, settings);
// Create EGL context
createContext(shared);
#if !defined(SFML_SYSTEM_ANDROID)
// Create EGL surface (except on Android because the window is created
// Create EGL surface (except on Android because the window is created
// asynchronously, its activity manager will call it for us)
createSurface((EGLNativeWindowType)owner->getSystemHandle());
#endif
@ -199,7 +199,7 @@ void EglContext::createContext(EglContext* shared)
EGL_CONTEXT_CLIENT_VERSION, 1,
EGL_NONE
};
EGLContext toShared;
if (shared)
@ -243,13 +243,13 @@ EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixe
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
EGL_NONE
};
EGLint configCount;
EGLConfig configs[1];
// Ask EGL for the best config matching our video settings
eglCheck(eglChooseConfig(display, attributes, configs, 1, &configCount));
return configs[0];
}
@ -260,44 +260,44 @@ XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsP
{
// Get the initialized EGL display
EGLDisplay display = getInitializedDisplay();
// Get the best EGL config matching the default video settings
EGLConfig config = getBestConfig(display, bitsPerPixel, settings);
// Retrieve the visual id associated with this EGL config
EGLint nativeVisualId;
eglCheck(eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &nativeVisualId));
if (nativeVisualId == 0)
{
// Should never happen...
err() << "No EGL visual found. You should check your graphics driver" << std::endl;
return XVisualInfo();
}
XVisualInfo vTemplate;
vTemplate.visualid = static_cast<VisualID>(nativeVisualId);
// Get X11 visuals compatible with this EGL config
XVisualInfo *availableVisuals, bestVisual;
int visualCount = 0;
availableVisuals = XGetVisualInfo(XDisplay, VisualIDMask, &vTemplate, &visualCount);
if (visualCount == 0)
{
// Can't happen...
err() << "No X11 visual found. Bug in your EGL implementation ?" << std::endl;
return XVisualInfo();
}
// Pick up the best one
bestVisual = availableVisuals[0];
XFree(availableVisuals);
return bestVisual;
}
#endif

View file

@ -148,7 +148,7 @@ public:
///
////////////////////////////////////////////////////////////
static EGLConfig getBestConfig(EGLDisplay display, unsigned int bitsPerPixel, const ContextSettings& settings);
#ifdef SFML_SYSTEM_LINUX
////////////////////////////////////////////////////////////
/// \brief Select the best EGL visual for a given set of settings

View file

@ -43,5 +43,5 @@ void Keyboard::setVirtualKeyboardVisible(bool visible)
{
priv::InputImpl::setVirtualKeyboardVisible(visible);
}
} // namespace sf

View file

@ -87,7 +87,7 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
{
sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl;
view = nil;
}
}

View file

@ -31,7 +31,7 @@
namespace sf
{
////////////////////////////////////////////////////////////
bool Sensor::isAvailable(Type sensor)
{

View file

@ -71,7 +71,7 @@ public:
///
////////////////////////////////////////////////////////////
void setEnabled(Sensor::Type sensor, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Check if a sensor is enabled
///
@ -97,7 +97,7 @@ public:
///
////////////////////////////////////////////////////////////
void update();
private:
////////////////////////////////////////////////////////////

View file

@ -171,7 +171,7 @@
////////////////////////////////////////////////////////////
+ (Class)layerClass
{
return [CAEAGLLayer class];
return [CAEAGLLayer class];
}
////////////////////////////////////////////////////////////
@ -181,7 +181,7 @@
self.contentScaleFactor = factor;
if (self)
if (self)
{
self.context = NULL;
self.touches = [NSMutableArray array];
@ -199,7 +199,7 @@
self.multipleTouchEnabled = true;
}
return self;
return self;
}