Title: [206495] trunk/Websites/webkit.org
Revision
206495
Author
commit-qu...@webkit.org
Date
2016-09-27 21:35:27 -0700 (Tue, 27 Sep 2016)

Log Message

Update style guide for #pragma once
https://bugs.webkit.org/show_bug.cgi?id=162633

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-09-27
Reviewed by Dan Bernstein.

* code-style.md:
Update style guide for #pragma once as discussed on webkit-dev.

Modified Paths

Diff

Modified: trunk/Websites/webkit.org/ChangeLog (206494 => 206495)


--- trunk/Websites/webkit.org/ChangeLog	2016-09-28 04:09:21 UTC (rev 206494)
+++ trunk/Websites/webkit.org/ChangeLog	2016-09-28 04:35:27 UTC (rev 206495)
@@ -1,3 +1,13 @@
+2016-09-27  Joseph Pecoraro  <pecor...@apple.com>
+
+        Update style guide for #pragma once
+        https://bugs.webkit.org/show_bug.cgi?id=162633
+
+        Reviewed by Dan Bernstein.
+
+        * code-style.md:
+        Update style guide for #pragma once as discussed on webkit-dev.
+
 2016-09-21  Filip Pizlo  <fpi...@apple.com>
 
         Add a Fence opcode to B3

Modified: trunk/Websites/webkit.org/code-style.md (206494 => 206495)


--- trunk/Websites/webkit.org/code-style.md	2016-09-28 04:09:21 UTC (rev 206494)
+++ trunk/Websites/webkit.org/code-style.md	2016-09-28 04:35:27 UTC (rev 206495)
@@ -114,8 +114,8 @@
 
 ```cpp
 return attribute.name() == srcAttr
-        || attribute.name() == lowsrcAttr
-        || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#');
+    || attribute.name() == lowsrcAttr
+    || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#');
 ```
 
 
@@ -123,8 +123,8 @@
 
 ```cpp
 return attribute.name() == srcAttr ||
-        attribute.name() == lowsrcAttr ||
-        (attribute.name() == usemapAttr && attr->value().string()[0] != '#');
+    attribute.name() == lowsrcAttr ||
+    (attribute.name() == usemapAttr && attr->value().string()[0] != '#');
 ```
 
 
@@ -695,14 +695,13 @@
         NSLocalizedString(@"Stop", @"Stop button title")
 ```
 
-[](#names-header-guards) `#define`, `#ifdef` "header guards" should be named exactly the same as the file (including case), replacing the `.` with a `_`.
+[](#header-guards) Use `#pragma once` instead of `#define` and `#ifdef` for header guards.
 
 ###### Right:
 
 ```cpp
 // HTMLDocument.h
-#ifndef HTMLDocument_h
-#define HTMLDocument_h
+#pragma once
 ```
 
 ###### Wrong:
@@ -709,8 +708,8 @@
 
 ```cpp
 // HTMLDocument.h
-#ifndef _HTML_DOCUMENT_H_
-#define _HTML_DOCUMENT_H_
+#ifndef HTMLDocument_h
+#define HTMLDocument_h
 ```
 
 [](#names-protectors-this) Ref and RefPtr objects meant to protect `this` from deletion should be named "protectedThis".
@@ -791,7 +790,7 @@
 
 ```cpp
 for (auto& frameView : frameViews)
-        frameView->updateLayoutAndStyleIfNeededRecursive();
+    frameView->updateLayoutAndStyleIfNeededRecursive();
 ```
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to