Lines Matching refs:buffer
126 Vector<char> buffer, int* length) {
128 buffer[(*length) + i] = '0' + number % 10;
135 static void FillDigits32(uint32_t number, Vector<char> buffer, int* length) {
141 buffer[(*length) + number_length] = '0' + digit;
148 char tmp = buffer[i];
149 buffer[i] = buffer[j];
150 buffer[j] = tmp;
159 Vector<char> buffer, int* length) {
167 FillDigits32FixedLength(part0, 3, buffer, length);
168 FillDigits32FixedLength(part1, 7, buffer, length);
169 FillDigits32FixedLength(part2, 7, buffer, length);
173 static void FillDigits64(uint64_t number, Vector<char> buffer, int* length) {
182 FillDigits32(part0, buffer, length);
183 FillDigits32FixedLength(part1, 7, buffer, length);
184 FillDigits32FixedLength(part2, 7, buffer, length);
186 FillDigits32(part1, buffer, length);
187 FillDigits32FixedLength(part2, 7, buffer, length);
189 FillDigits32(part2, buffer, length);
194 static void RoundUp(Vector<char> buffer, int* length, int* decimal_point) {
195 // An empty buffer represents 0.
197 buffer[0] = '1';
204 buffer[(*length) - 1]++;
206 if (buffer[i] != '0' + 10) {
209 buffer[i] = '0';
210 buffer[i - 1]++;
217 if (buffer[0] == '0' + 10) {
218 buffer[0] = '1';
229 // The buffer holds the result.
232 // might be updated. If this function generates the digits 99 and the buffer
233 // already contained "199" (thus yielding a buffer of "19999") then a
234 // rounding-up will change the contents of the buffer to "20000".
236 int fractional_count, Vector<char> buffer,
261 buffer[*length] = '0' + digit;
267 RoundUp(buffer, length, decimal_point);
282 buffer[*length] = '0' + digit;
286 RoundUp(buffer, length, decimal_point);
294 static void TrimZeros(Vector<char> buffer, int* length, int* decimal_point) {
295 while (*length > 0 && buffer[(*length) - 1] == '0') {
299 while (first_non_zero < *length && buffer[first_non_zero] == '0') {
304 buffer[i - first_non_zero] = buffer[i];
314 Vector<char> buffer,
365 FillDigits32(quotient, buffer, length);
366 FillDigits64FixedLength(remainder, divisor_power, buffer, length);
371 FillDigits64(significand, buffer, length);
378 FillDigits64(integrals, buffer, length);
380 FillDigits32(static_cast<uint32_t>(integrals), buffer, length);
384 buffer, length, decimal_point);
389 buffer[0] = '\0';
395 buffer, length, decimal_point);
397 TrimZeros(buffer, length, decimal_point);
398 buffer[*length] = '\0';