Changeset fb6f1a5 in mainline for uspace/srv


Ignore:
Timestamp:
2010-01-27T21:44:52Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ccafee
Parents:
b79d450
Message:

Implement some of C99 inttypes.h header (formatting macros for stdint.h). Use in appropriate places. Also replace use of 0x%lx with %p.

Location:
uspace/srv
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/ata_bd/ata_bd.c

    rb79d450 rfb6f1a5  
    5959#include <devmap.h>
    6060#include <sys/types.h>
     61#include <inttypes.h>
    6162#include <errno.h>
    6263#include <bool.h>
     
    112113        printf(NAME ": ATA disk driver\n");
    113114
    114         printf("I/O address 0x%p/0x%p\n", ctl_physical, cmd_physical);
     115        printf("I/O address %p/%p\n", ctl_physical, cmd_physical);
    115116
    116117        if (ata_bd_init() != EOK)
     
    180181        }
    181182
    182         printf(" %llu blocks", d->blocks, d->blocks / (2 * 1024));
     183        printf(" %" PRIu64 " blocks", d->blocks, d->blocks / (2 * 1024));
    183184
    184185        mbytes = d->blocks / (2 * 1024);
    185186        if (mbytes > 0)
    186                 printf(" %llu MB.", mbytes);
     187                printf(" %" PRIu64 " MB.", mbytes);
    187188
    188189        printf("\n");
  • uspace/srv/bd/part/guid_part/guid_part.c

    rb79d450 rfb6f1a5  
    5454#include <devmap.h>
    5555#include <sys/types.h>
     56#include <inttypes.h>
    5657#include <libblock.h>
    5758#include <devmap.h>
     
    196197                size_mb = (part->length * block_size + 1024 * 1024 - 1)
    197198                    / (1024 * 1024);
    198                 printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
    199                     name, part->length, size_mb);
     199                printf(NAME ": Registered device %s: %" PRIu64 " blocks "
     200                    "%" PRIu64 " MB.\n", name, (uint64_t) part->length, size_mb);
    200201
    201202                part->dev = dev;
  • uspace/srv/bd/part/mbr_part/mbr_part.c

    rb79d450 rfb6f1a5  
    6464#include <devmap.h>
    6565#include <sys/types.h>
     66#include <inttypes.h>
    6667#include <libblock.h>
    6768#include <devmap.h>
     
    247248                size_mb = (part->length * block_size + 1024 * 1024 - 1)
    248249                    / (1024 * 1024);
    249                 printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
    250                     name, part->length, size_mb);
     250                printf(NAME ": Registered device %s: %" PRIu64 " blocks "
     251                    "%" PRIu64 " MB.\n",
     252                    name, (uint64_t) part->length, size_mb);
    251253
    252254                part->dev = dev;
     
    274276        if (brb == NULL) {
    275277                printf(NAME ": Failed allocating memory.\n");
    276                 return ENOMEM; 
     278                return ENOMEM;
    277279        }
    278280
     
    289291        sgn = uint16_t_le2host(brb->signature);
    290292        if (sgn != BR_SIGNATURE) {
    291                 printf(NAME ": Invalid boot record signature 0x%04X.\n", sgn);
     293                printf(NAME ": Invalid boot record signature 0x%04" PRIX16
     294                    ".\n", sgn);
    292295                return EINVAL;
    293296        }
     
    339342                sgn = uint16_t_le2host(brb->signature);
    340343                if (sgn != BR_SIGNATURE) {
    341                         printf(NAME ": Invalid boot record signature 0x%04X "
    342                             " in EBR at %u.\n", sgn, ba);
     344                        printf(NAME ": Invalid boot record signature 0x%04"
     345                            PRIX16 " in EBR at %" PRIu32 ".\n", sgn, ba);
    343346                        return EINVAL;
    344347                }
  • uspace/srv/loader/elf_load.c

    rb79d450 rfb6f1a5  
    342342        seg_ptr = (void *) seg_addr;
    343343
    344         DPRINTF("Load segment at addr 0x%x, size 0x%x\n", seg_addr,
    345                 entry->p_memsz);       
     344        DPRINTF("Load segment at addr %p, size 0x%x\n", seg_addr,
     345                entry->p_memsz);
    346346
    347347        if (entry->p_align > 1) {
     
    370370        mem_sz = entry->p_memsz + (entry->p_vaddr - base);
    371371
    372         DPRINTF("Map to seg_addr=0x%x-0x%x.\n", seg_addr,
     372        DPRINTF("Map to seg_addr=%p-%p.\n", seg_addr,
    373373        entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
    374374
     
    384384        }
    385385
    386         DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
     386        DPRINTF("as_area_create(%p, 0x%x, %d) -> 0x%lx\n",
    387387                base + bias, mem_sz, flags, (uintptr_t)a);
    388388
     
    461461                elf->info->dynamic =
    462462                    (void *)((uint8_t *)entry->sh_addr + elf->bias);
    463                 DPRINTF("Dynamic section found at 0x%x.\n",
     463                DPRINTF("Dynamic section found at %p.\n",
    464464                        (uintptr_t)elf->info->dynamic);
    465465                break;
  • uspace/srv/loader/main.c

    rb79d450 rfb6f1a5  
    392392                /* Dynamically linked program */
    393393                DPRINTF("Run ELF interpreter.\n");
    394                 DPRINTF("Entry point: 0x%lx\n", interp_info.entry);
     394                DPRINTF("Entry point: %p\n", interp_info.entry);
    395395               
    396396                ipc_answer_0(rid, EOK);
  • uspace/srv/taskmon/taskmon.c

    rb79d450 rfb6f1a5  
    7070        }
    7171
    72         printf(NAME ": Task %lld fault in thread 0x%lx.\n", taskid, thread);
     72        printf(NAME ": Task %lld fault in thread %p.\n", taskid, thread);
    7373
    7474#ifdef CONFIG_VERBOSE_DUMPS
Note: See TracChangeset for help on using the changeset viewer.