refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
  lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Alexander von Gluck IV
2023-07-17 11:26:21 +00:00
committed by Adrien Destugues
parent d110ee8cc1
commit 425ac1b60a
137 changed files with 468 additions and 468 deletions
@@ -79,7 +79,7 @@ random_open(void *deviceCookie, const char *name, int flags, void **cookie)
static status_t static status_t
random_read(void *cookie, off_t position, void *_buffer, size_t *_numBytes) random_read(void *cookie, off_t position, void *_buffer, size_t *_numBytes)
{ {
TRACE("read(%Ld,, %ld)\n", position, *_numBytes); TRACE("read(%lld,, %ld)\n", position, *_numBytes);
MutexLocker locker(&sRandomLock); MutexLocker locker(&sRandomLock);
return RANDOM_READ(sRandomCookie, _buffer, _numBytes); return RANDOM_READ(sRandomCookie, _buffer, _numBytes);
@@ -89,7 +89,7 @@ random_read(void *cookie, off_t position, void *_buffer, size_t *_numBytes)
static status_t static status_t
random_write(void *cookie, off_t position, const void *buffer, size_t *_numBytes) random_write(void *cookie, off_t position, const void *buffer, size_t *_numBytes)
{ {
TRACE("write(%Ld,, %ld)\n", position, *_numBytes); TRACE("write(%lld,, %ld)\n", position, *_numBytes);
MutexLocker locker(&sRandomLock); MutexLocker locker(&sRandomLock);
return RANDOM_WRITE(sRandomCookie, buffer, _numBytes); return RANDOM_WRITE(sRandomCookie, buffer, _numBytes);
} }
@@ -181,11 +181,11 @@ void scsi_add_queued_request( scsi_ccb *request )
/* { /* {
scsi_ccb *tmp = device->queued_reqs; scsi_ccb *tmp = device->queued_reqs;
dprintf( "pos=%Ld, to_insert=%Ld; ", device->last_sort, dprintf( "pos=%lld, to_insert=%lld; ", device->last_sort,
request->sort ); request->sort );
do { do {
dprintf( "%Ld, %s", tmp->sort, tmp->next == device->queued_reqs ? "\n" : "" ); dprintf( "%lld, %s", tmp->sort, tmp->next == device->queued_reqs ? "\n" : "" );
tmp = tmp->next; tmp = tmp->next;
} while( tmp != device->queued_reqs ); } while( tmp != device->queued_reqs );
}*/ }*/
@@ -541,7 +541,7 @@ init_driver(void)
put_module(B_PCI_MODULE_NAME); put_module(B_PCI_MODULE_NAME);
return B_ERROR; return B_ERROR;
} }
LOG(("reset finished after %Ld, ICH_REG_GLOB_CNT = 0x%08x\n", system_time() - start, val)); LOG(("reset finished after %lld, ICH_REG_GLOB_CNT = 0x%08x\n", system_time() - start, val));
/* detect which codecs are ready */ /* detect which codecs are ready */
s0cr = s1cr = s2cr = false; s0cr = s1cr = s2cr = false;
@@ -550,15 +550,15 @@ init_driver(void)
val = ich_reg_read_32(ICH_REG_GLOB_STA); val = ich_reg_read_32(ICH_REG_GLOB_STA);
if (!s0cr && (val & STA_S0CR)) { if (!s0cr && (val & STA_S0CR)) {
s0cr = true; s0cr = true;
LOG(("AC_SDIN0 codec ready after %Ld us\n",(system_time() - start))); LOG(("AC_SDIN0 codec ready after %lld us\n",(system_time() - start)));
} }
if (!s1cr && (val & STA_S1CR)) { if (!s1cr && (val & STA_S1CR)) {
s1cr = true; s1cr = true;
LOG(("AC_SDIN1 codec ready after %Ld us\n",(system_time() - start))); LOG(("AC_SDIN1 codec ready after %lld us\n",(system_time() - start)));
} }
if (!s2cr && (val & STA_S2CR)) { if (!s2cr && (val & STA_S2CR)) {
s2cr = true; s2cr = true;
LOG(("AC_SDIN2 codec ready after %Ld us\n",(system_time() - start))); LOG(("AC_SDIN2 codec ready after %lld us\n",(system_time() - start)));
} }
snooze(50000); snooze(50000);
} while ((system_time() - start) < 1000000); } while ((system_time() - start) < 1000000);
@@ -769,9 +769,9 @@ uninit_driver(void)
LOG(("uninit_driver()\n")); LOG(("uninit_driver()\n"));
#if DEBUG #if DEBUG
if (chan_po) LOG(("chan_po frames_count = %Ld\n",chan_po->played_frames_count)); if (chan_po) LOG(("chan_po frames_count = %lld\n",chan_po->played_frames_count));
if (chan_pi) LOG(("chan_pi frames_count = %Ld\n",chan_pi->played_frames_count)); if (chan_pi) LOG(("chan_pi frames_count = %lld\n",chan_pi->played_frames_count));
if (chan_mc) LOG(("chan_mc frames_count = %Ld\n",chan_mc->played_frames_count)); if (chan_mc) LOG(("chan_mc frames_count = %lld\n",chan_mc->played_frames_count));
#endif #endif
/* reset all channels */ /* reset all channels */
@@ -174,7 +174,7 @@ ichaudio_attach(audio_drv_t *drv, void **_cookie)
LOG(("reset failed, ICH_REG_GLOB_CNT = 0x%08lx\n", value)); LOG(("reset failed, ICH_REG_GLOB_CNT = 0x%08lx\n", value));
goto err; goto err;
} }
LOG(("reset finished after %Ld, ICH_REG_GLOB_CNT = 0x%08lx\n", system_time() - start, value)); LOG(("reset finished after %lld, ICH_REG_GLOB_CNT = 0x%08lx\n", system_time() - start, value));
/* detect which codecs are ready */ /* detect which codecs are ready */
s0cr = s1cr = s2cr = false; s0cr = s1cr = s2cr = false;
@@ -183,15 +183,15 @@ ichaudio_attach(audio_drv_t *drv, void **_cookie)
value = ich_reg_read_32(cookie, ICH_REG_GLOB_STA); value = ich_reg_read_32(cookie, ICH_REG_GLOB_STA);
if (!s0cr && (value & STA_S0CR)) { if (!s0cr && (value & STA_S0CR)) {
s0cr = true; s0cr = true;
LOG(("AC_SDIN0 codec ready after %Ld us\n", system_time() - start)); LOG(("AC_SDIN0 codec ready after %lld us\n", system_time() - start));
} }
if (!s1cr && (value & STA_S1CR)) { if (!s1cr && (value & STA_S1CR)) {
s1cr = true; s1cr = true;
LOG(("AC_SDIN1 codec ready after %Ld us\n", system_time() - start)); LOG(("AC_SDIN1 codec ready after %lld us\n", system_time() - start));
} }
if (!s2cr && (value & STA_S2CR)) { if (!s2cr && (value & STA_S2CR)) {
s2cr = true; s2cr = true;
LOG(("AC_SDIN2 codec ready after %Ld us\n", system_time() - start)); LOG(("AC_SDIN2 codec ready after %lld us\n", system_time() - start));
} }
snooze(50000); snooze(50000);
} while ((system_time() - start) < 1000000); } while ((system_time() - start) < 1000000);
@@ -1488,10 +1488,10 @@ pcm_write(
{ {
bigtime_t delta = system_time() - the_time; bigtime_t delta = system_time() - the_time;
if (delta < 1) { if (delta < 1) {
ddprintf(("cmedia_pci: delta %Ld (low!) #%ld\n", delta, put_cnt)); ddprintf(("cmedia_pci: delta %lld (low!) #%ld\n", delta, put_cnt));
} }
else if (delta > 2000) { else if (delta > 2000) {
ddprintf(("cmedia_pci: delta %Ld (high!) #%ld\n", delta, put_cnt)); ddprintf(("cmedia_pci: delta %lld (high!) #%ld\n", delta, put_cnt));
} }
} }
if (put_cnt != int_cnt) { if (put_cnt != int_cnt) {
@@ -143,7 +143,7 @@ static status_t
nor_read(void *_cookie, off_t position, void *data, size_t *numbytes) nor_read(void *_cookie, off_t position, void *data, size_t *numbytes)
{ {
nor_driver_info *info = (nor_driver_info*)_cookie; nor_driver_info *info = (nor_driver_info*)_cookie;
TRACE("read(%Ld,%lu)\n", position, *numbytes); TRACE("read(%lld,%lu)\n", position, *numbytes);
position += HIDDEN_BLOCKS * info->blocksize; position += HIDDEN_BLOCKS * info->blocksize;
@@ -159,7 +159,7 @@ nor_read(void *_cookie, off_t position, void *data, size_t *numbytes)
static status_t static status_t
nor_write(void *_cookie, off_t position, const void *data, size_t *numbytes) nor_write(void *_cookie, off_t position, const void *data, size_t *numbytes)
{ {
TRACE("write(%Ld,%lu)\n", position, *numbytes); TRACE("write(%lld,%lu)\n", position, *numbytes);
*numbytes = 0; *numbytes = 0;
return B_ERROR; return B_ERROR;
} }
@@ -896,7 +896,7 @@ cd_ioctl(void* cookie, uint32 op, void* buffer, size_t length)
static void static void
cd_set_capacity(cd_driver_info* info, uint64 capacity, uint32 blockSize, uint32 physicalBlockSize) cd_set_capacity(cd_driver_info* info, uint64 capacity, uint32 blockSize, uint32 physicalBlockSize)
{ {
TRACE("cd_set_capacity(info = %p, capacity = %Ld, blockSize = %ld)\n", TRACE("cd_set_capacity(info = %p, capacity = %lld, blockSize = %ld)\n",
info, capacity, blockSize); info, capacity, blockSize);
if (info->block_size != blockSize) { if (info->block_size != blockSize) {
@@ -211,7 +211,7 @@ cx23882_mpegts_int(cx23882_device *device)
if (mstat & TS_INT_STAT_TS_RISC1) { if (mstat & TS_INT_STAT_TS_RISC1) {
int32 count; int32 count;
// dprintf("cx23882_mpegts_int buffer 1 at %Ld\n", system_time()); // dprintf("cx23882_mpegts_int buffer 1 at %lld\n", system_time());
device->capture_data = device->dma_buf1_virt; device->capture_data = device->dma_buf1_virt;
device->capture_end_time = system_time(); device->capture_end_time = system_time();
get_sem_count(device->capture_sem, &count); get_sem_count(device->capture_sem, &count);
@@ -221,7 +221,7 @@ cx23882_mpegts_int(cx23882_device *device)
if (mstat & TS_INT_STAT_TS_RISC2) { if (mstat & TS_INT_STAT_TS_RISC2) {
int32 count; int32 count;
// dprintf("cx23882_mpegts_int buffer 2 at %Ld\n", system_time()); // dprintf("cx23882_mpegts_int buffer 2 at %lld\n", system_time());
device->capture_data = device->dma_buf2_virt; device->capture_data = device->dma_buf2_virt;
device->capture_end_time = system_time(); device->capture_end_time = system_time();
get_sem_count(device->capture_sem, &count); get_sem_count(device->capture_sem, &count);
@@ -532,7 +532,7 @@ device_read(void* cookie, off_t pos, void* buf, size_t* count)
ret = device->notify_lock; ret = device->notify_lock;
DPRINTF_INFO((ID "device_read(%p,%Ld,0x%x,%d) name = \"%s%d\"\n", DPRINTF_INFO((ID "device_read(%p,%lld,0x%x,%d) name = \"%s%d\"\n",
cookie, pos, buf, *count, kBasePublishPath, device->number)); cookie, pos, buf, *count, kBasePublishPath, device->number));
if (ret >= B_OK) { if (ret >= B_OK) {
@@ -352,7 +352,7 @@ tun_deselect(cookie_t *cookie, uint8 event, selectsync *sync)
status_t status_t
tun_readv(cookie_t *cookie, off_t position, const iovec *vec, size_t count, size_t *numBytes) tun_readv(cookie_t *cookie, off_t position, const iovec *vec, size_t count, size_t *numBytes)
{ {
dprintf("tun: readv(, %Ld, , %ld)\n", position, count); dprintf("tun: readv(, %lld, , %ld)\n", position, count);
return EOPNOTSUPP; return EOPNOTSUPP;
} }
@@ -360,7 +360,7 @@ tun_readv(cookie_t *cookie, off_t position, const iovec *vec, size_t count, size
status_t status_t
tun_writev(cookie_t *cookie, off_t position, const iovec *vec, size_t count, size_t *numBytes) tun_writev(cookie_t *cookie, off_t position, const iovec *vec, size_t count, size_t *numBytes)
{ {
dprintf("tun: writev(, %Ld, , %ld)\n", position, count); dprintf("tun: writev(, %lld, , %ld)\n", position, count);
return EOPNOTSUPP; return EOPNOTSUPP;
} }
@@ -689,7 +689,7 @@ pc_serial_open(const char *name, uint32 flags, void **cookie)
status_t status_t
pc_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes) pc_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
{ {
TRACE_FUNCALLS("> pc_serial_read(0x%08x, %Ld, 0x%08x, %d)\n", cookie, TRACE_FUNCALLS("> pc_serial_read(0x%08x, %lld, 0x%08x, %d)\n", cookie,
position, buffer, *numBytes); position, buffer, *numBytes);
SerialDevice *device = (SerialDevice *)cookie; SerialDevice *device = (SerialDevice *)cookie;
return device->Read((char *)buffer, numBytes); return device->Read((char *)buffer, numBytes);
@@ -701,7 +701,7 @@ status_t
pc_serial_write(void *cookie, off_t position, const void *buffer, pc_serial_write(void *cookie, off_t position, const void *buffer,
size_t *numBytes) size_t *numBytes)
{ {
TRACE_FUNCALLS("> pc_serial_write(0x%08x, %Ld, 0x%08x, %d)\n", cookie, TRACE_FUNCALLS("> pc_serial_write(0x%08x, %lld, 0x%08x, %d)\n", cookie,
position, buffer, *numBytes); position, buffer, *numBytes);
SerialDevice *device = (SerialDevice *)cookie; SerialDevice *device = (SerialDevice *)cookie;
return device->Write((const char *)buffer, numBytes); return device->Write((const char *)buffer, numBytes);
@@ -237,7 +237,7 @@ usb_serial_open(const char *name, uint32 flags, void **cookie)
static status_t static status_t
usb_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes) usb_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
{ {
TRACE_FUNCALLS("> usb_serial_read(0x%08x, %Ld, 0x%08x, %d)\n", cookie, TRACE_FUNCALLS("> usb_serial_read(0x%08x, %lld, 0x%08x, %d)\n", cookie,
position, buffer, *numBytes); position, buffer, *numBytes);
SerialDevice *device = (SerialDevice *)cookie; SerialDevice *device = (SerialDevice *)cookie;
status_t status = device->Read((char *)buffer, numBytes); status_t status = device->Read((char *)buffer, numBytes);
@@ -251,7 +251,7 @@ static status_t
usb_serial_write(void *cookie, off_t position, const void *buffer, usb_serial_write(void *cookie, off_t position, const void *buffer,
size_t *numBytes) size_t *numBytes)
{ {
TRACE_FUNCALLS("> usb_serial_write(0x%08x, %Ld, 0x%08x, %d)\n", cookie, TRACE_FUNCALLS("> usb_serial_write(0x%08x, %lld, 0x%08x, %d)\n", cookie,
position, buffer, *numBytes); position, buffer, *numBytes);
SerialDevice *device = (SerialDevice *)cookie; SerialDevice *device = (SerialDevice *)cookie;
status_t status = device->Write((const char *)buffer, numBytes); status_t status = device->Write((const char *)buffer, numBytes);
@@ -398,7 +398,7 @@ Session::Session(team_id team, const char *name, dev_t device,
fNodeRef.device = device; fNodeRef.device = device;
fNodeRef.node = node; fNodeRef.node = node;
TRACE(("start session %ld:%Ld \"%s\", system_time: %Ld, active until: %Ld\n", TRACE(("start session %ld:%lld \"%s\", system_time: %lld, active until: %lld\n",
device, node, Name(), system_time(), fActiveUntil)); device, node, Name(), system_time(), fActiveUntil));
} }
@@ -589,7 +589,7 @@ Session::Save()
char name[B_OS_NAME_LENGTH + 25]; char name[B_OS_NAME_LENGTH + 25];
if (!IsMainSession()) { if (!IsMainSession()) {
snprintf(name, sizeof(name), "/etc/launch_cache/%ld:%Ld %s", snprintf(name, sizeof(name), "/etc/launch_cache/%ld:%lld %s",
fNodeRef.device, fNodeRef.node, Name()); fNodeRef.device, fNodeRef.node, Name());
} else } else
snprintf(name, sizeof(name), "/etc/launch_cache/%s", Name()); snprintf(name, sizeof(name), "/etc/launch_cache/%s", Name());
@@ -610,7 +610,7 @@ Session::Save()
NodeTable::Iterator iterator(fNodeHash); NodeTable::Iterator iterator(fNodeHash);
while (iterator.HasNext()) { while (iterator.HasNext()) {
struct node *node = iterator.Next(); struct node *node = iterator.Next();
snprintf(name, sizeof(name), "%ld:%Ld\n", node->ref.device, node->ref.node); snprintf(name, sizeof(name), "%ld:%lld\n", node->ref.device, node->ref.node);
ssize_t bytesWritten = write(fd, name, strlen(name)); ssize_t bytesWritten = write(fd, name, strlen(name));
if (bytesWritten < B_OK) { if (bytesWritten < B_OK) {
@@ -790,7 +790,7 @@ launch_speedup_control(const char *subsystem, uint32 function,
return B_BAD_VALUE; return B_BAD_VALUE;
if (!strcmp(name, "system boot")) if (!strcmp(name, "system boot"))
dprintf("STOP BOOT %Ld\n", system_time()); dprintf("STOP BOOT %lld\n", system_time());
sMainSession->Lock(); sMainSession->Lock();
stop_session(sMainSession); stop_session(sMainSession);
@@ -872,7 +872,7 @@ init()
sMainSession = start_session(-1, -1, -1, "system boot"); sMainSession = start_session(-1, -1, -1, "system boot");
sMainSession->Unlock(); sMainSession->Unlock();
dprintf("START BOOT %Ld\n", system_time()); dprintf("START BOOT %lld\n", system_time());
return B_OK; return B_OK;
err3: err3:
+6 -6
View File
@@ -115,7 +115,7 @@ log_node_opened(void *vnode, int32 fdType, mount_id device, vnode_id parent,
log->node = node; log->node = node;
log->timestamp = system_time(); log->timestamp = system_time();
TRACE(("log: added entry %s, <%c%d> %ld:%Ld:%Ld:%s\n", log->team_name, log->action, TRACE(("log: added entry %s, <%c%d> %ld:%lld:%lld:%s\n", log->team_name, log->action,
log->type, device, parent, node, log->file_name)); log->type, device, parent, node, log->file_name));
put_log_entry(log); put_log_entry(log);
@@ -141,7 +141,7 @@ log_node_closed(void *vnode, int32 fdType, mount_id device, vnode_id node, int32
log->access_type = accessType; log->access_type = accessType;
TRACE(("log: added entry %s, <c%d> %ld:%Ld, %ld\n", TRACE(("log: added entry %s, <c%d> %ld:%lld, %ld\n",
log->team_name, log->type, device, node, accessType)); log->team_name, log->type, device, node, accessType));
put_log_entry(log); put_log_entry(log);
@@ -196,7 +196,7 @@ log_node_launched(size_t argCount, char * const *args)
log->parent = -1; log->parent = -1;
} }
TRACE(("log: added entry %s, <l> %ld:%Ld %s ...\n", log->team_name, TRACE(("log: added entry %s, <l> %ld:%lld %s ...\n", log->team_name,
log->device, log->parent, args[0])); log->device, log->parent, args[0]));
put_log_entry(log); put_log_entry(log);
@@ -272,7 +272,7 @@ log_writer_daemon(void *arg, int /*iteration*/)
switch (log->action) { switch (log->action) {
case 'l': // launch case 'l': // launch
length = snprintf(line, sizeof(line), "%ld: %Ld \"%s\" l %ld:%Ld %ld \"%s\" ", length = snprintf(line, sizeof(line), "%ld: %lld \"%s\" l %ld:%lld %ld \"%s\" ",
log->team, log->timestamp, log->team_name, log->team, log->timestamp, log->team_name,
log->device, log->parent, log->launch.parent, log->device, log->parent, log->launch.parent,
log->launch.args[0]); log->launch.args[0]);
@@ -300,14 +300,14 @@ log_writer_daemon(void *arg, int /*iteration*/)
break; break;
case 'c': // close case 'c': // close
length = snprintf(line, sizeof(line), "%ld: %Ld \"%s\" c%d %ld:%Ld %ld\n", length = snprintf(line, sizeof(line), "%ld: %lld \"%s\" c%d %ld:%lld %ld\n",
log->team, log->timestamp, log->team_name, log->type, log->team, log->timestamp, log->team_name, log->type,
log->device, log->node, log->access_type); log->device, log->node, log->access_type);
length = std::min(length, (ssize_t)sizeof(line) - 1); length = std::min(length, (ssize_t)sizeof(line) - 1);
break; break;
default: // open, ? default: // open, ?
length = snprintf(line, sizeof(line), "%ld: %Ld \"%s\" %c%d %ld:%Ld:%Ld:\"%s\"\n", length = snprintf(line, sizeof(line), "%ld: %lld \"%s\" %c%d %ld:%lld:%lld:\"%s\"\n",
log->team, log->timestamp, log->team_name, log->action, log->type, log->device, log->team, log->timestamp, log->team_name, log->action, log->type, log->device,
log->parent, log->node, log->file_name); log->parent, log->node, log->file_name);
length = std::min(length, (ssize_t)sizeof(line) - 1); length = std::min(length, (ssize_t)sizeof(line) - 1);
@@ -412,7 +412,7 @@ load_rules()
if (name != NULL) { if (name != NULL) {
eat_spaces(line); eat_spaces(line);
int32 confidence = strtoul(line, &line, 10); int32 confidence = strtoul(line, &line, 10);
TRACE(("c %ld:%Ld:%s %s %ld\n", device, node, fileName, name, confidence)); TRACE(("c %ld:%lld:%s %s %ld\n", device, node, fileName, name, confidence));
struct head *head = new ::head; struct head *head = new ::head;
head->device = device; head->device = device;
@@ -506,7 +506,7 @@ Rule::Apply()
if (vfs_entry_ref_to_vnode(head->device, head->parent, head->name, &vnode) == B_OK) { if (vfs_entry_ref_to_vnode(head->device, head->parent, head->name, &vnode) == B_OK) {
vfs_vnode_to_node_ref(vnode, &head->device, &head->node); vfs_vnode_to_node_ref(vnode, &head->device, &head->node);
TRACE(("prefetch: %ld:%Ld:%s\n", head->device, head->parent, head->name)); TRACE(("prefetch: %ld:%lld:%s\n", head->device, head->parent, head->name));
cache_prefetch(head->device, head->node, 0, ~0UL); cache_prefetch(head->device, head->node, 0, ~0UL);
// ToDo: put head into a hash so that some statistics can be backpropagated quickly // ToDo: put head into a hash so that some statistics can be backpropagated quickly
@@ -543,11 +543,11 @@ Rule::Dump()
struct head *head = NULL; struct head *head = NULL;
while ((head = (struct head *)list_get_next_item(&fHeads, head)) != NULL) { while ((head = (struct head *)list_get_next_item(&fHeads, head)) != NULL) {
dprintf(" %ld:%Ld:\"%s\", ", head->device, head->parent, head->name); dprintf(" %ld:%lld:\"%s\", ", head->device, head->parent, head->name);
if (head->confidence < sMinConfidence) if (head->confidence < sMinConfidence)
dprintf("-\n"); dprintf("-\n");
else else
dprintf("%ld (%ld), %Ld us\n", head->used_count, dprintf("%ld (%ld), %lld us\n", head->used_count,
head->used_count - fAppliedCount, head->timestamp); head->used_count - fAppliedCount, head->timestamp);
} }
} }
@@ -697,7 +697,7 @@ node_opened(struct vnode *vnode, int32 fdType, dev_t device, vnode_id parent,
&& vfs_get_vnode_name(vnode, buffer, sizeof(buffer)) == B_OK) && vfs_get_vnode_name(vnode, buffer, sizeof(buffer)) == B_OK)
name = buffer; name = buffer;
//dprintf("opened: %ld:%Ld:%Ld:%s (%s)\n", device, parent, node, name, thread_get_current_thread()->name); //dprintf("opened: %ld:%lld:%lld:%s (%s)\n", device, parent, node, name, thread_get_current_thread()->name);
RuleMatcher matcher(team_get_current_team_id(), name); RuleMatcher matcher(team_get_current_team_id(), name);
matcher.GotFile(device, node); matcher.GotFile(device, node);
} }
@@ -113,7 +113,7 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("bfs:%s: block %Ld (%p), sum %lu, s/l %lu/%lu", fLabel, out.Print("bfs:%s: block %lld (%p), sum %lu, s/l %lu/%lu", fLabel,
fBlock, fData, fSum, fStart, fLength); fBlock, fData, fSum, fStart, fLength);
} }
@@ -39,7 +39,7 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("bfs:Create %Ld (%p), parent %Ld (%p), \"%s\", " out.Print("bfs:Create %lld (%p), parent %lld (%p), \"%s\", "
"mode %lx, omode %x, type %lx", fID, fInode, fParentID, "mode %lx, omode %x, type %lx", fID, fInode, fParentID,
fParent, fName, fMode, fOpenMode, fType); fParent, fName, fMode, fOpenMode, fType);
} }
@@ -68,7 +68,7 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("bfs:Remove %Ld (%p), \"%s\"", fID, fInode, fName); out.Print("bfs:Remove %lld (%p), \"%s\"", fID, fInode, fName);
} }
private: private:
@@ -90,7 +90,7 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("bfs:%s %Ld (%p)\n", fAction, fID, fInode); out.Print("bfs:%s %lld (%p)\n", fAction, fID, fInode);
} }
private: private:
@@ -114,7 +114,7 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("bfs:%s %Ld (%p), %Ld -> %Ld", fTrim ? "Trim" : "Resize", out.Print("bfs:%s %lld (%p), %lld -> %lld", fTrim ? "Trim" : "Resize",
fID, fInode, fOldSize, fNewSize); fID, fInode, fOldSize, fNewSize);
} }
@@ -283,7 +283,7 @@ static status_t
bfs_get_vnode(fs_volume* _volume, ino_t id, fs_vnode* _node, int* _type, bfs_get_vnode(fs_volume* _volume, ino_t id, fs_vnode* _node, int* _type,
uint32* _flags, bool reenter) uint32* _flags, bool reenter)
{ {
//FUNCTION_START(("ino_t = %Ld\n", id)); //FUNCTION_START(("ino_t = %lld\n", id));
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
// first inode may be after the log area, we don't go through // first inode may be after the log area, we don't go through
@@ -539,7 +539,7 @@ bfs_get_file_map(fs_volume* _volume, fs_vnode* _node, off_t offset, size_t size,
block_run run; block_run run;
off_t fileOffset; off_t fileOffset;
//FUNCTION_START(("offset = %Ld, size = %lu\n", offset, size)); //FUNCTION_START(("offset = %lld, size = %lu\n", offset, size));
while (true) { while (true) {
status_t status = inode->FindBlockRun(offset, run, fileOffset); status_t status = inode->FindBlockRun(offset, run, fileOffset);
@@ -604,7 +604,7 @@ bfs_lookup(fs_volume* _volume, fs_vnode* _directory, const char* file,
status = tree->Find((uint8*)file, (uint16)strlen(file), _vnodeID); status = tree->Find((uint8*)file, (uint16)strlen(file), _vnodeID);
if (status != B_OK) { if (status != B_OK) {
//PRINT(("bfs_walk() could not find %Ld:\"%s\": %s\n", directory->BlockNumber(), file, strerror(status))); //PRINT(("bfs_walk() could not find %lld:\"%s\": %s\n", directory->BlockNumber(), file, strerror(status)));
if (status == B_ENTRY_NOT_FOUND) if (status == B_ENTRY_NOT_FOUND)
entry_cache_add_missing(volume->ID(), directory->ID(), file); entry_cache_add_missing(volume->ID(), directory->ID(), file);
@@ -1689,7 +1689,7 @@ cdda_read(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t offset,
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Inode* inode = (Inode*)_node->private_node; Inode* inode = (Inode*)_node->private_node;
TRACE(("cdda_read(vnode = %p, offset %Ld, length = %lu, mode = %d)\n", TRACE(("cdda_read(vnode = %p, offset %lld, length = %lu, mode = %d)\n",
_node, offset, *_length, cookie->open_mode)); _node, offset, *_length, cookie->open_mode));
if (S_ISDIR(inode->Type())) if (S_ISDIR(inode->Type()))
@@ -691,7 +691,7 @@ ISOMount(const char *path, uint32 flags, iso9660_volume **_newVolume,
maxBlocks = volume->volSpaceSize[FS_DATA_FORMAT]; maxBlocks = volume->volSpaceSize[FS_DATA_FORMAT];
/* Initialize access to the cache so that we can do cached i/o */ /* Initialize access to the cache so that we can do cached i/o */
TRACE(("ISO9660: cache init: dev %d, max blocks %Ld\n", volume->fd, maxBlocks)); TRACE(("ISO9660: cache init: dev %d, max blocks %lld\n", volume->fd, maxBlocks));
volume->fBlockCache = block_cache_create(volume->fd, maxBlocks, volume->fBlockCache = block_cache_create(volume->fd, maxBlocks,
volume->logicalBlkSize[FS_DATA_FORMAT], true); volume->logicalBlkSize[FS_DATA_FORMAT], true);
isISO = true; isISO = true;
@@ -802,8 +802,8 @@ ISOReadDirEnt(iso9660_volume *volume, dircookie *cookie, struct dirent *dirent,
if (node.name_length <= nameBufferSize) { if (node.name_length <= nameBufferSize) {
// need to do some size checking here. // need to do some size checking here.
strlcpy(dirent->d_name, node.name, node.name_length + 1); strlcpy(dirent->d_name, node.name, node.name_length + 1);
TRACE(("ISOReadDirEnt - success, name is %s, block %Ld, " TRACE(("ISOReadDirEnt - success, name is %s, block %lld, "
"pos %Ld, inode id %Ld\n", dirent->d_name, cookie->block, "pos %lld, inode id %lld\n", dirent->d_name, cookie->block,
cookie->pos, dirent->d_ino)); cookie->pos, dirent->d_ino));
} else { } else {
// TODO: this can be just normal if we support reading more // TODO: this can be just normal if we support reading more
@@ -287,7 +287,7 @@ fs_walk(fs_volume* _volume, fs_vnode* _base, const char* file, ino_t* _vnodeID)
iso9660_inode node; iso9660_inode node;
int initResult; int initResult;
TRACE(("fs_walk - read buffer from disk at LBN %Ld into buffer " TRACE(("fs_walk - read buffer from disk at LBN %lld into buffer "
"%p.\n", block, blockData)); "%p.\n", block, blockData));
// Move to the next block if necessary // Move to the next block if necessary
@@ -304,11 +304,11 @@ fs_walk(fs_volume* _volume, fs_vnode* _base, const char* file, ino_t* _vnodeID)
if (initResult == B_OK) { if (initResult == B_OK) {
if ((node.flags & ISO_IS_ASSOCIATED_FILE) == 0 if ((node.flags & ISO_IS_ASSOCIATED_FILE) == 0
&& !strcmp(node.name, file)) { && !strcmp(node.name, file)) {
TRACE(("fs_walk - success, found vnode at block %Ld, pos " TRACE(("fs_walk - success, found vnode at block %lld, pos "
"%Ld\n", block, blockBytesRead)); "%lld\n", block, blockBytesRead));
*_vnodeID = (block << 30) + (blockBytesRead & 0xffffffff); *_vnodeID = (block << 30) + (blockBytesRead & 0xffffffff);
TRACE(("fs_walk - New vnode id is %Ld\n", *_vnodeID)); TRACE(("fs_walk - New vnode id is %lld\n", *_vnodeID));
result = get_vnode(_volume, *_vnodeID, (void**)&newNode); result = get_vnode(_volume, *_vnodeID, (void**)&newNode);
if (result == B_OK) { if (result == B_OK) {
@@ -328,13 +328,13 @@ fs_walk(fs_volume* _volume, fs_vnode* _base, const char* file, ino_t* _vnodeID)
blockBytesRead += bytesRead; blockBytesRead += bytesRead;
TRACE(("fs_walk - Adding %u bytes to blockBytes read (total " TRACE(("fs_walk - Adding %u bytes to blockBytes read (total "
"%Ld/%u).\n", (unsigned)bytesRead, blockBytesRead, "%lld/%u).\n", (unsigned)bytesRead, blockBytesRead,
(unsigned)baseNode->dataLen[FS_DATA_FORMAT])); (unsigned)baseNode->dataLen[FS_DATA_FORMAT]));
} }
totalRead += volume->logicalBlkSize[FS_DATA_FORMAT]; totalRead += volume->logicalBlkSize[FS_DATA_FORMAT];
block++; block++;
TRACE(("fs_walk - moving to next block %Ld, total read %u\n", TRACE(("fs_walk - moving to next block %lld, total read %u\n",
block, (unsigned)totalRead)); block, (unsigned)totalRead));
block_cache_put(volume->fBlockCache, cachedBlock); block_cache_put(volume->fBlockCache, cachedBlock);
} }
@@ -87,7 +87,7 @@ DataContainer::GetCache()
status_t status_t
DataContainer::Resize(off_t newSize) DataContainer::Resize(off_t newSize)
{ {
// PRINT("DataContainer::Resize(%Ld), fSize: %Ld\n", newSize, fSize); // PRINT("DataContainer::Resize(%lld), fSize: %lld\n", newSize, fSize);
status_t error = B_OK; status_t error = B_OK;
if (_RequiresCacheMode(newSize)) { if (_RequiresCacheMode(newSize)) {
@@ -125,7 +125,7 @@ DataContainer::Resize(off_t newSize)
fSize = newSize; fSize = newSize;
// PRINT("DataContainer::Resize() done: %lx, fSize: %Ld\n", error, fSize); // PRINT("DataContainer::Resize() done: %lx, fSize: %lld\n", error, fSize);
return error; return error;
} }
@@ -170,7 +170,7 @@ status_t
DataContainer::WriteAt(off_t offset, const void *_buffer, size_t size, DataContainer::WriteAt(off_t offset, const void *_buffer, size_t size,
size_t *bytesWritten) size_t *bytesWritten)
{ {
PRINT("DataContainer::WriteAt(%Ld, %p, %lu, %p), fSize: %Ld\n", offset, _buffer, size, bytesWritten, fSize); PRINT("DataContainer::WriteAt(%lld, %p, %lu, %p), fSize: %lld\n", offset, _buffer, size, bytesWritten, fSize);
const uint8 *buffer = (const uint8*)_buffer; const uint8 *buffer = (const uint8*)_buffer;
status_t error = (buffer && offset >= 0 && bytesWritten status_t error = (buffer && offset >= 0 && bytesWritten
@@ -202,7 +202,7 @@ DataContainer::WriteAt(off_t offset, const void *_buffer, size_t size,
// cache mode // cache mode
error = _DoCacheIO(offset, (uint8*)buffer, size, bytesWritten, true); error = _DoCacheIO(offset, (uint8*)buffer, size, bytesWritten, true);
PRINT("DataContainer::WriteAt() done: %lx, fSize: %Ld\n", error, fSize); PRINT("DataContainer::WriteAt() done: %lx, fSize: %lld\n", error, fSize);
return error; return error;
} }
@@ -78,7 +78,7 @@ Index::Dump()
PRINT("Index: `%s', type: %lx\n", GetName(), GetType()); PRINT("Index: `%s', type: %lx\n", GetName(), GetType());
for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) { for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) {
Entry *entry = it.GetCurrent(); Entry *entry = it.GetCurrent();
PRINT(" entry: `%s', dir: %Ld\n", entry->GetName(), PRINT(" entry: `%s', dir: %lld\n", entry->GetName(),
entry->GetParent()->GetID()); entry->GetParent()->GetID());
} }
) )
@@ -235,7 +235,7 @@ ramfs_get_vnode(fs_volume* _volume, ino_t vnid, fs_vnode* node, int* _type,
uint32* _flags, bool reenter) uint32* _flags, bool reenter)
{ {
// FUNCTION_START(); // FUNCTION_START();
FUNCTION(("node: %Ld\n", vnid)); FUNCTION(("node: %lld\n", vnid));
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Node *foundNode = NULL; Node *foundNode = NULL;
status_t error = B_OK; status_t error = B_OK;
@@ -259,7 +259,7 @@ ramfs_write_vnode(fs_volume* /*fs*/, fs_vnode* DARG(_node), bool /*reenter*/)
// called from another FS may cause the VFS layer to free vnodes and thus // called from another FS may cause the VFS layer to free vnodes and thus
// invoke this hook. // invoke this hook.
// FUNCTION_START(); // FUNCTION_START();
//FUNCTION(("node: %Ld\n", ((Node*)_node)->GetID())); //FUNCTION(("node: %lld\n", ((Node*)_node)->GetID()));
status_t error = B_OK; status_t error = B_OK;
RETURN_ERROR(error); RETURN_ERROR(error);
} }
@@ -269,7 +269,7 @@ ramfs_write_vnode(fs_volume* /*fs*/, fs_vnode* DARG(_node), bool /*reenter*/)
static status_t static status_t
ramfs_remove_vnode(fs_volume* _volume, fs_vnode* _node, bool /*reenter*/) ramfs_remove_vnode(fs_volume* _volume, fs_vnode* _node, bool /*reenter*/)
{ {
FUNCTION(("node: %Ld\n", ((Node*)_node)->GetID())); FUNCTION(("node: %lld\n", ((Node*)_node)->GetID()));
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
@@ -552,7 +552,7 @@ ramfs_rename(fs_volume* _volume, fs_vnode* _oldDir, const char *oldName,
status_t error = B_OK; status_t error = B_OK;
if (VolumeWriteLocker locker = volume) { if (VolumeWriteLocker locker = volume) {
FUNCTION(("old dir: %Ld, old name: `%s', new dir: %Ld, new name: `%s'\n", FUNCTION(("old dir: %lld, old name: `%s', new dir: %lld, new name: `%s'\n",
oldDir->GetID(), oldName, newDir->GetID(), newName)); oldDir->GetID(), oldName, newDir->GetID(), newName));
NodeMTimeUpdater mTimeUpdater1(oldDir); NodeMTimeUpdater mTimeUpdater1(oldDir);
NodeMTimeUpdater mTimeUpdater2(newDir); NodeMTimeUpdater mTimeUpdater2(newDir);
@@ -682,7 +682,7 @@ ramfs_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat *st)
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
FUNCTION(("node: %Ld\n", node->GetID())); FUNCTION(("node: %lld\n", node->GetID()));
status_t error = B_OK; status_t error = B_OK;
if (VolumeReadLocker locker = volume) { if (VolumeReadLocker locker = volume) {
st->st_dev = volume->GetID(); st->st_dev = volume->GetID();
@@ -879,7 +879,7 @@ ramfs_open(fs_volume* _volume, fs_vnode* _node, int openMode, void** _cookie)
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
FUNCTION(("node: %Ld\n", node->GetID())); FUNCTION(("node: %lld\n", node->GetID()));
status_t error = B_OK; status_t error = B_OK;
if (VolumeReadLocker locker = volume) { if (VolumeReadLocker locker = volume) {
// directory can be opened read-only // directory can be opened read-only
@@ -922,7 +922,7 @@ ramfs_close(fs_volume* _volume, fs_vnode* _node, void* /*cookie*/)
Volume* volume = (Volume*)_volume->private_volume; Volume* volume = (Volume*)_volume->private_volume;
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
FUNCTION(("node: %Ld\n", node->GetID())); FUNCTION(("node: %lld\n", node->GetID()));
status_t error = B_OK; status_t error = B_OK;
// notify listeners // notify listeners
if (VolumeReadLocker locker = volume) { if (VolumeReadLocker locker = volume) {
@@ -955,7 +955,7 @@ ramfs_read(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
FileCookie *cookie = (FileCookie*)_cookie; FileCookie *cookie = (FileCookie*)_cookie;
// FUNCTION(("((%lu, %lu), %Ld, %p, %lu)\n", node->GetDirID(), // FUNCTION(("((%lu, %lu), %lld, %p, %lu)\n", node->GetDirID(),
// node->GetObjectID(), pos, buffer, *bufferSize)); // node->GetObjectID(), pos, buffer, *bufferSize));
status_t error = B_OK; status_t error = B_OK;
if (VolumeReadLocker locker = volume) { if (VolumeReadLocker locker = volume) {
@@ -992,7 +992,7 @@ ramfs_write(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
Node* node = (Node*)_node->private_node; Node* node = (Node*)_node->private_node;
FileCookie *cookie = (FileCookie*)_cookie; FileCookie *cookie = (FileCookie*)_cookie;
// FUNCTION(("((%lu, %lu), %Ld, %p, %lu)\n", node->GetDirID(), // FUNCTION(("((%lu, %lu), %lld, %p, %lu)\n", node->GetDirID(),
// node->GetObjectID(), pos, buffer, *bufferSize)); // node->GetObjectID(), pos, buffer, *bufferSize));
status_t error = B_OK; status_t error = B_OK;
if (VolumeWriteLocker locker = volume) { if (VolumeWriteLocker locker = volume) {
@@ -1077,7 +1077,7 @@ fGetNextCounter++;
*entryName = entry->GetName(); *entryName = entry->GetName();
} }
} }
PRINT("EntryIterator %" B_PRId32 ", GetNext() counter: %" B_PRId32 ", entry: %p (%Ld)\n", PRINT("EntryIterator %" B_PRId32 ", GetNext() counter: %" B_PRId32 ", entry: %p (%lld)\n",
fIteratorID, fGetNextCounter, fIterator.GetCurrent(), fIteratorID, fGetNextCounter, fIterator.GetCurrent(),
(fIterator.GetCurrent() (fIterator.GetCurrent()
? fIterator.GetCurrent()->GetNode()->GetID() : -1)); ? fIterator.GetCurrent()->GetNode()->GetID() : -1));
@@ -605,7 +605,7 @@ ItemIterator::GoToNext(Item *item)
LeafNode *node = NULL; LeafNode *node = NULL;
status_t error = _GetLeafNode(&node); status_t error = _GetLeafNode(&node);
if (error == B_OK) { if (error == B_OK) {
//PRINT((" leaf node: %Ld\n", node->GetNumber())); //PRINT((" leaf node: %lld\n", node->GetNumber()));
// get the leaf node on which the next item resides // get the leaf node on which the next item resides
int32 newIndex = fIndex + 1; int32 newIndex = fIndex + 1;
while (error == B_OK && newIndex >= node->CountItems()) { while (error == B_OK && newIndex >= node->CountItems()) {
@@ -614,7 +614,7 @@ ItemIterator::GoToNext(Item *item)
} }
// got the node, get the item // got the node, get the item
if (error == B_OK) { if (error == B_OK) {
//PRINT((" leaf node now: %Ld\n", node->GetNumber())); //PRINT((" leaf node now: %lld\n", node->GetNumber()));
fIndex = newIndex; fIndex = newIndex;
//PRINT((" index now: %ld\n", fIndex)); //PRINT((" index now: %ld\n", fIndex));
if (item) if (item)
@@ -1315,7 +1315,7 @@ status_t
StreamReader::ReadAt(off_t position, void *buffer, size_t bufferSize, StreamReader::ReadAt(off_t position, void *buffer, size_t bufferSize,
size_t *_bytesRead) size_t *_bytesRead)
{ {
//PRINT(("StreamReader::ReadAt(%Ld, %p, %lu)\n", position, buffer, bufferSize)); //PRINT(("StreamReader::ReadAt(%lld, %p, %lu)\n", position, buffer, bufferSize));
status_t error = (position >= 0 && buffer && _bytesRead ? InitCheck() status_t error = (position >= 0 && buffer && _bytesRead ? InitCheck()
: B_BAD_VALUE); : B_BAD_VALUE);
// get the size of the stream // get the size of the stream
@@ -1334,7 +1334,7 @@ StreamReader::ReadAt(off_t position, void *buffer, size_t bufferSize,
size_t bytesRead = 0; size_t bytesRead = 0;
while (error == B_OK && bufferSize > 0 while (error == B_OK && bufferSize > 0
&& (error = _SeekTo(position)) == B_OK) { && (error = _SeekTo(position)) == B_OK) {
//PRINT((" seeked to %Ld: fItemOffset: %Ld, fItemSize: %Ld\n", position, //PRINT((" seeked to %lld: fItemOffset: %lld, fItemSize: %lld\n", position,
//fItemOffset, fItemSize)); //fItemOffset, fItemSize));
off_t inItemOffset = max_c(0LL, position - fItemOffset); off_t inItemOffset = max_c(0LL, position - fItemOffset);
off_t toRead = min_c(fItemSize - inItemOffset, (off_t)bufferSize); off_t toRead = min_c(fItemSize - inItemOffset, (off_t)bufferSize);
@@ -1500,7 +1500,7 @@ RETURN_ERROR(error);
status_t status_t
StreamReader::_ReadIndirectItem(off_t offset, void *buffer, size_t bufferSize) StreamReader::_ReadIndirectItem(off_t offset, void *buffer, size_t bufferSize)
{ {
//PRINT(("StreamReader::_ReadIndirectItem(%Ld, %p, %lu)\n", offset, buffer, bufferSize)); //PRINT(("StreamReader::_ReadIndirectItem(%lld, %p, %lu)\n", offset, buffer, bufferSize));
status_t error = B_OK; status_t error = B_OK;
IndirectItem &indirect = *static_cast<IndirectItem*>(&fItem); IndirectItem &indirect = *static_cast<IndirectItem*>(&fItem);
// skip items until the offset is reached // skip items until the offset is reached
@@ -1543,7 +1543,7 @@ StreamReader::_ReadIndirectItem(off_t offset, void *buffer, size_t bufferSize)
status_t status_t
StreamReader::_ReadDirectItem(off_t offset, void *buffer, size_t bufferSize) StreamReader::_ReadDirectItem(off_t offset, void *buffer, size_t bufferSize)
{ {
//PRINT(("StreamReader::_ReadDirectItem(%Ld, %p, %lu)\n", offset, buffer, bufferSize)); //PRINT(("StreamReader::_ReadDirectItem(%lld, %p, %lu)\n", offset, buffer, bufferSize));
// copy the data into the buffer // copy the data into the buffer
memcpy(buffer, memcpy(buffer,
reinterpret_cast<uint8*>(fItem.GetData()) + offset, bufferSize); reinterpret_cast<uint8*>(fItem.GetData()) + offset, bufferSize);
@@ -76,8 +76,8 @@ iterative_io_finished_hook(void *cookie, io_request *request, status_t status,
static float static float
udf_identify_partition(int fd, partition_data *partition, void **_cookie) udf_identify_partition(int fd, partition_data *partition, void **_cookie)
{ {
TRACE(("udf_identify_partition: fd = %d, id = %ld, offset = %Ld, size = %Ld " TRACE(("udf_identify_partition: fd = %d, id = %ld, offset = %lld, size = %lld "
"content_size = %Ld, block_size = %lu\n", fd, partition->id, "content_size = %lld, block_size = %lu\n", fd, partition->id,
partition->offset, partition->size, partition->content_size, partition->offset, partition->size, partition->content_size,
partition->block_size)); partition->block_size));
@@ -180,7 +180,7 @@ udf_get_vnode(fs_volume *_volume, ino_t id, fs_vnode *node, int *_type,
// Convert the given vnode id to an address, and create // Convert the given vnode id to an address, and create
// and return a corresponding Icb object for it. // and return a corresponding Icb object for it.
TRACE(("udf_get_vnode: id = %Ld, blockSize = %lu\n", id, TRACE(("udf_get_vnode: id = %lld, blockSize = %lu\n", id,
volume->BlockSize())); volume->BlockSize()));
Icb *icb = new(std::nothrow) Icb(volume, Icb *icb = new(std::nothrow) Icb(volume,
@@ -233,7 +233,7 @@ udf_lookup(fs_volume *_volume, fs_vnode *_directory, const char *file,
if (status != B_OK) if (status != B_OK)
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
TRACE(("udf_lookup: vnodeId = %Ld found!\n", *vnodeID)); TRACE(("udf_lookup: vnodeId = %lld found!\n", *vnodeID));
return B_OK; return B_OK;
} }
@@ -282,7 +282,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
stat->st_nlink = icb->FileLinkCount(); stat->st_nlink = icb->FileLinkCount();
stat->st_blksize = volume->BlockSize(); stat->st_blksize = volume->BlockSize();
TRACE(("udf_read_stat: st_dev = %ld, st_ino = %Ld, st_blksize = %d\n", TRACE(("udf_read_stat: st_dev = %ld, st_ino = %lld, st_blksize = %d\n",
stat->st_dev, stat->st_ino, stat->st_blksize)); stat->st_dev, stat->st_ino, stat->st_blksize));
stat->st_uid = icb->Uid(); stat->st_uid = icb->Uid();
@@ -302,7 +302,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
//icb->GetChangeTime(stat->st_ctim); //icb->GetChangeTime(stat->st_ctim);
//icb->GetCreationTime(stat->st_crtim); //icb->GetCreationTime(stat->st_crtim);
TRACE(("udf_read_stat: mode = 0x%x, st_ino: %Ld\n", stat->st_mode, TRACE(("udf_read_stat: mode = 0x%x, st_ino: %lld\n", stat->st_mode,
stat->st_ino)); stat->st_ino));
return B_OK; return B_OK;
@@ -564,8 +564,8 @@ udf_mount(fs_volume *_volume, const char *_device, uint32 flags,
if (ioctl(device, B_GET_PARTITION_INFO, &info, sizeof(partition_info)) == 0) { if (ioctl(device, B_GET_PARTITION_INFO, &info, sizeof(partition_info)) == 0) {
TRACE(("partition_info:\n")); TRACE(("partition_info:\n"));
TRACE(("\toffset: %Ld\n", info.offset)); TRACE(("\toffset: %lld\n", info.offset));
TRACE(("\tsize: %Ld\n", info.size)); TRACE(("\tsize: %lld\n", info.size));
TRACE(("\tlogical_block_size: %ld\n", info.logical_block_size)); TRACE(("\tlogical_block_size: %ld\n", info.logical_block_size));
TRACE(("\tsession: %ld\n", info.session)); TRACE(("\tsession: %ld\n", info.session));
TRACE(("\tpartition: %ld\n", info.partition)); TRACE(("\tpartition: %ld\n", info.partition));
@@ -586,7 +586,7 @@ udf_mount(fs_volume *_volume, const char *_device, uint32 flags,
status = fstat(device, &stat) < 0 ? B_ERROR : B_OK; status = fstat(device, &stat) < 0 ? B_ERROR : B_OK;
if (!status) { if (!status) {
TRACE(("stat_info:\n")); TRACE(("stat_info:\n"));
TRACE(("\tst_size: %Ld\n", stat.st_size)); TRACE(("\tst_size: %lld\n", stat.st_size));
deviceOffset = 0; deviceOffset = 0;
numBlock = stat.st_size / 2048; numBlock = stat.st_size / 2048;
} }
@@ -4441,7 +4441,7 @@ Volume::_IncrementVNodeCount(ino_t vnid)
} }
vnode->useCount++; vnode->useCount++;
//PRINT(("_IncrementVNodeCount(%Ld): count: %ld, fVNodeCountMap size: %ld\n", vnid, *count, fVNodeCountMap->Size())); //PRINT(("_IncrementVNodeCount(%lld): count: %ld, fVNodeCountMap size: %ld\n", vnid, *count, fVNodeCountMap->Size()));
} }
@@ -4462,7 +4462,7 @@ Volume::_DecrementVNodeCount(ino_t vnid)
} }
vnode->useCount--; vnode->useCount--;
//PRINT(("_DecrementVNodeCount(%Ld): count: %ld, fVNodeCountMap size: %ld\n", vnid, tmpCount, fVNodeCountMap->Size())); //PRINT(("_DecrementVNodeCount(%lld): count: %ld, fVNodeCountMap size: %ld\n", vnid, tmpCount, fVNodeCountMap->Size()));
} }
@@ -1261,7 +1261,7 @@ beos_set_blocks_info(int dev, fs_off_t *blocks, int nblocks,
/* we can call hash_lookup() here because we know it's around */ /* we can call hash_lookup() here because we know it's around */
ce = hash_lookup(&bc.ht, dev, blocks[i]); ce = hash_lookup(&bc.ht, dev, blocks[i]);
if (ce == NULL) { if (ce == NULL) {
beos_panic("*** set_block_info can't find bnum %Ld!\n", blocks[i]); beos_panic("*** set_block_info can't find bnum %lld!\n", blocks[i]);
UNLOCK(bc.lock); UNLOCK(bc.lock);
return ENOENT; /* hopefully this doesn't happen... */ return ENOENT; /* hopefully this doesn't happen... */
} }
@@ -1269,7 +1269,7 @@ beos_set_blocks_info(int dev, fs_off_t *blocks, int nblocks,
ce->flags &= ~(CE_DIRTY | CE_BUSY); ce->flags &= ~(CE_DIRTY | CE_BUSY);
if (ce->func != NULL) { if (ce->func != NULL) {
beos_panic("*** set_block_info non-null callback on bnum %Ld\n", beos_panic("*** set_block_info non-null callback on bnum %lld\n",
ce->block_num); ce->block_num);
} }
@@ -1280,7 +1280,7 @@ beos_set_blocks_info(int dev, fs_off_t *blocks, int nblocks,
ce->clone = (void *)malloc(ce->bsize); ce->clone = (void *)malloc(ce->bsize);
if (ce->clone == NULL) if (ce->clone == NULL)
beos_panic("*** can't clone bnum %Ld (bsize %d)\n", beos_panic("*** can't clone bnum %lld (bsize %d)\n",
ce->block_num, ce->bsize); ce->block_num, ce->bsize);
@@ -1770,10 +1770,10 @@ cache_block_io(int dev, fs_off_t bnum, void *data, fs_off_t num_blocks, int bsiz
/* some sanity checks first */ /* some sanity checks first */
if (bsize == 0) if (bsize == 0)
beos_panic("cache_io: block size == 0 for bnum %Ld?!?\n", bnum); beos_panic("cache_io: block size == 0 for bnum %lld?!?\n", bnum);
if (num_blocks == 0) if (num_blocks == 0)
beos_panic("cache_io: bnum %Ld has num_blocks == 0!\n", bnum); beos_panic("cache_io: bnum %lld has num_blocks == 0!\n", bnum);
if (data == NULL && dataptr == NULL) { if (data == NULL && dataptr == NULL) {
printf("major butthead move: " printf("major butthead move: "
@@ -1784,7 +1784,7 @@ cache_block_io(int dev, fs_off_t bnum, void *data, fs_off_t num_blocks, int bsiz
if (data == NULL) { if (data == NULL) {
if (num_blocks != 1) /* get_block() should never do that */ if (num_blocks != 1) /* get_block() should never do that */
beos_panic("cache_io: num_blocks %Ld but should be 1\n", beos_panic("cache_io: num_blocks %lld but should be 1\n",
num_blocks); num_blocks);
if (op & CACHE_WRITE) if (op & CACHE_WRITE)
@@ -1838,8 +1838,8 @@ cache_block_io(int dev, fs_off_t bnum, void *data, fs_off_t num_blocks, int bsiz
if (ce) { if (ce) {
if (tmp != ce->block_num || dev != ce->dev) { if (tmp != ce->block_num || dev != ce->dev) {
UNLOCK(bc.lock); UNLOCK(bc.lock);
beos_panic("*** error4: looked up dev %d block %Ld but " beos_panic("*** error4: looked up dev %d block %lld but "
"found %d %Ld\n", dev, tmp, ce->dev, "found %d %lld\n", dev, tmp, ce->dev,
ce->block_num); ce->block_num);
} }
@@ -1858,8 +1858,8 @@ cache_block_io(int dev, fs_off_t bnum, void *data, fs_off_t num_blocks, int bsiz
if (ce) { if (ce) {
if (tmp != ce->block_num || dev != ce->dev) { if (tmp != ce->block_num || dev != ce->dev) {
UNLOCK(bc.lock); UNLOCK(bc.lock);
beos_panic("*** error5: looked up dev %d block %Ld but " beos_panic("*** error5: looked up dev %d block %lld but "
"found %d %Ld\n", dev, tmp, ce->dev, "found %d %lld\n", dev, tmp, ce->dev,
ce->block_num); ce->block_num);
return EBADF; return EBADF;
} }
@@ -185,7 +185,7 @@ amiga_rdb_scan_partition(int fd, partition_data *partition, void *_cookie)
if (environment.Start() + environment.Size() if (environment.Start() + environment.Size()
> (uint64)partition->size) { > (uint64)partition->size) {
TRACE(("amiga_rdb: child partition exceeds existing space (%Ld " TRACE(("amiga_rdb: child partition exceeds existing space (%lld "
"bytes)\n", environment.Size())); "bytes)\n", environment.Size()));
continue; continue;
} }
@@ -163,7 +163,7 @@ apple_scan_partition(int fd, partition_data *partition, void *_cookie)
partitionMap.name, partitionMap.type)); partitionMap.name, partitionMap.type));
if (partitionMap.Start(descriptor) + partitionMap.Size(descriptor) > (uint64)partition->size) { if (partitionMap.Start(descriptor) + partitionMap.Size(descriptor) > (uint64)partition->size) {
TRACE(("apple: child partition exceeds existing space (%Ld bytes)\n", TRACE(("apple: child partition exceeds existing space (%lld bytes)\n",
partitionMap.Size(descriptor))); partitionMap.Size(descriptor)));
continue; continue;
} }
@@ -173,7 +173,7 @@ atari_scan_partition(int fd, partition_data *partition, void *_cookie)
continue; continue;
TRACE(("atari: file system: %.3s\n", p->id)); TRACE(("atari: file system: %.3s\n", p->id));
if ((p->Start() + p->Size())*(uint64)SECTSZ > (uint64)partition->size) { if ((p->Start() + p->Size())*(uint64)SECTSZ > (uint64)partition->size) {
TRACE(("atari: child partition exceeds existing space (%Ld bytes)\n", p->Size()*SECTSZ)); TRACE(("atari: child partition exceeds existing space (%lld bytes)\n", p->Size()*SECTSZ));
continue; continue;
} }
if (!isalnum(p->id[0])) if (!isalnum(p->id[0]))
@@ -298,7 +298,7 @@ PartitionMapParser::_ReadPartitionTable(off_t offset, partition_table* table)
// check the offset // check the offset
if (offset < 0 || offset + toRead > fSessionSize) { if (offset < 0 || offset + toRead > fSessionSize) {
TRACE(("intel: _ReadPartitionTable(): bad offset: %Ld\n", offset)); TRACE(("intel: _ReadPartitionTable(): bad offset: %lld\n", offset));
return B_BAD_VALUE; return B_BAD_VALUE;
} }
@@ -129,7 +129,7 @@ DVBCard::SetTuningParameter(const dvb_tuning_parameters_t& param)
printf("DVBCard::SetTuningParameter:\n"); printf("DVBCard::SetTuningParameter:\n");
/* /*
printf("frequency %Ld\n", param.frequency); printf("frequency %lld\n", param.frequency);
printf("inversion %d\n", param.inversion); printf("inversion %d\n", param.inversion);
printf("bandwidth %d\n", param.bandwidth); printf("bandwidth %d\n", param.bandwidth);
printf("modulation %d\n", param.modulation); printf("modulation %d\n", param.modulation);
@@ -274,7 +274,7 @@ DVBMediaNode::SetTimeSource(BTimeSource *time_source)
{ {
TRACE("DVBMediaNode::SetTimeSource\n"); TRACE("DVBMediaNode::SetTimeSource\n");
//printf("current RunMode = %d\n", RunMode()); //printf("current RunMode = %d\n", RunMode());
//printf("_m_recordDelay = %Ld\n", _m_recordDelay); //printf("_m_recordDelay = %lld\n", _m_recordDelay);
} }
@@ -283,7 +283,7 @@ DVBMediaNode::SetRunMode(run_mode mode)
{ {
TRACE("DVBMediaNode::SetRunMode: %d\n", mode); TRACE("DVBMediaNode::SetRunMode: %d\n", mode);
TRACE("current RunMode = %d\n", RunMode()); TRACE("current RunMode = %d\n", RunMode());
//printf("_m_recordDelay = %Ld\n", _m_recordDelay); //printf("_m_recordDelay = %lld\n", _m_recordDelay);
} }
@@ -346,7 +346,7 @@ DVBMediaNode::NodeRegistered()
// SetRunMode(B_RECORDING); // SetRunMode(B_RECORDING);
//printf("RunMode = %d\n", RunMode()); //printf("RunMode = %d\n", RunMode());
//printf("_m_recordDelay = %Ld\n", _m_recordDelay); //printf("_m_recordDelay = %lld\n", _m_recordDelay);
Run(); Run();
} }
@@ -457,7 +457,7 @@ DVBMediaNode::GetLatency(bigtime_t *out_latency)
if (B_OK != BBufferProducer::GetLatency(out_latency)) if (B_OK != BBufferProducer::GetLatency(out_latency))
*out_latency = 50000; *out_latency = 50000;
printf("DVBMediaNode::GetLatency: %Ld\n", *out_latency); printf("DVBMediaNode::GetLatency: %lld\n", *out_latency);
*out_latency += PROCESSING_LATENCY; *out_latency += PROCESSING_LATENCY;
return B_OK; return B_OK;
} }
@@ -845,7 +845,7 @@ DVBMediaNode::Connect(status_t error, const media_source &source,
if (B_OK != FindLatencyFor(destination, &latency, &ts)) if (B_OK != FindLatencyFor(destination, &latency, &ts))
TRACE("FindLatencyFor failed\n"); TRACE("FindLatencyFor failed\n");
else else
TRACE("downstream latency %Ld\n", latency); TRACE("downstream latency %lld\n", latency);
#endif #endif
} }
@@ -891,7 +891,7 @@ void
DVBMediaNode::LateNoticeReceived(const media_source &source, DVBMediaNode::LateNoticeReceived(const media_source &source,
bigtime_t how_much, bigtime_t performance_time) bigtime_t how_much, bigtime_t performance_time)
{ {
TRACE("DVBMediaNode::LateNoticeReceived %Ld late at %Ld\n", how_much, TRACE("DVBMediaNode::LateNoticeReceived %lld late at %lld\n", how_much,
performance_time); performance_time);
} }
@@ -938,7 +938,7 @@ DVBMediaNode::LatencyChanged(const media_source &source,
const media_destination &destination, bigtime_t new_latency, const media_destination &destination, bigtime_t new_latency,
uint32 flags) uint32 flags)
{ {
TRACE("DVBMediaNode::LatencyChanged to %Ld\n", new_latency); TRACE("DVBMediaNode::LatencyChanged to %lld\n", new_latency);
} }
/* DVBMediaNode */ /* DVBMediaNode */
@@ -947,14 +947,14 @@ DVBMediaNode::LatencyChanged(const media_source &source,
void void
DVBMediaNode::HandleTimeWarp(bigtime_t performance_time) DVBMediaNode::HandleTimeWarp(bigtime_t performance_time)
{ {
TRACE("DVBMediaNode::HandleTimeWarp at %Ld\n", performance_time); TRACE("DVBMediaNode::HandleTimeWarp at %lld\n", performance_time);
} }
void void
DVBMediaNode::HandleSeek(bigtime_t performance_time) DVBMediaNode::HandleSeek(bigtime_t performance_time)
{ {
TRACE("DVBMediaNode::HandleSeek at %Ld\n", performance_time); TRACE("DVBMediaNode::HandleSeek at %lld\n", performance_time);
} }
@@ -1773,24 +1773,24 @@ DVBMediaNode::raw_audio_thread()
bigtime_t delay; bigtime_t delay;
delay = start_time - TimeSource()->Now(); delay = start_time - TimeSource()->Now();
TRACE_TIMING("audio delay is %Ld\n", delay); TRACE_TIMING("audio delay is %lld\n", delay);
if (delay < -AUDIO_MAX_LATE) { if (delay < -AUDIO_MAX_LATE) {
printf("audio: decoded packet is %Ldms too late, dropped\n", printf("audio: decoded packet is %lldms too late, dropped\n",
-delay / 1000); -delay / 1000);
buf->Recycle(); buf->Recycle();
continue; continue;
} }
if (delay < 0) if (delay < 0)
// printf("audio: decoded packet is %Ldms too late\n", -delay / 1000); // printf("audio: decoded packet is %lldms too late\n", -delay / 1000);
if (delay > AUDIO_MAX_EARLY) { if (delay > AUDIO_MAX_EARLY) {
printf("audio: decoded packet is %Ldms too early, dropped\n", printf("audio: decoded packet is %lldms too early, dropped\n",
delay / 1000); delay / 1000);
buf->Recycle(); buf->Recycle();
continue; continue;
} }
if (delay > 0) if (delay > 0)
// printf("audio: decoded packet is %Ldms too early\n", delay / 1000); // printf("audio: decoded packet is %lldms too early\n", delay / 1000);
delay -= PROCESSING_LATENCY; delay -= PROCESSING_LATENCY;
if (delay > 0) { if (delay > 0) {
@@ -1802,7 +1802,7 @@ DVBMediaNode::raw_audio_thread()
} }
} }
TRACE_TIMING("audio playback delay %Ld\n", TRACE_TIMING("audio playback delay %lld\n",
start_time - TimeSource()->Now()); start_time - TimeSource()->Now());
media_header* hdr; media_header* hdr;
@@ -1993,15 +1993,15 @@ DVBMediaNode::raw_video_thread()
bigtime_t delay; bigtime_t delay;
delay = start_time - TimeSource()->Now(); delay = start_time - TimeSource()->Now();
TRACE_TIMING("video delay %Ld\n", delay); TRACE_TIMING("video delay %lld\n", delay);
if (delay < -VIDEO_MAX_LATE) { if (delay < -VIDEO_MAX_LATE) {
printf("video: decoded packet is %Ldms too late, dropped\n", printf("video: decoded packet is %lldms too late, dropped\n",
-delay / 1000); -delay / 1000);
buf->Recycle(); buf->Recycle();
continue; continue;
} }
if (delay > VIDEO_MAX_EARLY) { if (delay > VIDEO_MAX_EARLY) {
printf("video: decoded packet is %Ldms too early, dropped\n", printf("video: decoded packet is %lldms too early, dropped\n",
delay / 1000); delay / 1000);
buf->Recycle(); buf->Recycle();
continue; continue;
@@ -2016,7 +2016,7 @@ DVBMediaNode::raw_video_thread()
} }
} }
TRACE_TIMING("video playback delay %Ld\n", start_time TRACE_TIMING("video playback delay %lld\n", start_time
- TimeSource()->Now()); - TimeSource()->Now());
media_header* hdr; media_header* hdr;
@@ -2103,7 +2103,7 @@ DVBMediaNode::GetNextAudioChunk(const void **chunkData, size_t *chunkLen,
// measured in PCR time base // measured in PCR time base
mh->start_time = fCurrentAudioPacket->TimeStamp(); mh->start_time = fCurrentAudioPacket->TimeStamp();
// printf("GetNextAudioChunk: done start_time %Ld\n", mh->start_time); // printf("GetNextAudioChunk: done start_time %lld\n", mh->start_time);
return B_OK; return B_OK;
} }
@@ -2990,7 +2990,7 @@ DVBMediaNode::ExtractTuningParams(const char *description, int audio_pid_index,
TRACE("parsing result: audio pid %d\n", _apid); TRACE("parsing result: audio pid %d\n", _apid);
TRACE("parsing result: PCR pid %d\n", _cpid); TRACE("parsing result: PCR pid %d\n", _cpid);
TRACE("parsing result: symbol rate %d\n", _srate); TRACE("parsing result: symbol rate %d\n", _srate);
TRACE("parsing result: Frequency %Ld Hz, %Ld MHz\n", _freq, _freq / 1000000); TRACE("parsing result: Frequency %lld Hz, %lld MHz\n", _freq, _freq / 1000000);
if (fInterfaceType == DVB_TYPE_DVB_T) { if (fInterfaceType == DVB_TYPE_DVB_T) {
@@ -92,11 +92,11 @@ TransportStreamDemux::ProcessPacket(const mpeg_ts_packet *pkt, bigtime_t start_t
{ {
fCount++; fCount++;
// printf("ProcessPacket %Ld\n", fCount); // printf("ProcessPacket %lld\n", fCount);
if (pkt->SyncByte() != 0x47) { if (pkt->SyncByte() != 0x47) {
// fCountInvalid++; // fCountInvalid++;
printf("packet %Ld sync byte error " printf("packet %lld sync byte error "
"%02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x\n", fCount, "%02x %02x %02x %02x %02x %02x %02x %02x\n", fCount,
pkt->header[0], pkt->header[1], pkt->header[2], pkt->header[3], pkt->header[0], pkt->header[1], pkt->header[2], pkt->header[3],
@@ -108,7 +108,7 @@ TransportStreamDemux::ProcessPacket(const mpeg_ts_packet *pkt, bigtime_t start_t
// if (pkt->TransportError()) { // if (pkt->TransportError()) {
// fCountInvalid++; // fCountInvalid++;
// printf("invalid packet %Ld (transport_error_indicator)\n", fCount); // printf("invalid packet %lld (transport_error_indicator)\n", fCount);
// return; // return;
// } // }
@@ -156,10 +156,10 @@ TransportStreamDemux::ProcessPCR(const mpeg_ts_packet *pkt, bigtime_t start_time
| (pkt->data[6] >> 7); | (pkt->data[6] >> 7);
pcr *= 300; pcr *= 300;
pcr += (pkt->data[6] & 1) | pkt->data[7]; pcr += (pkt->data[6] & 1) | pkt->data[7];
// printf(" pcr = %Ld\n", pcr); // printf(" pcr = %lld\n", pcr);
// bigtime_t now = system_time(); // bigtime_t now = system_time();
// printf("system_time %.3f, PCR-time %.3f, delta %.06f, PCR %Ld\n", now / 1e6, CLOCK_TO_USEC(pcr) / 1e6, (CLOCK_TO_USEC(pcr) - now) / 1e6, pcr); // printf("system_time %.3f, PCR-time %.3f, delta %.06f, PCR %lld\n", now / 1e6, CLOCK_TO_USEC(pcr) / 1e6, (CLOCK_TO_USEC(pcr) - now) / 1e6, pcr);
// atomic_set64(&fCurrentTime, CLOCK_TO_USEC(pcr)); // atomic_set64(&fCurrentTime, CLOCK_TO_USEC(pcr));
@@ -247,7 +247,7 @@ TransportStreamDemux::ProcessAUD(const mpeg_ts_packet *pkt)
| (data[12] << 7) | (data[13] >> 1); | (data[12] << 7) | (data[13] >> 1);
pts *= 300; pts *= 300;
// printf("vid pts = %Ld\n", pts); // printf("vid pts = %lld\n", pts);
if (data[7] & 0x40) { // DTS if (data[7] & 0x40) { // DTS
@@ -256,7 +256,7 @@ TransportStreamDemux::ProcessAUD(const mpeg_ts_packet *pkt)
| (data[17] << 7) | (data[18] >> 1); | (data[17] << 7) | (data[18] >> 1);
dts *= 300; dts *= 300;
// printf("aud dts = %Ld\n", dts); // printf("aud dts = %lld\n", dts);
} else { } else {
dts = pts; dts = pts;
} }
@@ -358,7 +358,7 @@ TransportStreamDemux::ProcessVID(const mpeg_ts_packet *pkt)
| (data[12] << 7) | (data[13] >> 1); | (data[12] << 7) | (data[13] >> 1);
pts *= 300; pts *= 300;
// printf("vid pts = %Ld\n", pts); // printf("vid pts = %lld\n", pts);
if (data[7] & 0x40) { // DTS if (data[7] & 0x40) { // DTS
@@ -367,8 +367,8 @@ TransportStreamDemux::ProcessVID(const mpeg_ts_packet *pkt)
| (data[17] << 7) | (data[18] >> 1); | (data[17] << 7) | (data[18] >> 1);
dts *= 300; dts *= 300;
// printf("vid dts = %Ld\n", dts); // printf("vid dts = %lld\n", dts);
// printf("dts = %Ld, pts = %Ld, delta %Ld ### dts = %Ld, pts = %Ld, delta %Ld\n", // printf("dts = %lld, pts = %lld, delta %lld ### dts = %lld, pts = %lld, delta %lld\n",
// dts, pts, pts - dts, CLOCK_TO_USEC(dts), CLOCK_TO_USEC(pts), CLOCK_TO_USEC(pts - dts)); // dts, pts, pts - dts, CLOCK_TO_USEC(dts), CLOCK_TO_USEC(pts), CLOCK_TO_USEC(pts - dts));
} else { } else {
dts = pts; dts = pts;
@@ -272,7 +272,7 @@ ESDEndpoint::ConnectThread(void)
bigtime_t serverLatency = result * 1000000LL / (ESD_DEFAULT_RATE * 2/*16b*/ * 2/*stereo*/ ); bigtime_t serverLatency = result * 1000000LL / (ESD_DEFAULT_RATE * 2/*16b*/ * 2/*stereo*/ );
bigtime_t netLatency = (fLatency + ping) / 2; /* mean of both */ bigtime_t netLatency = (fLatency + ping) / 2; /* mean of both */
fprintf(stderr, "ESDEndpoint::Connect: Latency: server: %Ld, net1: %Ld, net2: %Ld\n", serverLatency, fLatency, ping); fprintf(stderr, "ESDEndpoint::Connect: Latency: server: %lld, net1: %lld, net2: %lld\n", serverLatency, fLatency, ping);
fLatency = netLatency + serverLatency; fLatency = netLatency + serverLatency;
@@ -417,7 +417,7 @@ status_t ESDSinkNode::GetLatencyFor(
if (netl > 500000) if (netl > 500000)
netl = 500000; netl = 500000;
*out_latency = intl + netl; *out_latency = intl + netl;
fprintf(stderr, "int latency %Ld, net latency %Ld, total latency %Ld\n", intl, netl, *out_latency); fprintf(stderr, "int latency %lld, net latency %lld, total latency %lld\n", intl, netl, *out_latency);
*out_timesource = TimeSource()->ID(); *out_timesource = TimeSource()->ID();
return B_OK; return B_OK;
} }
@@ -750,10 +750,10 @@ ESDSinkNode::Connect(status_t error, const media_source& source, const media_des
// Do so, then make sure we get our events early enough. // Do so, then make sure we get our events early enough.
media_node_id id; media_node_id id;
FindLatencyFor(channel->fOutput.destination, &fLatency, &id); FindLatencyFor(channel->fOutput.destination, &fLatency, &id);
PRINT(("\tdownstream latency = %Ld\n", fLatency)); PRINT(("\tdownstream latency = %lld\n", fLatency));
fInternalLatency = BufferDuration(); fInternalLatency = BufferDuration();
PRINT(("\tbuffer-filling took %Ld usec on this machine\n", fInternalLatency)); PRINT(("\tbuffer-filling took %lld usec on this machine\n", fInternalLatency));
//SetEventLatency(fLatency + fInternalLatency); //SetEventLatency(fLatency + fInternalLatency);
// Set up the buffer group for our connection, as long as nobody handed us a // Set up the buffer group for our connection, as long as nobody handed us a
@@ -828,7 +828,7 @@ ESDSinkNode::LateNoticeReceived(const media_source& what, bigtime_t how_much, bi
fInternalLatency += how_much; fInternalLatency += how_much;
SetEventLatency(fLatency + fInternalLatency); SetEventLatency(fLatency + fInternalLatency);
fprintf(stderr, "\tincreasing latency to %Ld\n", fLatency + fInternalLatency); fprintf(stderr, "\tincreasing latency to %lld\n", fLatency + fInternalLatency);
} }
else else
{ {
@@ -595,7 +595,7 @@ FinePixProducer::HandleStart(bigtime_t performance_time)
{ {
/* Start producing frames, even if the output hasn't been connected yet. */ /* Start producing frames, even if the output hasn't been connected yet. */
PRINTF(1, ("HandleStart(%Ld)\n", performance_time)); PRINTF(1, ("HandleStart(%lld)\n", performance_time));
if (fRunning) { if (fRunning) {
PRINTF(-1, ("HandleStart: Node already started\n")); PRINTF(-1, ("HandleStart: Node already started\n"));
@@ -406,7 +406,7 @@ FireWireDVNode::Connect(status_t error, const media_source& source,
if (B_OK != FindLatencyFor(destination, &latency, &ts)) if (B_OK != FindLatencyFor(destination, &latency, &ts))
TRACE("FindLatencyFor failed\n"); TRACE("FindLatencyFor failed\n");
else else
TRACE("downstream latency %Ld\n", latency); TRACE("downstream latency %lld\n", latency);
#endif #endif
} }
@@ -427,7 +427,7 @@ void
FireWireDVNode::LateNoticeReceived(const media_source& source, FireWireDVNode::LateNoticeReceived(const media_source& source,
bigtime_t how_much, bigtime_t performance_time) bigtime_t how_much, bigtime_t performance_time)
{ {
TRACE("FireWireDVNode::LateNoticeReceived %Ld late at %Ld\n", how_much, performance_time); TRACE("FireWireDVNode::LateNoticeReceived %lld late at %lld\n", how_much, performance_time);
} }
@@ -455,14 +455,14 @@ FireWireDVNode::AdditionalBufferRequested(const media_source& source,
void void
FireWireDVNode::HandleTimeWarp(bigtime_t performance_time) FireWireDVNode::HandleTimeWarp(bigtime_t performance_time)
{ {
TRACE("FireWireDVNode::HandleTimeWarp at %Ld\n", performance_time); TRACE("FireWireDVNode::HandleTimeWarp at %lld\n", performance_time);
} }
void void
FireWireDVNode::HandleSeek(bigtime_t performance_time) FireWireDVNode::HandleSeek(bigtime_t performance_time)
{ {
TRACE("FireWireDVNode::HandleSeek at %Ld\n", performance_time); TRACE("FireWireDVNode::HandleSeek at %lld\n", performance_time);
} }
@@ -728,7 +728,7 @@ AudioMixer::GetLatency(bigtime_t *out_latency)
// report our *total* latency: internal plus downstream plus scheduling // report our *total* latency: internal plus downstream plus scheduling
*out_latency = EventLatency() + SchedulingLatency(); *out_latency = EventLatency() + SchedulingLatency();
TRACE("AudioMixer::GetLatency %Ld\n", *out_latency); TRACE("AudioMixer::GetLatency %lld\n", *out_latency);
return B_OK; return B_OK;
} }
@@ -745,7 +745,7 @@ AudioMixer::LatencyChanged(const media_source& source,
} }
TRACE("AudioMixer::LatencyChanged: downstream latency from %ld/%ld to " TRACE("AudioMixer::LatencyChanged: downstream latency from %ld/%ld to "
"%ld/%ld changed from %Ld to %Ld\n", source.port, source.id, "%ld/%ld changed from %lld to %lld\n", source.port, source.id,
destination.port, destination.id, fDownstreamLatency, new_latency); destination.port, destination.id, fDownstreamLatency, new_latency);
#if DEBUG #if DEBUG
@@ -753,7 +753,7 @@ AudioMixer::LatencyChanged(const media_source& source,
media_node_id id; media_node_id id;
bigtime_t l; bigtime_t l;
FindLatencyFor(destination, &l, &id); FindLatencyFor(destination, &l, &id);
TRACE("AudioMixer: Reported downstream Latency is %Ld usecs\n", l); TRACE("AudioMixer: Reported downstream Latency is %lld usecs\n", l);
} }
#endif #endif
@@ -917,17 +917,17 @@ AudioMixer::Connect(status_t error, const media_source &source,
// Now that we're connected, we can determine our downstream latency. // Now that we're connected, we can determine our downstream latency.
media_node_id id; media_node_id id;
FindLatencyFor(dest, &fDownstreamLatency, &id); FindLatencyFor(dest, &fDownstreamLatency, &id);
TRACE("AudioMixer: Downstream Latency is %Ld usecs\n", fDownstreamLatency); TRACE("AudioMixer: Downstream Latency is %lld usecs\n", fDownstreamLatency);
// SetDuration of one buffer // SetDuration of one buffer
SetBufferDuration(buffer_duration(format.u.raw_audio)); SetBufferDuration(buffer_duration(format.u.raw_audio));
TRACE("AudioMixer: buffer duration is %Ld usecs\n", BufferDuration()); TRACE("AudioMixer: buffer duration is %lld usecs\n", BufferDuration());
// Our internal latency is at least the length of a full output buffer // Our internal latency is at least the length of a full output buffer
// plus mixing time, plus jitter // plus mixing time, plus jitter
fInternalLatency = BufferDuration() fInternalLatency = BufferDuration()
+ max(kMinMixingTime, bigtime_t(0.5 * BufferDuration())) + kMaxJitter; + max(kMinMixingTime, bigtime_t(0.5 * BufferDuration())) + kMaxJitter;
TRACE("AudioMixer: Internal latency is %Ld usecs\n", fInternalLatency); TRACE("AudioMixer: Internal latency is %lld usecs\n", fInternalLatency);
SetEventLatency(fDownstreamLatency + fInternalLatency); SetEventLatency(fDownstreamLatency + fInternalLatency);
@@ -1014,7 +1014,7 @@ AudioMixer::LateNoticeReceived(const media_source& what, bigtime_t howMuch,
// is the only runmode in which we can do anything about this // is the only runmode in which we can do anything about this
// TODO: quality could be decreased, too // TODO: quality could be decreased, too
ERROR("AudioMixer::LateNoticeReceived, %Ld too late at %Ld\n", howMuch, ERROR("AudioMixer::LateNoticeReceived, %lld too late at %lld\n", howMuch,
performanceTime); performanceTime);
if (what == fCore->Output()->MediaOutput().source if (what == fCore->Output()->MediaOutput().source
@@ -1147,7 +1147,7 @@ AudioMixer::PublishEventLatencyChange()
MixerInput *input; MixerInput *input;
for (int i = 0; (input = fCore->Input(i)) != 0; i++) { for (int i = 0; (input = fCore->Input(i)) != 0; i++) {
TRACE("AudioMixer::PublishEventLatencyChange: SendLatencyChange, " TRACE("AudioMixer::PublishEventLatencyChange: SendLatencyChange, "
"connection %ld/%ld to %ld/%ld event latency is now %Ld\n", "connection %ld/%ld to %ld/%ld event latency is now %lld\n",
input->MediaInput().source.port, input->MediaInput().source.id, input->MediaInput().source.port, input->MediaInput().source.id,
input->MediaInput().destination.port, input->MediaInput().destination.port,
input->MediaInput().destination.id, EventLatency()); input->MediaInput().destination.id, EventLatency());
@@ -1166,8 +1166,8 @@ AudioMixer::CreateBufferGroup(BBufferGroup** buffer) const
// (plus one for rounding up), plus one extra // (plus one for rounding up), plus one extra
int32 count = int32(fDownstreamLatency / BufferDuration()) + 2; int32 count = int32(fDownstreamLatency / BufferDuration()) + 2;
TRACE("AudioMixer::CreateBufferGroup: fDownstreamLatency %Ld, " TRACE("AudioMixer::CreateBufferGroup: fDownstreamLatency %lld, "
"BufferDuration %Ld, buffer count = %ld\n", fDownstreamLatency, "BufferDuration %lld, buffer count = %ld\n", fDownstreamLatency,
BufferDuration(), count); BufferDuration(), count);
if (count < 3) if (count < 3)
@@ -295,7 +295,7 @@ MixerCore::SetTimingInfo(BTimeSource *ts, bigtime_t downstream_latency)
fTimeSource = dynamic_cast<BTimeSource *>(ts->Acquire()); fTimeSource = dynamic_cast<BTimeSource *>(ts->Acquire());
fDownstreamLatency = downstream_latency; fDownstreamLatency = downstream_latency;
TRACE("MixerCore::SetTimingInfo, now = %Ld, downstream latency %Ld\n", TRACE("MixerCore::SetTimingInfo, now = %lld, downstream latency %lld\n",
fTimeSource->Now(), fDownstreamLatency); fTimeSource->Now(), fDownstreamLatency);
} }
@@ -484,7 +484,7 @@ MixerCore::_MixThread()
bigtime_t start = fTimeSource->Now(); bigtime_t start = fTimeSource->Now();
Unlock(); Unlock();
while (start <= 0) { while (start <= 0) {
TRACE("MixerCore: delaying _MixThread start, timesource is at %Ld\n", TRACE("MixerCore: delaying _MixThread start, timesource is at %lld\n",
start); start);
snooze(5000); snooze(5000);
if (!Lock()) if (!Lock())
@@ -500,8 +500,8 @@ MixerCore::_MixThread()
bigtime_t bufferRequestTimeout = buffer_duration( bigtime_t bufferRequestTimeout = buffer_duration(
fOutput->MediaOutput().format.u.raw_audio) / 2; fOutput->MediaOutput().format.u.raw_audio) / 2;
TRACE("MixerCore: starting _MixThread at %Ld with latency %Ld and " TRACE("MixerCore: starting _MixThread at %lld with latency %lld and "
"downstream latency %Ld, bufferRequestTimeout %Ld\n", start, "downstream latency %lld, bufferRequestTimeout %lld\n", start,
fEventLatency, fDownstreamLatency, bufferRequestTimeout); fEventLatency, fDownstreamLatency, bufferRequestTimeout);
// We must read from the input buffer at a position (pos) that is always // We must read from the input buffer at a position (pos) that is always
@@ -511,8 +511,8 @@ MixerCore::_MixThread()
* fMixBufferFrameCount; * fMixBufferFrameCount;
bigtime_t timeBase = duration_for_frames(fMixBufferFrameRate, frameBase); bigtime_t timeBase = duration_for_frames(fMixBufferFrameRate, frameBase);
TRACE("MixerCore: starting _MixThread, start %Ld, timeBase %Ld, " TRACE("MixerCore: starting _MixThread, start %lld, timeBase %lld, "
"frameBase %Ld\n", start, timeBase, frameBase); "frameBase %lld\n", start, timeBase, frameBase);
ASSERT(fMixBufferFrameCount > 0); ASSERT(fMixBufferFrameCount > 0);
@@ -570,7 +570,7 @@ MixerCore::_MixThread()
hdr->start_time = fEventTime; hdr->start_time = fEventTime;
if (fNode->SendBuffer(buffer, fOutput) != B_OK) { if (fNode->SendBuffer(buffer, fOutput) != B_OK) {
#if DEBUG #if DEBUG
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n", ERROR("MixerCore: SendBuffer failed for buffer %lld\n",
bufferIndex); bufferIndex);
#else #else
ERROR("MixerCore: SendBuffer failed\n"); ERROR("MixerCore: SendBuffer failed\n");
@@ -579,7 +579,7 @@ MixerCore::_MixThread()
} }
} else { } else {
#if DEBUG #if DEBUG
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n", ERROR("MixerCore: RequestBuffer failed for buffer %lld\n",
bufferIndex); bufferIndex);
#else #else
ERROR("MixerCore: RequestBuffer failed\n"); ERROR("MixerCore: RequestBuffer failed\n");
@@ -594,8 +594,8 @@ MixerCore::_MixThread()
// mix all data from all inputs into the mix buffer // mix all data from all inputs into the mix buffer
ASSERT(currentFramePos % fMixBufferFrameCount == 0); ASSERT(currentFramePos % fMixBufferFrameCount == 0);
PRINT(4, "create new buffer event at %Ld, reading input frames at " PRINT(4, "create new buffer event at %lld, reading input frames at "
"%Ld\n", fEventTime, currentFramePos); "%lld\n", fEventTime, currentFramePos);
// Init the channel information for each MixerInput. // Init the channel information for each MixerInput.
for (int i = 0; MixerInput* input = Input(i); i++) { for (int i = 0; MixerInput* input = Input(i); i++) {
@@ -706,7 +706,7 @@ MixerCore::_MixThread()
status_t res = fNode->SendBuffer(buffer, fOutput); status_t res = fNode->SendBuffer(buffer, fOutput);
if (res != B_OK) { if (res != B_OK) {
#if DEBUG #if DEBUG
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n", ERROR("MixerCore: SendBuffer failed for buffer %lld\n",
bufferIndex); bufferIndex);
#else #else
ERROR("MixerCore: SendBuffer failed\n"); ERROR("MixerCore: SendBuffer failed\n");
@@ -715,7 +715,7 @@ MixerCore::_MixThread()
} }
} else { } else {
#if DEBUG #if DEBUG
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n", ERROR("MixerCore: RequestBuffer failed for buffer %lld\n",
bufferIndex); bufferIndex);
#else #else
ERROR("MixerCore: RequestBuffer failed\n"); ERROR("MixerCore: RequestBuffer failed\n");
@@ -138,7 +138,7 @@ MixerInput::BufferReceived(BBuffer* buffer)
size / bytes_per_frame(fInput.format.u.raw_audio)); size / bytes_per_frame(fInput.format.u.raw_audio));
if (start < 0) { if (start < 0) {
ERROR("MixerInput::BufferReceived: buffer with negative start time of " ERROR("MixerInput::BufferReceived: buffer with negative start time of "
"%Ld dropped\n", start); "%lld dropped\n", start);
return; return;
} }
@@ -140,8 +140,8 @@ MixerInput::GetMixerChannelInfo(int mixerChannel, int64 framepos,
fDebugMixBufferFrames)) >= fLastDataAvailableTime) { fDebugMixBufferFrames)) >= fLastDataAvailableTime) {
// Print this error for the first channel only. // Print this error for the first channel only.
if (mixerChannel == 0) { if (mixerChannel == 0) {
ERROR("MixerInput::GetMixerChannelInfo: reading wrong data, have %Ld " ERROR("MixerInput::GetMixerChannelInfo: reading wrong data, have %lld "
"to %Ld, reading from %Ld to %Ld\n", "to %lld, reading from %lld to %lld\n",
fLastDataAvailableTime - duration_for_frames(fMixBufferFrameRate, fLastDataAvailableTime - duration_for_frames(fMixBufferFrameRate,
fMixBufferFrameCount), fLastDataAvailableTime, time, fMixBufferFrameCount), fLastDataAvailableTime, time,
time + duration_for_frames(fMixBufferFrameRate, time + duration_for_frames(fMixBufferFrameRate,
@@ -1194,7 +1194,7 @@ MultiAudioNode::_HandleBuffer(const media_timed_event* event,
else else
channel->fBuffer = buffer; channel->fBuffer = buffer;
} else { } else {
//PRINT(("MultiAudioNode::HandleBuffer writing channelId: %li, how_early:%Ld\n", channel->fChannelId, howEarly)); //PRINT(("MultiAudioNode::HandleBuffer writing channelId: %li, how_early:%lld\n", channel->fChannelId, howEarly));
channel->fBuffer = buffer; channel->fBuffer = buffer;
} }
} }
@@ -1799,8 +1799,8 @@ MultiAudioNode::_OutputThread()
fDevice->BufferExchange(&bufferInfo); fDevice->BufferExchange(&bufferInfo);
//PRINT(("MultiAudioNode::RunThread: buffer exchanged\n")); //PRINT(("MultiAudioNode::RunThread: buffer exchanged\n"));
//PRINT(("MultiAudioNode::RunThread: played_real_time: %Ld\n", bufferInfo.played_real_time)); //PRINT(("MultiAudioNode::RunThread: played_real_time: %lld\n", bufferInfo.played_real_time));
//PRINT(("MultiAudioNode::RunThread: played_frames_count: %Ld\n", bufferInfo.played_frames_count)); //PRINT(("MultiAudioNode::RunThread: played_frames_count: %lld\n", bufferInfo.played_frames_count));
//PRINT(("MultiAudioNode::RunThread: buffer_cycle: %li\n", bufferInfo.playback_buffer_cycle)); //PRINT(("MultiAudioNode::RunThread: buffer_cycle: %li\n", bufferInfo.playback_buffer_cycle));
for (int32 i = 0; i < fInputs.CountItems(); i++) { for (int32 i = 0; i < fInputs.CountItems(); i++) {
@@ -176,7 +176,7 @@ OpenSoundDeviceEngine::PlaybackLatency()
cardLatency = latency / 3; cardLatency = latency / 3;
} }
latency += cardLatency; latency += cardLatency;
// PRINT(("PlaybackLatency: odelay %d latency %Ld card %Ld\n", // PRINT(("PlaybackLatency: odelay %d latency %lld card %lld\n",
// fDriverBufferSize, latency, CardLatency())); // fDriverBufferSize, latency, CardLatency()));
return latency; return latency;
} }
@@ -327,7 +327,7 @@ OpenSoundDeviceEngine::GetCurrentIPtr(int32 *fifoed, oss_count_t *info)
* (fMediaFormat.AudioFormat() & media_raw_audio_format::B_AUDIO_SIZE_MASK)); * (fMediaFormat.AudioFormat() & media_raw_audio_format::B_AUDIO_SIZE_MASK));
info->fifo_samples = 0; info->fifo_samples = 0;
} }
PRINT(("OpenSoundDeviceEngine::%s: IPTR: { samples=%Ld, fifo_samples=%d }\n", __FUNCTION__, info->samples, info->fifo_samples)); PRINT(("OpenSoundDeviceEngine::%s: IPTR: { samples=%lld, fifo_samples=%d }\n", __FUNCTION__, info->samples, info->fifo_samples));
if (fifoed) if (fifoed)
*fifoed = info->fifo_samples; *fifoed = info->fifo_samples;
return info->samples; return info->samples;
@@ -365,7 +365,7 @@ OpenSoundDeviceEngine::GetCurrentOPtr(int32* fifoed, size_t* fragmentPos)
*fragmentPos = cinfo.ptr; *fragmentPos = cinfo.ptr;
} }
// PRINT(("OpenSoundDeviceEngine::%s: OPTR: { samples=%Ld, " // PRINT(("OpenSoundDeviceEngine::%s: OPTR: { samples=%lld, "
// "fifo_samples=%d }\n", __FUNCTION__, info->samples, // "fifo_samples=%d }\n", __FUNCTION__, info->samples,
// info->fifo_samples)); // info->fifo_samples));
if (fifoed != NULL) if (fifoed != NULL)
@@ -1233,10 +1233,10 @@ OpenSoundNode::Connect(status_t error, const media_source& source,
// Do so, then make sure we get our events early enough. // Do so, then make sure we get our events early enough.
media_node_id id; media_node_id id;
FindLatencyFor(channel->fOutput.destination, &fLatency, &id); FindLatencyFor(channel->fOutput.destination, &fLatency, &id);
TRACE("\tdownstream latency = %Ld\n", fLatency); TRACE("\tdownstream latency = %lld\n", fLatency);
fInternalLatency = BufferDuration(); fInternalLatency = BufferDuration();
TRACE("\tbuffer-filling took %Ld usec on this machine\n", TRACE("\tbuffer-filling took %lld usec on this machine\n",
fInternalLatency); fInternalLatency);
//SetEventLatency(fLatency + fInternalLatency); //SetEventLatency(fLatency + fInternalLatency);
@@ -950,7 +950,7 @@ VideoProducer::HandleStart(bigtime_t performance_time)
{ {
/* Start producing frames, even if the output hasn't been connected yet. */ /* Start producing frames, even if the output hasn't been connected yet. */
PRINTF(1, ("HandleStart(%Ld)\n", performance_time)); PRINTF(1, ("HandleStart(%lld)\n", performance_time));
if (fRunning) { if (fRunning) {
PRINTF(-1, ("HandleStart: Node already started\n")); PRINTF(-1, ("HandleStart: Node already started\n"));
@@ -108,7 +108,7 @@ CamStreamingDeframer::Write(const void *buffer, size_t size)
k = 0; k = 0;
while ((j = FindEOF(buf + k, bufsize - k, &which)) > -1) { while ((j = FindEOF(buf + k, bufsize - k, &which)) > -1) {
k += j; k += j;
//PRINT((CH "| EOF[%d] at offset %d; pos %Ld" CT, which, k, fCurrentFrame->Position())); //PRINT((CH "| EOF[%d] at offset %d; pos %lld" CT, which, k, fCurrentFrame->Position()));
if (fCurrentFrame->Position()+k >= fMinFrameSize) { if (fCurrentFrame->Position()+k >= fMinFrameSize) {
i = k; i = k;
break; break;
@@ -1006,7 +1006,7 @@ VideoProducer::FrameGenerator()
fStats[0].actual++;; fStats[0].actual++;;
fStats[0].stamp = system_time(); fStats[0].stamp = system_time();
//PRINTF(1, ("FrameGenerator: stamp %Ld vs %Ld\n", stamp, h->start_time)); //PRINTF(1, ("FrameGenerator: stamp %lld vs %lld\n", stamp, h->start_time));
//XXX: that's what we should be doing, but CodyCam drops all frames as they are late. (maybe add latency ??) //XXX: that's what we should be doing, but CodyCam drops all frames as they are late. (maybe add latency ??)
//h->start_time = TimeSource()->PerformanceTimeFor(stamp); //h->start_time = TimeSource()->PerformanceTimeFor(stamp);
h->start_time = TimeSource()->PerformanceTimeFor(system_time()); h->start_time = TimeSource()->PerformanceTimeFor(system_time());
@@ -340,7 +340,7 @@ VideoNode::HandleBuffer(BBuffer *buffer)
} else { } else {
memcpy(fBitmap->Bits(), buffer->Data(), fBitmap->BitsLength()); memcpy(fBitmap->Bits(), buffer->Data(), fBitmap->BitsLength());
} }
// printf("overlay copy: %Ld usec\n", system_time() - start); // printf("overlay copy: %lld usec\n", system_time() - start);
} }
UnlockBitmap(); UnlockBitmap();
@@ -167,11 +167,11 @@ TAPEReader::FindKeyFrame(void* cookie, uint32 flags, int64* frame,
if (flags & B_MEDIA_SEEK_TO_FRAME) { if (flags & B_MEDIA_SEEK_TO_FRAME) {
*time = *frame * 1000 / mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS) *time = *frame * 1000 / mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS)
* mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS); * mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS);
printf("FindKeyFrame for frame %Ld: %Ld\n", *frame, *time); printf("FindKeyFrame for frame %lld: %lld\n", *frame, *time);
} else if (flags & B_MEDIA_SEEK_TO_TIME) { } else if (flags & B_MEDIA_SEEK_TO_TIME) {
*frame = (*time) / 1000 * mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS) *frame = (*time) / 1000 * mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS)
/ mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS); / mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS);
printf("FindKeyFrame for time %Ld: %Ld\n", *time, *frame); printf("FindKeyFrame for time %lld: %lld\n", *time, *frame);
} else } else
return B_ERROR; return B_ERROR;
@@ -185,10 +185,10 @@ TAPEReader::Seek(void *cookie, uint32 flags, int64 *frame, bigtime_t *time)
int32 aNewBlock; int32 aNewBlock;
if (flags & B_MEDIA_SEEK_TO_FRAME) { if (flags & B_MEDIA_SEEK_TO_FRAME) {
printf("Seek to frame %Ld\n", *frame); printf("Seek to frame %lld\n", *frame);
aNewBlock = *frame; aNewBlock = *frame;
} else if (flags & B_MEDIA_SEEK_TO_TIME) { } else if (flags & B_MEDIA_SEEK_TO_TIME) {
printf("Seek for time %Ld\n", *time); printf("Seek for time %lld\n", *time);
aNewBlock = (*time) / 1000 * mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS) aNewBlock = (*time) / 1000 * mDecomp->GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS)
/ mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS); / mDecomp->GetInfo(APE_DECOMPRESS_LENGTH_MS);
} else } else
@@ -201,10 +201,10 @@ auReader::Sniff(int32 *streamCount)
fBufferSize = (BUFFER_SIZE / fBlockAlign) * fBlockAlign; fBufferSize = (BUFFER_SIZE / fBlockAlign) * fBlockAlign;
fBuffer = malloc(fBufferSize); fBuffer = malloc(fBufferSize);
TRACE(" fDataStart %Ld\n", fDataStart); TRACE(" fDataStart %lld\n", fDataStart);
TRACE(" fDataSize %Ld\n", fDataSize); TRACE(" fDataSize %lld\n", fDataSize);
TRACE(" fFrameCount %Ld\n", fFrameCount); TRACE(" fFrameCount %lld\n", fFrameCount);
TRACE(" fDuration %Ld\n", fDuration); TRACE(" fDuration %lld\n", fDuration);
TRACE(" fChannelCount %d\n", fChannelCount); TRACE(" fChannelCount %d\n", fChannelCount);
TRACE(" fFrameRate %ld\n", fFrameRate); TRACE(" fFrameRate %ld\n", fFrameRate);
TRACE(" fBitsPerSample %d\n", fBitsPerSample); TRACE(" fBitsPerSample %d\n", fBitsPerSample);
@@ -317,14 +317,14 @@ auReader::Seek(void *cookie,
else else
pos = (*frame * fDataSize) / fFrameCount; pos = (*frame * fDataSize) / fFrameCount;
pos = (pos / fBlockAlign) * fBlockAlign; // round down to a block start pos = (pos / fBlockAlign) * fBlockAlign; // round down to a block start
TRACE("auReader::Seek to frame %Ld, pos %Ld\n", *frame, pos); TRACE("auReader::Seek to frame %lld, pos %lld\n", *frame, pos);
} else if (seekTo & B_MEDIA_SEEK_TO_TIME) { } else if (seekTo & B_MEDIA_SEEK_TO_TIME) {
if (fRaw) if (fRaw)
pos = (*time * fFrameRate * fBitsPerFrame) / (1000000LL * 8); pos = (*time * fFrameRate * fBitsPerFrame) / (1000000LL * 8);
else else
pos = (*time * fDataSize) / fDuration; pos = (*time * fDataSize) / fDuration;
pos = (pos / fBlockAlign) * fBlockAlign; // round down to a block start pos = (pos / fBlockAlign) * fBlockAlign; // round down to a block start
TRACE("auReader::Seek to time %Ld, pos %Ld\n", *time, pos); TRACE("auReader::Seek to time %lld, pos %lld\n", *time, pos);
} else { } else {
return B_ERROR; return B_ERROR;
} }
@@ -335,11 +335,11 @@ auReader::Seek(void *cookie,
*frame = (pos * fFrameCount) / fDataSize; *frame = (pos * fFrameCount) / fDataSize;
*time = (*frame * 1000000LL) / fFrameRate; *time = (*frame * 1000000LL) / fFrameRate;
TRACE("auReader::Seek newtime %Ld\n", *time); TRACE("auReader::Seek newtime %lld\n", *time);
TRACE("auReader::Seek newframe %Ld\n", *frame); TRACE("auReader::Seek newframe %lld\n", *frame);
if (pos < 0 || pos > fDataSize) { if (pos < 0 || pos > fDataSize) {
TRACE("auReader::Seek invalid position %Ld\n", pos); TRACE("auReader::Seek invalid position %lld\n", pos);
return B_ERROR; return B_ERROR;
} }
@@ -141,7 +141,7 @@ AVCodecDecoder::~AVCodecDecoder()
#if DO_PROFILING #if DO_PROFILING
if (profileCounter > 0) { if (profileCounter > 0) {
printf("[%c] profile: d1 = %lld, d2 = %lld (%Ld)\n", printf("[%c] profile: d1 = %lld, d2 = %lld (%lld)\n",
fIsAudio?('a'):('v'), decodingTime / profileCounter, fIsAudio?('a'):('v'), decodingTime / profileCounter,
conversionTime / profileCounter, fFrame); conversionTime / profileCounter, fFrame);
} }
@@ -1305,7 +1305,7 @@ AVCodecDecoder::_DecodeNextVideoFrame()
conversionTime += doneTime - formatConversionStart; conversionTime += doneTime - formatConversionStart;
profileCounter++; profileCounter++;
if (!(fFrame % 5)) { if (!(fFrame % 5)) {
printf("[v] profile: d1 = %lld, d2 = %lld (%lld) required %Ld\n", printf("[v] profile: d1 = %lld, d2 = %lld (%lld) required %lld\n",
decodingTime / profileCounter, conversionTime / profileCounter, decodingTime / profileCounter, conversionTime / profileCounter,
fFrame, bigtime_t(1000000LL / fOutputFrameRate)); fFrame, bigtime_t(1000000LL / fOutputFrameRate));
decodingTime = 0; decodingTime = 0;
@@ -515,7 +515,7 @@ RawDecoder::Decode(void *buffer, int64 *frameCount,
if (fSwapOutput) if (fSwapOutput)
fSwapOutput(buffer, *frameCount * fInputFormat.u.raw_audio.channel_count); fSwapOutput(buffer, *frameCount * fInputFormat.u.raw_audio.channel_count);
TRACE("framecount %Ld, time %Ld\n",*frameCount, mediaHeader->start_time); TRACE("framecount %lld, time %lld\n",*frameCount, mediaHeader->start_time);
return *frameCount ? B_OK : B_ERROR; return *frameCount ? B_OK : B_ERROR;
} }
@@ -297,7 +297,7 @@ GIFTranslator::DerivedTranslate(BPositionIO* inSource,
if (debug) { if (debug) {
now = system_time() - now; now = system_time() - now;
syslog(LOG_INFO, "Translate() - Translation took %Ld microseconds\n", syslog(LOG_INFO, "Translate() - Translation took %lld microseconds\n",
now); now);
} }
return B_OK; return B_OK;
+6 -6
View File
@@ -404,7 +404,7 @@ status_t NodeGroup::setStartPosition(
Autolock _l(this); Autolock _l(this);
D_METHOD(( D_METHOD((
"NodeGroup::setStartPosition(%Ld)\n", start)); "NodeGroup::setStartPosition(%lld)\n", start));
if( if(
m_transportState == TRANSPORT_RUNNING || m_transportState == TRANSPORT_RUNNING ||
@@ -466,7 +466,7 @@ status_t NodeGroup::setEndPosition(
Autolock _l(this); Autolock _l(this);
D_METHOD(( D_METHOD((
"NodeGroup::setEndPosition(%Ld)\n", end)); "NodeGroup::setEndPosition(%lld)\n", end));
if( if(
m_transportState == TRANSPORT_RUNNING || m_transportState == TRANSPORT_RUNNING ||
@@ -1121,13 +1121,13 @@ status_t NodeGroup::_preroll() {
// strerror(err))); // strerror(err)));
// return; // return;
// } // }
//// PRINT(("- %Ld\n", latency)); //// PRINT(("- %lld\n", latency));
// //
// bigtime_t add; // bigtime_t add;
// err = BMediaRoster::Roster()->GetInitialLatencyFor( // err = BMediaRoster::Roster()->GetInitialLatencyFor(
// r->node(), // r->node(),
// &add); // &add);
//// PRINT(("- %Ld\n", add)); //// PRINT(("- %lld\n", add));
// if(err < B_OK) { // if(err < B_OK) {
// PRINT(( // PRINT((
// "* calcLatencyFn: GetInitialLatencyFor() failed: %s\n", // "* calcLatencyFn: GetInitialLatencyFor() failed: %s\n",
@@ -1140,7 +1140,7 @@ status_t NodeGroup::_preroll() {
// maxLatency = latency; // maxLatency = latency;
// //
//// PRINT(( //// PRINT((
//// "- max latency: %Ld\n", //// "- max latency: %lld\n",
//// maxLatency)); //// maxLatency));
// } // }
//}; //};
@@ -1482,7 +1482,7 @@ void NodeGroup::_cycleInit(
assert_locked(this); assert_locked(this);
ASSERT(m_cycleNodes.size() > 0); ASSERT(m_cycleNodes.size() > 0);
D_METHOD(( D_METHOD((
"NodeGroup::_cycleInit(%Ld)\n", "NodeGroup::_cycleInit(%lld)\n",
startTime)); startTime));
// +++++ rescan latencies? // +++++ rescan latencies?
+7 -7
View File
@@ -1693,7 +1693,7 @@ status_t NodeRef::_setRunMode(
assert_locked(this); assert_locked(this);
D_METHOD(( D_METHOD((
"NodeRef('%s')::_setRunMode(%ld : %Ld)\n", "NodeRef('%s')::_setRunMode(%ld : %lld)\n",
name(), runMode, delay)); name(), runMode, delay));
status_t err; status_t err;
@@ -1766,7 +1766,7 @@ status_t NodeRef::_preroll(
assert_locked(this); assert_locked(this);
D_METHOD(( D_METHOD((
"NodeRef('%s')::_preroll(%Ld)\n", "NodeRef('%s')::_preroll(%lld)\n",
name(), position)); name(), position));
status_t err; status_t err;
@@ -1867,7 +1867,7 @@ status_t NodeRef::_seekStopped(
assert_locked(this); assert_locked(this);
D_METHOD(( D_METHOD((
"NodeRef('%s')::_seekStopped(to %Ld)\n", "NodeRef('%s')::_seekStopped(to %lld)\n",
name(), position)); name(), position));
if(m_running) if(m_running)
@@ -1887,7 +1887,7 @@ status_t NodeRef::_start(
assert_locked(this); assert_locked(this);
D_METHOD(( D_METHOD((
"NodeRef('%s')::_start(at %Ld)\n", "NodeRef('%s')::_start(at %lld)\n",
name(), when)); name(), when));
if(isRunning()) { if(isRunning()) {
@@ -1978,7 +1978,7 @@ status_t NodeRef::_roll(
assert_locked(this); assert_locked(this);
D_METHOD(( D_METHOD((
"NodeRef('%s')::_roll(%Ld to %Ld, from %Ld)\n", "NodeRef('%s')::_roll(%lld to %lld, from %lld)\n",
name(), start, stop, position)); name(), start, stop, position));
status_t err; status_t err;
@@ -2224,8 +2224,8 @@ status_t NodeRef::_schedulePositionUpdate(
// //
//// PRINT(( //// PRINT((
//// "NodeRef::_schedulePositionUpdate():\n" //// "NodeRef::_schedulePositionUpdate():\n"
//// " when = %Ld\n" //// " when = %lld\n"
//// " position = %Ld\n", //// " position = %lld\n",
//// when, position)); //// when, position));
// //
// m_positionSyncThread->setPosition(position); // m_positionSyncThread->setPosition(position);
+1 -1
View File
@@ -168,7 +168,7 @@ status_t DormantNodeIO::instantiate(
// " kinds: %Lx\n" // " kinds: %Lx\n"
// " flags: %lx\n" // " flags: %lx\n"
// " runMode: %ld\n" // " runMode: %ld\n"
// " recDelay: %Ld\n" // " recDelay: %lld\n"
// " cycle: %s\n" // " cycle: %s\n"
// " entry: %s\n\n", // " entry: %s\n\n",
// m_nodeKey.String(), // m_nodeKey.String(),
@@ -232,7 +232,7 @@ NumericValControl::value() const
// ASSERT(digitSegment); // ASSERT(digitSegment);
// //
// PRINT(( // PRINT((
// "\t...segment %d: %d digits at %d: %Ld\n", // "\t...segment %d: %d digits at %d: %lld\n",
// n-1, // n-1,
// digitSegment->digitCount(), // digitSegment->digitCount(),
// digitSegment->scaleFactor(), // digitSegment->scaleFactor(),
@@ -288,7 +288,7 @@ NumericValControl::setValue(double value, bool setParam)
value = (double)fixed / scaleFactor; value = (double)fixed / scaleFactor;
// PRINT(( // PRINT((
// " -> %.12f, %Ld\n", value, fixed)); // " -> %.12f, %lld\n", value, fixed));
_SetValueFixed(fixed); _SetValueFixed(fixed);
@@ -373,7 +373,7 @@ NumericValControl::offsetSegmentValue(ValControlDigitSegment* segment,
{ {
// PRINT(( // PRINT((
// "### offsetSegmentValue(): %Ld\n", // "### offsetSegmentValue(): %lld\n",
// offset)); // offset));
int64 segmentFactor = (int64)pow(10, fFractionalDigits + segment->scaleFactor()); int64 segmentFactor = (int64)pow(10, fFractionalDigits + segment->scaleFactor());
@@ -566,7 +566,7 @@ NumericValControl::_ValueFixed() const {
ASSERT(digitSegment); ASSERT(digitSegment);
// PRINT(( // PRINT((
// "\t...segment %d: %d digits at %d: %Ld\n", // "\t...segment %d: %d digits at %d: %lld\n",
// n-1, // n-1,
// digitSegment->digitCount(), // digitSegment->digitCount(),
// digitSegment->scaleFactor(), // digitSegment->scaleFactor(),
@@ -576,7 +576,7 @@ NumericValControl::_ValueFixed() const {
scaleBase + digitSegment->scaleFactor()); scaleBase + digitSegment->scaleFactor());
// //
// PRINT(( // PRINT((
// "\t-> %Ld\n\n", acc)); // "\t-> %lld\n\n", acc));
} }
} }
@@ -590,7 +590,7 @@ void
NumericValControl::_SetValueFixed(int64 fixed) NumericValControl::_SetValueFixed(int64 fixed)
{ {
// PRINT(( // PRINT((
// "### NumericValControl::_SetValueFixed(%Ld)\n", fixed)); // "### NumericValControl::_SetValueFixed(%lld)\n", fixed));
// constrain // constrain
if (fixed > fMaxFixed) if (fixed > fMaxFixed)
@@ -621,14 +621,14 @@ NumericValControl::_SetValueFixed(int64 fixed)
scaleBase + digitSegment->scaleFactor() + digitSegment->digitCount()); scaleBase + digitSegment->scaleFactor() + digitSegment->digitCount());
// PRINT(( // PRINT((
// "\t [] %Ld\n", hiCut)); // "\t [] %lld\n", hiCut));
// shift value // shift value
int64 segmentValue = hiCut / (int64)pow(10, int64 segmentValue = hiCut / (int64)pow(10,
scaleBase + digitSegment->scaleFactor()); scaleBase + digitSegment->scaleFactor());
// PRINT(( // PRINT((
// "\t -> %Ld\n\n", segmentValue)); // "\t -> %lld\n\n", segmentValue));
digitSegment->setValue(segmentValue, fixed < 0); digitSegment->setValue(segmentValue, fixed < 0);
} }
@@ -130,7 +130,7 @@ void ValControlDigitSegment::setValue(
// int64 nLowPow = m_scaleFactor ? (int64)pow(10.0, abs(m_scaleFactor)) : 1; // int64 nLowPow = m_scaleFactor ? (int64)pow(10.0, abs(m_scaleFactor)) : 1;
// int64 nHighPow = (int64)pow(10.0, m_digitCount); // int64 nHighPow = (int64)pow(10.0, m_digitCount);
// //
//// printf(" lowPow %Ld, highPow %Ld\n", nLowPow, nHighPow); //// printf(" lowPow %lld, highPow %lld\n", nLowPow, nHighPow);
// //
// double dfTemp = bMult ? dfValue * nLowPow : dfValue / nLowPow; // double dfTemp = bMult ? dfValue * nLowPow : dfValue / nLowPow;
//// printf(" -> %.8lf\n", dfTemp); //// printf(" -> %.8lf\n", dfTemp);
@@ -149,9 +149,9 @@ void ValControlDigitSegment::setValue(
// else // else
// nLocal = (int64)dfTemp; // nLocal = (int64)dfTemp;
// //
//// printf(" -> %Ld\n", nLocal); //// printf(" -> %lld\n", nLocal);
// nLocal %= nHighPow; // nLocal %= nHighPow;
//// printf(" -> %Ld\n", nLocal); //// printf(" -> %lld\n", nLocal);
// //
// if(nLocal != m_value || m_negative != m_bWasNegative) { // if(nLocal != m_value || m_negative != m_bWasNegative) {
// m_value = nLocal; // m_value = nLocal;
@@ -495,7 +495,7 @@ void AudioFilterNode::BufferReceived(
// bigtime_t delta = now - m_tpLastReceived; // bigtime_t delta = now - m_tpLastReceived;
// m_tpLastReceived = now; // m_tpLastReceived = now;
// PRINT(( // PRINT((
// "### delta: %Ld (%Ld)\n", // "### delta: %lld (%lld)\n",
// delta, buffer->Header()->start_time - now)); // delta, buffer->Header()->start_time - now));
// fetch outbound buffer if needed // fetch outbound buffer if needed
@@ -781,7 +781,7 @@ void AudioFilterNode::Connect(
// //
// // figure processing time // // figure processing time
// m_processingLatency = calcProcessingLatency(); // m_processingLatency = calcProcessingLatency();
// PRINT(("\tprocessing latency = %Ld\n", m_processingLatency)); // PRINT(("\tprocessing latency = %lld\n", m_processingLatency));
// //
// // store summed latency // // store summed latency
// SetEventLatency(m_downstreamLatency + m_processingLatency); // SetEventLatency(m_downstreamLatency + m_processingLatency);
+4 -4
View File
@@ -250,7 +250,7 @@ ReplaceChange::Apply(off_t bufferOffset, uint8 *buffer, size_t bufferSize)
return; return;
#ifdef TRACE_DATA_EDITOR #ifdef TRACE_DATA_EDITOR
printf("Apply %p (buffer offset = %Ld):\n", this, bufferOffset); printf("Apply %p (buffer offset = %lld):\n", this, bufferOffset);
dump_block(buffer + offset - bufferOffset, size, "old:"); dump_block(buffer + offset - bufferOffset, size, "old:");
dump_block(fNewData + dataOffset, size, "new:"); dump_block(fNewData + dataOffset, size, "new:");
#endif #endif
@@ -279,7 +279,7 @@ ReplaceChange::Revert(off_t bufferOffset, uint8 *buffer, size_t bufferSize)
return; return;
#ifdef TRACE_DATA_EDITOR #ifdef TRACE_DATA_EDITOR
printf("Revert %p (buffer offset = %Ld):\n", this, bufferOffset); printf("Revert %p (buffer offset = %lld):\n", this, bufferOffset);
dump_block(buffer + offset - bufferOffset, size, "old:"); dump_block(buffer + offset - bufferOffset, size, "old:");
dump_block(fOldData + dataOffset, size, "new:"); dump_block(fOldData + dataOffset, size, "new:");
#endif #endif
@@ -303,7 +303,7 @@ ReplaceChange::Merge(DataChange *_change)
// in hex mode editing. // in hex mode editing.
fNewData[fSize - 1] = change->fNewData[0]; fNewData[fSize - 1] = change->fNewData[0];
#ifdef TRACE_DATA_EDITOR #ifdef TRACE_DATA_EDITOR
printf("Merge one byte %p (offset = %Ld, size = %lu):\n", this, fOffset, printf("Merge one byte %p (offset = %lld, size = %lu):\n", this, fOffset,
fSize); fSize);
dump_block(fOldData, fSize, "old:"); dump_block(fOldData, fSize, "old:");
dump_block(fNewData, fSize, "new:"); dump_block(fNewData, fSize, "new:");
@@ -349,7 +349,7 @@ ReplaceChange::Merge(DataChange *_change)
fSize = size; fSize = size;
#ifdef TRACE_DATA_EDITOR #ifdef TRACE_DATA_EDITOR
printf("Merge %p (offset = %Ld, size = %lu):\n", this, fOffset, fSize); printf("Merge %p (offset = %lld, size = %lu):\n", this, fOffset, fSize);
dump_block(fOldData, fSize, "old:"); dump_block(fOldData, fSize, "old:");
dump_block(fNewData, fSize, "new:"); dump_block(fNewData, fSize, "new:");
#endif #endif
+4 -4
View File
@@ -1520,7 +1520,7 @@ ProbeView::_UpdateSelectionMenuItems(int64 start, int64 end)
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Native: 0x%0*Lx"), snprintf(buffer, sizeof(buffer), B_TRANSLATE("Native: 0x%0*Lx"),
size * 2, position); size * 2, position);
} else { } else {
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Native: %Ld (0x%0*Lx)"), snprintf(buffer, sizeof(buffer), B_TRANSLATE("Native: %lld (0x%0*Lx)"),
position, size * 2, position); position, size * 2, position);
} }
@@ -1534,7 +1534,7 @@ ProbeView::_UpdateSelectionMenuItems(int64 start, int64 end)
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Swapped: 0x%0*Lx"), snprintf(buffer, sizeof(buffer), B_TRANSLATE("Swapped: 0x%0*Lx"),
size * 2, position); size * 2, position);
} else { } else {
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Swapped: %Ld (0x%0*Lx)"), snprintf(buffer, sizeof(buffer), B_TRANSLATE("Swapped: %lld (0x%0*Lx)"),
position, size * 2, position); position, size * 2, position);
} }
@@ -1562,7 +1562,7 @@ ProbeView::_UpdateBookmarkMenuItems()
if (fDataView->Base() == kHexBase) if (fDataView->Base() == kHexBase)
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block 0x%Lx"), block); snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block 0x%Lx"), block);
else else
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block %Ld (0x%Lx)"), block, block); snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block %lld (0x%Lx)"), block, block);
item->SetLabel(buffer); item->SetLabel(buffer);
} }
@@ -1602,7 +1602,7 @@ ProbeView::_AddBookmark(off_t position)
if (fDataView->Base() == kHexBase) if (fDataView->Base() == kHexBase)
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block 0x%Lx"), block); snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block 0x%Lx"), block);
else else
snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block %Ld (0x%Lx)"), block, block); snprintf(buffer, sizeof(buffer), B_TRANSLATE("Block %lld (0x%Lx)"), block, block);
BMessage* message; BMessage* message;
item = new BMenuItem(buffer, message = new BMessage(kMsgPositionUpdate)); item = new BMenuItem(buffer, message = new BMessage(kMsgPositionUpdate));
+1 -1
View File
@@ -689,7 +689,7 @@ NumberEditor::_Format(char *buffer)
return B_OK; return B_OK;
case B_INT64_TYPE: case B_INT64_TYPE:
case B_OFF_T_TYPE: case B_OFF_T_TYPE:
strcpy(buffer, "%Ld"); strcpy(buffer, "%lld");
return B_OK; return B_OK;
case B_UINT64_TYPE: case B_UINT64_TYPE:
strcpy(buffer, "%Lu"); strcpy(buffer, "%Lu");
@@ -98,9 +98,9 @@ void dbg_printf_end();
#endif #endif
#define DEBUG_THREAD find_thread(NULL) #define DEBUG_THREAD find_thread(NULL)
#define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] ", system_time(), DEBUG_THREAD); x; dbg_printf_end(); } #define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%lld: %5ld] ", system_time(), DEBUG_THREAD); x; dbg_printf_end(); }
#define DEBUG_CONTEXT_FUNCTION(prefix, x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] %s()" prefix, system_time(), DEBUG_THREAD, __FUNCTION__); x; dbg_printf_end(); } #define DEBUG_CONTEXT_FUNCTION(prefix, x) { dbg_printf_begin(); __out(DEBUG_APP ": [%lld: %5ld] %s()" prefix, system_time(), DEBUG_THREAD, __FUNCTION__); x; dbg_printf_end(); }
#define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] %s():%d: ", system_time(), DEBUG_THREAD, __FUNCTION__, __LINE__); x; dbg_printf_end(); } #define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%lld: %5ld] %s():%d: ", system_time(), DEBUG_THREAD, __FUNCTION__, __LINE__); x; dbg_printf_end(); }
#define TPRINT(x) DEBUG_CONTEXT( __out x ) #define TPRINT(x) DEBUG_CONTEXT( __out x )
#define TREPORT_ERROR(status) DEBUG_CONTEXT_LINE( __out("%s\n", strerror(status)) ) #define TREPORT_ERROR(status) DEBUG_CONTEXT_LINE( __out("%s\n", strerror(status)) )
@@ -620,7 +620,7 @@ NodeManager::_StartNodes()
print_error("error getting latency for video producer", print_error("error getting latency for video producer",
status); status);
} else } else
TRACE("video latency: %Ld\n", latency); TRACE("video latency: %lld\n", latency);
status = fMediaRoster->SetProducerRunModeDelay( status = fMediaRoster->SetProducerRunModeDelay(
fVideoConnection.producer, latency); fVideoConnection.producer, latency);
if (status < B_OK) { if (status < B_OK) {
@@ -643,7 +643,7 @@ NodeManager::_StartNodes()
bigtime_t audioLatency = 0; bigtime_t audioLatency = 0;
status = fMediaRoster->GetLatencyFor(fAudioConnection.producer, status = fMediaRoster->GetLatencyFor(fAudioConnection.producer,
&audioLatency); &audioLatency);
TRACE("audio latency: %Ld\n", audioLatency); TRACE("audio latency: %lld\n", audioLatency);
} }
BTimeSource* timeSource; BTimeSource* timeSource;
@@ -93,7 +93,7 @@ AudioAdapter::InitialLatency() const
status_t status_t
AudioAdapter::Read(void* buffer, int64 pos, int64 frames) AudioAdapter::Read(void* buffer, int64 pos, int64 frames)
{ {
TRACE("AudioAdapter::Read(%p, %Ld, %Ld)\n", buffer, pos, frames); TRACE("AudioAdapter::Read(%p, %lld, %lld)\n", buffer, pos, frames);
status_t error = InitCheck(); status_t error = InitCheck();
if (error != B_OK) if (error != B_OK)
return error; return error;
@@ -95,7 +95,7 @@ AudioChannelConverter::InitialLatency() const
status_t status_t
AudioChannelConverter::Read(void* outBuffer, int64 pos, int64 frames) AudioChannelConverter::Read(void* outBuffer, int64 pos, int64 frames)
{ {
TRACE("AudioChannelConverter::Read(%p, %Ld, %Ld)\n", outBuffer, pos, frames); TRACE("AudioChannelConverter::Read(%p, %lld, %lld)\n", outBuffer, pos, frames);
status_t error = InitCheck(); status_t error = InitCheck();
if (error != B_OK) if (error != B_OK)
return error; return error;
@@ -189,7 +189,7 @@ AudioFormatConverter::InitialLatency() const
status_t status_t
AudioFormatConverter::Read(void* buffer, int64 pos, int64 frames) AudioFormatConverter::Read(void* buffer, int64 pos, int64 frames)
{ {
TRACE("AudioFormatConverter::Read(%p, %Ld, %Ld)\n", buffer, pos, frames); TRACE("AudioFormatConverter::Read(%p, %lld, %lld)\n", buffer, pos, frames);
status_t error = InitCheck(); status_t error = InitCheck();
if (error != B_OK) { if (error != B_OK) {
TRACE("AudioFormatConverter::Read() done 1\n"); TRACE("AudioFormatConverter::Read() done 1\n");
@@ -109,7 +109,7 @@ AudioResampler::InitialLatency() const
status_t status_t
AudioResampler::Read(void* buffer, int64 pos, int64 frames) AudioResampler::Read(void* buffer, int64 pos, int64 frames)
{ {
TRACE("AudioResampler::Read(%p, %Ld, %Ld)\n", buffer, pos, frames); TRACE("AudioResampler::Read(%p, %lld, %lld)\n", buffer, pos, frames);
status_t error = InitCheck(); status_t error = InitCheck();
if (error != B_OK) { if (error != B_OK) {
@@ -555,7 +555,7 @@ void
VideoProducer::_HandleStart(bigtime_t performanceTime) VideoProducer::_HandleStart(bigtime_t performanceTime)
{ {
// Start producing frames, even if the output hasn't been connected yet. // Start producing frames, even if the output hasn't been connected yet.
TRACE("_HandleStart(%Ld)\n", performanceTime); TRACE("_HandleStart(%lld)\n", performanceTime);
if (fRunning) { if (fRunning) {
TRACE("_HandleStart: Node already started\n"); TRACE("_HandleStart: Node already started\n");
@@ -637,7 +637,7 @@ VideoProducer::_FrameGeneratorThread()
const int32 kMaxDroppedFrames = 15; const int32 kMaxDroppedFrames = 15;
bool running = true; bool running = true;
while (running) { while (running) {
TRACE("_FrameGeneratorThread: loop: %Ld\n", fFrame); TRACE("_FrameGeneratorThread: loop: %lld\n", fFrame);
// lock the node manager // lock the node manager
status_t err = fManager->LockWithTimeout(10000); status_t err = fManager->LockWithTimeout(10000);
bool ignoreEvent = false; bool ignoreEvent = false;
@@ -666,7 +666,7 @@ VideoProducer::_FrameGeneratorThread()
bool newPlayingState; bool newPlayingState;
playlistFrame = fManager->PlaylistFrameAtFrame(fFrame, playlistFrame = fManager->PlaylistFrameAtFrame(fFrame,
playingDirection, newPlayingState); playingDirection, newPlayingState);
TRACE("_FrameGeneratorThread: performance time: %Ld, " TRACE("_FrameGeneratorThread: performance time: %lld, "
"playlist frame: %lld\n", performanceTime, playlistFrame); "playlist frame: %lld\n", performanceTime, playlistFrame);
forceSendingBuffer |= newPlayingState; forceSendingBuffer |= newPlayingState;
fManager->SetCurrentVideoTime(nextPerformanceTime); fManager->SetCurrentVideoTime(nextPerformanceTime);
@@ -688,7 +688,7 @@ VideoProducer::_FrameGeneratorThread()
return B_OK; return B_OK;
} }
TRACE("_FrameGeneratorThread: waiting (%Ld)...\n", waitUntil); TRACE("_FrameGeneratorThread: waiting (%lld)...\n", waitUntil);
// wait until... // wait until...
err = acquire_sem_etc(fFrameSync, 1, B_ABSOLUTE_TIMEOUT, waitUntil); err = acquire_sem_etc(fFrameSync, 1, B_ABSOLUTE_TIMEOUT, waitUntil);
// The only acceptable responses are B_OK and B_TIMED_OUT. Everything // The only acceptable responses are B_OK and B_TIMED_OUT. Everything
@@ -755,8 +755,8 @@ VideoProducer::_FrameGeneratorThread()
h->u.raw_video.line_count h->u.raw_video.line_count
= fConnectedFormat.display.line_count; = fConnectedFormat.display.line_count;
// Fill in a frame // Fill in a frame
TRACE("_FrameGeneratorThread: frame: %Ld, " TRACE("_FrameGeneratorThread: frame: %lld, "
"playlistFrame: %Ld\n", fFrame, playlistFrame); "playlistFrame: %lld\n", fFrame, playlistFrame);
bool wasCached = false; bool wasCached = false;
err = fSupplier->FillBuffer(playlistFrame, err = fSupplier->FillBuffer(playlistFrame,
buffer->Data(), fConnectedFormat, forceSendingBuffer, buffer->Data(), fConnectedFormat, forceSendingBuffer,
+1 -1
View File
@@ -600,7 +600,7 @@ PackageInfo::Parse()
} }
swap_data(B_UINT64_TYPE, &size, sizeof(uint64), swap_data(B_UINT64_TYPE, &size, sizeof(uint64),
B_SWAP_BENDIAN_TO_HOST); B_SWAP_BENDIAN_TO_HOST);
parser_debug("DQSz - %Ld\n", size); parser_debug("DQSz - %lld\n", size);
} else if (!memcmp(buffer, "DQMi", 5)) { } else if (!memcmp(buffer, "DQMi", 5)) {
// TODO actually check if the query finds a file with // TODO actually check if the query finds a file with
// size found previously // size found previously
+1 -1
View File
@@ -88,7 +88,7 @@ ThreadBarMenu::AddNew()
k = fThreadsRecCount; // flag that the search didn't work. k = fThreadsRecCount; // flag that the search didn't work.
} }
if (k == fThreadsRecCount) { if (k == fThreadsRecCount) {
// printf("*** Thread %d %s/%s, user %Ld, kernel %Ld\n", info.thread, info.name, info.user_time, info.kernel_time); // printf("*** Thread %d %s/%s, user %lld, kernel %lld\n", info.thread, info.name, info.user_time, info.kernel_time);
// this is a new thread... // this is a new thread...
k = 0; k = 0;
while (k < fThreadsRecCount && !(fThreadsRec[k].thread == -1 || fThreadsRec[k].last_round+1 < fRound)) while (k < fThreadsRecCount && !(fThreadsRec[k].thread == -1 || fThreadsRec[k].last_round+1 < fRound))
+3 -3
View File
@@ -340,7 +340,7 @@ TrackSlider::_UpdatePosition(BPoint point)
Invoke(&msg); Invoke(&msg);
_RenderBitmap(); _RenderBitmap();
//printf("fLeftPos : %Ld\n", fLeftTime); //printf("fLeftPos : %lld\n", fLeftTime);
} else if (!fMainTracking && (fRightTracking } else if (!fMainTracking && (fRightTracking
|| ((point.x > fBitmapView->fPositionX+4) || ((point.x > fBitmapView->fPositionX+4)
&& rightRect.Contains(point)))) { && rightRect.Contains(point)))) {
@@ -369,7 +369,7 @@ TrackSlider::_UpdatePosition(BPoint point)
Invoke(&msg); Invoke(&msg);
_RenderBitmap(); _RenderBitmap();
//printf("fRightPos : %Ld\n", fRightTime); //printf("fRightPos : %lld\n", fRightTime);
} else { } else {
fBitmapView->fPositionX = MIN(MAX(point.x, 15), fBitmapView->fRight); fBitmapView->fPositionX = MIN(MAX(point.x, 15), fBitmapView->fRight);
fMainTime = (bigtime_t)(MAX(MIN((fBitmapView->fPositionX - 15) fMainTime = (bigtime_t)(MAX(MIN((fBitmapView->fPositionX - 15)
@@ -392,7 +392,7 @@ TrackSlider::_UpdatePosition(BPoint point)
} }
Invoke(&msg); Invoke(&msg);
//printf("fPosition : %Ld\n", fMainTime); //printf("fPosition : %lld\n", fMainTime);
} }
Draw(Bounds()); Draw(Bounds());
Flush(); Flush();
+1 -1
View File
@@ -374,7 +374,7 @@ VideoNode::HandleBuffer(BBuffer *buffer)
buffer->Data(), buffer->Data(),
fInput.format.u.raw_video.display.bytes_per_row); fInput.format.u.raw_video.display.bytes_per_row);
} }
// printf("overlay copy: %Ld usec\n", system_time() - start); // printf("overlay copy: %lld usec\n", system_time() - start);
} }
UnlockBitmap(); UnlockBitmap();
+6 -6
View File
@@ -46,18 +46,18 @@ int scan_device(const char *dev, off_t startBlock, off_t endBlock)
for (; block <= endBlock; block += group, at += len) { for (; block <= endBlock; block += group, at += len) {
int got; int got;
if (progress) if (progress)
fprintf(stderr, "checking block %Ld\x1b[1A\n", block); fprintf(stderr, "checking block %lld\x1b[1A\n", block);
got = pread(fd, buffer, len, at); got = pread(fd, buffer, len, at);
if (got == len) if (got == len)
continue; continue;
if (got >= 0) { if (got >= 0) {
if (verbose) if (verbose)
fprintf(stderr, "block %Ld (offset %Ld): got %d < %zd\n", fprintf(stderr, "block %lld (offset %lld): got %d < %zd\n",
block, at, got, len); block, at, got, len);
break; break;
} }
if (got < 0) { if (got < 0) {
fprintf(stderr, "block %Ld: error: %s\n", block, strerror(errno)); fprintf(stderr, "block %lld: error: %s\n", block, strerror(errno));
/* /*
if (errno != EIO && errno != ENXIO) { if (errno != EIO && errno != ENXIO) {
perror("pread"); perror("pread");
@@ -72,10 +72,10 @@ int scan_device(const char *dev, off_t startBlock, off_t endBlock)
continue; continue;
if (got < blockSize) { if (got < blockSize) {
if (got < 0) if (got < 0)
fprintf(stderr, "block %Ld: error: %s\n", block + i, strerror(errno)); fprintf(stderr, "block %lld: error: %s\n", block + i, strerror(errno));
else else
fprintf(stderr, "block %Ld: read %d bytes\n", block + i, got); fprintf(stderr, "block %lld: read %d bytes\n", block + i, got);
fprintf(outputFile, "%Ld\n", block + i); fprintf(outputFile, "%lld\n", block + i);
fflush(stdout); fflush(stdout);
} }
} }
+1 -1
View File
@@ -217,7 +217,7 @@ testBitmap(Disk& disk, const block_run& run)
return; return;
} }
printf("Block bitmap sees block %Ld as %s.\n", disk.ToBlock(run), printf("Block bitmap sees block %lld as %s.\n", disk.ToBlock(run),
bitmap.UsedAt(disk.ToBlock(run)) ? "used" : "free"); bitmap.UsedAt(disk.ToBlock(run)) ? "used" : "free");
} }
+3 -3
View File
@@ -154,7 +154,7 @@ checkIndexForNonExistingFiles(Disk &disk,BPlusTree &tree)
block_run run = disk.ToBlockRun(offset); block_run run = disk.ToBlockRun(offset);
if (!gHashtable.Contains(&run)) if (!gHashtable.Contains(&run))
{ {
printf(" inode at (%ld, %d), offset %Ld, doesn't exist!",run.allocation_group,run.start,offset); printf(" inode at (%ld, %d), offset %lld, doesn't exist!",run.allocation_group,run.start,offset);
switch (tree.Type()) switch (tree.Type())
{ {
case BPLUSTREE_STRING_TYPE: case BPLUSTREE_STRING_TYPE:
@@ -167,7 +167,7 @@ checkIndexForNonExistingFiles(Disk &disk,BPlusTree &tree)
printf(" (uint32 = %lu)",*(uint32 *)&name); printf(" (uint32 = %lu)",*(uint32 *)&name);
break; break;
case BPLUSTREE_INT64_TYPE: case BPLUSTREE_INT64_TYPE:
printf(" (int64 = %Ld)",*(int64 *)&name); printf(" (int64 = %lld)",*(int64 *)&name);
break; break;
case BPLUSTREE_UINT64_TYPE: case BPLUSTREE_UINT64_TYPE:
printf(" (uint64 = %Lu)",*(uint64 *)&name); printf(" (uint64 = %Lu)",*(uint64 *)&name);
@@ -335,7 +335,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
tree.Rewind(); tree.Rewind();
while (tree.GetNextEntry(name,&length,B_FILE_NAME_LENGTH,&offset) == B_OK) while (tree.GetNextEntry(name,&length,B_FILE_NAME_LENGTH,&offset) == B_OK)
{ {
//printf("search for = %ld, key = %ld -> value = %Ld (%ld, %d)\n",*(int32 *)&key,*(int32 *)&name,offset,disk.ToBlockRun(offset).allocation_group,disk.ToBlockRun(offset).start); //printf("search for = %ld, key = %ld -> value = %lld (%ld, %d)\n",*(int32 *)&key,*(int32 *)&name,offset,disk.ToBlockRun(offset).allocation_group,disk.ToBlockRun(offset).start);
if (keyLength == length && !memcmp(key,name,keyLength)) if (keyLength == length && !memcmp(key,name,keyLength))
{ {
duplicates = true; duplicates = true;
+4 -4
View File
@@ -165,7 +165,7 @@ Bitmap::BackupSet(Inode *inode, bool used)
// the attributes are ignored for now, because they will // the attributes are ignored for now, because they will
// be added anyway since all inodes from disk are collected. // be added anyway since all inodes from disk are collected.
// printf("a: %Ld\n",inode->Block()); // printf("a: %lld\n",inode->Block());
BackupSetAt(inode->Block(),used); BackupSetAt(inode->Block(),used);
// the data stream of symlinks is no real data stream // the data stream of symlinks is no real data stream
@@ -194,7 +194,7 @@ Bitmap::BackupSet(Inode *inode, bool used)
if (node->data.max_indirect_range == 0 || node->data.indirect.IsZero()) if (node->data.max_indirect_range == 0 || node->data.indirect.IsZero())
return; return;
// printf("c: %Ld\n",fDisk->ToBlock(node->data.indirect)); // printf("c: %lld\n",fDisk->ToBlock(node->data.indirect));
BackupSetAt(fDisk->ToBlock(node->data.indirect), used); BackupSetAt(fDisk->ToBlock(node->data.indirect), used);
DataStream *stream = dynamic_cast<DataStream *>(inode); DataStream *stream = dynamic_cast<DataStream *>(inode);
@@ -219,7 +219,7 @@ Bitmap::BackupSet(Inode *inode, bool used)
off_t start = fDisk->ToBlock(indirect[i]); off_t start = fDisk->ToBlock(indirect[i]);
off_t end = start + indirect[i].length; off_t end = start + indirect[i].length;
for (off_t block = start; block < end; block++) { for (off_t block = start; block < end; block++) {
// printf("d: %Ld\n", block); // printf("d: %lld\n", block);
if (!BackupSetAt(block, used)) if (!BackupSetAt(block, used))
break; break;
} }
@@ -232,7 +232,7 @@ Bitmap::BackupSet(Inode *inode, bool used)
|| node->data.double_indirect.IsZero()) || node->data.double_indirect.IsZero())
return; return;
// printf("e: %Ld\n",fDisk->ToBlock(node->data.double_indirect)); // printf("e: %lld\n",fDisk->ToBlock(node->data.double_indirect));
BackupSetAt(fDisk->ToBlock(node->data.double_indirect), used); BackupSetAt(fDisk->ToBlock(node->data.double_indirect), used);
// FIXME: to be implemented... // FIXME: to be implemented...
+9 -9
View File
@@ -698,7 +698,7 @@ DataStream::FindBlockRun(off_t pos)
int32 directSize = fDisk->BlockSize() * 4; int32 directSize = fDisk->BlockSize() * 4;
int32 index = start / indirectSize; int32 index = start / indirectSize;
//printf("\tstart = %Ld, indirectSize = %ld, directSize = %ld, index = %ld\n",start,indirectSize,directSize,index); //printf("\tstart = %lld, indirectSize = %ld, directSize = %ld, index = %ld\n",start,indirectSize,directSize,index);
//printf("\tlook for indirect block at %ld,%d\n",indirect[index].allocation_group,indirect[index].start); //printf("\tlook for indirect block at %ld,%d\n",indirect[index].allocation_group,indirect[index].start);
indirect = (block_run *)fDisk->ReadBlockRun(indirect[index]); indirect = (block_run *)fDisk->ReadBlockRun(indirect[index]);
if (indirect == NULL) if (indirect == NULL)
@@ -708,7 +708,7 @@ DataStream::FindBlockRun(off_t pos)
fRunFileOffset = fInode->data.max_indirect_range + (index * indirectSize) + (fCurrent * directSize); fRunFileOffset = fInode->data.max_indirect_range + (index * indirectSize) + (fCurrent * directSize);
fRunBlockEnd = fRunFileOffset + directSize; fRunBlockEnd = fRunFileOffset + directSize;
fRun = indirect[fCurrent]; fRun = indirect[fCurrent];
//printf("\tfCurrent = %ld, fRunFileOffset = %Ld, fRunBlockEnd = %Ld, fRun = %ld,%d\n",fCurrent,fRunFileOffset,fRunBlockEnd,fRun.allocation_group,fRun.start); //printf("\tfCurrent = %ld, fRunFileOffset = %lld, fRunBlockEnd = %lld, fRun = %ld,%d\n",fCurrent,fRunFileOffset,fRunBlockEnd,fRun.allocation_group,fRun.start);
} else { } else {
// access from indirect blocks // access from indirect blocks
@@ -738,7 +738,7 @@ DataStream::FindBlockRun(off_t pos)
fRun = indirect[fCurrent]; fRun = indirect[fCurrent];
//printf("reading from indirect block: %ld,%d\n",fRun.allocation_group,fRun.start); //printf("reading from indirect block: %ld,%d\n",fRun.allocation_group,fRun.start);
//printf("### indirect-run[%ld] = (%ld,%d,%d), offset = %Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset); //printf("### indirect-run[%ld] = (%ld,%d,%d), offset = %lld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
} }
} else { } else {
// access from direct blocks // access from direct blocks
@@ -761,7 +761,7 @@ DataStream::FindBlockRun(off_t pos)
return B_ERROR; return B_ERROR;
fRun = fInode->data.direct[fCurrent]; fRun = fInode->data.direct[fCurrent];
//printf("### run[%ld] = (%ld,%d,%d), offset = %Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset); //printf("### run[%ld] = (%ld,%d,%d), offset = %lld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
} }
return B_OK; return B_OK;
} }
@@ -772,7 +772,7 @@ DataStream::ReadAt(off_t pos, void *buffer, size_t size)
{ {
NodeGetter _(this); NodeGetter _(this);
//printf("DataStream::ReadAt(pos = %Ld,buffer = %p,size = %ld);\n",pos,buffer,size); //printf("DataStream::ReadAt(pos = %lld,buffer = %p,size = %ld);\n",pos,buffer,size);
// truncate size to read // truncate size to read
if (pos + (off_t)size > fInode->data.size) { if (pos + (off_t)size > fInode->data.size) {
if (pos > fInode->data.size) // reading outside the file if (pos > fInode->data.size) // reading outside the file
@@ -784,7 +784,7 @@ DataStream::ReadAt(off_t pos, void *buffer, size_t size)
} }
ssize_t read = 0; ssize_t read = 0;
//printf("### read %ld bytes at %Ld\n",size,pos); //printf("### read %ld bytes at %lld\n",size,pos);
while (size > 0) { while (size > 0) {
status_t status = FindBlockRun(pos); status_t status = FindBlockRun(pos);
if (status < B_OK) if (status < B_OK)
@@ -792,7 +792,7 @@ DataStream::ReadAt(off_t pos, void *buffer, size_t size)
ssize_t bytes = min_c((off_t)size, fRunBlockEnd - pos); ssize_t bytes = min_c((off_t)size, fRunBlockEnd - pos);
//printf("### read %ld bytes from %Ld\n### --\n",bytes,fDisk->ToOffset(fRun) + pos - fRunFileOffset); //printf("### read %ld bytes from %lld\n### --\n",bytes,fDisk->ToOffset(fRun) + pos - fRunFileOffset);
bytes = fDisk->ReadAt(fDisk->ToOffset(fRun) + pos - fRunFileOffset, bytes = fDisk->ReadAt(fDisk->ToOffset(fRun) + pos - fRunFileOffset,
buffer, bytes); buffer, bytes);
if (bytes <= 0) { if (bytes <= 0) {
@@ -831,7 +831,7 @@ DataStream::WriteAt(off_t pos, const void *buffer, size_t size)
} }
ssize_t written = 0; ssize_t written = 0;
//printf("### write %ld bytes at %Ld\n",size,pos); //printf("### write %ld bytes at %lld\n",size,pos);
while (size > 0) { while (size > 0) {
status_t status = FindBlockRun(pos); status_t status = FindBlockRun(pos);
if (status < B_OK) if (status < B_OK)
@@ -839,7 +839,7 @@ DataStream::WriteAt(off_t pos, const void *buffer, size_t size)
ssize_t bytes = min_c((off_t)size, fRunBlockEnd - pos); ssize_t bytes = min_c((off_t)size, fRunBlockEnd - pos);
//printf("### write %ld bytes to %Ld\n### --\n",bytes,fDisk->ToOffset(fRun) + pos - fRunFileOffset); //printf("### write %ld bytes to %lld\n### --\n",bytes,fDisk->ToOffset(fRun) + pos - fRunFileOffset);
bytes = fDisk->WriteAt(fDisk->ToOffset(fRun) + pos - fRunFileOffset,buffer,bytes); bytes = fDisk->WriteAt(fDisk->ToOffset(fRun) + pos - fRunFileOffset,buffer,bytes);
if (bytes < 0) if (bytes < 0)
return bytes; return bytes;
+1 -1
View File
@@ -233,7 +233,7 @@ collectInodes(Disk& disk, RunSet* set, InodeHashtable* hashTable, off_t start,
} }
//if ((offset % (disk.BlockSize() << disk.SuperBlock()->ag_shift)) == 0) //if ((offset % (disk.BlockSize() << disk.SuperBlock()->ag_shift)) == 0)
// printf("reading block %Ld, allocation group %Ld, %Ld inodes...\33[1A\n", offset / disk.BlockSize(),offset / (disk.BlockSize() << disk.SuperBlock()->ag_shift), count); // printf("reading block %lld, allocation group %lld, %lld inodes...\33[1A\n", offset / disk.BlockSize(),offset / (disk.BlockSize() << disk.SuperBlock()->ag_shift), count);
for (uint32 i = 0; i < sizeof(buffer); i += disk.BlockSize()) { for (uint32 i = 0; i < sizeof(buffer); i += disk.BlockSize()) {
inode.SetTo((bfs_inode *)(buffer + i)); inode.SetTo((bfs_inode *)(buffer + i));
+1 -1
View File
@@ -189,7 +189,7 @@
* Ooops, int64 doesn't exist, use long long instead. * Ooops, int64 doesn't exist, use long long instead.
* *
* Revision 1.79 2003/04/07 19:05:22 agmsmith * Revision 1.79 2003/04/07 19:05:22 agmsmith
* Now with Allen Brunson's atoll for PPC (you need the %Ld, but that * Now with Allen Brunson's atoll for PPC (you need the %lld, but that
* becomes %lld on other systems). * becomes %lld on other systems).
* *
* Revision 1.78 2003/04/04 22:43:53 agmsmith * Revision 1.78 2003/04/04 22:43:53 agmsmith
+2 -2
View File
@@ -572,11 +572,11 @@ BMessage::_PrintToStream(const char* indent) const
break; break;
case B_INT64_TYPE: case B_INT64_TYPE:
print_type<int64>("int64(0x%Lx or %Ld)\n", pointer); print_type<int64>("int64(0x%Lx or %lld)\n", pointer);
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
print_type<uint64>("uint64(0x%Lx or %Ld\n", pointer); print_type<uint64>("uint64(0x%Lx or %lld\n", pointer);
break; break;
case B_BOOL_TYPE: case B_BOOL_TYPE:
+2 -2
View File
@@ -684,11 +684,11 @@ BMessage::_PrintToStream(const char* indent) const
break; break;
case B_INT64_TYPE: case B_INT64_TYPE:
print_type<int64>("int64(0x%Lx or %Ld)\n", pointer); print_type<int64>("int64(0x%Lx or %lld)\n", pointer);
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
print_type<uint64>("uint64(0x%Lx or %Ld)\n", pointer); print_type<uint64>("uint64(0x%Lx or %lld)\n", pointer);
break; break;
case B_BOOL_TYPE: case B_BOOL_TYPE:
+1 -1
View File
@@ -388,7 +388,7 @@ BBufferConsumer::HandleMessage(int32 message, const void* data, size_t size)
buffer->SetHeader(&command->header); buffer->SetHeader(&command->header);
PRINT(4, "calling BBufferConsumer::BufferReceived buffer %ld " PRINT(4, "calling BBufferConsumer::BufferReceived buffer %ld "
"at perf %Ld and TimeSource()->Now() is %Ld\n", "at perf %lld and TimeSource()->Now() is %lld\n",
buffer->Header()->buffer, buffer->Header()->start_time, buffer->Header()->buffer, buffer->Header()->start_time,
TimeSource()->Now()); TimeSource()->Now());
+1 -1
View File
@@ -2912,7 +2912,7 @@ BMediaRoster::GetLatencyFor(const media_node& producer, bigtime_t* _latency)
*_latency = reply.latency; *_latency = reply.latency;
// printf("BMediaRoster::GetLatencyFor producer %ld has maximum latency %Ld\n", producer.node, *out_latency); // printf("BMediaRoster::GetLatencyFor producer %ld has maximum latency %lld\n", producer.node, *out_latency);
return B_OK; return B_OK;
} }
+2 -2
View File
@@ -657,13 +657,13 @@ SoundPlayNode::SendNewBuffer(const media_timed_event* event,
bigtime_t how_early = event->event_time - TimeSource()->Now() - fLatency - fInternalLatency; bigtime_t how_early = event->event_time - TimeSource()->Now() - fLatency - fInternalLatency;
if (how_early > 5000) { if (how_early > 5000) {
TRACE("SoundPlayNode::SendNewBuffer, event scheduled too early, how_early is %Ld\n", how_early); TRACE("SoundPlayNode::SendNewBuffer, event scheduled too early, how_early is %lld\n", how_early);
if (fTooEarlyCount++ == 5) { if (fTooEarlyCount++ == 5) {
fInternalLatency -= how_early; fInternalLatency -= how_early;
if (fInternalLatency < 500) if (fInternalLatency < 500)
fInternalLatency = 500; fInternalLatency = 500;
TRACE("SoundPlayNode::SendNewBuffer setting internal latency to %Ld\n", fInternalLatency); TRACE("SoundPlayNode::SendNewBuffer setting internal latency to %lld\n", fInternalLatency);
SetEventLatency(fLatency + fInternalLatency); SetEventLatency(fLatency + fInternalLatency);
fTooEarlyCount = 0; fTooEarlyCount = 0;
} }
+3 -3
View File
@@ -242,7 +242,7 @@ RunWhenIdleTask::RunIfNeeded(bigtime_t currentTime)
return false; return false;
fRunAfter = currentTime + fPeriod; fRunAfter = currentTime + fPeriod;
// PRINT(("runWhenIdle: runAfter %Ld, current time %Ld, period %Ld\n", // PRINT(("runWhenIdle: runAfter %lld, current time %lld, period %lld\n",
// fRunAfter, currentTime, fPeriod)); // fRunAfter, currentTime, fPeriod));
if (fState == kInitialDelay) { if (fState == kInitialDelay) {
@@ -290,7 +290,7 @@ RunWhenIdleTask::IsIdle(bigtime_t currentTime, float taskOverhead)
idle = false; idle = false;
} else if ((currentTime - fLastCPUTooBusyTime) < fIdleFor } else if ((currentTime - fLastCPUTooBusyTime) < fIdleFor
|| idle_time() < fIdleFor) { || idle_time() < fIdleFor) {
// PRINT(("load %f, not idle long enough %Ld, %Ld\n", load, // PRINT(("load %f, not idle long enough %lld, %lld\n", load,
// currentTime - fLastCPUTooBusyTime, // currentTime - fLastCPUTooBusyTime,
// idle_time())); // idle_time()));
idle = false; idle = false;
@@ -298,7 +298,7 @@ RunWhenIdleTask::IsIdle(bigtime_t currentTime, float taskOverhead)
#if xDEBUG #if xDEBUG
else else
PRINT(("load %f, idle for %Ld sec, go\n", load, PRINT(("load %f, idle for %lld sec, go\n", load,
(currentTime - fLastCPUTooBusyTime) / 1000000)); (currentTime - fLastCPUTooBusyTime) / 1000000));
#endif #endif
+2 -2
View File
@@ -238,11 +238,11 @@ IconSpewer::DrawSomeOld()
view->SetHighColor(0, 0, 0); view->SetHighColor(0, 0, 0);
char buffer[256]; char buffer[256];
if (cycleTime) { if (cycleTime) {
sprintf(buffer, "last cycle time %Ld ms", cycleTime/1000); sprintf(buffer, "last cycle time %lld ms", cycleTime/1000);
view->DrawString(buffer, BPoint(20, bounds.bottom - 20)); view->DrawString(buffer, BPoint(20, bounds.bottom - 20));
} }
if (numDrawn) { if (numDrawn) {
sprintf(buffer, "average draw time %Ld us per icon", sprintf(buffer, "average draw time %lld us per icon",
watch.ElapsedTime() / numDrawn); watch.ElapsedTime() / numDrawn);
view->DrawString(buffer, BPoint(20, bounds.bottom - 30)); view->DrawString(buffer, BPoint(20, bounds.bottom - 30));
} }
+1 -1
View File
@@ -518,7 +518,7 @@ inline void PrintDirToStream(const BDirectory*, const char* = 0) {}
if (logFile != 0) { \ if (logFile != 0) { \
thread_info info; \ thread_info info; \
get_thread_info(find_thread(NULL), &info); \ get_thread_info(find_thread(NULL), &info); \
PrintToLogFile("[t %Ld] \"%s\" (%s:%i) ", system_time(), \ PrintToLogFile("[t %lld] \"%s\" (%s:%i) ", system_time(), \
info.name, __FILE__, __LINE__); \ info.name, __FILE__, __LINE__); \
PrintToLogFile _ARGS_; \ PrintToLogFile _ARGS_; \
PrintToLogFile("\n"); \ PrintToLogFile("\n"); \
+1 -1
View File
@@ -109,7 +109,7 @@ TruncFileSizeBase(BString* outString, int64 value, const View* view,
"{0, plural, one{# byte} other{# bytes}}")); "{0, plural, one{# byte} other{# bytes}}"));
format.Format(buffer, value); format.Format(buffer, value);
if (view->StringWidth(buffer.String()) > width) if (view->StringWidth(buffer.String()) > width)
buffer.SetToFormat(B_TRANSLATE("%Ld B"), value); buffer.SetToFormat(B_TRANSLATE("%lld B"), value);
} else { } else {
const char* suffix; const char* suffix;
float doubleValue; float doubleValue;
+2 -2
View File
@@ -287,10 +287,10 @@ slower_sample:
#ifdef TRACE_CPU #ifdef TRACE_CPU
if (clockSpeed > 1000000000LL) { if (clockSpeed > 1000000000LL) {
dprintf("CPU at %Ld.%03Ld GHz\n", clockSpeed / 1000000000LL, dprintf("CPU at %lld.%03Ld GHz\n", clockSpeed / 1000000000LL,
(clockSpeed % 1000000000LL) / 1000000LL); (clockSpeed % 1000000000LL) / 1000000LL);
} else { } else {
dprintf("CPU at %Ld.%03Ld MHz\n", clockSpeed / 1000000LL, dprintf("CPU at %lld.%03Ld MHz\n", clockSpeed / 1000000LL,
(clockSpeed % 1000000LL) / 1000LL); (clockSpeed % 1000000LL) / 1000LL);
} }
#endif #endif
@@ -220,7 +220,7 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& offset)
if (indirect == NULL) if (indirect == NULL)
return B_ERROR; return B_ERROR;
//printf("\tstart = %Ld, indirectSize = %ld, directSize = %ld, index = %ld\n",start,indirectSize,directSize,index); //printf("\tstart = %lld, indirectSize = %ld, directSize = %ld, index = %ld\n",start,indirectSize,directSize,index);
//printf("\tlook for indirect block at %ld,%d\n",indirect[index].allocation_group,indirect[index].start); //printf("\tlook for indirect block at %ld,%d\n",indirect[index].allocation_group,indirect[index].start);
int32 current = (start % indirectSize) / directSize; int32 current = (start % indirectSize) / directSize;
@@ -233,7 +233,7 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& offset)
run = indirect[current % runsPerBlock]; run = indirect[current % runsPerBlock];
offset = data.MaxIndirectRange() + (index * indirectSize) offset = data.MaxIndirectRange() + (index * indirectSize)
+ (current * directSize); + (current * directSize);
//printf("\tfCurrent = %ld, fRunFileOffset = %Ld, fRunBlockEnd = %Ld, fRun = %ld,%d\n",fCurrent,fRunFileOffset,fRunBlockEnd,fRun.allocation_group,fRun.start); //printf("\tfCurrent = %ld, fRunFileOffset = %lld, fRunBlockEnd = %lld, fRun = %ld,%d\n",fCurrent,fRunFileOffset,fRunBlockEnd,fRun.allocation_group,fRun.start);
} else { } else {
// access to indirect blocks // access to indirect blocks
@@ -260,7 +260,7 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& offset)
offset = runBlockEnd offset = runBlockEnd
- ((uint32)run.Length() << cached.BlockShift()); - ((uint32)run.Length() << cached.BlockShift());
//printf("reading from indirect block: %ld,%d\n",fRun.allocation_group,fRun.start); //printf("reading from indirect block: %ld,%d\n",fRun.allocation_group,fRun.start);
//printf("### indirect-run[%ld] = (%ld,%d,%d), offset = %Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset); //printf("### indirect-run[%ld] = (%ld,%d,%d), offset = %lld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
return fVolume.ValidateBlockRun(run); return fVolume.ValidateBlockRun(run);
} }
} }
@@ -281,11 +281,11 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& offset)
if (runBlockEnd > pos) { if (runBlockEnd > pos) {
run = data.direct[current]; run = data.direct[current];
offset = runBlockEnd - ((uint32)run.Length() << fVolume.BlockShift()); offset = runBlockEnd - ((uint32)run.Length() << fVolume.BlockShift());
//printf("### run[%ld] = (%ld,%d,%d), offset = %Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset); //printf("### run[%ld] = (%ld,%d,%d), offset = %lld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
return fVolume.ValidateBlockRun(run); return fVolume.ValidateBlockRun(run);
} }
} }
//PRINT(("FindBlockRun() failed in direct range: size = %Ld, pos = %Ld\n",data.size,pos)); //PRINT(("FindBlockRun() failed in direct range: size = %lld, pos = %lld\n",data.size,pos));
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
return fVolume.ValidateBlockRun(run); return fVolume.ValidateBlockRun(run);
@@ -68,7 +68,7 @@ File::Close(void *cookie)
ssize_t ssize_t
File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
{ {
TRACE(("FATFS::File::%s(, %Ld,, %d)\n", __FUNCTION__, pos, bufferSize)); TRACE(("FATFS::File::%s(, %lld,, %d)\n", __FUNCTION__, pos, bufferSize));
status_t err; status_t err;
err = fStream.ReadAt(pos, buffer, &bufferSize); err = fStream.ReadAt(pos, buffer, &bufferSize);
if (err < B_OK) if (err < B_OK)
@@ -38,7 +38,7 @@ Stream::Stream(Volume &volume, uint32 chain, off_t size, const char *name)
fClusterMapCacheLast(0), fClusterMapCacheLast(0),
fSize(size) fSize(size)
{ {
TRACE(("FATFS::Stream::(, %d, %Ld, %s)\n", chain, size, name)); TRACE(("FATFS::Stream::(, %d, %lld, %s)\n", chain, size, name));
fName[FATFS_NAME_LENGTH] = '\0'; fName[FATFS_NAME_LENGTH] = '\0';
strlcpy(fName, name, FATFS_NAME_LENGTH+1); strlcpy(fName, name, FATFS_NAME_LENGTH+1);
fClusterCount = (fSize + fVolume.ClusterSize() - 1) / fVolume.ClusterSize(); fClusterCount = (fSize + fVolume.ClusterSize() - 1) / fVolume.ClusterSize();
@@ -109,7 +109,7 @@ Stream::GetFileMap(struct file_map_run *runs, int32 *count)
status_t status_t
Stream::_FindCluster(off_t pos, uint32& _cluster) Stream::_FindCluster(off_t pos, uint32& _cluster)
{ {
//TRACE(("FATFS::Stream::%s(%Ld,,)\n", __FUNCTION__, pos)); //TRACE(("FATFS::Stream::%s(%lld,,)\n", __FUNCTION__, pos));
uint32 index = (uint32)(pos / fVolume.ClusterSize()); uint32 index = (uint32)(pos / fVolume.ClusterSize());
if (pos > fSize || index >= fClusterCount) if (pos > fSize || index >= fClusterCount)
return B_BAD_VALUE; return B_BAD_VALUE;
@@ -234,7 +234,7 @@ Stream::FindBlock(off_t pos, off_t &block, off_t &offset)
status_t status_t
Stream::ReadAt(off_t pos, void *_buffer, size_t *_length, off_t *diskOffset) Stream::ReadAt(off_t pos, void *_buffer, size_t *_length, off_t *diskOffset)
{ {
TRACE(("FATFS::Stream::%s(%Ld, )\n", __FUNCTION__, pos)); TRACE(("FATFS::Stream::%s(%lld, )\n", __FUNCTION__, pos));
uint8* buffer = (uint8*)_buffer; uint8* buffer = (uint8*)_buffer;
+15 -15
View File
@@ -429,7 +429,7 @@ find_unique_check_sums(NodeList *devices)
disk.device.unknown.check_sums[i].offset = offset; disk.device.unknown.check_sums[i].offset = offset;
disk.device.unknown.check_sums[i].sum = compute_check_sum(drive, offset); disk.device.unknown.check_sums[i].sum = compute_check_sum(drive, offset);
TRACE(("disk %x, offset %Ld, sum %lu\n", drive->DriveID(), offset, TRACE(("disk %x, offset %lld, sum %lu\n", drive->DriveID(), offset,
disk.device.unknown.check_sums[i].sum)); disk.device.unknown.check_sums[i].sum));
} }
@@ -606,12 +606,12 @@ BlockHandle::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
ssize_t ret; ssize_t ret;
uint32 offset = pos % fBlockSize; uint32 offset = pos % fBlockSize;
pos /= fBlockSize; pos /= fBlockSize;
TRACE(("BlockHandle::%s: (%d) %Ld, %d\n", __FUNCTION__, fHandle, pos, bufferSize)); TRACE(("BlockHandle::%s: (%d) %lld, %d\n", __FUNCTION__, fHandle, pos, bufferSize));
uint32 blocksLeft = (bufferSize + offset + fBlockSize - 1) / fBlockSize; uint32 blocksLeft = (bufferSize + offset + fBlockSize - 1) / fBlockSize;
int32 totalBytesRead = 0; int32 totalBytesRead = 0;
//TRACE(("BIOS reads %lu bytes from %Ld (offset = %lu)\n", //TRACE(("BIOS reads %lu bytes from %lld (offset = %lu)\n",
// blocksLeft * fBlockSize, pos * fBlockSize, offset)); // blocksLeft * fBlockSize, pos * fBlockSize, offset));
// read partial block // read partial block
@@ -730,7 +730,7 @@ FloppyDrive::FloppyDrive(int handle)
TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE((" total sectors: %Ld\n", fParameters.sectors)); TRACE((" total sectors: %lld\n", fParameters.sectors));
fBlockSize = 512; fBlockSize = 512;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -744,7 +744,7 @@ FloppyDrive::FloppyDrive(int handle)
TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE(("total sectors: %Ld\n", fParameters.sectors)); TRACE(("total sectors: %lld\n", fParameters.sectors));
fBlockSize = fParameters.bytes_per_sector; fBlockSize = fParameters.bytes_per_sector;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -827,7 +827,7 @@ FloppyDrive::ReadBlocks(void *buffer, off_t first, int32 count)
int sectorsPerTrack = fParameters.sectors_per_track; int sectorsPerTrack = fParameters.sectors_per_track;
int heads = fParameters.heads; int heads = fParameters.heads;
int32 ret; int32 ret;
//TRACE(("FloppyDrive::%s(%Ld,%ld) (%d)\n", __FUNCTION__, first, count, fHandle)); //TRACE(("FloppyDrive::%s(%lld,%ld) (%d)\n", __FUNCTION__, first, count, fHandle));
// force single sector reads to avoid crossing track boundaries // force single sector reads to avoid crossing track boundaries
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
uint8 *buf = (uint8 *)buffer; uint8 *buf = (uint8 *)buffer;
@@ -901,7 +901,7 @@ BIOSDrive::BIOSDrive(int handle)
TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE((" total sectors: %Ld\n", fParameters.sectors)); TRACE((" total sectors: %lld\n", fParameters.sectors));
fBlockSize = 512; fBlockSize = 512;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -915,7 +915,7 @@ BIOSDrive::BIOSDrive(int handle)
TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE(("total sectors: %Ld\n", fParameters.sectors)); TRACE(("total sectors: %lld\n", fParameters.sectors));
fBlockSize = fParameters.bytes_per_sector; fBlockSize = fParameters.bytes_per_sector;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -978,7 +978,7 @@ BIOSDrive::ReadBlocks(void *buffer, off_t first, int32 count)
{ {
int sectorsPerBlocks = (fBlockSize / 256); int sectorsPerBlocks = (fBlockSize / 256);
int32 ret; int32 ret;
TRACE(("BIOSDrive::%s(%Ld,%ld) (%d)\n", __FUNCTION__, first, count, fHandle)); TRACE(("BIOSDrive::%s(%lld,%ld) (%d)\n", __FUNCTION__, first, count, fHandle));
// XXX: check for AHDI 3.0 before using long recno!!! // XXX: check for AHDI 3.0 before using long recno!!!
ret = Rwabs(RW_READ | RW_NOTRANSLATE, buffer, sectorsPerBlocks, -1, fHandle, first * sectorsPerBlocks); ret = Rwabs(RW_READ | RW_NOTRANSLATE, buffer, sectorsPerBlocks, -1, fHandle, first * sectorsPerBlocks);
if (ret < 0) if (ret < 0)
@@ -1043,7 +1043,7 @@ XHDIDrive::XHDIDrive(int handle, uint16 major, uint16 minor)
TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE((" total sectors: %Ld\n", fParameters.sectors)); TRACE((" total sectors: %lld\n", fParameters.sectors));
fBlockSize = 512; fBlockSize = 512;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -1057,7 +1057,7 @@ XHDIDrive::XHDIDrive(int handle, uint16 major, uint16 minor)
TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE(("total sectors: %Ld\n", fParameters.sectors)); TRACE(("total sectors: %lld\n", fParameters.sectors));
fBlockSize = fParameters.bytes_per_sector; fBlockSize = fParameters.bytes_per_sector;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -1105,7 +1105,7 @@ XHDIDrive::ReadBlocks(void *buffer, off_t first, int32 count)
int sectorsPerBlock = (fBlockSize / 256); int sectorsPerBlock = (fBlockSize / 256);
int32 ret; int32 ret;
uint16 flags = RW_READ; uint16 flags = RW_READ;
TRACE(("XHDIDrive::%s(%Ld, %d) (%d,%d)\n", __FUNCTION__, first, count, fMajor, fMinor)); TRACE(("XHDIDrive::%s(%lld, %d) (%d,%d)\n", __FUNCTION__, first, count, fMajor, fMinor));
ret = XHReadWrite(fMajor, fMinor, flags, (uint32)first, (uint16)count, buffer); ret = XHReadWrite(fMajor, fMinor, flags, (uint32)first, (uint16)count, buffer);
if (ret < 0) if (ret < 0)
return xhdierror(ret); return xhdierror(ret);
@@ -1181,7 +1181,7 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
add_block_devices(devicesList, true); add_block_devices(devicesList, true);
} }
TRACE(("boot drive size: %Ld bytes\n", drive->Size())); TRACE(("boot drive size: %lld bytes\n", drive->Size()));
gBootVolume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage); gBootVolume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage);
return B_OK; return B_OK;
@@ -1195,12 +1195,12 @@ platform_get_boot_partitions(struct stage2_args *args, Node *bootDevice,
BlockHandle *drive = static_cast<BlockHandle *>(bootDevice); BlockHandle *drive = static_cast<BlockHandle *>(bootDevice);
off_t offset = (off_t)gBootPartitionOffset * drive->BlockSize(); off_t offset = (off_t)gBootPartitionOffset * drive->BlockSize();
dprintf("boot partition offset: %Ld\n", offset); dprintf("boot partition offset: %lld\n", offset);
NodeIterator iterator = list->GetIterator(); NodeIterator iterator = list->GetIterator();
boot::Partition *partition = NULL; boot::Partition *partition = NULL;
while ((partition = (boot::Partition *)iterator.Next()) != NULL) { while ((partition = (boot::Partition *)iterator.Next()) != NULL) {
TRACE(("partition offset = %Ld, size = %Ld\n", partition->offset, partition->size)); TRACE(("partition offset = %lld, size = %lld\n", partition->offset, partition->size));
// search for the partition that contains the partition // search for the partition that contains the partition
// offset as reported by the BFS boot block // offset as reported by the BFS boot block
if (offset >= partition->offset if (offset >= partition->offset
@@ -502,7 +502,7 @@ find_unique_check_sums(NodeList *devices)
disk.device.unknown.check_sums[i].offset = offset; disk.device.unknown.check_sums[i].offset = offset;
disk.device.unknown.check_sums[i].sum = compute_check_sum(drive, offset); disk.device.unknown.check_sums[i].sum = compute_check_sum(drive, offset);
TRACE(("disk %x, offset %Ld, sum %lu\n", drive->DriveID(), offset, TRACE(("disk %x, offset %lld, sum %lu\n", drive->DriveID(), offset,
disk.device.unknown.check_sums[i].sum)); disk.device.unknown.check_sums[i].sum));
} }
@@ -587,7 +587,7 @@ BIOSDrive::BIOSDrive(uint8 driveID)
TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE((" cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE((" total sectors: %Ld\n", fParameters.sectors)); TRACE((" total sectors: %lld\n", fParameters.sectors));
fBlockSize = 512; fBlockSize = 512;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -601,7 +601,7 @@ BIOSDrive::BIOSDrive(uint8 driveID)
TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n", TRACE(("cylinders: %lu, heads: %lu, sectors: %lu, bytes_per_sector: %u\n",
fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track, fParameters.cylinders, fParameters.heads, fParameters.sectors_per_track,
fParameters.bytes_per_sector)); fParameters.bytes_per_sector));
TRACE(("total sectors: %Ld\n", fParameters.sectors)); TRACE(("total sectors: %lld\n", fParameters.sectors));
fBlockSize = fParameters.bytes_per_sector; fBlockSize = fParameters.bytes_per_sector;
fSize = fParameters.sectors * fBlockSize; fSize = fParameters.sectors * fBlockSize;
@@ -632,7 +632,7 @@ BIOSDrive::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
uint32 blocksLeft = (bufferSize + offset + fBlockSize - 1) / fBlockSize; uint32 blocksLeft = (bufferSize + offset + fBlockSize - 1) / fBlockSize;
int32 totalBytesRead = 0; int32 totalBytesRead = 0;
//TRACE(("BIOS reads %lu bytes from %Ld (offset = %lu), drive %u\n", //TRACE(("BIOS reads %lu bytes from %lld (offset = %lu), drive %u\n",
// blocksLeft * fBlockSize, pos * fBlockSize, offset, fDriveID)); // blocksLeft * fBlockSize, pos * fBlockSize, offset, fDriveID));
uint32 scratchSize = 24 * 1024 / fBlockSize; uint32 scratchSize = 24 * 1024 / fBlockSize;
@@ -713,7 +713,7 @@ BIOSDrive::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
} }
if (!readWorked) { if (!readWorked) {
dprintf("reading %ld bytes from drive %u failed at %Ld\n", dprintf("reading %ld bytes from drive %u failed at %lld\n",
blocksRead, fDriveID, pos); blocksRead, fDriveID, pos);
return B_ERROR; return B_ERROR;
} }
@@ -869,7 +869,7 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
add_block_devices(devicesList, true); add_block_devices(devicesList, true);
} }
TRACE(("boot drive size: %Ld bytes\n", drive->Size())); TRACE(("boot drive size: %lld bytes\n", drive->Size()));
gBootVolume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage); gBootVolume.SetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, gBootedFromImage);
return B_OK; return B_OK;
@@ -883,12 +883,12 @@ platform_get_boot_partitions(struct stage2_args *args, Node *bootDevice,
BIOSDrive *drive = static_cast<BIOSDrive *>(bootDevice); BIOSDrive *drive = static_cast<BIOSDrive *>(bootDevice);
off_t offset = (off_t)gBootPartitionOffset * drive->BlockSize(); off_t offset = (off_t)gBootPartitionOffset * drive->BlockSize();
dprintf("boot partition offset: %Ld\n", offset); dprintf("boot partition offset: %lld\n", offset);
NodeIterator iterator = list->GetIterator(); NodeIterator iterator = list->GetIterator();
boot::Partition *partition = NULL; boot::Partition *partition = NULL;
while ((partition = (boot::Partition *)iterator.Next()) != NULL) { while ((partition = (boot::Partition *)iterator.Next()) != NULL) {
TRACE(("partition offset = %Ld, size = %Ld\n", partition->offset, partition->size)); TRACE(("partition offset = %lld, size = %lld\n", partition->offset, partition->size));
// search for the partition that contains the partition // search for the partition that contains the partition
// offset as reported by the BFS boot block // offset as reported by the BFS boot block
if (offset >= partition->offset if (offset >= partition->offset
@@ -126,7 +126,7 @@ enumerate_cpus(void)
} }
gKernelArgs.arch_args.bus_frequency = busFrequency; gKernelArgs.arch_args.bus_frequency = busFrequency;
} }
TRACE((" bus clock frequency: %Ld\n", TRACE((" bus clock frequency: %lld\n",
gKernelArgs.arch_args.bus_frequency)); gKernelArgs.arch_args.bus_frequency));
#if 0 #if 0
+1 -1
View File
@@ -174,7 +174,7 @@ print_demangled_call(const char* image, const char* symbol, addr_t args,
case B_INT64_TYPE: case B_INT64_TYPE:
value = read_function_argument_value<int64>(arg, valueKnown); value = read_function_argument_value<int64>(arg, valueKnown);
if (valueKnown) if (valueKnown)
kprintf("int64: \33[34m%Ld\33[0m", value); kprintf("int64: \33[34m%lld\33[0m", value);
break; break;
case B_INT32_TYPE: case B_INT32_TYPE:
value = read_function_argument_value<int32>(arg, valueKnown); value = read_function_argument_value<int32>(arg, valueKnown);
+1 -1
View File
@@ -212,7 +212,7 @@ print_demangled_call(const char* image, const char* symbol, addr_t args,
case B_INT64_TYPE: case B_INT64_TYPE:
value = read_function_argument_value<int64>(arg, valueKnown); value = read_function_argument_value<int64>(arg, valueKnown);
if (valueKnown) if (valueKnown)
kprintf("int64: \33[34m%Ld\33[0m", value); kprintf("int64: \33[34m%lld\33[0m", value);
break; break;
case B_INT32_TYPE: case B_INT32_TYPE:
value = read_function_argument_value<int32>(arg, valueKnown); value = read_function_argument_value<int32>(arg, valueKnown);

Some files were not shown because too many files have changed in this diff Show More