Deleted Added
sdiff udiff text old ( 249139 ) new ( 300056 )
full compact
1/*-
2 * Copyright (c) 1998 Robert Nordier
3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms are freely
7 * permitted provided that the above copyright notice and this
8 * paragraph and the following disclaimer are duplicated in all
9 * such forms.
10 *
11 * This software is provided "AS IS" and without any express or
12 * implied warranties, including, without limitation, the implied
13 * warranties of merchantability and fitness for a particular
14 * purpose.
15 */
16
17#include <sys/cdefs.h>
18__FBSDID("$FreeBSD: head/sys/boot/common/util.c 249139 2013-04-05 09:14:30Z avg $");
19
20#include <sys/param.h>
21
22#include <stdarg.h>
23
24#include "cons.h"
25#include "util.h"
26

--- 88 unchanged lines hidden (view full) ---

115}
116
117void
118printf(const char *fmt, ...)
119{
120 va_list ap;
121 const char *hex = "0123456789abcdef";
122 char buf[32], *s;
123 unsigned long long u;
124 int c, l;
125
126 va_start(ap, fmt);
127 while ((c = *fmt++) != '\0') {
128 if (c != '%') {
129 putchar(c);
130 continue;

--- 7 unchanged lines hidden (view full) ---

138 goto nextfmt;
139 case 'c':
140 putchar(va_arg(ap, int));
141 break;
142 case 's':
143 for (s = va_arg(ap, char *); *s != '\0'; s++)
144 putchar(*s);
145 break;
146 case 'd': /* A lie, always prints unsigned */
147 case 'u':
148 case 'x':
149 switch (l) {
150 case 2:
151 u = va_arg(ap, unsigned long long);
152 break;
153 case 1:

--- 23 unchanged lines hidden ---