Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 41 → Rev 42

/SPARTAN/trunk/include/print.h
36,8 → 36,8
#define INT32 4
 
static void print_str(char *str);
static void print_fixed_hex(__u32 num, int width);
static void print_number(__u32 num, int base);
static void print_fixed_hex(__native num, int width);
static void print_number(__native num, int base);
 
extern void putchar(char c);
extern void printf(char *fmt, ...);
/SPARTAN/trunk/include/stdarg.h
0,0 → 1,44
/*
* Copyright (C) 2005 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
 
/*
* Variable argument list manipulation macros
* for all architectures with compiler support for __builtin_va_*.
*/
#ifndef __STDARG_H__
#define __STDARG_H__
 
typedef __builtin_va_list va_list;
 
#define va_start(ap, last) __builtin_va_start(ap, last)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
#define va_end(ap) __builtin_va_end(ap)
 
#endif
/SPARTAN/trunk/src/debug/print.c
49,7 → 49,7
* This is a universal function for printing hexadecimal numbers of fixed
* width.
*/
void print_fixed_hex(__u32 num, int width)
void print_fixed_hex(__native num, int width)
{
int i;
61,16 → 61,16
* This is a universal function for printing decimal and hexadecimal numbers.
* It prints only significant digits.
*/
void print_number(__u32 num, int base)
void print_number(__native num, int base)
{
char d[32+1]; /* this is good enough even for base == 2 */
int i = 31;
char d[sizeof(__native)*8+1]; /* this is good enough even for base == 2 */
int i = sizeof(__native)*8-1;
do {
d[i--] = digits[num % base];
} while (num /= base);
d[32] = 0;
d[sizeof(__native)*8] = 0;
print_str(&d[i + 1]);
}
 
109,7 → 109,7
goto loop;
 
case 'c':
c = va_arg(ap, char);
c = (char) va_arg(ap, int);
break;
 
/*
/SPARTAN/trunk/arch/ia64/include/arg.h
29,7 → 29,6
#ifndef __ia64_ARG_H__
#define __ia64_ARG_H__
 
/* TODO: to be replaced by real IA-64 stuff */
#include <stackarg.h>
#include <stdarg.h>
 
#endif