Changeset 199145a1 in mainline for src/debug/print.c


Ignore:
Timestamp:
2005-05-07T21:39:47Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0985add
Parents:
75e5a8a
Message:

Add stdarg.h to support variable argument list functions on architectures with compiler support for builtin_va_*.
stackarg.h is kept for those architectures which lack that kind of support and for testing purposes.

Make printing functions use the native type and support the maximum integer width.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/debug/print.c

    r75e5a8a r199145a1  
    5050 * width.
    5151 */
    52 void print_fixed_hex(__u32 num, int width)
     52void print_fixed_hex(__native num, int width)
    5353{
    5454        int i;
     
    6262 * It prints only significant digits.
    6363 */
    64 void print_number(__u32 num, int base)
     64void print_number(__native num, int base)
    6565{
    66         char d[32+1];           /* this is good enough even for base == 2 */
    67         int i = 31;
     66        char d[sizeof(__native)*8+1];           /* this is good enough even for base == 2 */
     67        int i = sizeof(__native)*8-1;
    6868   
    6969        do {
     
    7171        } while (num /= base);
    7272       
    73         d[32] = 0;     
     73        d[sizeof(__native)*8] = 0;     
    7474        print_str(&d[i + 1]);
    7575}
     
    110110
    111111                                case 'c':
    112                                         c = va_arg(ap, char);
     112                                        c = (char) va_arg(ap, int);
    113113                                        break;
    114114
Note: See TracChangeset for help on using the changeset viewer.