Fix build warnings in editor/

RESOLVED FIXED in mozilla2.0b8

Status

()

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla2.0b8
x86
Linux
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
Created attachment 484013 [details] [diff] [review]
Patch v1
Flags: in-testsuite-
Attachment #484013 - Flags: review?(ehsan)

Comment 1

8 years ago
Comment on attachment 484013 [details] [diff] [review]
Patch v1

>diff --git a/editor/txtsvc/src/nsTextServicesDocument.cpp b/editor/txtsvc/src/nsTextServicesDocument.cpp
>-  PRInt32 nodeIndex, tcount;
>-  PRBool hasEntry;
>+  PRInt32 tcount;
>+  PRInt32 nodeIndex = 0;
>+  PRBool hasEntry = PR_FALSE;

Why are you not initializing tcount as well?

Looks good otherwise.
Attachment #484013 - Flags: review?(ehsan)
(Assignee)

Comment 2

8 years ago
Because tcount is initialized unconditionally later in the function. How about

@@ -1846,1 +1847,1 @@
-tcount = mOffsetTable.Length();
+PRInt32 tcount = mOffsetTable.Length();

instead?
(Assignee)

Updated

8 years ago
Attachment #484013 - Flags: review?(ehsan)

Comment 3

8 years ago
Comment on attachment 484013 [details] [diff] [review]
Patch v1

(In reply to comment #2)
> Because tcount is initialized unconditionally later in the function. How about
> 
> @@ -1846,1 +1847,1 @@
> -tcount = mOffsetTable.Length();
> +PRInt32 tcount = mOffsetTable.Length();
> 
> instead?

That makes more sense.  r=me with that change.
Attachment #484013 - Flags: review?(ehsan) → review+
(Assignee)

Comment 4

8 years ago
Created attachment 485136 [details] [diff] [review]
Patch v2

Done.
Attachment #484013 - Attachment is obsolete: true
Attachment #485136 - Flags: approval2.0?

Updated

8 years ago
Attachment #485136 - Flags: approval2.0? → approval2.0+

Comment 5

8 years ago
Temporarily assigning to me so that this patch shows up in my "needs landing" query.  Will assign back to Ms2ger once I land this.
Assignee: Ms2ger → ehsan
Whiteboard: [build_warning] → [build_warning][needs landing]

Comment 6

8 years ago
http://hg.mozilla.org/mozilla-central/rev/8f95ff16a6ba
Assignee: ehsan → Ms2ger
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: [build_warning][needs landing] → [build_warning]
Target Milestone: --- → mozilla2.0b8

Updated

8 years ago
Duplicate of this bug: 577907
You need to log in before you can comment on or make changes to this bug.