Bug 1253149 - Use bool instead of int for boolean return values. r=SimonSapin
authorBobby Holley <bobbyholley@gmail.com>
Wed, 02 Mar 2016 20:27:07 -0800
changeset 323312 c9bf05039c309efa6f729c4d512b6fddd4f31c3c
parent 323311 51dc3c11ef230a5669df5bb8f9865fb712e52962
child 323313 9e56921407e9e862d3284a059cc39d1954dc1597
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
bugs1253149
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1253149 - Use bool instead of int for boolean return values. r=SimonSapin
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -18,17 +18,17 @@
 #include "mozilla/dom/Element.h"
 
 uint32_t
 Gecko_ChildrenCount(RawGeckoNode* aNode)
 {
   return aNode->GetChildCount();
 }
 
-int
+bool
 Gecko_NodeIsElement(RawGeckoNode* aNode)
 {
   return aNode->IsElement();
 }
 
 RawGeckoNode*
 Gecko_GetParentNode(RawGeckoNode* aNode)
 {
@@ -96,46 +96,47 @@ Gecko_GetDocumentElement(RawGeckoDocumen
 
 uint8_t
 Gecko_ElementState(RawGeckoElement* aElement)
 {
   return aElement->StyleState().GetInternalValue() &
          ((1 << (NS_EVENT_STATE_HIGHEST_SERVO_BIT + 1)) - 1);
 }
 
-int
+bool
 Gecko_IsHTMLElementInHTMLDocument(RawGeckoElement* aElement)
 {
   return aElement->IsHTMLElement() && aElement->OwnerDoc()->IsHTMLDocument();
 }
 
-int
+bool
 Gecko_IsLink(RawGeckoElement* aElement)
 {
   return nsCSSRuleProcessor::IsLink(aElement);
 }
 
-int Gecko_IsTextNode(RawGeckoNode* aNode)
+bool
+Gecko_IsTextNode(RawGeckoNode* aNode)
 {
   return aNode->NodeInfo()->NodeType() == nsIDOMNode::TEXT_NODE;
 }
 
-int
+bool
 Gecko_IsVisitedLink(RawGeckoElement* aElement)
 {
   return aElement->StyleState().HasState(NS_EVENT_STATE_VISITED);
 }
 
-int
+bool
 Gecko_IsUnvisitedLink(RawGeckoElement* aElement)
 {
   return aElement->StyleState().HasState(NS_EVENT_STATE_UNVISITED);
 }
 
-int
+bool
 Gecko_IsRootElement(RawGeckoElement* aElement)
 {
   return aElement->OwnerDoc()->GetRootElement() == aElement;
 }
 
 ServoNodeData*
 Gecko_GetNodeData(RawGeckoNode* aNode)
 {
@@ -184,17 +185,18 @@ void Servo_PrependStyleSheet(RawServoSty
 }
 
 void Servo_RemoveStyleSheet(RawServoStyleSheet* sheet, RawServoStyleSet* set)
 {
   MOZ_CRASH("stylo: shouldn't be calling Servo_RemoveStyleSheet in a "
             "non-MOZ_STYLO build");
 }
 
-int Servo_StyleSheetHasRules(RawServoStyleSheet* sheet)
+bool
+Servo_StyleSheetHasRules(RawServoStyleSheet* sheet)
 {
   MOZ_CRASH("stylo: shouldn't be calling Servo_StyleSheetHasRules in a "
             "non-MOZ_STYLO build");
 }
 
 RawServoStyleSet*
 Servo_InitStyleSet()
 {
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -27,53 +27,53 @@ typedef nsIDocument RawGeckoDocument;
 struct ServoNodeData;
 struct RawServoStyleSheet;
 struct RawServoStyleSet;
 
 extern "C" {
 
 // DOM Traversal.
 uint32_t Gecko_ChildrenCount(RawGeckoNode* node);
-int Gecko_NodeIsElement(RawGeckoNode* node);
+bool Gecko_NodeIsElement(RawGeckoNode* node);
 RawGeckoNode* Gecko_GetParentNode(RawGeckoNode* node);
 RawGeckoNode* Gecko_GetFirstChild(RawGeckoNode* node);
 RawGeckoNode* Gecko_GetLastChild(RawGeckoNode* node);
 RawGeckoNode* Gecko_GetPrevSibling(RawGeckoNode* node);
 RawGeckoNode* Gecko_GetNextSibling(RawGeckoNode* node);
 RawGeckoElement* Gecko_GetParentElement(RawGeckoElement* element);
 RawGeckoElement* Gecko_GetFirstChildElement(RawGeckoElement* element);
 RawGeckoElement* Gecko_GetLastChildElement(RawGeckoElement* element);
 RawGeckoElement* Gecko_GetPrevSiblingElement(RawGeckoElement* element);
 RawGeckoElement* Gecko_GetNextSiblingElement(RawGeckoElement* element);
 RawGeckoElement* Gecko_GetDocumentElement(RawGeckoDocument* document);
 
 // Selector Matching.
 uint8_t Gecko_ElementState(RawGeckoElement* element);
-int Gecko_IsHTMLElementInHTMLDocument(RawGeckoElement* element);
-int Gecko_IsLink(RawGeckoElement* element);
-int Gecko_IsTextNode(RawGeckoNode* node);
-int Gecko_IsVisitedLink(RawGeckoElement* element);
-int Gecko_IsUnvisitedLink(RawGeckoElement* element);
-int Gecko_IsRootElement(RawGeckoElement* element);
+bool Gecko_IsHTMLElementInHTMLDocument(RawGeckoElement* element);
+bool Gecko_IsLink(RawGeckoElement* element);
+bool Gecko_IsTextNode(RawGeckoNode* node);
+bool Gecko_IsVisitedLink(RawGeckoElement* element);
+bool Gecko_IsUnvisitedLink(RawGeckoElement* element);
+bool Gecko_IsRootElement(RawGeckoElement* element);
 
 // Node data.
 ServoNodeData* Gecko_GetNodeData(RawGeckoNode* node);
 void Gecko_SetNodeData(RawGeckoNode* node, ServoNodeData* data);
 void Servo_DropNodeData(ServoNodeData* data);
 
 // Styleset and Stylesheet management.
 //
 // TODO: Make these return already_AddRefed and UniquePtr when the binding
 // generator is smart enough to handle them.
 RawServoStyleSheet* Servo_StylesheetFromUTF8Bytes(const uint8_t* bytes, uint32_t length);
 void Servo_ReleaseStylesheet(RawServoStyleSheet* sheet);
 void Servo_AppendStyleSheet(RawServoStyleSheet* sheet, RawServoStyleSet* set);
 void Servo_PrependStyleSheet(RawServoStyleSheet* sheet, RawServoStyleSet* set);
 void Servo_RemoveStyleSheet(RawServoStyleSheet* sheet, RawServoStyleSet* set);
-int Servo_StyleSheetHasRules(RawServoStyleSheet* sheet);
+bool Servo_StyleSheetHasRules(RawServoStyleSheet* sheet);
 RawServoStyleSet* Servo_InitStyleSet();
 void Servo_DropStyleSet(RawServoStyleSet* set);
 
 // Servo API.
 void Servo_RestyleDocument(RawGeckoDocument* doc, RawServoStyleSet* set);
 
 } // extern "C"