}
-/*******************************************************************************
-Function:
- PAL_printf_arg_remover
-
-Parameters:
- ap
- - pointer to the va_list from which to remove arguments
- Precision
- - the precision of the current format option
- Type
- - the type of the argument for the current format option
- Prefix
- - the prefix for the current format option
-*******************************************************************************/
-void PAL_printf_arg_remover(va_list *ap, INT Precision, INT Type, INT Prefix)
-{
- /* remove arg and precision if needed */
- if (PRECISION_STAR == Precision ||
- PRECISION_INVALID == Precision)
- {
- (void)va_arg(*ap, LONG);
- }
- if (Type == PFF_TYPE_FLOAT)
- {
- (void)va_arg(*ap, double);
- }
- else if (Type == PFF_TYPE_INT && Prefix == PFF_PREFIX_LONGLONG)
- {
- (void)va_arg(*ap, INT64);
- }
- else
- {
- (void)va_arg(*ap, LONG);
- }
-}
-
/*++
Function:
PAL_printf
}
else
{
- TempInt = NativeVsnprintf(pthrCurrent, TempSprintfStr, TEMP_COUNT, TempBuff, ap);
+ va_list apcopy;
+
+ va_copy(apcopy, ap);
+ TempInt = NativeVsnprintf(pthrCurrent, TempSprintfStr, TEMP_COUNT, TempBuff, apcopy);
if (TempInt < 0 || static_cast<size_t>(TempInt) >= TEMP_COUNT)
{
}
TempSprintfStr = TempSprintfStrPtr;
- NativeVsnprintf(pthrCurrent, TempSprintfStr, TempInt, TempBuff, ap);
+ va_end(apcopy);
+ va_copy(apcopy, ap);
+ NativeVsnprintf(pthrCurrent, TempSprintfStr, TempInt, TempBuff, apcopy);
}
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
+ va_copy(ap, apcopy);
+ va_end(apcopy);
}
mbtowcResult = MultiByteToWideChar(CP_ACP, 0,
else
{
TempInt = NativeVsnprintf(pthrCurrent, BufferPtr, TempCount, TempBuff, ap);
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
}
if (TempInt < 0 || static_cast<size_t>(TempInt) >= TempCount) /* buffer not long enough */
else
{
TempInt = NativeVsnprintf(pthrCurrent, (LPSTR) BufferPtr, TempCount, TempBuff, ap);
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
}
if (TempInt == 0)
else
{
TempInt = NativeVfprintf(pthrCurrent, stream->bsdFilePtr, TempBuff, ap);
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
}
if (-1 == TempInt)
}
TempInt = PAL__vsnprintf(BufferPtr, TempCount, TempBuff, ap);
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
}
if (TempInt < 0 || static_cast<size_t>(TempInt) >= TempCount) /* buffer not long enough */
else
{
TempInt = PAL_vfprintf(stream, TempBuff, ap);
- PAL_printf_arg_remover((va_list *)&ap, Precision, Type, Prefix);
}
if (-1 != TempInt)
*******************************************************************************/
BOOL Internal_AddPaddingA(LPSTR *Out, INT Count, LPSTR In, INT Padding, INT Flags);
-/*******************************************************************************
-Function:
- PAL_printf_arg_remover
-
-Parameters:
- ap
- - pointer to the va_list from which to remove arguments
- Precision
- - the precision of the current format option
- Type
- - the type of the argument for the current format option
- Prefix
- - the prefix for the current format option
-*******************************************************************************/
-void PAL_printf_arg_remover(va_list *ap, INT Precision, INT Type, INT Prefix);
-
/*++
Function:
Silent_PAL_vsnprintf