Open Bug 989737 Opened 10 years ago Updated 2 years ago

Fixed warnings in accessible/src/generic/

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: iulian.matesica, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0 (Beta/Release)
Build ID: 20140317233501

Steps to reproduce:

It is my first patch, I hope it fixed the warnings.
Attached patch Warnings.patchSplinter Review
Attachment #8399079 - Flags: review?(trev.saunders)
Comment on attachment 8399079 [details] [diff] [review]
Warnings.patch



For the first bunch here I'd sort of rather leave the warning if we're not going to fix the issue somehow

>@@ -1030,17 +1030,17 @@ HyperTextAccessible::TextBounds(int32_t 
>   int32_t childIdx = GetChildIndexAtOffset(startOffset);
>   if (childIdx == -1)
>     return nsIntRect();
> 
>   nsIntRect bounds;
>   int32_t prevOffset = GetChildOffset(childIdx);
>   int32_t offset1 = startOffset - prevOffset;
> 
>-  while (childIdx < ChildCount()) {
>+  while (static_cast<unsigned int>(childIdx) < ChildCount()) {

istm the right fix here is to add some sort of unsigned int option class and then have  GetChildIndexAtOffset() return that instead of int32_t.

>@@ -1356,17 +1356,17 @@ HyperTextAccessible::SelectionBoundsAt(i
>                                        int32_t* aEndOffset)
> {
>   *aStartOffset = *aEndOffset = 0;
> 
>   nsTArray<nsRange*> ranges;
>   GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
> 
>   uint32_t rangeCount = ranges.Length();
>-  if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
>+  if (aSelectionNum < 0 || static_cast<unsigned int>(aSelectionNum) >= rangeCount)

why isn't the type of aSelectionNum unsigned?

>@@ -1398,30 +1398,30 @@ HyperTextAccessible::SetSelectionBoundsA
>   int32_t endOffset = ConvertMagicOffset(aEndOffset);
> 
>   Selection* domSel = DOMSelection();
>   if (!domSel)
>     return false;
> 
>   nsRefPtr<nsRange> range;
>   uint32_t rangeCount = domSel->GetRangeCount();
>-  if (aSelectionNum == rangeCount)
>+  if (static_cast<unsigned int>(aSelectionNum) == rangeCount)

same
Attachment #8399079 - Flags: review?(trev.saunders)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: