From 333523e5f7b0a8c3c40ffedc8d7234a0eb14eb88 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Mon, 23 Oct 2023 13:24:38 -0500 Subject: [PATCH] Remove all leading whitespace --- INSTALL.md | 6 +++--- src/battle_factory.c | 2 +- src/easy_chat.c | 4 ++-- src/event_object_movement.c | 2 +- src/mini_printf.c | 12 ++++++------ src/rom_header_gf.c | 4 ++-- src/trade.c | 2 +- tools/aif2pcm/main.c | 14 +++++++------- tools/gbagfx/font.c | 6 +++--- tools/preproc/c_file.cpp | 4 ++-- tools/preproc/charmap.cpp | 2 +- tools/scaninc/source_file.cpp | 4 ++-- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index a76d0acc75..920e03c713 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -150,9 +150,9 @@ Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert.
Notes... - > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator. - > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`. - > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed. + > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator. + > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`. + > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed. > Note 4: If libpng was saved elsewhere, you will need to specify the full path to where libpng was downloaded, e.g. `cd c:/devkitpro/msys2` if it was saved there.
diff --git a/src/battle_factory.c b/src/battle_factory.c index 3606d88e6a..0f4ed9816d 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -741,7 +741,7 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle) u8 ivSet; bool8 useHigherIV = isLastBattle ? TRUE : FALSE; -// The Factory has an out-of-bounds access when generating the rental draft for round 9 (challengeNum==8), +// The Factory has an out-of-bounds access when generating the rental draft for round 9 (challengeNum==8), // or the "elevated" rentals from round 8 (challengeNum+1==8) // This happens to land on a number higher than 31, which is interpreted as "random IVs" #ifdef BUGFIX diff --git a/src/easy_chat.c b/src/easy_chat.c index 93fdafd80b..8e93ca310e 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -230,7 +230,7 @@ enum { PALTAG_TRIANGLE_CURSOR, PALTAG_RECTANGLE_CURSOR, PALTAG_MISC_UI, - PALTAG_RS_INTERVIEW_FRAME, + PALTAG_RS_INTERVIEW_FRAME, }; enum { @@ -240,7 +240,7 @@ enum { GFXTAG_START_SELECT_BUTTONS, GFXTAG_MODE_WINDOW, GFXTAG_RS_INTERVIEW_FRAME, - GFXTAG_BUTTON_WINDOW, + GFXTAG_BUTTON_WINDOW, }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 29dcf4d27c..a181ea9f21 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -498,7 +498,7 @@ static const struct SpritePalette sObjectEventSpritePalettes[] = { {gObjectEventPal_RubySapphireBrendan, OBJ_EVENT_PAL_TAG_RS_BRENDAN}, {gObjectEventPal_RubySapphireMay, OBJ_EVENT_PAL_TAG_RS_MAY}, #ifdef BUGFIX - {NULL, OBJ_EVENT_PAL_TAG_NONE}, + {NULL, OBJ_EVENT_PAL_TAG_NONE}, #else {}, // BUG: FindObjectEventPaletteIndexByTag looks for OBJ_EVENT_PAL_TAG_NONE and not 0x0. // If it's looking for a tag that isn't in this table, the game locks in an infinite loop. diff --git a/src/mini_printf.c b/src/mini_printf.c index 69500157c6..9fb4ecfac9 100644 --- a/src/mini_printf.c +++ b/src/mini_printf.c @@ -41,7 +41,7 @@ #ifndef NDEBUG -struct mini_buff +struct mini_buff { char *buffer, *pbuffer; u32 buffer_len; @@ -95,7 +95,7 @@ static s32 _putsAscii(char *s, s32 len, void *buf) s32 i; struct mini_buff *b; - if (!buf) + if (!buf) return len; b = buf; @@ -118,7 +118,7 @@ static s32 _putsEncoded(char *s, s32 len, void *buf) s32 i; struct mini_buff *b; - if (!buf) + if (!buf) return len; b = buf; @@ -159,7 +159,7 @@ static s32 mini_itoa(s32 value, u32 radix, s32 uppercase, bool32 unsig, char *bu } /* This builds the string back to front ... */ - do + do { s32 digit = value % radix; *(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10); @@ -243,7 +243,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) { len = 1; len = _putsAscii(&ch, len, buf); - } else + } else { char pad_char = ' '; s32 pad_to = 0; @@ -270,7 +270,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) ch=*(fmt++); } - switch (ch) + switch (ch) { case 0: goto end; diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 465c0cf410..36ff3401d3 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -9,8 +9,8 @@ // The purpose of this struct is for outside applications to be // able to access parts of the ROM or its save file, like a public API. // In vanilla, it was used by Colosseum and XD to access pokemon graphics. -// -// If this struct is rearranged in any way, it defeats the purpose of +// +// If this struct is rearranged in any way, it defeats the purpose of // having it at all. Applications like PKHex or streaming HUDs may find // these values useful, so there's some potential benefit to keeping it. // If there's a compilation problem below, just comment out the assignment diff --git a/src/trade.c b/src/trade.c index 037ea4101a..5728a6ee51 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1285,7 +1285,7 @@ static void Leader_HandleCommunication(void) if (sTradeMenu->playerSelectStatus == STATUS_READY && sTradeMenu->partnerSelectStatus == STATUS_READY) { - // Both players have selected a pokemon to trade + // Both players have selected a pokemon to trade sTradeMenu->callbackId = CB_SET_SELECTED_MONS; sTradeMenu->linkData[0] = LINKCMD_SET_MONS_TO_TRADE; sTradeMenu->linkData[1] = sTradeMenu->cursorPosition; diff --git a/tools/aif2pcm/main.c b/tools/aif2pcm/main.c index 720db1acae..0824b92da8 100644 --- a/tools/aif2pcm/main.c +++ b/tools/aif2pcm/main.c @@ -238,7 +238,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { FATAL_ERROR("More than one MARK Chunk in file!\n"); } - + markers = calloc(num_markers, sizeof(struct Marker)); // Read each marker. @@ -289,7 +289,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) // Skip NoLooping sustain loop. pos += 4; } - + // Skip release loop, we don't need it. pos += 6; } @@ -303,7 +303,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { uint8_t *sample_data = (uint8_t *)malloc(num_samples * sizeof(uint8_t)); memcpy(sample_data, &aif->data[pos], num_samples); - + aif_data->samples8 = sample_data; aif_data->real_num_samples = num_samples; } @@ -316,7 +316,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { sample_data_swapped[i] = __builtin_bswap16(sample_data[i]); } - + aif_data->samples16 = sample_data_swapped; aif_data->real_num_samples = num_samples; free(sample_data); @@ -329,12 +329,12 @@ void read_aif(struct Bytes *aif, AifData *aif_data) pos += chunk_size; } } - + if (markers) { // Resolve loop points. struct Marker *cur_marker = markers; - + // Grab loop start point. for (int i = 0; i < num_markers; i++, cur_marker++) { @@ -573,7 +573,7 @@ void aif2pcm(const char *aif_filename, const char *pcm_filename, bool compress) struct Bytes *aif = read_bytearray(aif_filename); AifData aif_data = {0}; read_aif(aif, &aif_data); - + // Convert 16-bit to 8-bit if necessary if (aif_data.sample_size == 16) { diff --git a/tools/gbagfx/font.c b/tools/gbagfx/font.c index 0dd6fbc3ee..1251b5c647 100644 --- a/tools/gbagfx/font.c +++ b/tools/gbagfx/font.c @@ -26,7 +26,7 @@ static void ConvertFromLatinFont(unsigned char *src, unsigned char *dest, unsign unsigned int pixelsX = (column * 16) + ((glyphTile & 1) * 8); for (unsigned int i = 0; i < 8; i++) { - unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i; + unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i; unsigned int destPixelsOffset = (pixelsY * 64) + (pixelsX / 4); dest[destPixelsOffset] = src[srcPixelsOffset + 1]; @@ -75,7 +75,7 @@ static void ConvertFromHalfwidthJapaneseFont(unsigned char *src, unsigned char * for (unsigned int i = 0; i < 8; i++) { unsigned int pixelsY = (row * 16) + (glyphTile * 8) + i; unsigned int destPixelsOffset = (pixelsY * 32) + (pixelsX / 4); - + dest[destPixelsOffset] = src[srcPixelsOffset + 1]; dest[destPixelsOffset + 1] = src[srcPixelsOffset]; @@ -233,7 +233,7 @@ void ReadHalfwidthJapaneseFont(char *path, struct Image *image) FATAL_ERROR("The file size (%d) is not a multiple of %d.\n", fileSize, glyphSize); int numGlyphs = fileSize / glyphSize; - + if (numGlyphs % 16 != 0) FATAL_ERROR("The number of glyphs (%d) is not a multiple of 16.\n", numGlyphs); diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 17a08cc9f7..508c628731 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -383,7 +383,7 @@ void CFile::TryConvertIncbin() if (m_buffer[m_pos] == '\\') RaiseError("unexpected escape in path string"); - + m_pos++; } @@ -418,7 +418,7 @@ void CFile::TryConvertIncbin() m_pos++; } - + if (m_buffer[m_pos] != ')') RaiseError("expected ')'"); diff --git a/tools/preproc/charmap.cpp b/tools/preproc/charmap.cpp index a7bedfe26f..a0c631026c 100644 --- a/tools/preproc/charmap.cpp +++ b/tools/preproc/charmap.cpp @@ -119,7 +119,7 @@ Lhs CharmapReader::ReadLhs() break; } } - + if (m_buffer[m_pos] == '\'') { m_pos++; diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp index df31282f80..9d188eb738 100644 --- a/tools/scaninc/source_file.cpp +++ b/tools/scaninc/source_file.cpp @@ -41,7 +41,7 @@ SourceFileType GetFileType(std::string& path) return SourceFileType::Inc; else FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str()); - + // Unreachable return SourceFileType::Cpp; } @@ -84,7 +84,7 @@ SourceFile::SourceFile(std::string path) else incbins.insert(outputPath); } - + new (&m_source_file.asm_wrapper) SourceFile::InnerUnion::AsmWrapper{incbins, includes}; } }