Changeset 81887b7 in mainline


Ignore:
Timestamp:
2005-08-30T08:59:22Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00e00fa
Parents:
1fbbcd6
Message:

Bugs in printf and va_arg functions repaired.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/print.h

    r1fbbcd6 r81887b7  
    3838
    3939static void print_str(const char *str);
    40 static void print_fixed_hex(const __native num, const int width);
     40static void print_fixed_hex(const __u64 num, const int width);
    4141static void print_number(const __native num, const unsigned int base);
    4242
  • include/stackarg.h

    r1fbbcd6 r81887b7  
    4040typedef struct va_list {
    4141        int pos;
    42         __address *last;
     42        __u8 *last;
    4343} va_list;
    4444
    4545#define va_start(ap, lst)               \
    46         (ap).pos = 0;                   \
    47         (ap).last = (__address *) &(lst)
     46        (ap).pos = sizeof(lst);                         \
     47        (ap).last = (__u8 *) &(lst)
    4848
    4949#define va_arg(ap, type)                \
    50         ((type) *((ap).last + ++((ap).pos)))
     50        (*((type *)((ap).last + ((ap).pos  += sizeof(type) ) - sizeof(type))))
    5151
    5252#define va_end(ap)
  • src/debug/print.c

    r1fbbcd6 r81887b7  
    6767 *
    6868 */
    69 void print_fixed_hex(const __native num, const int width)
     69void print_fixed_hex(const __u64 num, const int width)
    7070{
    7171        int i;
     
    187187                                        print_str("0x");
    188188                                case 'q':
    189                                         print_fixed_hex(va_arg(ap, __native), INT64);
     189                                        print_fixed_hex(va_arg(ap, __u64), INT64);
    190190                                        goto loop;
    191191
Note: See TracChangeset for help on using the changeset viewer.