2009-11-10 Joanmarie Diggs <joanmarie.diggs@gmail.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Nov 2009 09:53:33 +0000 (09:53 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Nov 2009 09:53:33 +0000 (09:53 +0000)
        Reviewed by Reviewed by Jan Alonzo.

        https://bugs.webkit.org/show_bug.cgi?id=30901
        [Gtk] Need to de-lint the Atk a11y code

        Removal of various and sundry style-violating nits.

        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

index bcea395140a10c43984f501bfc7d1286ebff2ce7..6c95e27d7ccd7d184cf3ee952375fd3397d779ce 100644 (file)
@@ -1,3 +1,14 @@
+2009-11-10  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Reviewed by Jan Alonzo.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30901
+        [Gtk] Need to de-lint the Atk a11y code
+
+        Removal of various and sundry style-violating nits.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+
 2009-11-10  Philippe Normand  <pnormand@igalia.com>
 
         Reviewed by Jan Alonzo.
index 67fd29dea01389adf4e8739e0949e40d215ad4d6..86bc37366442c29378c30fa1805390d1232fb45f 100644 (file)
@@ -199,7 +199,7 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk
     }
 }
 
-static gpointer webkit_accessible_parent_class = NULL;
+static gpointer webkit_accessible_parent_class = 0;
 
 static AtkObject* atkParentOfWebView(AtkObject* object)
 {
@@ -247,13 +247,13 @@ static AtkObject* webkit_accessible_ref_child(AtkObject* object, gint index)
 {
     AccessibilityObject* coreObject = core(object);
     AccessibilityObject::AccessibilityChildrenVector children = coreObject->children();
-    if (index < 0 || index >= children.size())
+    if (index < 0 || static_cast<unsigned>(index) >= children.size())
         return 0;
 
     AccessibilityObject* coreChild = children.at(index).get();
 
     if (!coreChild)
-        return NULL;
+        return 0;
 
     AtkObject* child = coreChild->wrapper();
     atk_object_set_parent(child, object);
@@ -304,7 +304,7 @@ static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const c
 
 static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
 {
-    AtkAttributeSet* attributeSet = NULL;
+    AtkAttributeSet* attributeSet = 0;
 
     int headingLevel = core(object)->headingLevel();
     if (headingLevel) {
@@ -592,15 +592,15 @@ webkit_accessible_get_type(void)
     if (g_once_init_enter(&type_volatile)) {
         static const GTypeInfo tinfo = {
             sizeof(WebKitAccessibleClass),
-            (GBaseInitFunc)NULL,
-            (GBaseFinalizeFunc)NULL,
-            (GClassInitFunc)webkit_accessible_class_init,
-            (GClassFinalizeFunc)NULL,
-            NULL, /* class data */
+            (GBaseInitFunc) 0,
+            (GBaseFinalizeFunc) 0,
+            (GClassInitFunc) webkit_accessible_class_init,
+            (GClassFinalizeFunc) 0,
+            0, /* class data */
             sizeof(WebKitAccessible), /* instance size */
             0, /* nb preallocs */
-            (GInstanceInitFunc)NULL,
-            NULL /* value table */
+            (GInstanceInitFunc) 0,
+            0 /* value table */
         };
 
         GType type = g_type_register_static(ATK_TYPE_OBJECT,
@@ -624,7 +624,7 @@ static gint webkit_accessible_action_get_n_actions(AtkAction* action)
 
 static const gchar* webkit_accessible_action_get_description(AtkAction* action, gint i)
 {
-    g_return_val_if_fail(i == 0, NULL);
+    g_return_val_if_fail(i == 0, 0);
     // TODO: Need a way to provide/localize action descriptions.
     notImplemented();
     return "";
@@ -632,14 +632,14 @@ static const gchar* webkit_accessible_action_get_description(AtkAction* action,
 
 static const gchar* webkit_accessible_action_get_keybinding(AtkAction* action, gint i)
 {
-    g_return_val_if_fail(i == 0, NULL);
+    g_return_val_if_fail(i == 0, 0);
     // FIXME: Construct a proper keybinding string.
     return returnString(core(action)->accessKey().string());
 }
 
 static const gchar* webkit_accessible_action_get_name(AtkAction* action, gint i)
 {
-    g_return_val_if_fail(i == 0, NULL);
+    g_return_val_if_fail(i == 0, 0);
     return returnString(core(action)->actionVerb());
 }
 
@@ -840,12 +840,12 @@ static gchar* convertUniCharToUTF8(const UChar* characters, gint length, int fro
 {
     CString stringUTF8 = UTF8Encoding().encode(characters, length, QuestionMarksForUnencodables);
     gchar* utf8String = utf8Substr(stringUTF8.data(), from, to);
-    if (!g_utf8_validate(utf8String, -1, NULL)) {
+    if (!g_utf8_validate(utf8String, -1, 0)) {
         g_free(utf8String);
         return 0;
     }
     gsize len = strlen(utf8String);
-    GString* ret = g_string_new_len(NULL, len);
+    GString* ret = g_string_new_len(0, len);
     gchar* ptr = utf8String;
 
     // WebCore introduces line breaks in the text that do not reflect
@@ -876,7 +876,7 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
     if (!webView)
         return 0;
 
-    GString* str = g_string_new(NULL);
+    GString* str = g_string_new(0);
 
     AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject);
     if (!accObject)
@@ -888,7 +888,7 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
     // Create a string with the layout as it appears on the screen
     InlineTextBox* box = renderText->firstTextBox();
     while (box) {
-        gchar *text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
+        gchartext = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
         g_string_append(str, text);
         g_string_append(str, "\n");
         box = box->nextTextBox();
@@ -917,7 +917,7 @@ static gchar* webkit_accessible_text_get_text_before_offset(AtkText* text, gint
 static gunichar webkit_accessible_text_get_character_at_offset(AtkText* text, gint offset)
 {
     notImplemented();
-    return NULL;
+    return 0;
 }
 
 static gint webkit_accessible_text_get_caret_offset(AtkText* text)
@@ -929,13 +929,13 @@ static gint webkit_accessible_text_get_caret_offset(AtkText* text)
 static AtkAttributeSet* webkit_accessible_text_get_run_attributes(AtkText* text, gint offset, gint* start_offset, gint* end_offset)
 {
     notImplemented();
-    return NULL;
+    return 0;
 }
 
 static AtkAttributeSet* webkit_accessible_text_get_default_attributes(AtkText* text)
 {
     notImplemented();
-    return NULL;
+    return 0;
 }
 
 static void webkit_accessible_text_get_character_extents(AtkText* text, gint offset, gint* x, gint* y, gint* width, gint* height, AtkCoordType coords)
@@ -980,7 +980,7 @@ static gint webkit_accessible_text_get_offset_at_point(AtkText* text, gint x, gi
     return range.start;
 }
 
-static bool selectionBelongsToObject(AccessibilityObject *coreObject, VisibleSelection& selection)
+static bool selectionBelongsToObject(AccessibilityObjectcoreObject, VisibleSelection& selection)
 {
     if (!coreObject->isAccessibilityRenderObject())
         return false;
@@ -1015,7 +1015,7 @@ static gchar* webkit_accessible_text_get_selection(AtkText* text, gint selection
     // the global one (the API is a bit confusing)
     if (selection_num != 0 || !selectionBelongsToObject(coreObject, selection)) {
         *start_offset = *end_offset = 0;
-        return NULL;
+        return 0;
     }
 
     *start_offset = selection.start().offsetInContainerNode();
@@ -1201,7 +1201,7 @@ static AtkObject* webkit_accessible_component_ref_accessible_at_point(AtkCompone
     IntPoint pos = atkToContents(core(component), coordType, x, y);
     AccessibilityObject* target = core(component)->doAccessibilityHitTest(pos);
     if (!target)
-        return NULL;
+        return 0;
     g_object_ref(target->wrapper());
     return target->wrapper();
 }
@@ -1218,7 +1218,7 @@ static gboolean webkit_accessible_component_grab_focus(AtkComponent* component)
     return core(component)->isFocused();
 }
 
-static void atk_component_interface_init(AtkComponentIface *iface)
+static void atk_component_interface_init(AtkComponentIfaceiface)
 {
     iface->ref_accessible_at_point = webkit_accessible_component_ref_accessible_at_point;
     iface->get_extents = webkit_accessible_component_get_extents;
@@ -1265,14 +1265,14 @@ static AccessibilityTableCell* cell(AtkTable* table, guint row, guint column)
     return 0;
 }
 
-static gint cellIndex(AccessibilityTableCell* AXCell, AccessibilityTable* AXTable)
+static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable)
 {
     // Calculate the cell's index as if we had a traditional Gtk+ table in
     // which cells are all direct children of the table, arranged row-first.
     AccessibilityObject::AccessibilityChildrenVector allCells;
-    AXTable->cells(allCells);
+    axTable->cells(allCells);
     AccessibilityObject::AccessibilityChildrenVector::iterator position;
-    position = std::find(allCells.begin(), allCells.end(), AXCell);
+    position = std::find(allCells.begin(), allCells.end(), axCell);
     if (position == allCells.end())
         return -1;
     return position - allCells.begin();
@@ -1294,17 +1294,17 @@ static AccessibilityTableCell* cellAtIndex(AtkTable* table, gint index)
 
 static AtkObject* webkit_accessible_table_ref_at(AtkTable* table, gint row, gint column)
 {
-    AccessibilityTableCell* AXCell = cell(table, row, column);
-    if (!AXCell)
+    AccessibilityTableCell* axCell = cell(table, row, column);
+    if (!axCell)
         return 0;
-    return AXCell->wrapper();
+    return axCell->wrapper();
 }
 
 static gint webkit_accessible_table_get_index_at(AtkTable* table, gint row, gint column)
 {
-    AccessibilityTableCell* AXCell = cell(table, row, column);
-    AccessibilityTable* AXTable = static_cast<AccessibilityTable*>(core(table));
-    return cellIndex(AXCell, AXTable);
+    AccessibilityTableCell* axCell = cell(table, row, column);
+    AccessibilityTable* axTable = static_cast<AccessibilityTable*>(core(table));
+    return cellIndex(axCell, axTable);
 }
 
 static gint webkit_accessible_table_get_column_at_index(AtkTable* table, gint index)
@@ -1347,10 +1347,10 @@ static gint webkit_accessible_table_get_n_rows(AtkTable* table)
 
 static gint webkit_accessible_table_get_column_extent_at(AtkTable* table, gint row, gint column)
 {
-    AccessibilityTableCell* AXCell = cell(table, row, column);
-    if (AXCell) {
+    AccessibilityTableCell* axCell = cell(table, row, column);
+    if (axCell) {
         pair<int, int> columnRange;
-        AXCell->columnIndexRange(columnRange);
+        axCell->columnIndexRange(columnRange);
         return columnRange.second;
     }
     return 0;
@@ -1358,10 +1358,10 @@ static gint webkit_accessible_table_get_column_extent_at(AtkTable* table, gint r
 
 static gint webkit_accessible_table_get_row_extent_at(AtkTable* table, gint row, gint column)
 {
-    AccessibilityTableCell* AXCell = cell(table, row, column);
-    if (AXCell) {
+    AccessibilityTableCell* axCell = cell(table, row, column);
+    if (axCell) {
         pair<int, int> rowRange;
-        AXCell->rowIndexRange(rowRange);
+        axCell->rowIndexRange(rowRange);
         return rowRange.second;
     }
     return 0;
@@ -1498,21 +1498,21 @@ static void atk_document_interface_init(AtkDocumentIface* iface)
 
 static const GInterfaceInfo AtkInterfacesInitFunctions[] = {
     {(GInterfaceInitFunc)atk_action_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_selection_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_editable_text_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_text_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_component_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_image_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_table_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL},
+     (GInterfaceFinalizeFunc) 0, 0},
     {(GInterfaceInitFunc)atk_document_interface_init,
-     (GInterfaceFinalizeFunc) NULL, NULL}
+     (GInterfaceFinalizeFunc) 0, 0}
 };
 
 enum WAIType {
@@ -1595,10 +1595,10 @@ static const char* getUniqueAccessibilityTypeName(guint16 interfaceMask)
 {
 #define WAI_TYPE_NAME_LEN (30) /* Enough for prefix + 5 hex characters (max) */
     static char name[WAI_TYPE_NAME_LEN + 1];
-    
+
     g_sprintf(name, "WAIType%x", interfaceMask);
     name[WAI_TYPE_NAME_LEN] = '\0';
-    
+
     return name;
 }
 
@@ -1606,15 +1606,15 @@ static GType getAccessibilityTypeFromObject(AccessibilityObject* coreObject)
 {
     static const GTypeInfo typeInfo = {
         sizeof(WebKitAccessibleClass),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) NULL,
-        (GClassFinalizeFunc) NULL,
-        NULL, /* class data */
+        (GBaseInitFunc) 0,
+        (GBaseFinalizeFunc) 0,
+        (GClassInitFunc) 0,
+        (GClassFinalizeFunc) 0,
+        0, /* class data */
         sizeof(WebKitAccessible), /* instance size */
         0, /* nb preallocs */
-        (GInstanceInitFunc) NULL,
-        NULL /* value table */
+        (GInstanceInitFunc) 0,
+        0 /* value table */
     };
 
     guint16 interfaceMask = getInterfaceMaskFromObject(coreObject);
@@ -1639,7 +1639,7 @@ static GType getAccessibilityTypeFromObject(AccessibilityObject* coreObject)
 WebKitAccessible* webkit_accessible_new(AccessibilityObject* coreObject)
 {
     GType type = getAccessibilityTypeFromObject(coreObject);
-    AtkObject* object = static_cast<AtkObject*>(g_object_new(type, NULL));
+    AtkObject* object = static_cast<AtkObject*>(g_object_new(type, 0));
 
     atk_object_initialize(object, coreObject);