Changeset bd1deed in mainline for kernel/generic/src/printf/vprintf.c


Ignore:
Timestamp:
2007-02-11T20:04:08Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c993e45
Parents:
ce8aed1
Message:

experimental support for Objective C
(disabled by default)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/printf/vprintf.c

    rce8aed1 rbd1deed  
    3737#include <putchar.h>
    3838
    39 int vprintf_write(const char *str, size_t count, void *unused);
     39static int vprintf_write(const char *str, size_t count, void *unused)
     40{
     41        size_t i;
     42        for (i = 0; i < count; i++)
     43                putchar(str[i]);
     44        return i;
     45}
    4046
    41 int vprintf_write(const char *str, size_t count, void *unused)
     47int puts(const char *s)
    4248{
    43         size_t i = 0;
    44         for (; i < count; i++)
    45                 putchar(str[i]);
     49        size_t i;
     50        for (i = 0; s[i] != 0; i++)
     51                putchar(s[i]);
    4652        return i;
    4753}
     
    4955int vprintf(const char *fmt, va_list ap)
    5056{
    51         struct printf_spec ps = {(int(*)(void *, size_t, void *))vprintf_write, NULL};
     57        struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL};
    5258        return printf_core(fmt, &ps, ap);
    5359
Note: See TracChangeset for help on using the changeset viewer.