]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/gdtoa/strtod.c
EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release.
[mirror_edk2.git] / StdLib / LibC / gdtoa / strtod.c
index 989663a01e74afe555b9f87f3094713fdfb08845..5cc6b8e44e21e994681656a2576e420639d5ac30 100644 (file)
@@ -1,35 +1,48 @@
-/* $NetBSD: strtod.c,v 1.4.14.1 2008/04/08 21:10:55 jdc Exp $ */\r
-\r
-/****************************************************************\r
-\r
-The author of this software is David M. Gay.\r
-\r
-Copyright (C) 1998-2001 by Lucent Technologies\r
-All Rights Reserved\r
-\r
-Permission to use, copy, modify, and distribute this software and\r
-its documentation for any purpose and without fee is hereby\r
-granted, provided that the above copyright notice appear in all\r
-copies and that both that the copyright notice and this\r
-permission notice and warranty disclaimer appear in supporting\r
-documentation, and that the name of Lucent or any of its entities\r
-not be used in advertising or publicity pertaining to\r
-distribution of the software without specific, written prior\r
-permission.\r
-\r
-LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\r
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\r
-IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\r
-SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\r
-IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\r
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r
-THIS SOFTWARE.\r
-\r
-****************************************************************/\r
-\r
-/* Please send bug reports to David M. Gay (dmg at acm dot org,\r
- * with " at " changed at "@" and " dot " changed to ".").  */\r
+/** @file\r
+\r
+  Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  *****************************************************************\r
+\r
+  The author of this software is David M. Gay.\r
+\r
+  Copyright (C) 1998-2001 by Lucent Technologies\r
+  All Rights Reserved\r
+\r
+  Permission to use, copy, modify, and distribute this software and\r
+  its documentation for any purpose and without fee is hereby\r
+  granted, provided that the above copyright notice appear in all\r
+  copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting\r
+  documentation, and that the name of Lucent or any of its entities\r
+  not be used in advertising or publicity pertaining to\r
+  distribution of the software without specific, written prior\r
+  permission.\r
+\r
+  LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\r
+  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\r
+  IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\r
+  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r
+  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\r
+  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\r
+  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r
+  THIS SOFTWARE.\r
+\r
+\r
+  Please send bug reports to David M. Gay (dmg at acm dot org,\r
+  with " at " changed at "@" and " dot " changed to ".").\r
+\r
+  *****************************************************************\r
+\r
+  NetBSD: strtod.c,v 1.4.14.1 2008/04/08 21:10:55 jdc Exp\r
+**/\r
 #include  <LibConfig.h>\r
 \r
 #include "gdtoaimp.h"\r
@@ -477,7 +490,7 @@ strtod(CONST char *s00, char **se)
       for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)\r
         if (e1 & 1)\r
           dval(rv) *= tinytens[j];\r
-      if (scale && (j = 2*P + 1 - ((word0(rv) & Exp_mask)\r
+      if (scale && (j = 2*P + 1 - (unsigned int)((word0(rv) & Exp_mask)\r
             >> Exp_shift)) > 0) {\r
         /* scaled rv is denormal; zap j low bits */\r
         if (j >= 32) {\r