mirror of
https://github.com/depp/syncfiles.git
synced 2024-12-22 02:29:56 +00:00
Style: Use trailing commas for enums
The trailing comma is supported in MPW and GCC. It fixes the formatting issue with clang-format and makes cleaner diffs, so trailing commas have been added to enums and clang-format has been run over the sources.
This commit is contained in:
parent
75f1908690
commit
dd96385d7c
@ -4,7 +4,6 @@ AccessModifierOffset: -4
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
DerivePointerAlignment: false
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
|
@ -4,8 +4,7 @@
|
||||
|
||||
#include "lib/defs.h"
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
/* Constants for CR and LF. Note that we should not use '\n' or '\r'
|
||||
anywhere, because these character constants may have unexpected values on
|
||||
certain old Mac OS compilers, depending on the compiler settings. In
|
||||
@ -17,8 +16,7 @@ enum
|
||||
kCharSubstitute = 63
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* Don't translite line breaks. */
|
||||
kLineBreakKeep,
|
||||
|
||||
@ -33,11 +31,7 @@ typedef enum
|
||||
} LineBreakConversion;
|
||||
|
||||
/* Directions that the converter runs in. */
|
||||
typedef enum
|
||||
{
|
||||
kToUTF8,
|
||||
kFromUTF8
|
||||
} ConvertDirection;
|
||||
typedef enum { kToUTF8, kFromUTF8 } ConvertDirection;
|
||||
|
||||
/* Get the character map used for the given Mac OS script and region codes.
|
||||
Return -1 if no known character map exists. */
|
||||
|
@ -2,8 +2,7 @@
|
||||
#include "convert/convert.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
/* Maximum length of encoded character. */
|
||||
kMaxEncodedLength = 8,
|
||||
|
||||
|
@ -7,10 +7,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
kInitialBufSize = 4 * 1024,
|
||||
kConvertBufferSize = 1024
|
||||
kConvertBufferSize = 1024,
|
||||
};
|
||||
|
||||
static UInt8 *gBuffer[3];
|
||||
|
@ -69,10 +69,9 @@ Basic types
|
||||
#if __bool_true_false_are_defined
|
||||
typedef bool Boolean;
|
||||
#else
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
false,
|
||||
true
|
||||
true,
|
||||
};
|
||||
typedef unsigned char Boolean;
|
||||
#endif
|
||||
@ -95,8 +94,7 @@ Error codes and error reporting
|
||||
==============================================================================*/
|
||||
|
||||
/* Error codes. */
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
/* No error. */
|
||||
kErrorOK,
|
||||
|
||||
|
@ -21,6 +21,6 @@ void Failf(const char *msg, ...) __attribute__((format(printf, 1, 2)));
|
||||
const char *ErrorDescriptionOrDie(ErrorCode err);
|
||||
|
||||
/* Print information about completed tests and return the status code. */
|
||||
int TestsDone(void );
|
||||
int TestsDone(void);
|
||||
|
||||
#endif
|
||||
|
13
sync/meta.h
13
sync/meta.h
@ -15,21 +15,18 @@ struct Timestamp {
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
kTypeNotExist,
|
||||
kTypeFile,
|
||||
kTypeDirectory
|
||||
kTypeDirectory,
|
||||
} FileType;
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
kLocal,
|
||||
kRemote
|
||||
kRemote,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
/* Maximum length of a filename. This is a Mac OS limitation. */
|
||||
kFilenameLength = 31,
|
||||
|
||||
|
@ -22,8 +22,7 @@ static int CompareFilename(const FileName *x, const FileName *y)
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
/*
|
||||
Maximum height of a file tree.
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
/* A reference to a file node by 1-based index, or 0 for none. */
|
||||
typedef int FileRef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
kNodeBlack,
|
||||
kNodeRed,
|
||||
} NodeColor;
|
||||
|
@ -8,9 +8,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
enum
|
||||
{
|
||||
kFileCount = 200
|
||||
enum {
|
||||
kFileCount = 200,
|
||||
};
|
||||
|
||||
static UInt32 Random(UInt32 state)
|
||||
|
Loading…
Reference in New Issue
Block a user