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