Skip to content

Commit

Permalink
Change indentation of preprocessor directives.
Browse files Browse the repository at this point in the history
Avoid too large indention relative to the main code:

static char *
fsp_to_string (const struct statfs *fsp)
{
    return (char *) (fsp->f_fstypename);
    return fstype_to_string (fsp->f_type);
}

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
  • Loading branch information
aborodin committed Mar 8, 2025
1 parent 92c19b8 commit 7be7b0d
Show file tree
Hide file tree
Showing 105 changed files with 1,038 additions and 1,046 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BraceWrapping:
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
ColumnLimit: 100
IndentPPDirectives: AfterHash
IndentPPDirectives: None
IndentWidth: 4
SortIncludes: Never
SpaceAfterCStyleCast: true
Expand Down
2 changes: 1 addition & 1 deletion lib/fileloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*** typedefs(not structures) and defined constants **********************************************/

#ifndef MC_USERCONF_DIR
# define MC_USERCONF_DIR "mc"
#define MC_USERCONF_DIR "mc"
#endif

#define TAGS_NAME "TAGS"
Expand Down
78 changes: 39 additions & 39 deletions lib/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,92 +15,92 @@
/*** typedefs(not structures) and defined constants **********************************************/

#ifdef S_ISREG
# define HAVE_S_ISREG 1
#define HAVE_S_ISREG 1
#else
# define HAVE_S_ISREG 0
# define S_ISREG(x) 0
#define HAVE_S_ISREG 0
#define S_ISREG(x) 0
#endif

#ifdef S_ISDIR
# define HAVE_S_ISDIR 1
#define HAVE_S_ISDIR 1
#else
# define HAVE_S_ISDIR 0
# define S_ISDIR(x) 0
#define HAVE_S_ISDIR 0
#define S_ISDIR(x) 0
#endif

/* Replacement for permission bits missing in sys/stat.h */
#ifdef S_ISLNK
# define HAVE_S_ISLNK 1
#define HAVE_S_ISLNK 1
#else
# define HAVE_S_ISLNK 0
# define S_ISLNK(x) 0
#define HAVE_S_ISLNK 0
#define S_ISLNK(x) 0
#endif

#ifdef S_ISSOCK
# define HAVE_S_ISSOCK 1
#define HAVE_S_ISSOCK 1
#else
# define HAVE_S_ISSOCK 0
# define S_ISSOCK(x) 0
#define HAVE_S_ISSOCK 0
#define S_ISSOCK(x) 0
#endif

#ifdef S_ISFIFO
# define HAVE_S_ISFIFO 1
#define HAVE_S_ISFIFO 1
#else
# define HAVE_S_ISFIFO 0
# define S_ISFIFO(x) 0
#define HAVE_S_ISFIFO 0
#define S_ISFIFO(x) 0
#endif

#ifdef S_ISCHR
# define HAVE_S_ISCHR 1
#define HAVE_S_ISCHR 1
#else
# define HAVE_S_ISCHR 0
# define S_ISCHR(x) 0
#define HAVE_S_ISCHR 0
#define S_ISCHR(x) 0
#endif

#ifdef S_ISBLK
# define HAVE_S_ISBLK 1
#define HAVE_S_ISBLK 1
#else
# define HAVE_S_ISBLK 0
# define S_ISBLK(x) 0
#define HAVE_S_ISBLK 0
#define S_ISBLK(x) 0
#endif

/* Door is something that only exists on Solaris */
#ifdef S_ISDOOR
# define HAVE_S_ISDOOR 1
#define HAVE_S_ISDOOR 1
#else
# define HAVE_S_ISDOOR 0
# define S_ISDOOR(x) 0
#define HAVE_S_ISDOOR 0
#define S_ISDOOR(x) 0
#endif

/* Special named files are widely used in QNX6 */
#ifdef S_ISNAM
# define HAVE_S_ISNAM 1
#define HAVE_S_ISNAM 1
#else
# define HAVE_S_ISNAM 0
# define S_ISNAM(x) 0
#define HAVE_S_ISNAM 0
#define S_ISNAM(x) 0
#endif

#ifndef PATH_MAX
# ifdef _POSIX_VERSION
# define PATH_MAX _POSIX_PATH_MAX
# else
# ifdef MAXPATHLEN
# define PATH_MAX MAXPATHLEN
# else
# define PATH_MAX 1024
# endif
# endif
#ifdef _POSIX_VERSION
#define PATH_MAX _POSIX_PATH_MAX
#else
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#endif

#ifndef MAXPATHLEN
# define MC_MAXPATHLEN 4096
#define MC_MAXPATHLEN 4096
#else
# define MC_MAXPATHLEN MAXPATHLEN
#define MC_MAXPATHLEN MAXPATHLEN
#endif

/* DragonFlyBSD doesn't provide MAXNAMLEN macro */
#ifndef MAXNAMLEN
# define MAXNAMLEN NAME_MAX
#define MAXNAMLEN NAME_MAX
#endif

#define MC_MAXFILENAMELEN MAXNAMLEN
Expand Down
2 changes: 1 addition & 1 deletion lib/glibcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*** typedefs(not structures) and defined constants **********************************************/

#ifndef G_OPTION_ENTRY_NULL
# define G_OPTION_ENTRY_NULL { NULL, '\0', 0, 0, NULL, NULL, NULL }
#define G_OPTION_ENTRY_NULL { NULL, '\0', 0, 0, NULL, NULL, NULL }
#endif

/*** enums ***************************************************************************************/
Expand Down
14 changes: 7 additions & 7 deletions lib/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
#include "global.h"

#ifdef ENABLE_SUBSHELL
# ifdef SUBSHELL_OPTIONAL
# define SUBSHELL_USE FALSE
# else // SUBSHELL_OPTIONAL
# define SUBSHELL_USE TRUE
# endif
#else // !ENABLE_SUBSHELL
# define SUBSHELL_USE FALSE
#ifdef SUBSHELL_OPTIONAL
#define SUBSHELL_USE FALSE
#else
#define SUBSHELL_USE TRUE
#endif
#else
#define SUBSHELL_USE FALSE
#endif

/*** global variables ****************************************************************************/
Expand Down
44 changes: 22 additions & 22 deletions lib/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <glib.h>

#if defined(HAVE_FUNC_ATTRIBUTE_WEAK) && defined(HAVE_TESTS)
# define MC_MOCKABLE __attribute__ ((weak))
#define MC_MOCKABLE __attribute__ ((weak))
#else
# define MC_MOCKABLE
#define MC_MOCKABLE
#endif

#include "glibcompat.h"
Expand All @@ -26,38 +26,38 @@
/*** typedefs(not structures) and defined constants **********************************************/

#ifdef ENABLE_NLS
# include <libintl.h>
# define _(String) gettext (String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#include <libintl.h>
#define _(String) gettext (String)
#ifdef gettext_noop
#define N_(String) gettext_noop (String)
#else
#define N_(String) (String)
#endif
#else // Stubs that do something close enough.
# define textdomain(String) 1
# define gettext(String) (String)
# define ngettext(String1, String2, Num) (((Num) == 1) ? (String1) : (String2))
# define dgettext(Domain, Message) (Message)
# define dcgettext(Domain, Message, Type) (Message)
# define bindtextdomain(Domain, Directory) 1
# define _(String) (String)
# define N_(String) (String)
#define textdomain(String) 1
#define gettext(String) (String)
#define ngettext(String1, String2, Num) (((Num) == 1) ? (String1) : (String2))
#define dgettext(Domain, Message) (Message)
#define dcgettext(Domain, Message, Type) (Message)
#define bindtextdomain(Domain, Directory) 1
#define _(String) (String)
#define N_(String) (String)
#endif

#ifdef HAVE_FUNC_ATTRIBUTE_FALLTHROUGH
# define MC_FALLTHROUGH __attribute__ ((fallthrough))
#define MC_FALLTHROUGH __attribute__ ((fallthrough))
#else
# define MC_FALLTHROUGH
#define MC_FALLTHROUGH
#endif

#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
# define MC_UNUSED __attribute__ ((unused))
#define MC_UNUSED __attribute__ ((unused))
#else
# define MC_UNUSED
#define MC_UNUSED
#endif

#ifdef USE_MAINTAINER_MODE
# include "lib/logging.h"
#include "lib/logging.h"
#endif

/* Just for keeping Your's brains from invention a proper size of the buffer :-) */
Expand Down
Loading

0 comments on commit 7be7b0d

Please sign in to comment.