bin/mail_utils/spamdbm: Fix -Wformat=
Change-Id: I912a7eac48e6e0343a59821fb1026ef54e6b0d75 Reviewed-on: https://review.haiku-os.org/c/1521 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
7d633b87d8
commit
fe6e591432
@@ -2614,7 +2614,8 @@ status_t ABSApp::AddPositionIOToDatabase (
|
|||||||
NewAge = m_TotalGenuineMessages + m_TotalSpamMessages;
|
NewAge = m_TotalGenuineMessages + m_TotalSpamMessages;
|
||||||
if (NewAge >= 0xFFFFFFF0UL)
|
if (NewAge >= 0xFFFFFFF0UL)
|
||||||
{
|
{
|
||||||
sprintf (ErrorMessage, "The database is full! There are %lu messages in "
|
sprintf (ErrorMessage,
|
||||||
|
"The database is full! There are %" B_PRIu32 " messages in "
|
||||||
"it and we can't add any more without overflowing the maximum integer "
|
"it and we can't add any more without overflowing the maximum integer "
|
||||||
"representation in 32 bits", NewAge);
|
"representation in 32 bits", NewAge);
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -3709,7 +3710,8 @@ status_t ABSApp::LoadSaveDatabase (bool DoLoad, char *ErrorMessage)
|
|||||||
else /* Saving */
|
else /* Saving */
|
||||||
{
|
{
|
||||||
fprintf (DatabaseFile,
|
fprintf (DatabaseFile,
|
||||||
"Classifications and total messages:\t%s\t%lu\t%s\t%lu\n",
|
"Classifications and total messages:\t%s\t%" B_PRIu32
|
||||||
|
"\t%s\t%" B_PRIu32 "\n",
|
||||||
g_ClassifiedGenuine, m_TotalGenuineMessages,
|
g_ClassifiedGenuine, m_TotalGenuineMessages,
|
||||||
g_ClassifiedSpam, m_TotalSpamMessages);
|
g_ClassifiedSpam, m_TotalSpamMessages);
|
||||||
}
|
}
|
||||||
@@ -3800,7 +3802,8 @@ status_t ABSApp::LoadSaveDatabase (bool DoLoad, char *ErrorMessage)
|
|||||||
EndIter = m_WordMap.end ();
|
EndIter = m_WordMap.end ();
|
||||||
for (DataIter = m_WordMap.begin (); DataIter != EndIter; DataIter++)
|
for (DataIter = m_WordMap.begin (); DataIter != EndIter; DataIter++)
|
||||||
{
|
{
|
||||||
if (fprintf (DatabaseFile, "%s\t%lu\t%lu\t%lu\n",
|
if (fprintf (DatabaseFile,
|
||||||
|
"%s\t%" B_PRIu32 "\t%" B_PRIu32 "\t%" B_PRIu32 "\n",
|
||||||
DataIter->first.c_str (), DataIter->second.age,
|
DataIter->first.c_str (), DataIter->second.age,
|
||||||
DataIter->second.genuineCount, DataIter->second.spamCount) <= 0)
|
DataIter->second.genuineCount, DataIter->second.spamCount) <= 0)
|
||||||
{
|
{
|
||||||
@@ -4241,7 +4244,7 @@ ABSApp::ProcessScriptingMessage (
|
|||||||
CommandText.Append (ArgumentBool ? " true" : " false");
|
CommandText.Append (ArgumentBool ? " true" : " false");
|
||||||
if (ArgumentGotInt32)
|
if (ArgumentGotInt32)
|
||||||
{
|
{
|
||||||
sprintf (TempString, " %ld", ArgumentInt32);
|
sprintf (TempString, " %" B_PRId32, ArgumentInt32);
|
||||||
CommandText.Append (TempString);
|
CommandText.Append (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4761,7 +4764,7 @@ ABSApp::PurgeOldWords (char *ErrorMessage)
|
|||||||
/* Just a little bug check here. Just in case. */
|
/* Just a little bug check here. Just in case. */
|
||||||
|
|
||||||
if (m_WordCount != m_WordMap.size ()) {
|
if (m_WordCount != m_WordMap.size ()) {
|
||||||
sprintf (TempString, "Our word count of %lu doesn't match the "
|
sprintf (TempString, "Our word count of %" B_PRIu32 " doesn't match the "
|
||||||
"size of the database, %lu", m_WordCount, m_WordMap.size());
|
"size of the database, %lu", m_WordCount, m_WordMap.size());
|
||||||
DisplayErrorMessage (TempString, -1, "Bug!");
|
DisplayErrorMessage (TempString, -1, "Bug!");
|
||||||
m_WordCount = m_WordMap.size ();
|
m_WordCount = m_WordMap.size ();
|
||||||
@@ -6947,7 +6950,7 @@ ControlsView::PollServerForChanges ()
|
|||||||
m_PurgeAgeTextboxPntr != NULL)
|
m_PurgeAgeTextboxPntr != NULL)
|
||||||
{
|
{
|
||||||
m_PurgeAgeCachedValue = MyAppPntr->m_PurgeAge;
|
m_PurgeAgeCachedValue = MyAppPntr->m_PurgeAge;
|
||||||
sprintf (TempString, "%lu", m_PurgeAgeCachedValue);
|
sprintf (TempString, "%" B_PRIu32, m_PurgeAgeCachedValue);
|
||||||
m_PurgeAgeTextboxPntr->SetText (TempString);
|
m_PurgeAgeTextboxPntr->SetText (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6957,7 +6960,7 @@ ControlsView::PollServerForChanges ()
|
|||||||
m_PurgePopularityTextboxPntr != NULL)
|
m_PurgePopularityTextboxPntr != NULL)
|
||||||
{
|
{
|
||||||
m_PurgePopularityCachedValue = MyAppPntr->m_PurgePopularity;
|
m_PurgePopularityCachedValue = MyAppPntr->m_PurgePopularity;
|
||||||
sprintf (TempString, "%lu", m_PurgePopularityCachedValue);
|
sprintf (TempString, "%" B_PRIu32, m_PurgePopularityCachedValue);
|
||||||
m_PurgePopularityTextboxPntr->SetText (TempString);
|
m_PurgePopularityTextboxPntr->SetText (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6979,7 +6982,7 @@ ControlsView::PollServerForChanges ()
|
|||||||
m_GenuineCountTextboxPntr != NULL)
|
m_GenuineCountTextboxPntr != NULL)
|
||||||
{
|
{
|
||||||
m_GenuineCountCachedValue = MyAppPntr->m_TotalGenuineMessages;
|
m_GenuineCountCachedValue = MyAppPntr->m_TotalGenuineMessages;
|
||||||
sprintf (TempString, "%lu", m_GenuineCountCachedValue);
|
sprintf (TempString, "%" B_PRIu32, m_GenuineCountCachedValue);
|
||||||
m_GenuineCountTextboxPntr->SetText (TempString);
|
m_GenuineCountTextboxPntr->SetText (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6989,7 +6992,7 @@ ControlsView::PollServerForChanges ()
|
|||||||
m_SpamCountTextboxPntr != NULL)
|
m_SpamCountTextboxPntr != NULL)
|
||||||
{
|
{
|
||||||
m_SpamCountCachedValue = MyAppPntr->m_TotalSpamMessages;
|
m_SpamCountCachedValue = MyAppPntr->m_TotalSpamMessages;
|
||||||
sprintf (TempString, "%lu", m_SpamCountCachedValue);
|
sprintf (TempString, "%" B_PRIu32, m_SpamCountCachedValue);
|
||||||
m_SpamCountTextboxPntr->SetText (TempString);
|
m_SpamCountTextboxPntr->SetText (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6999,7 +7002,7 @@ ControlsView::PollServerForChanges ()
|
|||||||
m_WordCountTextboxPntr != NULL)
|
m_WordCountTextboxPntr != NULL)
|
||||||
{
|
{
|
||||||
m_WordCountCachedValue = MyAppPntr->m_WordCount;
|
m_WordCountCachedValue = MyAppPntr->m_WordCount;
|
||||||
sprintf (TempString, "%lu", m_WordCountCachedValue);
|
sprintf (TempString, "%" B_PRIu32, m_WordCountCachedValue);
|
||||||
m_WordCountTextboxPntr->SetText (TempString);
|
m_WordCountTextboxPntr->SetText (TempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7488,7 +7491,7 @@ WordsView::Draw (BRect UpdateRect)
|
|||||||
SetHighColor (0, 0, 0);
|
SetHighColor (0, 0, 0);
|
||||||
SetDrawingMode (B_OP_OVER); /* So that antialiased text mixes better. */
|
SetDrawingMode (B_OP_OVER); /* So that antialiased text mixes better. */
|
||||||
|
|
||||||
sprintf (TempString, "%lu", StatisticsPntr->genuineCount);
|
sprintf (TempString, "%" B_PRIu32, StatisticsPntr->genuineCount);
|
||||||
Width = m_TextFont.StringWidth (TempString);
|
Width = m_TextFont.StringWidth (TempString);
|
||||||
MovePenTo (ceilf (ColumnLeftCenterX - Width / 2), Y + m_AscentHeight);
|
MovePenTo (ceilf (ColumnLeftCenterX - Width / 2), Y + m_AscentHeight);
|
||||||
DrawString (TempString);
|
DrawString (TempString);
|
||||||
@@ -7498,7 +7501,7 @@ WordsView::Draw (BRect UpdateRect)
|
|||||||
MovePenTo (ceilf (ColumnMiddleCenterX - Width / 2), Y + m_AscentHeight);
|
MovePenTo (ceilf (ColumnMiddleCenterX - Width / 2), Y + m_AscentHeight);
|
||||||
DrawString (TempString);
|
DrawString (TempString);
|
||||||
|
|
||||||
sprintf (TempString, "%lu", StatisticsPntr->spamCount);
|
sprintf (TempString, "%" B_PRIu32, StatisticsPntr->spamCount);
|
||||||
Width = m_TextFont.StringWidth (TempString);
|
Width = m_TextFont.StringWidth (TempString);
|
||||||
MovePenTo (ceilf (ColumnRightCenterX - Width / 2), Y + m_AscentHeight);
|
MovePenTo (ceilf (ColumnRightCenterX - Width / 2), Y + m_AscentHeight);
|
||||||
DrawString (TempString);
|
DrawString (TempString);
|
||||||
|
|||||||
Reference in New Issue
Block a user