VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrFormatV.c@ 79611

Last change on this file since 79611 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.4 KB
Line 
1/* $Id: bs3-cmn-StrFormatV.c 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * BS3Kit - Bs3StrFormatV
4 */
5
6/*
7 * Copyright (C) 2007-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27
28/*********************************************************************************************************************************
29* Header Files *
30*********************************************************************************************************************************/
31#include "bs3kit-template-header.h"
32#include <iprt/ctype.h>
33
34
35/*********************************************************************************************************************************
36* Defined Constants And Macros *
37*********************************************************************************************************************************/
38#define STR_F_CAPITAL 0x0001
39#define STR_F_LEFT 0x0002
40#define STR_F_ZEROPAD 0x0004
41#define STR_F_SPECIAL 0x0008
42#define STR_F_VALSIGNED 0x0010
43#define STR_F_PLUS 0x0020
44#define STR_F_BLANK 0x0040
45#define STR_F_WIDTH 0x0080
46#define STR_F_PRECISION 0x0100
47#define STR_F_THOUSAND_SEP 0x0200
48#define STR_F_NEGATIVE 0x0400 /**< Used to indicated '-' must be printed. */
49
50
51/*********************************************************************************************************************************
52* Structures and Typedefs *
53*********************************************************************************************************************************/
54/** Size of the temporary buffer. */
55#define BS3FMT_TMP_SIZE 64
56
57/**
58 * BS3kit string format state.
59 */
60typedef struct BS3FMTSTATE
61{
62 /** The output function. */
63 PFNBS3STRFORMATOUTPUT pfnOutput;
64 /** User argument for pfnOutput. */
65 void BS3_FAR *pvUser;
66
67 /** STR_F_XXX flags. */
68 unsigned fFlags;
69 /** The width when STR_F_WIDTH is specific. */
70 int cchWidth;
71 /** The width when STR_F_PRECISION is specific. */
72 int cchPrecision;
73 /** The number format base. */
74 unsigned uBase;
75 /** Temporary buffer. */
76 char szTmp[BS3FMT_TMP_SIZE];
77} BS3FMTSTATE;
78/** Pointer to a BS3Kit string formatter state. */
79typedef BS3FMTSTATE BS3_FAR *PBS3FMTSTATE;
80
81
82
83/*********************************************************************************************************************************
84* Internal Functions *
85*********************************************************************************************************************************/
86#if ARCH_BITS != 64
87static size_t bs3StrFormatU32(PBS3FMTSTATE pState, uint32_t uValue);
88#endif
89
90
91
92/**
93 * Formats a number string.
94 *
95 * @returns Number of chars printed.
96 * @param pState The string formatter state.
97 * @param pszNumber The formatted number string.
98 * @param cchNumber The length of the number.
99 */
100static size_t bs3StrFormatNumberString(PBS3FMTSTATE pState, char const BS3_FAR *pszNumber, size_t cchNumber)
101{
102 /*
103 * Calc the length of the core number with prefixes.
104 */
105 size_t cchActual = 0;
106 size_t cchRet = cchNumber;
107
108 /* Accunt for sign char. */
109 cchRet += !!(pState->fFlags & (STR_F_NEGATIVE | STR_F_PLUS | STR_F_BLANK));
110
111 /* Account for the hex prefix: '0x' or '0X' */
112 if (pState->fFlags & STR_F_SPECIAL)
113 {
114 cchRet += 2;
115 BS3_ASSERT(pState->uBase == 16);
116 }
117
118 /* Account for thousand separators (applied while printing). */
119 if (pState->fFlags & STR_F_THOUSAND_SEP)
120 cchRet += (cchNumber - 1) / (pState->uBase == 10 ? 3 : 8);
121
122 /*
123 * Do left blank padding.
124 */
125 if ((pState->fFlags & (STR_F_ZEROPAD | STR_F_LEFT | STR_F_WIDTH)) == STR_F_WIDTH)
126 while (cchRet < pState->cchWidth)
127 {
128 cchActual += pState->pfnOutput(' ', pState->pvUser);
129 cchRet++;
130 }
131
132 /*
133 * Sign indicator / space.
134 */
135 if (pState->fFlags & (STR_F_NEGATIVE | STR_F_PLUS | STR_F_BLANK))
136 {
137 char ch;
138 if (pState->fFlags & STR_F_NEGATIVE)
139 ch = '-';
140 else if (pState->fFlags & STR_F_PLUS)
141 ch = '+';
142 else
143 ch = ' ';
144 cchActual += pState->pfnOutput(ch, pState->pvUser);
145 }
146
147 /*
148 * Hex prefix.
149 */
150 if (pState->fFlags & STR_F_SPECIAL)
151 {
152 cchActual += pState->pfnOutput('0', pState->pvUser);
153 cchActual += pState->pfnOutput(!(pState->fFlags & STR_F_CAPITAL) ? 'x' : 'X', pState->pvUser);
154 }
155
156 /*
157 * Zero padding.
158 */
159 if (pState->fFlags & STR_F_ZEROPAD)
160 while (cchRet < pState->cchWidth)
161 {
162 cchActual += pState->pfnOutput('0', pState->pvUser);
163 cchRet++;
164 }
165
166 /*
167 * Output the number.
168 */
169 if ( !(pState->fFlags & STR_F_THOUSAND_SEP)
170 || cchNumber < 4)
171 while (cchNumber-- > 0)
172 cchActual += pState->pfnOutput(*pszNumber++, pState->pvUser);
173 else
174 {
175 char const chSep = pState->uBase == 10 ? ' ' : '\'';
176 unsigned const cchEvery = pState->uBase == 10 ? 3 : 8;
177 unsigned cchLeft = --cchNumber % cchEvery;
178
179 cchActual += pState->pfnOutput(*pszNumber++, pState->pvUser);
180 while (cchNumber-- > 0)
181 {
182 if (cchLeft == 0)
183 {
184 cchActual += pState->pfnOutput(chSep, pState->pvUser);
185 cchLeft = cchEvery;
186 }
187 cchLeft--;
188 cchActual += pState->pfnOutput(*pszNumber++, pState->pvUser);
189 }
190 }
191
192 /*
193 * Do right blank padding.
194 */
195 if ((pState->fFlags & (STR_F_ZEROPAD | STR_F_LEFT | STR_F_WIDTH)) == (STR_F_WIDTH | STR_F_LEFT))
196 while (cchRet < pState->cchWidth)
197 {
198 cchActual += pState->pfnOutput(' ', pState->pvUser);
199 cchRet++;
200 }
201
202 return cchActual;
203}
204
205
206/**
207 * Format a 64-bit number.
208 *
209 * @returns Number of characters.
210 * @param pState The string formatter state.
211 * @param uValue The value.
212 */
213static size_t bs3StrFormatU64(PBS3FMTSTATE pState, uint64_t uValue)
214{
215#if ARCH_BITS != 64
216 /* Avoid 64-bit division by formatting 64-bit numbers as hex if they're higher than _4G. */
217 if (pState->uBase == 10)
218 {
219 if (!(uValue >> 32)) /* uValue <= UINT32_MAX does not work, trouble with 64-bit compile time math! */
220 return bs3StrFormatU32(pState, uValue);
221 pState->fFlags |= STR_F_SPECIAL;
222 pState->uBase = 16;
223 }
224#endif
225
226 {
227 const char BS3_FAR *pachDigits = !(pState->fFlags & STR_F_CAPITAL) ? g_achBs3HexDigits : g_achBs3HexDigitsUpper;
228 char BS3_FAR *psz = &pState->szTmp[BS3FMT_TMP_SIZE];
229
230 *--psz = '\0';
231#if ARCH_BITS == 64
232 if (pState->uBase == 10)
233 {
234 do
235 {
236 *--psz = pachDigits[uValue % 10];
237 uValue /= 10;
238 } while (uValue > 0);
239 }
240 else
241#endif
242 {
243 BS3_ASSERT(pState->uBase == 16);
244 do
245 {
246 *--psz = pachDigits[uValue & 0xf];
247 uValue >>= 4;
248 } while (uValue > 0);
249 }
250 return bs3StrFormatNumberString(pState, psz, &pState->szTmp[BS3FMT_TMP_SIZE - 1] - psz);
251 }
252}
253
254
255/**
256 * Format a 32-bit number.
257 *
258 * @returns Number of characters.
259 * @param pState The string formatter state.
260 * @param uValue The value.
261 */
262static size_t bs3StrFormatU32(PBS3FMTSTATE pState, uint32_t uValue)
263{
264#if ARCH_BITS < 64
265 const char BS3_FAR *pachDigits = !(pState->fFlags & STR_F_CAPITAL) ? g_achBs3HexDigits : g_achBs3HexDigitsUpper;
266 char BS3_FAR *psz = &pState->szTmp[BS3FMT_TMP_SIZE];
267
268 *--psz = '\0';
269 if (pState->uBase == 10)
270 {
271 do
272 {
273 *--psz = pachDigits[uValue % 10];
274 uValue /= 10;
275 } while (uValue > 0);
276 }
277 else
278 {
279 BS3_ASSERT(pState->uBase == 16);
280 do
281 {
282 *--psz = pachDigits[uValue & 0xf];
283 uValue >>= 4;
284 } while (uValue > 0);
285 }
286 return bs3StrFormatNumberString(pState, psz, &pState->szTmp[BS3FMT_TMP_SIZE - 1] - psz);
287
288#else
289 /* We've got native 64-bit division, save space. */
290 return bs3StrFormatU64(pState, uValue);
291#endif
292}
293
294
295#if ARCH_BITS == 16
296/**
297 * Format a 16-bit number.
298 *
299 * @returns Number of characters.
300 * @param pState The string formatter state.
301 * @param uValue The value.
302 */
303static size_t bs3StrFormatU16(PBS3FMTSTATE pState, uint16_t uValue)
304{
305 if (pState->uBase == 10)
306 {
307 const char BS3_FAR *pachDigits = !(pState->fFlags & STR_F_CAPITAL)
308 ? g_achBs3HexDigits : g_achBs3HexDigitsUpper;
309 char BS3_FAR *psz = &pState->szTmp[BS3FMT_TMP_SIZE];
310
311 *--psz = '\0';
312 do
313 {
314 *--psz = pachDigits[uValue % 10];
315 uValue /= 10;
316 } while (uValue > 0);
317 return bs3StrFormatNumberString(pState, psz, &pState->szTmp[BS3FMT_TMP_SIZE - 1] - psz);
318 }
319
320 /*
321 * 32-bit shifting is reasonably cheap and inlined, so combine with 32-bit.
322 */
323 return bs3StrFormatU32(pState, uValue);
324}
325#endif
326
327
328static size_t bs3StrFormatS64(PBS3FMTSTATE pState, int32_t iValue)
329{
330 if (iValue < 0)
331 {
332 iValue = -iValue;
333 pState->fFlags |= STR_F_NEGATIVE;
334 }
335 return bs3StrFormatU64(pState, iValue);
336}
337
338
339static size_t bs3StrFormatS32(PBS3FMTSTATE pState, int32_t iValue)
340{
341 if (iValue < 0)
342 {
343 iValue = -iValue;
344 pState->fFlags |= STR_F_NEGATIVE;
345 }
346 return bs3StrFormatU32(pState, iValue);
347}
348
349
350#if ARCH_BITS == 16
351static size_t bs3StrFormatS16(PBS3FMTSTATE pState, int16_t iValue)
352{
353 if (iValue < 0)
354 {
355 iValue = -iValue;
356 pState->fFlags |= STR_F_NEGATIVE;
357 }
358 return bs3StrFormatU16(pState, iValue);
359}
360#endif
361
362
363#undef Bs3StrFormatV
364BS3_CMN_DEF(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va,
365 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser))
366{
367 BS3FMTSTATE State;
368 size_t cchRet = 0;
369 char ch;
370#if ARCH_BITS == 16
371 typedef int SIZE_CHECK_TYPE1[sizeof(va) == 4 && sizeof(va[0]) == 4];
372#endif
373
374 State.pfnOutput = pfnOutput;
375 State.pvUser = pvUser;
376
377 while ((ch = *pszFormat++) != '\0')
378 {
379 char chArgSize;
380
381 /*
382 * Deal with plain chars.
383 */
384 if (ch != '%')
385 {
386 cchRet += State.pfnOutput(ch, State.pvUser);
387 continue;
388 }
389
390 ch = *pszFormat++;
391 if (ch == '%')
392 {
393 cchRet += State.pfnOutput(ch, State.pvUser);
394 continue;
395 }
396
397 /*
398 * Flags.
399 */
400 State.fFlags = 0;
401 for (;;)
402 {
403 unsigned int fThis;
404 switch (ch)
405 {
406 default: fThis = 0; break;
407 case '#': fThis = STR_F_SPECIAL; break;
408 case '-': fThis = STR_F_LEFT; break;
409 case '+': fThis = STR_F_PLUS; break;
410 case ' ': fThis = STR_F_BLANK; break;
411 case '0': fThis = STR_F_ZEROPAD; break;
412 case '\'': fThis = STR_F_THOUSAND_SEP; break;
413 }
414 if (!fThis)
415 break;
416 State.fFlags |= fThis;
417 ch = *pszFormat++;
418 }
419
420 /*
421 * Width.
422 */
423 State.cchWidth = 0;
424 if (RT_C_IS_DIGIT(ch))
425 {
426 do
427 {
428 State.cchWidth *= 10;
429 State.cchWidth += ch - '0';
430 ch = *pszFormat++;
431 } while (RT_C_IS_DIGIT(ch));
432 State.fFlags |= STR_F_WIDTH;
433 }
434 else if (ch == '*')
435 {
436 State.cchWidth = va_arg(va, int);
437 if (State.cchWidth < 0)
438 {
439 State.cchWidth = -State.cchWidth;
440 State.fFlags |= STR_F_LEFT;
441 }
442 State.fFlags |= STR_F_WIDTH;
443 ch = *pszFormat++;
444 }
445
446 /*
447 * Precision
448 */
449 State.cchPrecision = 0;
450 if (ch == '.')
451 {
452 ch = *pszFormat++;
453 if (RT_C_IS_DIGIT(ch))
454 {
455 do
456 {
457 State.cchPrecision *= 10;
458 State.cchPrecision += ch - '0';
459 ch = *pszFormat++;
460 } while (RT_C_IS_DIGIT(ch));
461 State.fFlags |= STR_F_PRECISION;
462 }
463 else if (ch == '*')
464 {
465 State.cchPrecision = va_arg(va, int);
466 if (State.cchPrecision < 0)
467 State.cchPrecision = 0;
468 State.fFlags |= STR_F_PRECISION;
469 ch = *pszFormat++;
470 }
471 }
472
473 /*
474 * Argument size.
475 */
476 chArgSize = ch;
477 switch (ch)
478 {
479 default:
480 chArgSize = 0;
481 break;
482
483 case 'z':
484 case 'L':
485 case 'j':
486 case 't':
487 ch = *pszFormat++;
488 break;
489
490 case 'l':
491 ch = *pszFormat++;
492 if (ch == 'l')
493 {
494 chArgSize = 'L';
495 ch = *pszFormat++;
496 }
497 break;
498
499 case 'h':
500 ch = *pszFormat++;
501 if (ch == 'h')
502 {
503 chArgSize = 'H';
504 ch = *pszFormat++;
505 }
506 break;
507 }
508
509 /*
510 * The type.
511 */
512 switch (ch)
513 {
514 /*
515 * Char
516 */
517 case 'c':
518 {
519 char ch = va_arg(va, int /*char*/);
520 cchRet += State.pfnOutput(ch, State.pvUser);
521 break;
522 }
523
524 /*
525 * String.
526 */
527 case 's':
528 {
529 const char BS3_FAR *psz = va_arg(va, const char BS3_FAR *);
530 size_t cch;
531 if (psz != NULL)
532 cch = Bs3StrNLen(psz, State.fFlags & STR_F_PRECISION ? RT_ABS(State.cchPrecision) : ~(size_t)0);
533 else
534 {
535 psz = "<NULL>";
536 cch = 6;
537 }
538
539 if ((State.fFlags & (STR_F_LEFT | STR_F_WIDTH)) == STR_F_WIDTH)
540 while (--State.cchWidth >= cch)
541 cchRet += State.pfnOutput(' ', State.pvUser);
542
543 cchRet += cch;
544 while (cch-- > 0)
545 cchRet += State.pfnOutput(*psz++, State.pvUser);
546
547 if ((State.fFlags & (STR_F_LEFT | STR_F_WIDTH)) == (STR_F_LEFT | STR_F_WIDTH))
548 while (--State.cchWidth >= cch)
549 cchRet += State.pfnOutput(' ', State.pvUser);
550 break;
551 }
552
553 /*
554 * Signed integers.
555 */
556 case 'i':
557 case 'd':
558 State.fFlags &= ~STR_F_SPECIAL;
559 State.fFlags |= STR_F_VALSIGNED;
560 State.uBase = 10;
561 switch (chArgSize)
562 {
563 case 0:
564 case 'h': /* signed short should be promoted to int or be the same as int */
565 case 'H': /* signed char should be promoted to int. */
566 {
567 signed int iValue = va_arg(va, signed int);
568#if ARCH_BITS == 16
569 cchRet += bs3StrFormatS16(&State, iValue);
570#else
571 cchRet += bs3StrFormatS32(&State, iValue);
572#endif
573 break;
574 }
575 case 'l':
576 {
577 signed long lValue = va_arg(va, signed long);
578 if (sizeof(lValue) == 4)
579 cchRet += bs3StrFormatS32(&State, lValue);
580 else
581 cchRet += bs3StrFormatS64(&State, lValue);
582 break;
583 }
584 case 'L':
585 {
586 unsigned long long ullValue = va_arg(va, unsigned long long);
587 cchRet += bs3StrFormatS64(&State, ullValue);
588 break;
589 }
590 }
591 break;
592
593 /*
594 * Unsigned integers.
595 */
596 case 'X':
597 State.fFlags |= STR_F_CAPITAL;
598 case 'x':
599 case 'u':
600 {
601 if (ch == 'u')
602 {
603 State.uBase = 10;
604 State.fFlags &= ~(STR_F_PLUS | STR_F_BLANK | STR_F_SPECIAL);
605 }
606 else
607 {
608 State.uBase = 16;
609 State.fFlags &= ~(STR_F_PLUS | STR_F_BLANK);
610 }
611 switch (chArgSize)
612 {
613 case 0:
614 case 'h': /* unsigned short should be promoted to int or be the same as int */
615 case 'H': /* unsigned char should be promoted to int. */
616 {
617 unsigned int uValue = va_arg(va, unsigned int);
618#if ARCH_BITS == 16
619 cchRet += bs3StrFormatU16(&State, uValue);
620#else
621 cchRet += bs3StrFormatU32(&State, uValue);
622#endif
623 break;
624 }
625 case 'l':
626 {
627 unsigned long ulValue = va_arg(va, unsigned long);
628 if (sizeof(ulValue) == 4)
629 cchRet += bs3StrFormatU32(&State, ulValue);
630 else
631 cchRet += bs3StrFormatU64(&State, ulValue);
632 break;
633 }
634 case 'L':
635 {
636 unsigned long long ullValue = va_arg(va, unsigned long long);
637 cchRet += bs3StrFormatU64(&State, ullValue);
638 break;
639 }
640 }
641 break;
642 }
643
644 /*
645 * Our stuff.
646 */
647 case 'R':
648 {
649 ch = *pszFormat++;
650 switch (ch)
651 {
652 case 'I':
653 State.fFlags |= STR_F_VALSIGNED;
654 State.uBase &= ~STR_F_SPECIAL;
655 State.uBase = 10;
656 break;
657 case 'U':
658 State.fFlags &= ~(STR_F_PLUS | STR_F_BLANK | STR_F_SPECIAL);
659 State.uBase = 10;
660 break;
661 case 'X':
662 State.fFlags &= ~(STR_F_PLUS | STR_F_BLANK);
663 State.uBase = 16;
664 break;
665 case 'h':
666 ch = *pszFormat++;
667 if (ch == 'x')
668 {
669 /* Hex dumping. */
670 uint8_t const BS3_FAR *pbHex = va_arg(va, uint8_t const BS3_FAR *);
671 if (State.cchPrecision < 0)
672 State.cchPrecision = 16;
673 ch = *pszFormat++;
674 if (ch == 's' || ch == 'd')
675 {
676 /* %Rhxd is currently implemented as %Rhxs. */
677 while (State.cchPrecision-- > 0)
678 {
679 uint8_t b = *pbHex++;
680 State.pfnOutput(g_achBs3HexDigits[b >> 4], State.pvUser);
681 State.pfnOutput(g_achBs3HexDigits[b & 0x0f], State.pvUser);
682 if (State.cchPrecision)
683 State.pfnOutput(' ', State.pvUser);
684 }
685 }
686 }
687 State.uBase = 0;
688 break;
689 default:
690 State.uBase = 0;
691 break;
692 }
693 if (State.uBase)
694 {
695 ch = *pszFormat++;
696 switch (ch)
697 {
698#if ARCH_BITS != 16
699 case '3':
700 case '1': /* Will an unsigned 16-bit value always be promoted
701 to a 16-bit unsigned int. It certainly will be promoted to a 32-bit int. */
702 pszFormat++; /* Assumes (1)'6' or (3)'2' */
703#else
704 case '1':
705 pszFormat++; /* Assumes (1)'6' */
706#endif
707 case '8': /* An unsigned 8-bit value should be promoted to int, which is at least 16-bit. */
708 {
709 unsigned int uValue = va_arg(va, unsigned int);
710#if ARCH_BITS == 16
711 cchRet += bs3StrFormatU16(&State, uValue);
712#else
713 cchRet += bs3StrFormatU32(&State, uValue);
714#endif
715 break;
716 }
717#if ARCH_BITS == 16
718 case '3':
719 {
720 uint32_t uValue = va_arg(va, uint32_t);
721 pszFormat++;
722 cchRet += bs3StrFormatU32(&State, uValue);
723 break;
724 }
725#endif
726 case '6':
727 {
728 uint64_t uValue = va_arg(va, uint64_t);
729 pszFormat++;
730 cchRet += bs3StrFormatU64(&State, uValue);
731 break;
732 }
733 }
734 }
735 break;
736 }
737
738 /*
739 * Pointers.
740 */
741 case 'P':
742 State.fFlags |= STR_F_CAPITAL;
743 RT_FALL_THRU();
744 case 'p':
745 {
746 void BS3_FAR *pv = va_arg(va, void BS3_FAR *);
747 State.uBase = 16;
748 State.fFlags &= ~(STR_F_PLUS | STR_F_BLANK);
749#if ARCH_BITS == 16
750 State.fFlags |= STR_F_ZEROPAD;
751 State.cchWidth = State.fFlags & STR_F_SPECIAL ? 6: 4;
752 cchRet += bs3StrFormatU16(&State, BS3_FP_SEG(pv));
753 cchRet += State.pfnOutput(':', State.pvUser);
754 cchRet += bs3StrFormatU16(&State, BS3_FP_OFF(pv));
755#elif ARCH_BITS == 32
756 State.fFlags |= STR_F_SPECIAL | STR_F_ZEROPAD;
757 State.cchWidth = 10;
758 cchRet += bs3StrFormatU32(&State, (uintptr_t)pv);
759#elif ARCH_BITS == 64
760 State.fFlags |= STR_F_SPECIAL | STR_F_ZEROPAD | STR_F_THOUSAND_SEP;
761 State.cchWidth = 19;
762 cchRet += bs3StrFormatU64(&State, (uintptr_t)pv);
763#else
764# error "Undefined or invalid ARCH_BITS."
765#endif
766 break;
767 }
768
769 }
770 }
771
772 /*
773 * Termination call.
774 */
775 cchRet += State.pfnOutput(0, State.pvUser);
776
777 return cchRet;
778}
779
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette