Closed Bug 92569 Opened 23 years ago Closed 23 years ago

nsLocalFileUnix needs general clean up. [FIX] {PATCH]

Categories

(Core :: XPCOM, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: pete, Assigned: pete)

References

Details

Attachments

(4 files, 4 obsolete files)

Clean up and fix uses like mPath.Adopt(foo) to check for 
NS_ERROR_OUT_OF_MEMORY
unchecked accessors like:

newParent->IsDirectory(&targetIsDirectory);

overall style congruity etc . . .

--pete
Attached patch a first pass (obsolete) — Splinter Review
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4
Keywords: patch, review
Summary: nsLocalFileUnix needs general clean up. → nsLocalFileUnix needs general clean up. [FIX] {PATCH]
Depends on: 94323
Priority: -- → P3
Target Milestone: mozilla0.9.4 → mozilla0.9.5
pushing back
Target Milestone: mozilla0.9.5 → mozilla0.9.7
I am working on this bug now and am writing some notes for myself to state the
changes being made.

1. removed all the unnecessary (const char*) casting of XPIDLCStrings and using
.get() instead.
2. add proper include files so FreeBSD can statfs instead of returning "not
implemented"
3. some very minor style clean ups. I want to change the tabstops to 2 spaces
instead of 4 but perhaps    i can do that on a second pass.
4. in ::CopyTo, i cloned the param newParent so the method will operate on the
clone instead of the callers param. I beleive win and mac implement this way as
well.

--pete
Attached patch general cleanup (obsolete) — Splinter Review
Attached patch patch for review (obsolete) — Splinter Review
need review
Attached patch for reviewSplinter Review
Attachment #43780 - Attachment is obsolete: true
Attachment #43823 - Attachment is obsolete: true
Attachment #59080 - Attachment is obsolete: true
Attachment #59084 - Attachment is obsolete: true
Adding other nsLocalFileUnix buddies.

/be
Comment on attachment 59085 [details] [diff] [review]
for review

Need to indent the return rv; below:

@@ -564,7 +578,8 @@
	 } else {
	     // make sure that the target is actually a directory
	     PRBool targetIsDirectory;
-	     newParent->IsDirectory(&targetIsDirectory);
+	     if (NS_FAILED(rv = newParent->IsDirectory(&targetIsDirectory)))
+	     return rv;

Otherwise looks good to me -- r/sr=brendan@mozilla.org, whichever ya need.

/be
Attachment #59085 - Flags: superreview+
Someone else should give the patch a good r=, I was in a hurry for lunch (but
I'm not worried).

/be
Comment on attachment 59085 [details] [diff] [review]
for review

what brendan said.
Attachment #59085 - Flags: review+
Checked in.

I am going to leave this open and do a style modification and change the tabstop
to 2.


--pete
Pete: why change the indentation?  A bunch of xpcom files (in particular,
xpcom/io files) use four space.  I prefer it, and so do others with vested
interests here.  You should not change it unilaterally, even though you are
doing great work and touching more lines than the rest of us vested interested
parties, I think.  What's your motivation?

/be
Brendan, i cleande up the comments and white space etc. 
My motivation is to just make the file more uniform and easier to read.

I prefer 2 space indentation but i can put it back to 4 if you like.
Two makes it easier to read IMHO.

Anyway, i'd like to land this now.

I can keep it at 4 and just land the pure style and white space cleanup here.
I won't need another review. No code has been altered.

Thanks

--pete
Indentation reamins at 4 spaces.

I will check it in, in about a half an hour.

Thanks

--pete
Comment on attachment 59563 [details] [diff] [review]
purely a style/white space/comment cleanup patch 

Pete, how about a diff -wu?  Also, please don't make the license comment a
doc-comment -- don't mess with anything in the "license block", in general.

/be
Thanks Brendan. 

Part two now checked in.

--pete
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: