Change preprocessor-directive indentation to be two-space, not one-space. rs=cjones in bug 702437
authorJeff Walden <jwalden@mit.edu>
Tue, 15 Nov 2011 22:26:55 -0800
changeset 81140 94b2b53b2db60e1ee05c375c09faa0218ffc3fcc
parent 81139 47131206c09f0c124775b4384ded1d3357c94f46
child 81141 30161b298513513dba7fc9dfcfcd915fd244ba46
child 81142 75ace50df0089eaffb8137850e0c49458cd890b7
push id628
push userclegnitto@mozilla.com
push dateWed, 21 Dec 2011 14:41:57 +0000
treeherdermozilla-aurora@24a61ad789e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs702437
milestone11.0a1
Change preprocessor-directive indentation to be two-space, not one-space. rs=cjones in bug 702437
mfbt/Types.h
mfbt/Util.h
--- a/mfbt/Types.h
+++ b/mfbt/Types.h
@@ -74,19 +74,19 @@
 #define MOZ_EXPORT_API(type_)  JS_EXPORT_API(type_)
 #define MOZ_IMPORT_API(type_)  JS_IMPORT_API(type_)
 
 /*
  * mfbt definitions need to see export declarations when built, but
  * other code needs to see import declarations when using mfbt.
  */
 #if defined(IMPL_MFBT)
-# define MFBT_API(type_)       MOZ_EXPORT_API(type_)
+#  define MFBT_API(type_)       MOZ_EXPORT_API(type_)
 #else
-# define MFBT_API(type_)       MOZ_IMPORT_API(type_)
+#  define MFBT_API(type_)       MOZ_IMPORT_API(type_)
 #endif
 
 
 #define MOZ_BEGIN_EXTERN_C     JS_BEGIN_EXTERN_C
 #define MOZ_END_EXTERN_C       JS_END_EXTERN_C
 
 #ifdef __cplusplus
 
@@ -94,42 +94,42 @@
  * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality
  * without warnings (functionality used by the macros below).  These modes are
  * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more
  * standardly, by checking whether __cplusplus has a C++11 or greater value.
  * Current versions of g++ do not correctly set __cplusplus, so we check both
  * for forward compatibility.
  */
 #if defined(__clang__)
-# if __clang_major__ >= 3
-#  define MOZ_HAVE_CXX11_DELETE
-#  define MOZ_HAVE_CXX11_OVERRIDE
-# elif __clang_major__ == 2
-#  if __clang_minor__ >= 9
-#   define MOZ_HAVE_CXX11_DELETE
+#  if __clang_major__ >= 3
+#    define MOZ_HAVE_CXX11_DELETE
+#    define MOZ_HAVE_CXX11_OVERRIDE
+#  elif __clang_major__ == 2
+#    if __clang_minor__ >= 9
+#      define MOZ_HAVE_CXX11_DELETE
+#    endif
 #  endif
-# endif
 #elif defined(__GNUC__)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
-#  if __GNUC__ > 4
-#   define MOZ_HAVE_CXX11_DELETE
-#   define MOZ_HAVE_CXX11_OVERRIDE
-#  elif __GNUC__ == 4
-#   if __GNUC_MINOR__ >= 7
+#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
+#    if __GNUC__ > 4
+#      define MOZ_HAVE_CXX11_DELETE
+#      define MOZ_HAVE_CXX11_OVERRIDE
+#    elif __GNUC__ == 4
+#      if __GNUC_MINOR__ >= 7
+#        define MOZ_HAVE_CXX11_OVERRIDE
+#      endif
+#      if __GNUC_MINOR__ >= 4
+#        define MOZ_HAVE_CXX11_DELETE
+#      endif
+#    endif
+#  endif
+#elif defined(_MSC_VER)
+#  if _MSC_VER >= 1400
 #    define MOZ_HAVE_CXX11_OVERRIDE
-#   endif
-#   if __GNUC_MINOR__ >= 4
-#    define MOZ_HAVE_CXX11_DELETE
-#   endif
 #  endif
-# endif
-#elif defined(_MSC_VER)
-# if _MSC_VER >= 1400
-#  define MOZ_HAVE_CXX11_OVERRIDE
-# endif
 #endif
 
 /*
  * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-
  * method declaration, attempts to delete that method from the corresponding
  * class.  An attempt to use the method will always produce an error *at compile
  * time* (instead of sometimes as late as link time) when this macro can be
  * implemented.  For example, you can use MOZ_DELETE to produce classes with no
@@ -145,19 +145,19 @@
  * If MOZ_DELETE can't be implemented for the current compiler, use of the
  * annotated method will still cause an error, but the error might occur at link
  * time in some cases rather than at compile time.
  *
  * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a
  * backstop, method declarations using MOZ_DELETE should be private.
  */
 #if defined(MOZ_HAVE_CXX11_DELETE)
-# define MOZ_DELETE            = delete
+#  define MOZ_DELETE            = delete
 #else
-# define MOZ_DELETE            /* no support */
+#  define MOZ_DELETE            /* no support */
 #endif
 
 /*
  * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class
  * overrides a member function of a base class, rather than potentially being a
  * new member function.  MOZ_OVERRIDE should be placed immediately before the
  * ';' terminating the member function's declaration, or before '= 0;' if the
  * member function is pure.  If the member function is defined in the class
@@ -186,16 +186,16 @@
  *
  * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that
  * the function marked with it override a member function of a base class: it
  * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect
  * semantics and merely documents the override relationship to the reader (but
  * of course must still be used correctly to not break C++11 compilers).
  */
 #if defined(MOZ_HAVE_CXX11_OVERRIDE)
-# define MOZ_OVERRIDE          override
+#  define MOZ_OVERRIDE          override
 #else
-# define MOZ_OVERRIDE          /* no support */
+#  define MOZ_OVERRIDE          /* no support */
 #endif
 
 #endif /* __cplusplus */
 
 #endif  /* mozilla_Types_h_ */
--- a/mfbt/Util.h
+++ b/mfbt/Util.h
@@ -64,77 +64,73 @@ JS_Assert(const char *s, const char *fil
 MOZ_END_EXTERN_C
 
 /*
  * MOZ_ASSERT() is a "strong" assertion of state, like libc's
  * assert().  If a MOZ_ASSERT() fails in a debug build, the process in
  * which it fails will stop running in a loud and dramatic way.
  */
 #ifdef DEBUG
-
-# define MOZ_ASSERT(expr_)                                      \
-    ((expr_) ? (void)0 : JS_Assert(#expr_, __FILE__, __LINE__))
-
+#  define MOZ_ASSERT(expr_)                                      \
+     ((expr_) ? (void)0 : JS_Assert(#expr_, __FILE__, __LINE__))
 #else
-
-# define MOZ_ASSERT(expr_) ((void)0)
-
+#  define MOZ_ASSERT(expr_) ((void)0)
 #endif  /* DEBUG */
 
 /*
  * MOZ_INLINE is a macro which expands to tell the compiler that the method
  * decorated with it should be inlined.  This macro is usable from C and C++
  * code, even though C89 does not support the |inline| keyword.  The compiler
  * may ignore this directive if it chooses.
  */
 #ifndef MOZ_INLINE
-# if defined __cplusplus
-#  define MOZ_INLINE          inline
-# elif defined _MSC_VER
-#  define MOZ_INLINE          __inline
-# elif defined __GNUC__
-#  define MOZ_INLINE          __inline__
-# else
-#  define MOZ_INLINE          inline
-# endif
+#  if defined __cplusplus
+#    define MOZ_INLINE          inline
+#  elif defined _MSC_VER
+#    define MOZ_INLINE          __inline
+#  elif defined __GNUC__
+#    define MOZ_INLINE          __inline__
+#  else
+#    define MOZ_INLINE          inline
+#  endif
 #endif
 
 /*
  * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the
  * method decorated with it must be inlined, even if the compiler thinks
  * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:
  * compilers are not guaranteed to respect it (although they're much more likely
  * to do so).
  */
 #ifndef MOZ_ALWAYS_INLINE
-# if defined DEBUG
-#  define MOZ_ALWAYS_INLINE   MOZ_INLINE
-# elif defined _MSC_VER
-#  define MOZ_ALWAYS_INLINE   __forceinline
-# elif defined __GNUC__
-#  define MOZ_ALWAYS_INLINE   __attribute__((always_inline)) MOZ_INLINE
-# else
-#  define MOZ_ALWAYS_INLINE   MOZ_INLINE
-# endif
+#  if defined DEBUG
+#    define MOZ_ALWAYS_INLINE   MOZ_INLINE
+#  elif defined _MSC_VER
+#    define MOZ_ALWAYS_INLINE   __forceinline
+#  elif defined __GNUC__
+#    define MOZ_ALWAYS_INLINE   __attribute__((always_inline)) MOZ_INLINE
+#  else
+#    define MOZ_ALWAYS_INLINE   MOZ_INLINE
+#  endif
 #endif
 
 /*
  * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the
  * method decorated with it must never be inlined, even if the compiler would
  * otherwise choose to inline the method.  Compilers aren't absolutely
  * guaranteed to support this, but most do.
  */
 #ifndef MOZ_NEVER_INLINE
-# if defined _MSC_VER
-#  define MOZ_NEVER_INLINE __declspec(noinline)
-# elif defined __GNUC__
-#  define MOZ_NEVER_INLINE __attribute__((noinline))
-# else
-#  define MOZ_NEVER_INLINE
-# endif
+#  if defined _MSC_VER
+#    define MOZ_NEVER_INLINE __declspec(noinline)
+#  elif defined __GNUC__
+#    define MOZ_NEVER_INLINE __attribute__((noinline))
+#  else
+#    define MOZ_NEVER_INLINE
+#  endif
 #endif
 
 #ifdef __cplusplus
 
 namespace mozilla {
 
 /**
  * DebugOnly contains a value of type T, but only in debug builds.  In
@@ -219,28 +215,24 @@ public:
  * For instance,
  *
  *   MOZ_ALIGNED_DECL(char arr[2], 8);
  *
  * will declare a two-character array |arr| aligned to 8 bytes.
  */
 
 #if defined(__GNUC__)
-#define MOZ_ALIGNED_DECL(_type, _align) \
-  _type __attribute__((aligned(_align)))
-
+#  define MOZ_ALIGNED_DECL(_type, _align) \
+     _type __attribute__((aligned(_align)))
 #elif defined(_MSC_VER)
-#define MOZ_ALIGNED_DECL(_type, _align) \
-  __declspec(align(_align)) _type
-
+#  define MOZ_ALIGNED_DECL(_type, _align) \
+     __declspec(align(_align)) _type
 #else
-
-#warning "We don't know how to align variables on this compiler."
-#define MOZ_ALIGNED_DECL(_type, _align) _type
-
+#  warning "We don't know how to align variables on this compiler."
+#  define MOZ_ALIGNED_DECL(_type, _align) _type
 #endif
 
 /*
  * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N bytes.
  *
  * We support 1, 2, 4, 8, and 16-bit alignment.
  */
 template<size_t align>