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

Unified Diff: base/third_party/dmg_fp/g_fmt.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/third_party/dmg_fp/float_precision_crash.patch ('k') | base/third_party/dmg_fp/gcc_64_bit.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/third_party/dmg_fp/g_fmt.cc
diff --git a/base/third_party/dmg_fp/g_fmt.cc b/base/third_party/dmg_fp/g_fmt.cc
deleted file mode 100644
index bfa358d154c7d5cb2bead52329fc22af38687280..0000000000000000000000000000000000000000
--- a/base/third_party/dmg_fp/g_fmt.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991, 1996 by Lucent Technologies.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* g_fmt(buf,x) stores the closest decimal approximation to x in buf;
- * it suffices to declare buf
- * char buf[32];
- */
-
-#include "dmg_fp.h"
-
-namespace dmg_fp {
-
- char *
-g_fmt(register char *b, double x)
-{
- register int i, k;
- register char *s;
- int decpt, j, sign;
- char *b0, *s0, *se;
-
- b0 = b;
-#ifdef IGNORE_ZERO_SIGN
- if (!x) {
- *b++ = '0';
- *b = 0;
- goto done;
- }
-#endif
- s = s0 = dtoa(x, 0, 0, &decpt, &sign, &se);
- if (sign)
- *b++ = '-';
- if (decpt == 9999) /* Infinity or Nan */ {
- for(*b = *s++; *b++; *b = *s++) {}
- goto done0;
- }
- if (decpt <= -4 || decpt > se - s + 5) {
- *b++ = *s++;
- if (*s) {
- *b++ = '.';
- for(*b = *s++; *b; *b = *s++)
- b++;
- }
- *b++ = 'e';
- /* sprintf(b, "%+.2d", decpt - 1); */
- if (--decpt < 0) {
- *b++ = '-';
- decpt = -decpt;
- }
- else
- *b++ = '+';
- for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10) {}
- for(;;) {
- i = decpt / k;
- *b++ = (char)i + '0';
- if (--j <= 0)
- break;
- decpt -= i*k;
- decpt *= 10;
- }
- *b = 0;
- }
- else if (decpt <= 0) {
- *b++ = '.';
- for(; decpt < 0; decpt++)
- *b++ = '0';
- for(*b = *s++; *b++; *b = *s++) {}
- }
- else {
- for(*b = *s++; *b; *b = *s++) {
- b++;
- if (--decpt == 0 && *s)
- *b++ = '.';
- }
- for(; decpt > 0; decpt--)
- *b++ = '0';
- *b = 0;
- }
- done0:
- freedtoa(s0);
-#ifdef IGNORE_ZERO_SIGN
- done:
-#endif
- return b0;
- }
-
-} // namespace dmg_fp
« no previous file with comments | « base/third_party/dmg_fp/float_precision_crash.patch ('k') | base/third_party/dmg_fp/gcc_64_bit.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698