Changeset 199145a1 in mainline


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.

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • arch/ia64/include/arg.h

    r75e5a8a r199145a1  
    3030#define __ia64_ARG_H__
    3131
    32 /* TODO: to be replaced by real IA-64 stuff */
    33 #include <stackarg.h>
     32#include <stdarg.h>
    3433
    3534#endif
  • include/print.h

    r75e5a8a r199145a1  
    3737
    3838static void print_str(char *str);
    39 static void print_fixed_hex(__u32 num, int width);
    40 static  void print_number(__u32 num, int base);
     39static void print_fixed_hex(__native num, int width);
     40static  void print_number(__native num, int base);
    4141
    4242extern void putchar(char c);
  • 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.