Closed Bug 137489 Opened 23 years ago Closed 15 years ago

hierarchyDelimiter should consistently be a char

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: timeless, Assigned: mkmelin)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 2 obsolete files)

F:\build\mozilla\mailnews\imap\src\nsImapIncomingServer.cpp(1310) : warning 
C4244: 'argument' : conversion from 'unsigned short' to 'char', possible loss 
of data

1122 NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char 
*folderPath, PRUnichar hierarchyDelimiter, PRInt32 boxFlags, PRBool 
*aNewFolder)
1310 dupFolderPath.ReplaceChar('/', hierarchyDelimiter);

Is there a real need for hierarchyDelimiter to be a PRUnichar?

bienvenu: no, there's not - I think whoever ported that code thought we would 
use prunichar's everywhere and we never fixed it.
*** Bug 160650 has been marked as a duplicate of this bug. ***
Adding Henry's comments from bug 160650:
--------------------------------------------------------------------------------
nsIMsgImapMailFolder uses 'PRUnichar' delimiter, nsImapUrl uses 'char'
delimiter, nsIImapMailFolderSink uses 'char' delimiter, nsISubscribableServer
uses 'char' delimiter...

I think we should unify the data type because we often set the value from one to
another. I suggest to use 'char' to reduce the memory usage.
----------------------------------------------------------------------------------
Blocks: 160644
Attached patch patch for review (obsolete) — Splinter Review
Taking.

Add mscott to CC list.
Assignee: mscott → Henry.Jia
Keywords: review
Add navin & Cavin to the CC list.

Pls r=. Thx.
Status: NEW → ASSIGNED
Comment on attachment 93990 [details] [diff] [review]
patch for review

r=naving
Attachment #93990 - Flags: review+
Comment on attachment 93990 [details] [diff] [review]
patch for review

David, please take a look at. Thx.
Attachment #93990 - Flags: superreview?(bienvenu)
bienvenu: Do you forget this review ?
this patch won't reduce memory useage or really have any effect at all, but we
can look at getting it in after 1.4 is done.
But it can simplify the usage of hierarchyDelimiter. :-)
two year old sr request. Anyone want to do anything?
Attachment #93990 - Flags: superreview?(bienvenu) → superreview?(alecf)
Comment on attachment 93990 [details] [diff] [review]
patch for review

first thing I'll do is request a new patch. I'm sure this one is log since
stale.
It looks fine though, it ought to be a quick review on the new patch.
Attachment #93990 - Flags: superreview?(alecf) → superreview-
Product: MailNews → Core
Product: Core → MailNews Core
Alec, do you want to sign up as assignee?
Severity: trivial → minor
Status: ASSIGNED → NEW
Keywords: helpwanted
Whiteboard: [patchlove]
Assignee: Henry.Jia → nobody
QA Contact: stephend → networking.imap
Comment on attachment 93990 [details] [diff] [review]
patch for review

Patch has bitrotted.

$ patch -p0 --dry-run < ~/Desktop/tbTestPatches/bz137489.diff 
(Stripping trailing CRs from patch.)
patching file nsIImapServerSink.idl
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file nsIImapServerSink.idl.rej
(Stripping trailing CRs from patch.)
can't find file to patch at input line 25
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|Index: nsImapIncomingServer.cpp
|===================================================================
|RCS file: /cvsroot/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp,v
|retrieving revision 1.264
|diff -u -r1.264 nsImapIncomingServer.cpp
|--- nsImapIncomingServer.cpp   23 Jul 2002 02:27:19 -0000      1.264
|+++ nsImapIncomingServer.cpp   5 Aug 2002 07:51:23 -0000
--------------------------
File to patch:
Attachment #93990 - Attachment is obsolete: true
Blocks: 201332
Attached patch proposed fix (obsolete) — Splinter Review
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #379209 - Flags: superreview?(bienvenu)
Attachment #379209 - Flags: review?(bienvenu)
Attachment #379209 - Flags: superreview?(bienvenu)
Attachment #379209 - Flags: superreview+
Attachment #379209 - Flags: review?(bienvenu)
Attachment #379209 - Flags: review+
Comment on attachment 379209 [details] [diff] [review]
proposed fix

+      if (hierarchyDelimiter != kOnlineHierarchySeparatorUnknown &&
+          onlineSubDirDelimiter != hierarchyDelimiter)
+          m_runningUrl->SetOnlineSubDirSeparator(hierarchyDelimiter);

last line shouldn't be indented so much.

While you're doing this (thx!, btw), can you replace hierarchySeparator w/ hierarchyDelimiter - the IMAP RFC calls it a hierarchyDelimiter and we should be consistent.

r/sr=me with those nits addressed.
changeset:   2775:e14d90899db9
http://hg.mozilla.org/comm-central/rev/e14d90899db9
Attachment #379209 - Attachment is obsolete: true
->FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Keywords: helpwanted
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.0b3
Whiteboard: [patchlove]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: