Lines Matching refs:buff
33 static int AppendChar(char **buff, const char *buff_end, char c) { in AppendChar() argument
34 if (*buff < buff_end) { in AppendChar()
35 **buff = c; in AppendChar()
36 (*buff)++; in AppendChar()
44 static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value, in AppendNumber() argument
56 result += AppendChar(buff, buff_end, '-'); in AppendNumber()
74 result += AppendChar(buff, buff_end, c); in AppendNumber()
76 if (negative && !pad_with_zero) result += AppendChar(buff, buff_end, '-'); in AppendNumber()
79 result += AppendChar(buff, buff_end, (digit < 10) ? '0' + digit in AppendNumber()
85 static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base, in AppendUnsigned() argument
87 return AppendNumber(buff, buff_end, num, base, minimal_num_length, in AppendUnsigned()
91 static int AppendSignedDecimal(char **buff, const char *buff_end, s64 num, in AppendSignedDecimal() argument
94 return AppendNumber(buff, buff_end, (u64)(negative ? -num : num), 10, in AppendSignedDecimal()
98 static int AppendString(char **buff, const char *buff_end, int precision, in AppendString() argument
106 result += AppendChar(buff, buff_end, *s); in AppendString()
111 static int AppendPointer(char **buff, const char *buff_end, u64 ptr_value) { in AppendPointer() argument
113 result += AppendString(buff, buff_end, -1, "0x"); in AppendPointer()
114 result += AppendUnsigned(buff, buff_end, ptr_value, 16, in AppendPointer()
119 int VSNPrintf(char *buff, int buff_length, in VSNPrintf() argument
125 const char *buff_end = &buff[buff_length - 1]; in VSNPrintf()
130 result += AppendChar(&buff, buff_end, *cur); in VSNPrintf()
162 result += AppendSignedDecimal(&buff, buff_end, dval, width, in VSNPrintf()
171 result += AppendUnsigned(&buff, buff_end, uval, in VSNPrintf()
177 result += AppendPointer(&buff, buff_end, va_arg(args, uptr)); in VSNPrintf()
182 result += AppendString(&buff, buff_end, precision, va_arg(args, char*)); in VSNPrintf()
187 result += AppendChar(&buff, buff_end, va_arg(args, int)); in VSNPrintf()
192 result += AppendChar(&buff, buff_end, '%'); in VSNPrintf()
200 RAW_CHECK(buff <= buff_end); in VSNPrintf()
201 AppendChar(&buff, buff_end + 1, '\0'); in VSNPrintf()