Changed {,u}int64 to be long rather than long long on x86_64.

This commit is contained in:
Alex Smith 2012-06-28 12:36:45 +01:00
parent 0705884ac4
commit 294711f98c
15 changed files with 71 additions and 67 deletions

View File

@ -20,9 +20,13 @@ typedef signed short __haiku_std_int16;
typedef unsigned short __haiku_std_uint16;
typedef signed int __haiku_std_int32;
typedef unsigned int __haiku_std_uint32;
#ifdef __HAIKU_ARCH_64_BIT
typedef signed long __haiku_std_int64;
typedef unsigned long __haiku_std_uint64;
#else
typedef signed long long __haiku_std_int64;
typedef unsigned long long __haiku_std_uint64;
// TODO: on x86_64 these should be long
#endif
typedef __haiku_std_int8 __haiku_int8;
typedef __haiku_std_uint8 __haiku_uint8;
@ -43,16 +47,11 @@ typedef signed long int __haiku_saddr_t;
typedef unsigned long int __haiku_addr_t;
#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
# if __HAIKU_ARCH_64_BIT
typedef signed long int __haiku_phys_saddr_t;
typedef unsigned long int __haiku_phys_addr_t;
# else
typedef signed long long __haiku_phys_saddr_t;
typedef unsigned long long __haiku_phys_addr_t;
# endif
typedef __haiku_int64 __haiku_phys_saddr_t;
typedef __haiku_uint64 __haiku_phys_addr_t;
#else
typedef signed long int __haiku_phys_saddr_t;
typedef unsigned long int __haiku_phys_addr_t;
typedef __haiku_int32 __haiku_phys_saddr_t;
typedef __haiku_uint32 __haiku_phys_addr_t;
#endif
/* address type limits */
@ -77,21 +76,25 @@ typedef unsigned long int __haiku_addr_t;
/* printf()/scanf() format prefixes */
#define __HAIKU_STD_PRI_PREFIX_32 ""
#define __HAIKU_STD_PRI_PREFIX_64 "ll"
#ifdef __HAIKU_ARCH_64_BIT
# define __HAIKU_STD_PRI_PREFIX_64 "l"
#else
# define __HAIKU_STD_PRI_PREFIX_64 "ll"
#endif
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
# define __HAIKU_PRI_PREFIX_32 "l"
# define __HAIKU_PRI_PREFIX_32 "l"
#else
# define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32
# define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32
#endif
#define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64
#define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64
#define __HAIKU_PRI_PREFIX_ADDR "l"
#define __HAIKU_PRI_PREFIX_ADDR "l"
#if __HAIKU_ARCH_PHYSICAL_64_BIT && !__HAIKU_ARCH_64_BIT
# define __HAIKU_PRI_PREFIX_PHYS_ADDR "ll"
#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_64
#else
# define __HAIKU_PRI_PREFIX_PHYS_ADDR "l"
# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_32
#endif

View File

@ -91,7 +91,7 @@ cmd_expr(int argc, char **argv)
uint64 result;
if (evaluate_debug_expression(argv[1], &result, false)) {
kprintf("%llu (0x%llx)\n", result, result);
kprintf("%" B_PRIu64 " (0x%" B_PRIx64 ")\n", result, result);
set_debug_variable("_", result);
}
@ -291,8 +291,8 @@ cmd_wc(int argc, char** argv)
const char* line = argv[1];
if (line == NULL) {
// last run -- print results
kprintf("%10lld %10lld %10lld\n", userData->lines, userData->words,
userData->chars);
kprintf("%10" B_PRIu64 " %10" B_PRIu64 " %10" B_PRIu64 "\n",
userData->lines, userData->words, userData->chars);
return 0;
}

View File

@ -845,7 +845,7 @@ ExpressionParser::_ParseArgument(int& argc, char** argv)
fTokenizer.SetCommandMode(true);
_EatToken(TOKEN_CLOSING_PARENTHESIS);
snprintf(sTempBuffer, sizeof(sTempBuffer), "%llu", value);
snprintf(sTempBuffer, sizeof(sTempBuffer), "%" B_PRIu64, value);
_AddArgument(argc, argv, sTempBuffer);
return true;
}
@ -857,7 +857,7 @@ ExpressionParser::_ParseArgument(int& argc, char** argv)
uint64 value = _ParseCommandPipe(returnValue);
_EatToken(TOKEN_CLOSING_BRACKET);
snprintf(sTempBuffer, sizeof(sTempBuffer), "%llu", value);
snprintf(sTempBuffer, sizeof(sTempBuffer), "%" B_PRIu64, value);
_AddArgument(argc, argv, sTempBuffer);
return true;
}
@ -1050,7 +1050,7 @@ ExpressionParser::_ParseDereference(void** _address, uint32* _size)
if (size != 1 && size != 2 && size != 4 && size != 8) {
snprintf(sTempBuffer, sizeof(sTempBuffer),
"invalid size (%llu) for unary * operator", size);
"invalid size (%" B_PRIu64 ") for unary * operator", size);
parse_exception(sTempBuffer, position);
}

View File

@ -226,8 +226,8 @@ cmd_variables(int argc, char **argv)
for (int i = 0; i < kVariableCount; i++) {
Variable& variable = sVariables[i];
if (variable.IsUsed()) {
kprintf("%16s: %llu (0x%llx)\n", variable.name, variable.value,
variable.value);
kprintf("%16s: %" B_PRIu64 " (0x%" B_PRIx64 ")\n", variable.name,
variable.value, variable.value);
}
}
@ -235,8 +235,8 @@ cmd_variables(int argc, char **argv)
for (int i = 0; i < kTemporaryVariableCount; i++) {
Variable& variable = sTemporaryVariables[i];
if (variable.IsUsed()) {
kprintf("%16s: %llu (0x%llx)\n", variable.name, variable.value,
variable.value);
kprintf("%16s: %" B_PRIu64 " (0x%" B_PRIx64 ")\n", variable.name,
variable.value, variable.value);
}
}

View File

@ -806,9 +806,10 @@ AbstractTraceEntry::Dump(TraceOutput& out)
: fTime;
if (out.Flags() & TRACE_OUTPUT_TEAM_ID)
out.Print("[%6" B_PRId32 ":%6" B_PRId32 "] %10Ld: ", fThread, fTeam, time);
out.Print("[%6" B_PRId32 ":%6" B_PRId32 "] %10" B_PRId64 ": ", fThread,
fTeam, time);
else
out.Print("[%6" B_PRId32 "] %10Ld: ", fThread, time);
out.Print("[%6" B_PRId32 "] %10" B_PRId64 ": ", fThread, time);
AddDump(out);
@ -994,7 +995,7 @@ public:
{
// TODO: this is *very* slow
char buffer[64];
snprintf(buffer, sizeof(buffer), "%Ld", fValue);
snprintf(buffer, sizeof(buffer), "%" B_PRId64, fValue);
return strstr(out.DumpEntry(entry), buffer) != NULL;
}
};
@ -1005,7 +1006,7 @@ public:
{
// TODO: this is *very* slow
char buffer[64];
snprintf(buffer, sizeof(buffer), "%Lx", fValue);
snprintf(buffer, sizeof(buffer), "%" B_PRIx64, fValue);
return strstr(out.DumpEntry(entry), buffer) != NULL;
}
};

View File

@ -664,8 +664,8 @@ IOOperation::Dump() const
kprintf(" parent: %p\n", fParent);
kprintf(" status: %s\n", strerror(fStatus));
kprintf(" dma buffer: %p\n", fDMABuffer);
kprintf(" offset: %-8Ld (original: %Ld)\n", fOffset,
fOriginalOffset);
kprintf(" offset: %-8" B_PRIdOFF " (original: %" B_PRIdOFF ")\n",
fOffset, fOriginalOffset);
kprintf(" length: %-8" B_PRIuGENADDR " (original: %"
B_PRIuGENADDR ")\n", fLength, fOriginalLength);
kprintf(" transferred: %" B_PRIuGENADDR "\n", fTransferredBytes);
@ -1162,8 +1162,8 @@ IORequest::_CopyData(void* _buffer, off_t offset, size_t size, bool copyIn)
uint8* buffer = (uint8*)_buffer;
if (offset < fOffset || offset + (off_t)size > fOffset + (off_t)fLength) {
panic("IORequest::_CopyData(): invalid range: (%lld, %lu)", offset,
size);
panic("IORequest::_CopyData(): invalid range: (%" B_PRIdOFF ", %lu)",
offset, size);
return B_BAD_VALUE;
}
@ -1281,7 +1281,7 @@ IORequest::Dump() const
kprintf(" status: %s\n", strerror(fStatus));
kprintf(" mutex: %p\n", &fLock);
kprintf(" IOBuffer: %p\n", fBuffer);
kprintf(" offset: %Ld\n", fOffset);
kprintf(" offset: %" B_PRIdOFF "\n", fOffset);
kprintf(" length: %" B_PRIuGENADDR "\n", fLength);
kprintf(" transfer size: %" B_PRIuGENADDR "\n", fTransferSize);
kprintf(" relative offset: %" B_PRIuGENADDR "\n", fRelativeParentOffset);

View File

@ -802,7 +802,7 @@ dump_node(int argc, char** argv)
}
kprintf("DEVFS NODE: %p\n", vnode);
kprintf(" id: %Ld\n", vnode->id);
kprintf(" id: %" B_PRIdINO "\n", vnode->id);
kprintf(" name: \"%s\"\n", vnode->name);
kprintf(" type: %x\n", vnode->stream.type);
kprintf(" parent: %p\n", vnode->parent);
@ -814,7 +814,7 @@ dump_node(int argc, char** argv)
devfs_vnode* children = vnode->stream.u.dir.dir_head;
while (children != NULL) {
kprintf(" %p, id %Ld\n", children, children->id);
kprintf(" %p, id %" B_PRIdINO "\n", children, children->id);
children = children->dir_next;
}
} else if (S_ISLNK(vnode->stream.type)) {
@ -826,8 +826,8 @@ dump_node(int argc, char** argv)
partition_info& info = vnode->stream.u.dev.partition->info;
kprintf(" raw device node: %p\n",
vnode->stream.u.dev.partition->raw_device);
kprintf(" offset: %Ld\n", info.offset);
kprintf(" size: %Ld\n", info.size);
kprintf(" offset: %" B_PRIdOFF "\n", info.offset);
kprintf(" size: %" B_PRIdOFF "\n", info.size);
kprintf(" block size: %" B_PRId32 "\n", info.logical_block_size);
kprintf(" session: %" B_PRId32 "\n", info.session);
kprintf(" partition: %" B_PRId32 "\n", info.partition);

View File

@ -664,7 +664,7 @@ load_driver_symbols(const char *driverName)
static status_t
reload_driver(legacy_driver *driver)
{
dprintf("devfs: reload driver \"%s\" (%" B_PRIdDEV ", %lld)\n",
dprintf("devfs: reload driver \"%s\" (%" B_PRIdDEV ", %" B_PRIdINO ")\n",
driver->name, driver->device, driver->node);
unload_driver(driver);
@ -827,7 +827,7 @@ dump_driver(legacy_driver* driver)
kprintf(" path: %s\n", driver->path);
kprintf(" image: %" B_PRId32 "\n", driver->image);
kprintf(" device: %" B_PRIdDEV "\n", driver->device);
kprintf(" node: %Ld\n", driver->node);
kprintf(" node: %" B_PRIdINO "\n", driver->node);
kprintf(" last modified: %" B_PRIdTIME ".%ld\n", driver->last_modified.tv_sec,
driver->last_modified.tv_nsec);
kprintf(" devs used: %" B_PRIu32 "\n", driver->devices_used);

View File

@ -1303,10 +1303,10 @@ KPartition::Dump(bool deep, int32 level)
GetPath(&path);
if (level > 0)
OUT("%spartition %" B_PRId32 ": %s\n", prefix, ID(), path.Path());
OUT("%s offset: %lld\n", prefix, Offset());
OUT("%s size: %lld (%.2f MB)\n", prefix, Size(),
OUT("%s offset: %" B_PRIdOFF "\n", prefix, Offset());
OUT("%s size: %" B_PRIdOFF " (%.2f MB)\n", prefix, Size(),
Size() / (1024.0*1024));
OUT("%s content size: %lld\n", prefix, ContentSize());
OUT("%s content size: %" B_PRIdOFF "\n", prefix, ContentSize());
OUT("%s block size: %" B_PRIu32 "\n", prefix, BlockSize());
OUT("%s child count: %" B_PRId32 "\n", prefix, CountChildren());
OUT("%s index: %" B_PRId32 "\n", prefix, Index());

View File

@ -80,9 +80,9 @@ dump_int_statistics(int argc, char **argv)
&& sVectors[i].handler_list == NULL)
continue;
kprintf("int %3d, enabled %" B_PRId32 ", handled %8lld, unhandled %8lld%s%s\n",
i, sVectors[i].enable_count, sVectors[i].handled_count,
sVectors[i].unhandled_count,
kprintf("int %3d, enabled %" B_PRId32 ", handled %8" B_PRId64 ", "
"unhandled %8" B_PRId64 "%s%s\n", i, sVectors[i].enable_count,
sVectors[i].handled_count,sVectors[i].unhandled_count,
B_SPINLOCK_IS_LOCKED(&sVectors[i].vector_lock) ? ", ACTIVE" : "",
sVectors[i].handler_list == NULL ? ", no handler" : "");
@ -106,7 +106,7 @@ dump_int_statistics(int argc, char **argv)
if (io->no_handled_info)
kprintf("<unknown>\n");
else
kprintf("%8lld\n", io->handled_count);
kprintf("%8" B_PRId64 "\n", io->handled_count);
}
kprintf("\n");

View File

@ -84,8 +84,8 @@ rtc_debug(int argc, char **argv)
= arch_rtc_get_system_time_offset(sRealTimeData);
currentTime = (systemTimeOffset + system_time()) / 1000000;
dprintf("system_time: %Ld\n", system_time());
dprintf("system_time_offset: %Ld\n", systemTimeOffset);
dprintf("system_time: %" B_PRId64 "\n", system_time());
dprintf("system_time_offset: %" B_PRId64 "\n", systemTimeOffset);
dprintf("current_time: %" B_PRIu32 "\n", currentTime);
} else {
// If there was an argument, reset the system and hw time.

View File

@ -1685,11 +1685,11 @@ _dump_thread_info(Thread *thread, bool shortInfo)
kprintf("(%d)\n", thread->cpu->cpu_num);
else
kprintf("\n");
kprintf("sig_pending: %#llx (blocked: %#llx"
", before sigsuspend(): %#llx)\n",
(long long)thread->ThreadPendingSignals(),
(long long)thread->sig_block_mask,
(long long)thread->sigsuspend_original_unblocked_mask);
kprintf("sig_pending: %#" B_PRIx64 " (blocked: %#" B_PRIx64
", before sigsuspend(): %#" B_PRIx64 ")\n",
(int64)thread->ThreadPendingSignals(),
(int64)thread->sig_block_mask,
(int64)thread->sigsuspend_original_unblocked_mask);
kprintf("in_kernel: %d\n", thread->in_kernel);
if (thread->state == B_THREAD_WAITING) {
@ -1756,8 +1756,8 @@ _dump_thread_info(Thread *thread, bool shortInfo)
kprintf("user_thread: %p\n", (void *)thread->user_thread);
kprintf("kernel_errno: %#x (%s)\n", thread->kernel_errno,
strerror(thread->kernel_errno));
kprintf("kernel_time: %Ld\n", thread->kernel_time);
kprintf("user_time: %Ld\n", thread->user_time);
kprintf("kernel_time: %" B_PRId64 "\n", thread->kernel_time);
kprintf("user_time: %" B_PRId64 "\n", thread->user_time);
kprintf("flags: 0x%" B_PRIx32 "\n", thread->flags);
kprintf("architecture dependant section:\n");
arch_thread_dump_info(&thread->arch_info);

View File

@ -999,8 +999,8 @@ VMAnonymousCache::_Commit(off_t size, int priority)
off_t toReserve = size - committed_size;
if (vm_try_reserve_memory(toReserve, priority, 1000000) != B_OK) {
dprintf("%p->VMAnonymousCache::_Commit(%lld): Failed to reserve %lld "
"bytes of RAM\n", this, size, toReserve);
dprintf("%p->VMAnonymousCache::_Commit(%" B_PRIdOFF "): Failed to "
"reserve %" B_PRIdOFF " bytes of RAM\n", this, size, toReserve);
return B_NO_MEMORY;
}
@ -1370,8 +1370,8 @@ swap_init_post_modules()
status_t error = _kern_write_stat(fd, NULL, false, &stat,
sizeof(struct stat), B_STAT_SIZE | B_STAT_SIZE_INSECURE);
if (error != B_OK) {
dprintf("Failed to resize /var/swap to %lld bytes: %s\n", size,
strerror(error));
dprintf("Failed to resize /var/swap to %" B_PRIdOFF " bytes: %s\n",
size, strerror(error));
}
close(fd);

View File

@ -1328,8 +1328,8 @@ VMCache::Dump(bool showPages) const
kprintf(" ref_count: %" B_PRId32 "\n", RefCount());
kprintf(" source: %p\n", source);
kprintf(" type: %s\n", vm_cache_type_to_string(type));
kprintf(" virtual_base: 0x%Lx\n", virtual_base);
kprintf(" virtual_end: 0x%Lx\n", virtual_end);
kprintf(" virtual_base: 0x%" B_PRIx64 "\n", virtual_base);
kprintf(" virtual_end: 0x%" B_PRIx64 "\n", virtual_end);
kprintf(" temporary: %" B_PRIu32 "\n", temporary);
kprintf(" lock: %p\n", &fLock);
#if KDEBUG

View File

@ -3114,7 +3114,7 @@ dump_caches_recursively(VMCache* cache, cache_info& info, int level)
kprintf("/%lu", info.page_count);
if (cache->type == CACHE_TYPE_RAM || (level == 0 && info.committed > 0)) {
kprintf(", committed: %lld", cache->committed_size);
kprintf(", committed: %" B_PRIdOFF, cache->committed_size);
if (level == 0)
kprintf("/%lu", info.committed);
@ -3267,7 +3267,7 @@ dump_area_struct(VMArea* area, bool mappings)
kprintf("memory_type:\t%#" B_PRIx32 "\n", area->MemoryType());
kprintf("cache:\t\t%p\n", area->cache);
kprintf("cache_type:\t%s\n", vm_cache_type_to_string(area->cache_type));
kprintf("cache_offset:\t0x%Lx\n", area->cache_offset);
kprintf("cache_offset:\t0x%" B_PRIx64 "\n", area->cache_offset);
kprintf("cache_next:\t%p\n", area->cache_next);
kprintf("cache_prev:\t%p\n", area->cache_prev);