Skip to content

Commit

Permalink
tidy code
Browse files Browse the repository at this point in the history
- tidy array defs
- clang-format
  • Loading branch information
flatcap committed Jan 7, 2022
1 parent 051c3d9 commit 9daa896
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion menu/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ typedef uint8_t MenuRedrawFlags; ///< Flags, e.g. #MENU_REDRAW_INDEX
#define MENU_REDRAW_BODY (1 << 4) ///< Redraw the pager
#define MENU_REDRAW_FLOW (1 << 5) ///< Used by pager to reflow text

ARRAY_HEAD(DialogLines, char *);

/**
* @defgroup menu_api Menu API
*
Expand All @@ -79,7 +81,7 @@ struct Menu
* In dialog mode menubar is hidden and prompt keys are checked before
* normal menu movement keys. This can cause problems with scrolling, if
* prompt keys override movement keys. */
ARRAY_HEAD(, char *) dialog; ///< Dialog lines themselves
struct DialogLines dialog; ///< Dialog lines themselves
char *prompt; ///< Prompt for user, similar to mutt_multi_choice
char *keys; ///< Keys used in the prompt

Expand Down
4 changes: 2 additions & 2 deletions mutt/mbyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ size_t mutt_mb_mbstowcs(wchar_t **pwbuf, size_t *pwbuflen, size_t i, const char
while (*buf != '\0')
{
memset(&mbstate, 0, sizeof(mbstate));
for (; (k = mbrtowc(&wc, buf, MB_LEN_MAX, &mbstate)) && k != (size_t) (-1) &&
k != (size_t) (-2);
for (; (k = mbrtowc(&wc, buf, MB_LEN_MAX, &mbstate)) &&
k != (size_t) (-1) && k != (size_t) (-2);
buf += k)
{
if (i >= wbuflen)
Expand Down
3 changes: 2 additions & 1 deletion mutt_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ static const struct Command mutt_commands[] = {
// clang-format on
};

ARRAY_HEAD(, struct Command) commands = ARRAY_HEAD_INITIALIZER;
ARRAY_HEAD(CommandArray, struct Command);
struct CommandArray commands = ARRAY_HEAD_INITIALIZER;

/**
* mutt_commands_init - Initialize commands array and register default commands
Expand Down
4 changes: 3 additions & 1 deletion notmuch/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "mutt/lib.h"

ARRAY_HEAD(Tags, char *);

/**
* struct TagArray - Array of Notmuch tags
*
Expand All @@ -33,7 +35,7 @@
*/
struct TagArray
{
ARRAY_HEAD(, char *) tags; ///< Tags
struct Tags tags; ///< Tags
char *tag_str; ///< Source string
};

Expand Down
3 changes: 2 additions & 1 deletion sidebar/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct SbEntry
bool is_hidden; ///< Don't show, e.g. $sidebar_new_mail_only
enum ColorId cid; ///< Colour to use
};
ARRAY_HEAD(SbEntryArray, struct SbEntry *);

/**
* enum DivType - Source of the sidebar divider character
Expand All @@ -63,7 +64,7 @@ enum DivType
struct SidebarWindowData
{
struct IndexSharedData *shared; ///< Shared Index Data
ARRAY_HEAD(, struct SbEntry *) entries; ///< Items to display in the sidebar
struct SbEntryArray entries; ///< Items to display in the sidebar

int top_index; ///< First mailbox visible in sidebar
int opn_index; ///< Current (open) mailbox
Expand Down

0 comments on commit 9daa896

Please sign in to comment.