Fix the build following the 64-bit time_t switch.

This commit is contained in:
Augustin Cavalier 2017-06-05 21:29:11 -04:00
parent 39efd913c1
commit 9f6dbb5ff0
3 changed files with 15 additions and 8 deletions

View File

@ -357,7 +357,7 @@ PowerStatusView::_SetLabel(char* buffer, size_t bufferLength)
snprintf(buffer, bufferLength, "%s%" B_PRId32 "%%%s", open, fPercent,
close);
} else if (fShowTime && fTimeLeft >= 0) {
snprintf(buffer, bufferLength, "%s%" B_PRId32 ":%02" B_PRId32 "%s",
snprintf(buffer, bufferLength, "%s%" B_PRIdTIME ":%02" B_PRIdTIME "%s",
open, fTimeLeft / 3600, (fTimeLeft / 60) % 60, close);
}
}
@ -417,7 +417,7 @@ PowerStatusView::Update(bool force)
"%%%s", open, fPercent, close);
if (fTimeLeft >= 0) {
length += snprintf(text + length, sizeof(text) - length,
"\n%" B_PRId32 ":%02" B_PRId32, fTimeLeft / 3600,
"\n%" B_PRIdTIME ":%02" B_PRIdTIME, fTimeLeft / 3600,
(fTimeLeft / 60) % 60);
}

View File

@ -753,7 +753,7 @@ BEmailMessage::RenderToRFC822(BPositionIO* file)
}
// add the date field
int32 creationTime = time(NULL);
time_t creationTime = time(NULL);
{
char date[128];
struct tm tm;

View File

@ -984,7 +984,7 @@ EmbedUniqueVolumeInfo(BMessage* message, const BVolume* volume)
if (volume->GetRootDirectory(&rootDirectory) == B_OK
&& rootDirectory.GetCreationTime(&created) == B_OK
&& fs_stat_dev(volume->Device(), &info) == 0) {
message->AddInt32("creationDate", created);
message->AddInt64("creationDate", created);
message->AddInt64("capacity", volume->Capacity());
message->AddString("deviceName", info.device_name);
message->AddString("volumeName", info.volume_name);
@ -996,14 +996,21 @@ EmbedUniqueVolumeInfo(BMessage* message, const BVolume* volume)
status_t
MatchArchivedVolume(BVolume* volume, const BMessage* message, int32 index)
{
time_t created;
int64 created64;
off_t capacity;
if (message->FindInt32("creationDate", index, &created) != B_OK
|| message->FindInt64("capacity", index, &capacity) != B_OK) {
return B_ERROR;
if (message->FindInt64("creationDate", index, &created64) != B_OK) {
int32 created32;
if (message->FindInt32("creationDate", index, &created32) != B_OK)
return B_ERROR;
created64 = created32;
}
time_t created = created64;
if (message->FindInt64("capacity", index, &capacity) != B_OK)
return B_ERROR;
BVolumeRoster roster;
BVolume tempVolume;
BString deviceName;