printk.cc (9034:8b9f227b64d8) printk.cc (9550:e0e2c8f83d08)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

181 out << s;
182 ++args;
183 }
184 break;
185 case 'C':
186 case 'c': {
187 uint64_t mask = (*p == 'C') ? 0xffL : 0x7fL;
188 uint64_t num;
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

181 out << s;
182 ++args;
183 }
184 break;
185 case 'C':
186 case 'c': {
187 uint64_t mask = (*p == 'C') ? 0xffL : 0x7fL;
188 uint64_t num;
189 int width;
189 int cwidth;
190
191 if (islong) {
192 num = (uint64_t)args;
190
191 if (islong) {
192 num = (uint64_t)args;
193 width = sizeof(uint64_t);
193 cwidth = sizeof(uint64_t);
194 } else {
195 num = (uint32_t)args;
194 } else {
195 num = (uint32_t)args;
196 width = sizeof(uint32_t);
196 cwidth = sizeof(uint32_t);
197 }
198
197 }
198
199 while (width-- > 0) {
199 while (cwidth-- > 0) {
200 char c = (char)(num & mask);
201 if (c)
202 out << c;
203 num >>= 8;
204 }
205
206 ++args;
207 }

--- 52 unchanged lines hidden ---
200 char c = (char)(num & mask);
201 if (c)
202 out << c;
203 num >>= 8;
204 }
205
206 ++args;
207 }

--- 52 unchanged lines hidden ---