Bug 1353634 - Fix the -Wmisleading-indentation warnings r=jorgk

This commit is contained in:
Sylvestre Ledru 2017-04-05 22:33:24 -07:00
Родитель 7993f692d0
Коммит e347d1489c
13 изменённых файлов: 205 добавлений и 205 удалений

Просмотреть файл

@ -1333,7 +1333,7 @@ NS_IMETHODIMP nsAddrDatabase::CreateNewListCardAndAddToDB(nsIAbDirectory *aList,
if (notify)
NotifyCardEntryChange(AB_NotifyInserted, newCard, aList);
return rv;
return rv;
}
NS_IMETHODIMP nsAddrDatabase::AddListCardColumnsToRow
@ -1570,29 +1570,29 @@ void nsAddrDatabase::DeleteCardFromAllMailLists(mdb_id cardRowID)
if (!m_mdbEnv)
return;
nsCOMPtr <nsIMdbTableRowCursor> rowCursor;
m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, getter_AddRefs(rowCursor));
nsCOMPtr <nsIMdbTableRowCursor> rowCursor;
m_mdbPabTable->GetTableRowCursor(m_mdbEnv, -1, getter_AddRefs(rowCursor));
if (rowCursor)
if (rowCursor)
{
nsCOMPtr <nsIMdbRow> pListRow;
mdb_pos rowPos;
do
{
nsCOMPtr <nsIMdbRow> pListRow;
mdb_pos rowPos;
do
nsresult err = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(pListRow), &rowPos);
if (NS_SUCCEEDED(err) && pListRow)
{
mdbOid rowOid;
if (NS_SUCCEEDED(pListRow->GetOid(m_mdbEnv, &rowOid)))
{
nsresult err = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(pListRow), &rowPos);
if (NS_SUCCEEDED(err) && pListRow)
{
mdbOid rowOid;
if (NS_SUCCEEDED(pListRow->GetOid(m_mdbEnv, &rowOid)))
{
if (IsListRowScopeToken(rowOid.mOid_Scope))
DeleteCardFromListRow(pListRow, cardRowID);
}
}
} while (pListRow);
}
if (IsListRowScopeToken(rowOid.mOid_Scope))
DeleteCardFromListRow(pListRow, cardRowID);
}
}
} while (pListRow);
}
}
NS_IMETHODIMP nsAddrDatabase::DeleteCard(nsIAbCard *aCard, bool aNotify, nsIAbDirectory *aParent)
@ -1868,40 +1868,40 @@ NS_IMETHODIMP nsAddrDatabase::PurgeDeletedCardTable()
if (!m_mdbEnv)
return NS_ERROR_NULL_POINTER;
if (m_mdbDeletedCardsTable) {
mdb_count cardCount=0;
// if not too many cards let it be
m_mdbDeletedCardsTable->GetCount(m_mdbEnv, &cardCount);
if(cardCount < PURGE_CUTOFF_COUNT)
return NS_OK;
uint32_t purgeTimeInSec;
PRTime2Seconds(PR_Now(), &purgeTimeInSec);
purgeTimeInSec -= (182*24*60*60); // six months in seconds
nsCOMPtr<nsIMdbTableRowCursor> rowCursor;
nsresult rv = m_mdbDeletedCardsTable->GetTableRowCursor(m_mdbEnv, -1, getter_AddRefs(rowCursor));
while(NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIMdbRow> currentRow;
mdb_pos rowPos;
rv = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(currentRow), &rowPos);
if(currentRow) {
uint32_t deletedTimeStamp = 0;
GetIntColumn(currentRow, m_LastModDateColumnToken, &deletedTimeStamp, 0);
// if record was deleted more than six months earlier, purge it
if(deletedTimeStamp && (deletedTimeStamp < purgeTimeInSec)) {
if(NS_SUCCEEDED(currentRow->CutAllColumns(m_mdbEnv)))
m_mdbDeletedCardsTable->CutRow(m_mdbEnv, currentRow);
}
else
// since the ordering in Mork is maintained and thus
// the cards added later appear on the top when retrieved
break;
}
else
break; // no more row
if (m_mdbDeletedCardsTable) {
mdb_count cardCount=0;
// if not too many cards let it be
m_mdbDeletedCardsTable->GetCount(m_mdbEnv, &cardCount);
if(cardCount < PURGE_CUTOFF_COUNT)
return NS_OK;
uint32_t purgeTimeInSec;
PRTime2Seconds(PR_Now(), &purgeTimeInSec);
purgeTimeInSec -= (182*24*60*60); // six months in seconds
nsCOMPtr<nsIMdbTableRowCursor> rowCursor;
nsresult rv = m_mdbDeletedCardsTable->GetTableRowCursor(m_mdbEnv, -1, getter_AddRefs(rowCursor));
while(NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIMdbRow> currentRow;
mdb_pos rowPos;
rv = rowCursor->NextRow(m_mdbEnv, getter_AddRefs(currentRow), &rowPos);
if(currentRow) {
uint32_t deletedTimeStamp = 0;
GetIntColumn(currentRow, m_LastModDateColumnToken, &deletedTimeStamp, 0);
// if record was deleted more than six months earlier, purge it
if(deletedTimeStamp && (deletedTimeStamp < purgeTimeInSec)) {
if(NS_SUCCEEDED(currentRow->CutAllColumns(m_mdbEnv)))
m_mdbDeletedCardsTable->CutRow(m_mdbEnv, currentRow);
}
else
// since the ordering in Mork is maintained and thus
// the cards added later appear on the top when retrieved
break;
}
else
break; // no more row
}
}
return NS_OK;
return NS_OK;
}
NS_IMETHODIMP nsAddrDatabase::EditCard(nsIAbCard *aCard, bool aNotify, nsIAbDirectory *aParent)
@ -2847,27 +2847,27 @@ nsresult nsAddrDatabase::CreateCardFromDeletedCardsTable(nsIMdbRow* cardRow, mdb
if (!cardRow || !m_mdbEnv || !result)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
nsresult rv = NS_OK;
mdbOid outOid;
mdb_id rowID = 0;
mdbOid outOid;
mdb_id rowID = 0;
if (NS_SUCCEEDED(cardRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
if (NS_SUCCEEDED(cardRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
if(NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIAbCard> personCard;
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
if(NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIAbCard> personCard;
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
InitCardFromRow(personCard, cardRow);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
InitCardFromRow(personCard, cardRow);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
NS_IF_ADDREF(*result = personCard);
}
NS_IF_ADDREF(*result = personCard);
}
return rv;
return rv;
}
nsresult nsAddrDatabase::CreateCard(nsIMdbRow* cardRow, mdb_id listRowID, nsIAbCard **result)
@ -2875,37 +2875,37 @@ nsresult nsAddrDatabase::CreateCard(nsIMdbRow* cardRow, mdb_id listRowID, nsIAbC
if (!cardRow || !m_mdbEnv || !result)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
nsresult rv = NS_OK;
mdbOid outOid;
mdb_id rowID = 0;
mdbOid outOid;
mdb_id rowID = 0;
if (NS_SUCCEEDED(cardRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
if (NS_SUCCEEDED(cardRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
if(NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIAbCard> personCard;
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
if(NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIAbCard> personCard;
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
InitCardFromRow(personCard, cardRow);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
InitCardFromRow(personCard, cardRow);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
nsAutoCString id;
id.AppendInt(rowID);
personCard->SetLocalId(id);
nsAutoCString id;
id.AppendInt(rowID);
personCard->SetLocalId(id);
nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
if (abDir)
abDir->GetUuid(id);
nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
if (abDir)
abDir->GetUuid(id);
personCard->SetDirectoryId(id);
personCard->SetDirectoryId(id);
NS_IF_ADDREF(*result = personCard);
}
NS_IF_ADDREF(*result = personCard);
}
return rv;
return rv;
}
nsresult nsAddrDatabase::CreateABCard(nsIMdbRow* cardRow, mdb_id listRowID, nsIAbCard **result)
@ -2919,53 +2919,53 @@ nsresult nsAddrDatabase::CreateABListCard(nsIMdbRow* listRow, nsIAbCard **result
if (!listRow || !m_mdbEnv || !result)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
nsresult rv = NS_OK;
mdbOid outOid;
mdb_id rowID = 0;
mdbOid outOid;
mdb_id rowID = 0;
if (NS_SUCCEEDED(listRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
if (NS_SUCCEEDED(listRow->GetOid(m_mdbEnv, &outOid)))
rowID = outOid.mOid_Id;
char* listURI = nullptr;
char* listURI = nullptr;
nsAutoString fileName;
rv = m_dbName->GetLeafName(fileName);
NS_ENSURE_SUCCESS(rv, rv);
listURI = PR_smprintf("%s%s/MailList%ld", kMDBDirectoryRoot, NS_ConvertUTF16toUTF8(fileName).get(), rowID);
nsAutoString fileName;
rv = m_dbName->GetLeafName(fileName);
NS_ENSURE_SUCCESS(rv, rv);
listURI = PR_smprintf("%s%s/MailList%ld", kMDBDirectoryRoot, NS_ConvertUTF16toUTF8(fileName).get(), rowID);
nsCOMPtr<nsIAbCard> personCard;
nsCOMPtr<nsIAbMDBDirectory> dbm_dbDirectory(do_QueryReferent(m_dbDirectory,
&rv));
if (NS_SUCCEEDED(rv) && dbm_dbDirectory)
nsCOMPtr<nsIAbCard> personCard;
nsCOMPtr<nsIAbMDBDirectory> dbm_dbDirectory(do_QueryReferent(m_dbDirectory,
&rv));
if (NS_SUCCEEDED(rv) && dbm_dbDirectory)
{
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
if (personCard)
{
personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
GetListCardFromDB(personCard, listRow);
if (personCard)
{
GetListCardFromDB(personCard, listRow);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
personCard->SetIsMailList(true);
personCard->SetMailListURI(listURI);
personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
personCard->SetIsMailList(true);
personCard->SetMailListURI(listURI);
nsAutoCString id;
id.AppendInt(rowID);
personCard->SetLocalId(id);
nsAutoCString id;
id.AppendInt(rowID);
personCard->SetLocalId(id);
nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
if (abDir)
abDir->GetUuid(id);
personCard->SetDirectoryId(id);
}
NS_IF_ADDREF(*result = personCard);
nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
if (abDir)
abDir->GetUuid(id);
personCard->SetDirectoryId(id);
}
if (listURI)
PR_smprintf_free(listURI);
return rv;
NS_IF_ADDREF(*result = personCard);
}
if (listURI)
PR_smprintf_free(listURI);
return rv;
}
/* create a sub directory for mailing list in the address book left pane */

Просмотреть файл

@ -432,12 +432,12 @@ VObject* addGroup(VObject *o, const char *g)
VObject* addPropValue(VObject *o, const char *p, const char *v)
{
VObject *prop;
prop = addProp(o,p);
VObject *prop;
prop = addProp(o,p);
if (v) {
setVObjectUStringZValue_(prop, fakeUnicode(v,0));
if (needsQuotedPrintable (v)) {
if (PL_strcasecmp (VCCardProp, vObjectName(o)) == 0)
if (PL_strcasecmp (VCCardProp, vObjectName(o)) == 0)
addProp (prop, VCQuotedPrintableProp);
else
addProp (o, VCQuotedPrintableProp);
@ -446,7 +446,7 @@ VObject* addPropValue(VObject *o, const char *p, const char *v)
else
setVObjectUStringZValue_(prop, fakeUnicode("",0));
return prop;
return prop;
}
VObject* addPropSizedValue_(VObject *o, const char *p, const char *v,

Просмотреть файл

@ -326,7 +326,7 @@ void nsMsgBodyHandler::StripHtml (nsCString &pBufInOut)
else
if (*pWalkInOut == '>')
inTag = false;
pWalkInOut++;
pWalkInOut++;
}
*pWalk = 0; // null terminator

Просмотреть файл

@ -415,20 +415,20 @@ NS_IMPL_ISUPPORTS(nsMsgSearchTerm, nsIMsgSearchTerm)
for (const char *strPtr = str; *strPtr; strPtr++)
if (*strPtr == '"')
numQuotes++;
int escapedStrLen = PL_strlen(str) + numQuotes;
char *escapedStr = (char *) PR_Malloc(escapedStrLen + 1);
if (escapedStr)
int escapedStrLen = PL_strlen(str) + numQuotes;
char *escapedStr = (char *) PR_Malloc(escapedStrLen + 1);
if (escapedStr)
{
char *destPtr;
for (destPtr = escapedStr; *str; str++)
{
char *destPtr;
for (destPtr = escapedStr; *str; str++)
{
if (*str == '"')
*destPtr++ = '\\';
*destPtr++ = *str;
}
*destPtr = '\0';
if (*str == '"')
*destPtr++ = '\\';
*destPtr++ = *str;
}
return escapedStr;
*destPtr = '\0';
}
return escapedStr;
}
@ -440,8 +440,8 @@ nsresult nsMsgSearchTerm::OutputValue(nsCString &outputStr)
// need to quote strings with ')' and strings starting with '"' or ' '
// filter code will escape quotes
if (PL_strchr(m_value.string, ')') ||
(m_value.string[0] == ' ') ||
(m_value.string[0] == '"'))
(m_value.string[0] == ' ') ||
(m_value.string[0] == '"'))
{
quoteVal = true;
outputStr += "\"";
@ -467,7 +467,7 @@ nsresult nsMsgSearchTerm::OutputValue(nsCString &outputStr)
{
switch (m_attribute)
{
case nsMsgSearchAttrib::Date:
case nsMsgSearchAttrib::Date:
{
PRExplodedTime exploded;
PR_ExplodeTime(m_value.u.date, PR_LocalTimeParameters, &exploded);

Просмотреть файл

@ -1260,21 +1260,21 @@ NS_MSG_BASE nsresult NS_GetUnicharPreferenceWithDefault(nsIPrefBranch *prefBranc
const nsAString& defValue,
nsAString& prefValue)
{
NS_ENSURE_ARG(prefName);
NS_ENSURE_ARG(prefName);
nsCOMPtr<nsIPrefBranch> pbr;
if(!prefBranch) {
pbr = do_GetService(NS_PREFSERVICE_CONTRACTID);
prefBranch = pbr;
}
nsCOMPtr<nsIPrefBranch> pbr;
if(!prefBranch) {
pbr = do_GetService(NS_PREFSERVICE_CONTRACTID);
prefBranch = pbr;
}
nsCOMPtr<nsISupportsString> str;
nsresult rv = prefBranch->GetComplexValue(prefName, NS_GET_IID(nsISupportsString), getter_AddRefs(str));
if (NS_SUCCEEDED(rv))
nsresult rv = prefBranch->GetComplexValue(prefName, NS_GET_IID(nsISupportsString), getter_AddRefs(str));
if (NS_SUCCEEDED(rv))
str->GetData(prefValue);
else
prefValue = defValue;
return NS_OK;
return NS_OK;
}
NS_MSG_BASE nsresult NS_GetLocalizedUnicharPreferenceWithDefault(nsIPrefBranch *prefBranch, //can be null, if so uses the root branch

Просмотреть файл

@ -372,9 +372,9 @@ divide_content_headers(const char *headers,
out = &content_tail;
else
out = &message_tail;
memcpy(*out, head, (tail-head));
*out += (tail-head);
memcpy(*out, head, (tail-head));
*out += (tail-head);
}
*message_tail = 0;

Просмотреть файл

@ -42,20 +42,20 @@ void nsIMAPNamespace::SetDelimiter(char delimiter, bool delimiterFilledIn)
// or the length of the prefix if it is part of this namespace
int nsIMAPNamespace::MailboxMatchesNamespace(const char *boxname)
{
if (!boxname) return -1;
if (!boxname) return -1;
// If the namespace is part of the boxname
// If the namespace is part of the boxname
if (!m_prefix || !*m_prefix)
return 0;
if (PL_strstr(boxname, m_prefix) == boxname)
return PL_strlen(m_prefix);
if (PL_strstr(boxname, m_prefix) == boxname)
return PL_strlen(m_prefix);
// If the boxname is part of the prefix
// (Used for matching Personal mailbox with Personal/ namespace, etc.)
if (PL_strstr(m_prefix, boxname) == m_prefix)
return PL_strlen(boxname);
return -1;
// If the boxname is part of the prefix
// (Used for matching Personal mailbox with Personal/ namespace, etc.)
if (PL_strstr(m_prefix, boxname) == m_prefix)
return PL_strlen(boxname);
return -1;
}

Просмотреть файл

@ -659,7 +659,7 @@ void nsImapServerResponseParser::response_data()
case 'E':
if (!PL_strcasecmp(fNextToken, "ENABLED"))
enable_data();
break;
break;
case 'X':
if (!PL_strcasecmp(fNextToken, "XSERVERINFO"))
xserverinfo_data();
@ -1780,8 +1780,8 @@ void nsImapServerResponseParser::flags()
while(*fNextToken != ')')
fNextToken++;
fCurrentLineContainedFlagInfo = true; // handled in PostProcessEndOfLine
fSavedFlagInfo = messageFlags;
fCurrentLineContainedFlagInfo = true; // handled in PostProcessEndOfLine
fSavedFlagInfo = messageFlags;
}
// RFC3501: resp-cond-state = ("OK" / "NO" / "BAD") SP resp-text

Просмотреть файл

@ -574,21 +574,21 @@ mime_intl_insert_message_header_1(char **body,
else
NS_MsgSACat(body, ": ");
// MIME decode header
nsAutoCString utf8Value;
MIME_DecodeMimeHeader(hdr_value, mailcharset, false, true, utf8Value);
if (!utf8Value.IsEmpty()) {
// MIME decode header
nsAutoCString utf8Value;
MIME_DecodeMimeHeader(hdr_value, mailcharset, false, true, utf8Value);
if (!utf8Value.IsEmpty()) {
char *escaped = nullptr;
if (htmlEdit)
escaped = MsgEscapeHTML(utf8Value.get());
escaped = MsgEscapeHTML(utf8Value.get());
NS_MsgSACat(body, escaped ? escaped : utf8Value.get());
NS_Free(escaped);
} else {
NS_MsgSACat(body, hdr_value); // raw MIME encoded string
}
} else {
NS_MsgSACat(body, hdr_value); // raw MIME encoded string
}
if (htmlEdit)
NS_MsgSACat(body, HEADER_END_JUNK);
NS_MsgSACat(body, HEADER_END_JUNK);
}
char *

Просмотреть файл

@ -83,17 +83,17 @@ MimeInlineImage_parse_begin (MimeObject *obj)
part = mime_part_address(obj);
if (!part) return MIME_OUT_OF_MEMORY;
char *no_part_url = nullptr;
if (obj->options->part_to_load && obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay)
no_part_url = mime_get_base_url(obj->options->url);
char *no_part_url = nullptr;
if (obj->options->part_to_load && obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay)
no_part_url = mime_get_base_url(obj->options->url);
if (no_part_url)
{
image_url = mime_set_url_part(no_part_url, part, true);
PR_Free(no_part_url);
}
else
image_url = mime_set_url_part(obj->options->url, part, true);
if (no_part_url)
{
image_url = mime_set_url_part(no_part_url, part, true);
PR_Free(no_part_url);
}
else
image_url = mime_set_url_part(obj->options->url, part, true);
if (!image_url)
{

Просмотреть файл

@ -512,8 +512,8 @@ MimeMultipartRelated_output_child_p(MimeObject *obj, MimeObject* child)
(This happens primarily on Windows and Unix.) */
if (PL_strchr(part, ' ') || PL_strchr(part, '>') || PL_strchr(part, '%'))
temp = escape_for_mrel_subst(part);
MimeHashValue * value = new MimeHashValue(child, temp);
PL_HashTableAdd(relobj->hash, absolute, value);
MimeHashValue * value = new MimeHashValue(child, temp);
PL_HashTableAdd(relobj->hash, absolute, value);
/* rhp - If this part ALSO has a Content-ID we need to put that into
the hash table and this is what this code does

Просмотреть файл

@ -110,16 +110,16 @@ MimeInlineTextHTML_parse_begin (MimeObject *obj)
if (!IS_SPACE(*in) && *in != '"')
*out++ = *in;
/* Close the tag and argument. */
*out++ = '"';
*out++ = '>';
*out++ = 0;
/* Close the tag and argument. */
*out++ = '"';
*out++ = '>';
*out++ = 0;
PR_Free(base_hdr);
PR_Free(base_hdr);
status = MimeObject_write(obj, buf, strlen(buf), false);
PR_Free(buf);
if (status < 0) return status;
status = MimeObject_write(obj, buf, strlen(buf), false);
PR_Free(buf);
if (status < 0) return status;
}
}

Просмотреть файл

@ -981,15 +981,15 @@ nsMsgNewsFolder::HandleNewsrcLine(const char * line, uint32_t line_size)
if ((*s == ':') || (*s == '!'))
break;
if (*s == 0)
/* What is this?? Well, don't just throw it away... */
return RememberLine(nsDependentCString(line));
if (*s == 0)
/* What is this?? Well, don't just throw it away... */
return RememberLine(nsDependentCString(line));
bool subscribed = (*s == ':');
setStr = s+1;
bool subscribed = (*s == ':');
setStr = s+1;
if (*line == '\0')
return 0;
if (*line == '\0')
return 0;
// previous versions of Communicator poluted the
// newsrc files with articles