Changeset 7e752b2 in mainline for uspace/srv


Ignore:
Timestamp:
2010-11-26T01:33:20Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf61d3a
Parents:
202f57b
Message:
  • correct printf() formatting strings and corresponding arguments
  • minor cstyle changes and other small fixes
Location:
uspace/srv
Files:
21 edited

Legend:

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

    r202f57b r7e752b2  
    113113        printf(NAME ": ATA disk driver\n");
    114114
    115         printf("I/O address %p/%p\n", ctl_physical, cmd_physical);
     115        printf("I/O address %p/%p\n", (void *) ctl_physical,
     116            (void *) cmd_physical);
    116117
    117118        if (ata_bd_init() != EOK)
     
    181182        }
    182183
    183         printf(" %" PRIu64 " blocks", d->blocks, d->blocks / (2 * 1024));
     184        printf(" %" PRIu64 " blocks", d->blocks);
    184185
    185186        mbytes = d->blocks / (2 * 1024);
  • uspace/srv/bd/part/guid_part/guid_part.c

    r202f57b r7e752b2  
    155155
    156156        if (block_size < 512 || (block_size % 512) != 0) {
    157                 printf(NAME ": invalid block size %d.\n");
     157                printf(NAME ": invalid block size %zu.\n", block_size);
    158158                return ENOTSUP;
    159159        }
  • uspace/srv/bd/part/mbr_part/mbr_part.c

    r202f57b r7e752b2  
    206206
    207207        if (block_size < 512 || (block_size % 512) != 0) {
    208                 printf(NAME ": invalid block size %d.\n");
     208                printf(NAME ": invalid block size %zu.\n", block_size);
    209209                return ENOTSUP;
    210210        }
  • uspace/srv/bd/rd/rd.c

    r202f57b r7e752b2  
    230230        }
    231231       
    232         printf("%s: Found RAM disk at %p, %d bytes\n", NAME, rd_ph_addr, rd_size);
     232        printf("%s: Found RAM disk at %p, %zu bytes\n", NAME,
     233            (void *) rd_ph_addr, rd_size);
    233234       
    234235        int rc = devmap_driver_register(NAME, rd_connection);
  • uspace/srv/devman/devman.c

    r202f57b r7e752b2  
    10141014       
    10151015        size_t idx = get_new_class_dev_idx(cl);
    1016         asprintf(&dev_name, "%s%d", base_name, idx);
     1016        asprintf(&dev_name, "%s%zu", base_name, idx);
    10171017       
    10181018        return dev_name;
  • uspace/srv/devman/main.c

    r202f57b r7e752b2  
    3636 */
    3737
     38#include <inttypes.h>
    3839#include <assert.h>
    3940#include <ipc/services.h>
     
    417418        node_t *dev = find_dev_node(&device_tree, handle);
    418419        if (dev == NULL) {
    419                 printf(NAME ": devman_forward error - no device with handle %x "
    420                     "was found.\n", handle);
     420                printf(NAME ": devman_forward error - no device with handle %" PRIun
     421                    " was found.\n", handle);
    421422                ipc_answer_0(iid, ENOENT);
    422423                return;
     
    434435       
    435436        if (driver == NULL) {
    436                 printf(NAME ": devman_forward error - the device is not in "
    437                     "usable state.\n", handle);
     437                printf(NAME ": devman_forward error - the device is not in %" PRIun
     438                    " usable state.\n", handle);
    438439                ipc_answer_0(iid, ENOENT);
    439440                return;
     
    449450                printf(NAME ": devman_forward: cound not forward to driver %s ",
    450451                    driver->name);
    451                 printf("the driver's phone is %x).\n", driver->phone);
     452                printf("the driver's phone is %" PRIun ").\n", driver->phone);
    452453                ipc_answer_0(iid, EINVAL);
    453454                return;
  • uspace/srv/devmap/devmap.c

    r202f57b r7e752b2  
    555555        if (devmap_device_find_name(namespace->name, device->name) != NULL) {
    556556                printf("%s: Device '%s/%s' already registered\n", NAME,
    557                     device->namespace, device->name);
     557                    device->namespace->name, device->name);
    558558                devmap_namespace_destroy(namespace);
    559559                fibril_mutex_unlock(&devices_list_mutex);
  • uspace/srv/hid/console/console.c

    r202f57b r7e752b2  
    804804                        if (screenbuffer_init(&consoles[i].scr,
    805805                            fb_info.cols, fb_info.rows) == NULL) {
    806                                 printf(NAME ": Unable to allocate screen buffer %u\n", i);
     806                                printf(NAME ": Unable to allocate screen buffer %zu\n", i);
    807807                                return false;
    808808                        }
     
    813813                       
    814814                        char vc[DEVMAP_NAME_MAXLEN + 1];
    815                         snprintf(vc, DEVMAP_NAME_MAXLEN, "%s/vc%u", NAMESPACE, i);
     815                        snprintf(vc, DEVMAP_NAME_MAXLEN, "%s/vc%zu", NAMESPACE, i);
    816816                       
    817817                        if (devmap_device_register(vc, &consoles[i].devmap_handle) != EOK) {
  • uspace/srv/hid/console/gcons.c

    r202f57b r7e752b2  
    157157               
    158158                char data[5];
    159                 snprintf(data, 5, "%u", index + 1);
     159                snprintf(data, 5, "%zu", index + 1);
    160160               
    161161                size_t i;
  • uspace/srv/hid/fb/serial_console.c

    r202f57b r7e752b2  
    4747#include <io/style.h>
    4848#include <str.h>
     49#include <inttypes.h>
    4950#include <io/screenbuffer.h>
    5051
     
    135136       
    136137        char control[MAX_CONTROL];
    137         snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1);
     138        snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f",
     139            row + 1, col + 1);
    138140        serial_puts(control);
    139141}
     
    253255{
    254256        char control[MAX_CONTROL];
    255         snprintf(control, MAX_CONTROL, "\033[0;%ur", last_row);
     257        snprintf(control, MAX_CONTROL, "\033[0;%" PRIun "r", last_row);
    256258        serial_puts(control);
    257259}
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r202f57b r7e752b2  
    5050#include <sysinfo.h>
    5151#include <errno.h>
     52#include <inttypes.h>
    5253
    5354#include "s3c24xx_ts.h"
     
    136137        ts->last_y = 0;
    137138
    138         printf(NAME ": device at physical address 0x%x, inr %d.\n",
    139             ts->paddr, inr);
     139        printf(NAME ": device at physical address %p, inr %" PRIun ".\n",
     140            (void *) ts->paddr, inr);
    140141
    141142        async_set_interrupt_received(s3c24xx_ts_irq_handler);
  • uspace/srv/hw/char/i8042/i8042.c

    r202f57b r7e752b2  
    4646#include <stdio.h>
    4747#include <errno.h>
     48#include <inttypes.h>
    4849
    4950#include "i8042.h"
     
    201202        ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
    202203        ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
    203         printf("%s: registered for interrupts %d and %d\n", NAME, inr_a, inr_b);
     204        printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n",
     205            NAME, inr_a, inr_b);
    204206
    205207        wait_ready();
     
    262264                        break;
    263265                case IPC_FIRST_USER_METHOD:
    264                         printf(NAME ": write %d to devid %d\n",
     266                        printf(NAME ": write %" PRIun " to devid %d\n",
    265267                            IPC_GET_ARG1(call), dev_id);
    266268                        i8042_port_write(dev_id, IPC_GET_ARG1(call));
  • uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    r202f57b r7e752b2  
    4848#include <sysinfo.h>
    4949#include <errno.h>
     50#include <inttypes.h>
    5051
    5152#include "s3c24xx_uart.h"
     
    9596        if (rc != EOK) {
    9697                devmap_hangup_phone(DEVMAP_DRIVER);
    97                 printf(NAME ": Unable to register device %s.\n");
     98                printf(NAME ": Unable to register device %s.\n",
     99                    NAMESPACE "/" NAME);
    98100                return -1;
    99101        }
     
    134136                        break;
    135137                case CHAR_WRITE_BYTE:
    136                         printf(NAME ": write %d to device\n",
     138                        printf(NAME ": write %" PRIun " to device\n",
    137139                            IPC_GET_ARG1(call));
    138140                        s3c24xx_uart_sendb(uart, (uint8_t) IPC_GET_ARG1(call));
     
    185187        uart->client_phone = -1;
    186188
    187         printf(NAME ": device at physical address 0x%x, inr %d.\n",
    188             uart->paddr, inr);
     189        printf(NAME ": device at physical address %p, inr %" PRIun ".\n",
     190            (void *) uart->paddr, inr);
    189191
    190192        async_set_interrupt_received(s3c24xx_uart_irq_handler);
  • uspace/srv/hw/cir/fhc/fhc.c

    r202f57b r7e752b2  
    129129        }
    130130       
    131         printf(NAME ": FHC UART registers at %p, %d bytes\n", fhc_uart_phys,
     131        printf(NAME ": FHC UART registers at %p, %zu bytes\n", fhc_uart_phys,
    132132            fhc_uart_size);
    133133       
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r202f57b r7e752b2  
    15161516        if (!wdeth_probe(dep) && !ne_probe(dep) && !el2_probe(dep))
    15171517        {
    1518                 printf("%s: No ethernet card found at 0x%x\n",
    1519                         dep->de_name, dep->de_base_port);
     1518                printf("%s: No ethernet card found at %#lx\n",
     1519                    dep->de_name, dep->de_base_port);
    15201520                dep->de_mode= DEM_DISABLED;
    15211521                return;
  • uspace/srv/hw/netif/dp8390/ne2000.c

    r202f57b r7e752b2  
    267267        if (!debug)
    268268        {
    269                 printf("%s: NE%d000 at %X:%d\n",
    270                         dep->de_name, dep->de_16bit ? 2 : 1,
    271                         dep->de_base_port, dep->de_irq);
     269                printf("%s: NE%d000 at %#lx:%d\n",
     270                    dep->de_name, dep->de_16bit ? 2 : 1,
     271                    dep->de_base_port, dep->de_irq);
    272272        }
    273273        else
    274274        {
    275275                printf("%s: Novell NE%d000 ethernet card at I/O address "
    276                         "0x%X, memory size 0x%X, irq %d\n",
    277                         dep->de_name, dep->de_16bit ? 2 : 1,
    278                         dep->de_base_port, dep->de_ramsize, dep->de_irq);
     276                    "%#lx, memory size %#lx, irq %d\n",
     277                    dep->de_name, dep->de_16bit ? 2 : 1,
     278                    dep->de_base_port, dep->de_ramsize, dep->de_irq);
    279279        }
    280280}
  • uspace/srv/net/il/arp/arp.c

    r202f57b r7e752b2  
    391391        device->packet_dimension.content = mtu;
    392392        fibril_rwlock_write_unlock(&arp_globals.lock);
    393         printf("arp - device %d changed mtu to %d\n\n", device_id, mtu);
     393        printf("arp - device %d changed mtu to %zu\n\n", device_id, mtu);
    394394        return EOK;
    395395}
  • uspace/srv/net/il/ip/ip.c

    r202f57b r7e752b2  
    461461       
    462462        if (ip_netif->packet_dimension.content < IP_MIN_CONTENT) {
    463                 printf("Maximum transmission unit %d bytes is too small, at "
     463                printf("Maximum transmission unit %zu bytes is too small, at "
    464464                    "least %d bytes are needed\n",
    465465                    ip_netif->packet_dimension.content, IP_MIN_CONTENT);
     
    502502        fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
    503503
    504         printf("%s: Device %d changed MTU to %d\n", NAME, device_id, mtu);
     504        printf("%s: Device %d changed MTU to %zu\n", NAME, device_id, mtu);
    505505
    506506        return EOK;
  • uspace/srv/net/nil/eth/eth.c

    r202f57b r7e752b2  
    315315                        device->mtu = ETH_MAX_TAGGED_CONTENT(device->flags);
    316316               
    317                 printf("Device %d already exists:\tMTU\t= %d\n",
     317                printf("Device %d already exists:\tMTU\t= %zu\n",
    318318                    device->device_id, device->mtu);
    319319                fibril_rwlock_write_unlock(&eth_globals.devices_lock);
     
    407407        }
    408408       
    409         printf("%s: Device registered (id: %d, service: %d: mtu: %d, "
     409        printf("%s: Device registered (id: %d, service: %d: mtu: %zu, "
    410410            "mac: %x:%x:%x:%x:%x:%x, flags: 0x%x)\n",
    411411            NAME, device->device_id, device->service, device->mtu,
  • uspace/srv/net/nil/nildummy/nildummy.c

    r202f57b r7e752b2  
    175175                        device->mtu = NET_DEFAULT_MTU;
    176176               
    177                 printf("Device %d already exists:\tMTU\t= %d\n",
     177                printf("Device %d already exists:\tMTU\t= %zu\n",
    178178                    device->device_id, device->mtu);
    179179                fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
     
    232232        }
    233233       
    234         printf("%s: Device registered (id: %d, service: %d, mtu: %d)\n",
     234        printf("%s: Device registered (id: %d, service: %d, mtu: %zu)\n",
    235235            NAME, device->device_id, device->service, device->mtu);
    236236        fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
  • uspace/srv/taskmon/taskmon.c

    r202f57b r7e752b2  
    6060        thread = IPC_GET_ARG3(*call);
    6161
    62         if (asprintf(&s_taskid, "%" PRIuTASKID, taskid) < 0) {
     62        if (asprintf(&s_taskid, "%" PRIu64, taskid) < 0) {
    6363                printf("Memory allocation failed.\n");
    6464                return;
    6565        }
    6666
    67         printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
     67        printf(NAME ": Task %" PRIu64 " fault in thread %p.\n", taskid,
     68            (void *) thread);
    6869
    6970        fname = "/app/taskdump";
     
    7273        char *dump_fname;
    7374
    74         if (asprintf(&dump_fname, "/data/core%" PRIuTASKID, taskid) < 0) {
     75        if (asprintf(&dump_fname, "/data/core%" PRIu64, taskid) < 0) {
    7576                printf("Memory allocation failed.\n");
    7677                return;
    7778        }
    7879
    79         printf(NAME ": Executing %s -c %s -t %s\n", dump_fname, s_taskid);
     80        printf(NAME ": Executing %s -c %s -t %s\n", fname, dump_fname, s_taskid);
    8081        rc = task_spawnl(NULL, fname, fname, "-c", dump_fname, "-t", s_taskid,
    8182            NULL);
    8283#else
    83         printf(NAME ": Executing %s -t %s\n", s_taskid);
     84        printf(NAME ": Executing %s -t %s\n", fname, s_taskid);
    8485        rc = task_spawnl(NULL, fname, fname, "-t", s_taskid, NULL);
    8586#endif
Note: See TracChangeset for help on using the changeset viewer.