Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: src/fast-dtoa.cc

Issue 3471001: Fix build-breakage on Mac. Initial variable in unreachable branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 bool FastDtoa(double v, 695 bool FastDtoa(double v,
696 FastDtoaMode mode, 696 FastDtoaMode mode,
697 int requested_digits, 697 int requested_digits,
698 Vector<char> buffer, 698 Vector<char> buffer,
699 int* length, 699 int* length,
700 int* decimal_point) { 700 int* decimal_point) {
701 ASSERT(v > 0); 701 ASSERT(v > 0);
702 ASSERT(!Double(v).IsSpecial()); 702 ASSERT(!Double(v).IsSpecial());
703 703
704 bool result = false; 704 bool result = false;
705 int decimal_exponent; 705 int decimal_exponent = 0;
706 switch (mode) { 706 switch (mode) {
707 case FAST_DTOA_SHORTEST: 707 case FAST_DTOA_SHORTEST:
708 result = Grisu3(v, buffer, length, &decimal_exponent); 708 result = Grisu3(v, buffer, length, &decimal_exponent);
709 break; 709 break;
710 case FAST_DTOA_PRECISION: 710 case FAST_DTOA_PRECISION:
711 result = Grisu3Counted(v, requested_digits, 711 result = Grisu3Counted(v, requested_digits,
712 buffer, length, &decimal_exponent); 712 buffer, length, &decimal_exponent);
713 break; 713 break;
714 default:
715 UNREACHABLE();
714 } 716 }
715 if (result) { 717 if (result) {
716 *decimal_point = *length + decimal_exponent; 718 *decimal_point = *length + decimal_exponent;
717 buffer[*length] = '\0'; 719 buffer[*length] = '\0';
718 } 720 }
719 return result; 721 return result;
720 } 722 }
721 723
722 } } // namespace v8::internal 724 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698