Closed
Bug 428597
Opened 17 years ago
Closed 13 years ago
Some MIME functions in mimedrft.cpp return error values not in range with their return types.
Categories
(MailNews Core :: MIME, defect)
MailNews Core
MIME
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: bugmil.ebirol, Unassigned)
Details
I am getting the following compiler warnings while building Thunderbird:
/mozilla/mailnews/mime/src/mimedrft.cpp: In function ‘nsresult mime_decompose_file_init_fn(void*, MimeHeaders*)’:
/mozilla/mailnews/mime/src/mimedrft.cpp:1729: warning: converting negative value ‘-0x00000000000000001’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1768: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1785: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1794: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1900: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1908: warning: converting negative value ‘-0x000000000000003e9’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1929: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1945: warning: converting negative value ‘-0x000000000000003e8’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp: In function ‘nsresult mime_decompose_file_output_fn(const char*, PRInt32, v
/mozilla/mailnews/mime/src/mimedrft.cpp:1961: warning: converting negative value ‘-0x00000000000000001’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1969: warning: converting negative value ‘-0x00000000000000001’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp:1975: warning: comparison between signed and unsigned integer expressions
/mozilla/mailnews/mime/src/mimedrft.cpp:1976: warning: converting negative value ‘-0x000000000000003ea’ to ‘nsresult’
/mozilla/mailnews/mime/src/mimedrft.cpp: In function ‘nsresult mime_decompose_file_close_fn(void*)’:
/mozilla/mailnews/mime/src/mimedrft.cpp:1988: warning: converting negative value ‘-0x00000000000000001’ to ‘nsresult’
nsresult is unsigned int but the functions shown above return negative values instead of returning something nsresult compatible such as NS_ERROR_FAILURE.
I am going to wait couple days to get feedback before submit a patch. If you think that we should return something other than NS_ERROR_FAILURE, please comment here.
Flags: wanted1.9.0.x?
Comment 1•17 years ago
|
||
Wouldn't it be best to use the corresponding NS_ values? E.g. for NS_ERROR_OUT_OF_MEMORY when MIME_OUT_OF_MEMORY and so on. For those with no suitable equivalent, NS_ERROR_FAILURE is probably fine.
Assignee: ebirol → nobody
Component: Security: S/MIME → MailNews: MIME
Hardware: PC → All
Assignee | ||
Updated•17 years ago
|
Product: Core → MailNews Core
Comment 3•17 years ago
|
||
Emre, I'm guessing this doesn't need to get fixed on 1.9 since Thunderbird moved development to 1.9.1. If that's true, can you removed the wanted1.9.0.x request?
Comment 4•17 years ago
|
||
That's correct, and since mimedrft.cpp is in mailnews/ this doesn't need any core flags. Emre, renominate to one of the thunderbird ones if you think it's important enough.
Flags: wanted1.9.0.x?
Is this still valid? Also, very similar to bug 182265.
Emre, are you working on this?
The functions in mimedrft.cpp are declared 'int' today instead of nsresult. So the negative return values seem OK.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•