Skip to content

Commit 38d6e70

Browse files
committed
Apply more style changes across all code
1 parent 844d42f commit 38d6e70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4992
-5195
lines changed

src/action_replay.cpp

Lines changed: 171 additions & 172 deletions
Large diffs are not rendered by default.

src/action_replay.h

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
along with NooDS. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifndef ACTION_REPLAY_H
21-
#define ACTION_REPLAY_H
20+
#pragma once
2221

2322
#include <cstdint>
2423
#include <mutex>
@@ -34,24 +33,22 @@ struct ARCheat {
3433
};
3534

3635
class ActionReplay {
37-
public:
38-
std::vector<ARCheat> cheats;
36+
public:
37+
std::vector<ARCheat> cheats;
3938

40-
ActionReplay(Core *core): core(core) {}
41-
void setPath(std::string path);
42-
void setFd(int fd);
39+
ActionReplay(Core *core): core(core) {}
40+
void setPath(std::string path);
41+
void setFd(int fd);
4342

44-
bool loadCheats();
45-
bool saveCheats();
46-
void applyCheats();
43+
bool loadCheats();
44+
bool saveCheats();
45+
void applyCheats();
4746

48-
private:
49-
Core *core;
50-
std::mutex mutex;
51-
std::string path;
52-
int fd = -1;
47+
private:
48+
Core *core;
49+
std::mutex mutex;
50+
std::string path;
51+
int fd = -1;
5352

54-
FILE *openFile(const char *mode);
53+
FILE *openFile(const char *mode);
5554
};
56-
57-
#endif // ACTION_REPLAY_H

src/android/java/com/hydra/noods/FileBrowser.java

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -131,29 +131,29 @@ public boolean onCreateOptionsMenu(Menu menu) {
131131
@Override
132132
public boolean onOptionsItemSelected(MenuItem item) {
133133
switch (item.getItemId()) {
134-
case R.id.info_action:
135-
// Show the Play Store information dialog
136-
showInfo(false);
134+
case R.id.info_action:
135+
// Show the Play Store information dialog
136+
showInfo(false);
137+
break;
138+
139+
case R.id.storage_action:
140+
// Open the scoped storage selector in scoped mode
141+
if (scoped) {
142+
startActivityForResult(new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE), 2);
137143
break;
144+
}
138145

139-
case R.id.storage_action:
140-
// Open the scoped storage selector in scoped mode
141-
if (scoped) {
142-
startActivityForResult(new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE), 2);
143-
break;
144-
}
145-
146-
// Switch to the next storage device
147-
curStorage = (curStorage + 1) % storagePaths.size();
148-
path = storagePaths.get(curStorage);
149-
curDepth = 0;
150-
update();
151-
break;
146+
// Switch to the next storage device
147+
curStorage = (curStorage + 1) % storagePaths.size();
148+
path = storagePaths.get(curStorage);
149+
curDepth = 0;
150+
update();
151+
break;
152152

153-
case R.id.settings_action:
154-
// Open the settings menu
155-
startActivity(new Intent(this, SettingsMenu.class));
156-
return true;
153+
case R.id.settings_action:
154+
// Open the settings menu
155+
startActivity(new Intent(this, SettingsMenu.class));
156+
return true;
157157
}
158158
return super.onOptionsItemSelected(item);
159159
}
@@ -178,34 +178,34 @@ public void onBackPressed() {
178178
@Override
179179
public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
180180
switch (requestCode) {
181-
case 1: // Manage files permission
182-
// Fall back to scoped storage if permission wasn't granted
183-
if (checkPermissions())
184-
initialize();
185-
else
186-
openScoped();
187-
return;
188-
189-
case 2: // Scoped directory selection
190-
// Reload if nothing was selected
191-
if (resultData == null) {
192-
openScoped();
193-
return;
194-
}
195-
196-
// Save the returned URI with persistent permissions so it can be restored next time
197-
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
198-
int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
199-
getContentResolver().takePersistableUriPermission(resultData.getData(), flags);
200-
editor.putString("scoped_uri", resultData.getData().toString());
201-
editor.commit();
202-
203-
// Initialize for scoped storage mode
204-
pathUris = new Stack<Uri>();
205-
pathUris.push(resultData.getData());
206-
scoped = true;
181+
case 1: // Manage files permission
182+
// Fall back to scoped storage if permission wasn't granted
183+
if (checkPermissions())
207184
initialize();
185+
else
186+
openScoped();
187+
return;
188+
189+
case 2: // Scoped directory selection
190+
// Reload if nothing was selected
191+
if (resultData == null) {
192+
openScoped();
208193
return;
194+
}
195+
196+
// Save the returned URI with persistent permissions so it can be restored next time
197+
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
198+
int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
199+
getContentResolver().takePersistableUriPermission(resultData.getData(), flags);
200+
editor.putString("scoped_uri", resultData.getData().toString());
201+
editor.commit();
202+
203+
// Initialize for scoped storage mode
204+
pathUris = new Stack<Uri>();
205+
pathUris.push(resultData.getData());
206+
scoped = true;
207+
initialize();
208+
return;
209209
}
210210
}
211211

@@ -357,22 +357,22 @@ private void tryStartCore() {
357357

358358
// Inform the user of the error if loading wasn't successful
359359
switch (result) {
360-
case 1: // Missing BIOS files
361-
builder.setTitle("Error Loading BIOS");
362-
builder.setMessage("Make sure the path settings point to valid BIOS files and try again. " +
363-
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
364-
break;
365-
366-
case 2: // Non-bootable firmware file
367-
builder.setTitle("Error Loading Firmware");
368-
builder.setMessage("Make sure the path settings point to a bootable firmware file or try another boot method. " +
369-
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
370-
break;
371-
372-
case 3: // Unreadable ROM file
373-
builder.setTitle("Error Loading ROM");
374-
builder.setMessage("Make sure the ROM file is accessible and try again.");
375-
break;
360+
case 1: // Missing BIOS files
361+
builder.setTitle("Error Loading BIOS");
362+
builder.setMessage("Make sure the path settings point to valid BIOS files and try again. " +
363+
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
364+
break;
365+
366+
case 2: // Non-bootable firmware file
367+
builder.setTitle("Error Loading Firmware");
368+
builder.setMessage("Make sure the path settings point to a bootable firmware file or try another boot method. " +
369+
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
370+
break;
371+
372+
case 3: // Unreadable ROM file
373+
builder.setTitle("Error Loading ROM");
374+
builder.setMessage("Make sure the ROM file is accessible and try again.");
375+
break;
376376
}
377377

378378
builder.create().show();

0 commit comments

Comments
 (0)