diff --git a/libctru/Doxyfile b/libctru/Doxyfile index c6bf7bb..320d0c9 100644 --- a/libctru/Doxyfile +++ b/libctru/Doxyfile @@ -1983,7 +1983,7 @@ ENABLE_PREPROCESSING = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -MACRO_EXPANSION = YES +MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # the macro expansion is limited to the macros specified with the PREDEFINED and @@ -1991,7 +1991,7 @@ MACRO_EXPANSION = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_ONLY_PREDEF = YES +EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. @@ -2023,7 +2023,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = PACKED +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/libctru/include/3ds/applets/miiselector.h b/libctru/include/3ds/applets/miiselector.h index 6a187b1..cab0698 100644 --- a/libctru/include/3ds/applets/miiselector.h +++ b/libctru/include/3ds/applets/miiselector.h @@ -153,7 +153,10 @@ void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index); * If there is no mii with that index, the the cursor will start at the Mii * with the index 0 (the personal Mii). */ -void miiSelectorSetInitalIndex(MiiSelectorConf *conf, u32 index); +static inline void miiSelectorSetInitialIndex(MiiSelectorConf *conf, u32 index) +{ + conf->initial_index = index; +} /** * @brief Get Mii name diff --git a/libctru/source/applets/miiselector.c b/libctru/source/applets/miiselector.c index ea95c01..3f11ac0 100644 --- a/libctru/source/applets/miiselector.c +++ b/libctru/source/applets/miiselector.c @@ -76,17 +76,16 @@ void miiSelectorSetTitle(MiiSelectorConf *conf, const char* text) miiSelectorConvertToUTF16(conf->title, text, MIISELECTOR_TITLE_LEN); } -static const u8 miiSelectorOptions[] = -{ - offsetof(MiiSelectorConf, enable_cancel_button), - offsetof(MiiSelectorConf, enable_selecting_guests), - offsetof(MiiSelectorConf, show_on_top_screen), - offsetof(MiiSelectorConf, show_guest_page), -}; - void miiSelectorSetOptions(MiiSelectorConf *conf, u32 options) { - for (int i = 0; i < (sizeof(miiSelectorOptions)/sizeof(char)); i ++) + static const u8 miiSelectorOptions[] = + { + offsetof(MiiSelectorConf, enable_cancel_button), + offsetof(MiiSelectorConf, enable_selecting_guests), + offsetof(MiiSelectorConf, show_on_top_screen), + offsetof(MiiSelectorConf, show_guest_page), + }; + for (int i = 0; i < sizeof(miiSelectorOptions); i ++) *((u8*)conf + miiSelectorOptions[i]) = (options & BIT(i)) ? 1 : 0; } @@ -126,10 +125,6 @@ void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index) conf->mii_whitelist[i] = 0; } -void miiSelectorSetInitalIndex(MiiSelectorConf *conf, u32 index) { - conf->initial_index = index; -} - void miiSelectorReturnGetName(const MiiSelectorReturn *returnbuf, char* out, size_t max_size) { if (!out) @@ -151,7 +146,7 @@ void miiSelectorReturnGetAuthor(const MiiSelectorReturn *returnbuf, char* out, s static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val) { - if(buf == NULL) + if (!buf) return -1; u8 const *cbuf = buf; @@ -159,13 +154,13 @@ static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val) static const u16 POLY = 0x1021; - for(size_t i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) { - for(int bit = 7; bit >= 0; bit--) + for (int bit = 7; bit >= 0; bit--) crc = ((crc << 1) | ((cbuf[i] >> bit) & 0x1)) ^ (crc & 0x8000 ? POLY : 0); } - for(int _ = 0; _ < 16; _++) + for (int _ = 0; _ < 16; _++) crc = (crc << 1) ^ (crc & 0x8000 ? POLY : 0); return (u16)(crc & 0xffff);