Closed
Bug 1208355
Opened 9 years ago
Closed 9 years ago
Fix -Wshadow warnings in dom/datastore
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
Details
Attachments
(2 files, 1 obsolete file)
1.69 KB,
patch
|
cpeterson
:
feedback+
|
Details | Diff | Splinter Review |
4.92 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
dom/datastore/DataStoreService.cpp:956:15 [-Wshadow-local] shadowed declaration is here dom/datastore/DataStoreService.cpp:974:14 [-Wshadow-local] declaration of 'rv' shadows a previous local
Attachment #8665803 -
Flags: review?(amarchesini)
Comment 1•9 years ago
|
||
Comment on attachment 8665803 [details] [diff] [review] Wshadow_datastore.patch Review of attachment 8665803 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/datastore/DataStoreService.cpp @@ +953,5 @@ > } > > nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(window); > + ErrorResult createResult; > + nsRefPtr<Promise> promise = Promise::Create(global, createResult); Instead doing this, can you use 'rv' also in the rest of the code?
Attachment #8665803 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 2•9 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #1) > > nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(window); > > + ErrorResult createResult; > > + nsRefPtr<Promise> promise = Promise::Create(global, createResult); > > Instead doing this, can you use 'rv' also in the rest of the code? I'm not sure I understand. Do you mean I should use a variable name like 'createRv' or simply 'rv'? I can't use the name 'ErrorResult rv' here because it will clash with the declaration 'nsresult rv' later in this function, which is the original -Wshadow warning I am trying to fix. :)
Flags: needinfo?(amarchesini)
Comment 3•9 years ago
|
||
I meant something like this.
Flags: needinfo?(amarchesini)
Attachment #8666666 -
Flags: review?(cpeterson)
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8666666 [details] [diff] [review] example.patch Review of attachment 8666666 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! I understand now. I didn't see the ErrorResult class had a conversion constructor for nsresult values.
Attachment #8666666 -
Flags: review?(cpeterson) → feedback+
Assignee | ||
Comment 5•9 years ago
|
||
This patch includes the rv changes you asked for plus some other -Wshadow fixes in the DataStoreService::GetDataStoreInfos() member function.
Attachment #8665803 -
Attachment is obsolete: true
Attachment #8669286 -
Flags: review?(amarchesini)
Updated•9 years ago
|
Attachment #8669286 -
Flags: review?(amarchesini) → review+
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9adede8793f2
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•