Deleted Added
full compact
util.c (249139) util.c (300056)
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>
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 $");
18__FBSDID("$FreeBSD: head/sys/boot/common/util.c 300056 2016-05-17 14:10:45Z imp $");
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;
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 uint16_t *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;
124 unsigned long long u;
125 int c, l;
126
127 va_start(ap, fmt);
128 while ((c = *fmt++) != '\0') {
129 if (c != '%') {
130 putchar(c);
131 continue;

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

139 goto nextfmt;
140 case 'c':
141 putchar(va_arg(ap, int));
142 break;
143 case 's':
144 for (s = va_arg(ap, char *); *s != '\0'; s++)
145 putchar(*s);
146 break;
147 case 'S': /* Assume console can cope with wide chars */
148 for (S = va_arg(ap, uint16_t *); *S != 0; S++)
149 putchar(*S);
150 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 ---
151 case 'd': /* A lie, always prints unsigned */
152 case 'u':
153 case 'x':
154 switch (l) {
155 case 2:
156 u = va_arg(ap, unsigned long long);
157 break;
158 case 1:

--- 23 unchanged lines hidden ---