android: Run clang-format

This commit is contained in:
FearlessTobi 2020-05-02 21:28:12 +02:00 committed by xperia64
parent 280d298471
commit 00bb72073f
7 changed files with 25 additions and 28 deletions

View File

@ -106,7 +106,7 @@ void Config::ReadValues() {
// Premium // Premium
Settings::values.texture_filter_name = Settings::values.texture_filter_name =
sdl2_config->GetString("Premium", "texture_filter_name", "none"); sdl2_config->GetString("Premium", "texture_filter_name", "none");
// Renderer // Renderer
Settings::values.use_gles = sdl2_config->GetBoolean("Renderer", "use_gles", true); Settings::values.use_gles = sdl2_config->GetBoolean("Renderer", "use_gles", true);

View File

@ -3,9 +3,9 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cstring> #include <cstring>
#include <map>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <map>
#include "common/string_util.h" #include "common/string_util.h"
#include "core/hle/service/am/am.h" #include "core/hle/service/am/am.h"
@ -90,7 +90,7 @@ char16_t* GetPublisher(std::string physical_name) {
// Get the Publisher's name from SMDH in UTF-16 format // Get the Publisher's name from SMDH in UTF-16 format
char16_t* publisher; char16_t* publisher;
publisher = publisher =
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].publisher.data()); reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].publisher.data());
LOG_INFO(Frontend, "Publisher: {}", Common::UTF16ToUTF8(publisher)); LOG_INFO(Frontend, "Publisher: {}", Common::UTF16ToUTF8(publisher));
@ -111,13 +111,10 @@ std::string GetRegions(std::string physical_name) {
using GameRegion = Loader::SMDH::GameRegion; using GameRegion = Loader::SMDH::GameRegion;
static const std::map<GameRegion, const char*> regions_map = { static const std::map<GameRegion, const char*> regions_map = {
{GameRegion::Japan, "Japan"}, {GameRegion::Japan, "Japan"}, {GameRegion::NorthAmerica, "North America"},
{GameRegion::NorthAmerica, "North America"}, {GameRegion::Europe, "Europe"}, {GameRegion::Australia, "Australia"},
{GameRegion::Europe, "Europe"}, {GameRegion::China, "China"}, {GameRegion::Korea, "Korea"},
{GameRegion::Australia, "Australia"}, {GameRegion::Taiwan, "Taiwan"}};
{GameRegion::China, "China"},
{GameRegion::Korea, "Korea"},
{GameRegion::Taiwan, "Taiwan"}};
std::vector<GameRegion> regions = smdh.GetRegions(); std::vector<GameRegion> regions = smdh.GetRegions();
if (regions.empty()) { if (regions.empty()) {
@ -125,9 +122,9 @@ std::string GetRegions(std::string physical_name) {
} }
const bool region_free = const bool region_free =
std::all_of(regions_map.begin(), regions_map.end(), [&regions](const auto& it) { std::all_of(regions_map.begin(), regions_map.end(), [&regions](const auto& it) {
return std::find(regions.begin(), regions.end(), it.first) != regions.end(); return std::find(regions.begin(), regions.end(), it.first) != regions.end();
}); });
if (region_free) { if (region_free) {
return "Region free"; return "Region free";

View File

@ -153,7 +153,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
window->StartPresenting(); window->StartPresenting();
SCOPE_EXIT({TryShutdown();}); SCOPE_EXIT({ TryShutdown(); });
while (is_running) { while (is_running) {
if (!pause_emulation) { if (!pause_emulation) {
@ -519,7 +519,8 @@ void Java_org_citra_citra_1emu_NativeLibrary_ReloadCameraDevices(JNIEnv* env, jc
} }
} }
jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass clazz, jbyteArray bytes) { jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv* env, jclass clazz,
jbyteArray bytes) {
Core::System& system{Core::System::GetInstance()}; Core::System& system{Core::System::GetInstance()};
Service::SM::ServiceManager& sm = system.ServiceManager(); Service::SM::ServiceManager& sm = system.ServiceManager();
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u"); auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
@ -528,15 +529,16 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass
} }
Service::NFC::AmiiboData amiibo_data{}; Service::NFC::AmiiboData amiibo_data{};
env->GetByteArrayRegion(bytes, 0, sizeof(Service::NFC::AmiiboData), reinterpret_cast<jbyte*>(&amiibo_data)); env->GetByteArrayRegion(bytes, 0, sizeof(Service::NFC::AmiiboData),
reinterpret_cast<jbyte*>(&amiibo_data));
nfc->LoadAmiibo(amiibo_data); nfc->LoadAmiibo(amiibo_data);
return static_cast<jboolean>(true); return static_cast<jboolean>(true);
} }
void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv *env, jclass clazz) { void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv* env, jclass clazz) {
Core::System &system{Core::System::GetInstance()}; Core::System& system{Core::System::GetInstance()};
Service::SM::ServiceManager &sm = system.ServiceManager(); Service::SM::ServiceManager& sm = system.ServiceManager();
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u"); auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
if (nfc == nullptr) { if (nfc == nullptr) {
return; return;

View File

@ -137,9 +137,10 @@ Java_org_citra_citra_1emu_NativeLibrary_GetTextureFilterNames(JNIEnv* env, jclas
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_NativeLibrary_ReloadCameraDevices(JNIEnv* env, JNIEXPORT void JNICALL Java_org_citra_citra_1emu_NativeLibrary_ReloadCameraDevices(JNIEnv* env,
jclass clazz); jclass clazz);
JNIEXPORT jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass clazz, jbyteArray bytes); JNIEXPORT jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv* env, jclass clazz,
jbyteArray bytes);
JNIEXPORT void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv *env, jclass clazz); JNIEXPORT void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv* env, jclass clazz);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -67,8 +67,7 @@ class NDKMotion final : public Input::MotionDevice {
LOG_CRITICAL(Input, "Could not retrieve sensor manager"); LOG_CRITICAL(Input, "Could not retrieve sensor manager");
return; return;
} }
event_queue = ASensorManager_createEventQueue( event_queue = ASensorManager_createEventQueue(sensor_manager, looper, 0, nullptr, nullptr);
sensor_manager, looper, 0, nullptr, nullptr);
if (!event_queue) { if (!event_queue) {
LOG_ERROR(Input, "Could not create sensor event queue"); LOG_ERROR(Input, "Could not create sensor event queue");
return; return;
@ -101,7 +100,7 @@ class NDKMotion final : public Input::MotionDevice {
while (ASensorEventQueue_getEvents(event_queue, &event, 1) > 0) { while (ASensorEventQueue_getEvents(event_queue, &event, 1) > 0) {
if (event.type == ASENSOR_TYPE_ACCELEROMETER) { if (event.type == ASENSOR_TYPE_ACCELEROMETER) {
new_accel.emplace(event.vector.x, event.vector.y, event.vector.z); new_accel.emplace(event.vector.x, event.vector.y, event.vector.z);
} else if (event.type == ASENSOR_TYPE_GYROSCOPE){ } else if (event.type == ASENSOR_TYPE_GYROSCOPE) {
new_rot.emplace(event.vector.x, event.vector.y, event.vector.z); new_rot.emplace(event.vector.x, event.vector.y, event.vector.z);
} }
// occasionally the queue has ASENSOR_TYPE_ADDITIONAL_INFO events // occasionally the queue has ASENSOR_TYPE_ADDITIONAL_INFO events

View File

@ -9,6 +9,4 @@
#include <string_view> #include <string_view>
#include "common/logging/log.h" #include "common/logging/log.h"
namespace Log { namespace Log {} // namespace Log
} // namespace Log

View File

@ -72,7 +72,7 @@ void TextureDownloaderES::Test() {
// every time the error between the real and expected value changes, log it // every time the error between the real and expected value changes, log it
// some error is expected in D24 due to floating point precision // some error is expected in D24 due to floating point precision
LOG_WARNING(Render_OpenGL, "difference changed at {:#X}: {:#X} -> {:#X}", idx, LOG_WARNING(Render_OpenGL, "difference changed at {:#X}: {:#X} -> {:#X}", idx,
original_data[idx], new_data[idx]); original_data[idx], new_data[idx]);
} }
}; };
LOG_INFO(Render_OpenGL, "GL_DEPTH24_STENCIL8 download test starting"); LOG_INFO(Render_OpenGL, "GL_DEPTH24_STENCIL8 download test starting");