summaryrefslogtreecommitdiffstats
path: root/StdLib/LibC
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-24 01:19:06 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-24 01:19:06 +0000
commitd78fab6b4e9be83b781212f6a9f3fde0c092e81d (patch)
treec16ad39d0aa2ca7f1c62a39b68121db6d4fb5b05 /StdLib/LibC
parent2df686c67c7819e01a1487dd703faffef2b59dce (diff)
downloadedk2-d78fab6b4e9be83b781212f6a9f3fde0c092e81d.tar.gz
edk2-d78fab6b4e9be83b781212f6a9f3fde0c092e81d.tar.bz2
edk2-d78fab6b4e9be83b781212f6a9f3fde0c092e81d.zip
EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release.
Clean up and clearly differentiate required and optional items in configuration files. Enable the system command and synchronize configuration options between all CPU architectures. Replace the UEFI_ENV macro with UEFI_C_SOURCE to align with Linux and Posix conventions. Update copyrights and versions and make minor cosmetic enhancements to files. Fix compiler-specific build errors. Add Python-specific ReadMe file. Signed-off-by: darylm503 Reviewed-by: geekboy15a Reviewed-by: jljusten Reviewed-by: leegrosenbaum git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13119 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC')
-rw-r--r--StdLib/LibC/Main/Main.c6
-rw-r--r--StdLib/LibC/gdtoa/strtod.c79
-rw-r--r--StdLib/LibC/gdtoa/strtodg.c71
3 files changed, 91 insertions, 65 deletions
diff --git a/StdLib/LibC/Main/Main.c b/StdLib/LibC/Main/Main.c
index 59a72bd630..523965fa43 100644
--- a/StdLib/LibC/Main/Main.c
+++ b/StdLib/LibC/Main/Main.c
@@ -4,7 +4,7 @@
All of the global data in the gMD structure is initialized to 0, NULL, or
SIG_DFL; as appropriate.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -74,7 +74,7 @@ static
char **
ArgvConvert(UINTN Argc, CHAR16 **Argv)
{
- size_t AVsz; /* Size of a single nArgv string */
+ ssize_t AVsz; /* Size of a single nArgv string, or -1 */
UINTN count;
char **nArgv;
char *string;
@@ -90,7 +90,7 @@ DEBUG_CODE_END();
nArgvSize = Argc;
/* Determine space needed for narrow Argv strings. */
for(count = 0; count < Argc; ++count) {
- AVsz = wcstombs(NULL, Argv[count], ARG_MAX);
+ AVsz = (ssize_t)wcstombs(NULL, Argv[count], ARG_MAX);
if(AVsz < 0) {
Print(L"ABORTING: Argv[%d] contains an unconvertable character.\n", count);
exit(EXIT_FAILURE);
diff --git a/StdLib/LibC/gdtoa/strtod.c b/StdLib/LibC/gdtoa/strtod.c
index 989663a01e..5cc6b8e44e 100644
--- a/StdLib/LibC/gdtoa/strtod.c
+++ b/StdLib/LibC/gdtoa/strtod.c
@@ -1,35 +1,48 @@
-/* $NetBSD: strtod.c,v 1.4.14.1 2008/04/08 21:10:55 jdc Exp $ */
-
-/****************************************************************
-
-The author of this software is David M. Gay.
-
-Copyright (C) 1998-2001 by Lucent Technologies
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and
-its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the name of Lucent or any of its entities
-not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
-IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
-SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-THIS SOFTWARE.
-
-****************************************************************/
-
-/* Please send bug reports to David M. Gay (dmg at acm dot org,
- * with " at " changed at "@" and " dot " changed to "."). */
+/** @file
+
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ *****************************************************************
+
+ The author of this software is David M. Gay.
+
+ Copyright (C) 1998-2001 by Lucent Technologies
+ All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of Lucent or any of its entities
+ not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
+
+ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ THIS SOFTWARE.
+
+
+ Please send bug reports to David M. Gay (dmg at acm dot org,
+ with " at " changed at "@" and " dot " changed to ".").
+
+ *****************************************************************
+
+ NetBSD: strtod.c,v 1.4.14.1 2008/04/08 21:10:55 jdc Exp
+**/
#include <LibConfig.h>
#include "gdtoaimp.h"
@@ -477,7 +490,7 @@ strtod(CONST char *s00, char **se)
for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
if (e1 & 1)
dval(rv) *= tinytens[j];
- if (scale && (j = 2*P + 1 - ((word0(rv) & Exp_mask)
+ if (scale && (j = 2*P + 1 - (unsigned int)((word0(rv) & Exp_mask)
>> Exp_shift)) > 0) {
/* scaled rv is denormal; zap j low bits */
if (j >= 32) {
diff --git a/StdLib/LibC/gdtoa/strtodg.c b/StdLib/LibC/gdtoa/strtodg.c
index fc0ae7cf38..a8c28cf091 100644
--- a/StdLib/LibC/gdtoa/strtodg.c
+++ b/StdLib/LibC/gdtoa/strtodg.c
@@ -1,35 +1,48 @@
-/* $NetBSD: strtodg.c,v 1.5.14.1 2008/04/08 21:10:55 jdc Exp $ */
+/** @file
-/****************************************************************
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.
-The author of this software is David M. Gay.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-Copyright (C) 1998-2001 by Lucent Technologies
-All Rights Reserved
+ *****************************************************************
-Permission to use, copy, modify, and distribute this software and
-its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the name of Lucent or any of its entities
-not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
+ The author of this software is David M. Gay.
-LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
-IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
-SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-THIS SOFTWARE.
+ Copyright (C) 1998-2001 by Lucent Technologies
+ All Rights Reserved
-****************************************************************/
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that the copyright notice and this
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of Lucent or any of its entities
+ not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
-/* Please send bug reports to David M. Gay (dmg at acm dot org,
- * with " at " changed at "@" and " dot " changed to "."). */
+ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ THIS SOFTWARE.
+
+
+ Please send bug reports to David M. Gay (dmg at acm dot org,
+ with " at " changed at "@" and " dot " changed to ".").
+
+ *****************************************************************
+
+ NetBSD: strtodg.c,v 1.5.14.1 2008/04/08 21:10:55 jdc Exp
+**/
#include <LibConfig.h>
#include "gdtoaimp.h"
@@ -611,14 +624,14 @@ strtodg
if (e1 &= ~15) {
e1 = (unsigned int)e1 >> 4;
while(e1 >= (1 << (n_bigtens-1))) {
- e2 += ((word0(rv) & Exp_mask)
+ e2 += (unsigned int)((word0(rv) & Exp_mask)
>> Exp_shift1) - Bias;
word0(rv) &= ~Exp_mask;
word0(rv) |= Bias << Exp_shift1;
dval(rv) *= bigtens[n_bigtens-1];
e1 -= 1 << (n_bigtens-1);
}
- e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias;
+ e2 += (unsigned int)((word0(rv) & Exp_mask) >> Exp_shift1) - Bias;
word0(rv) &= ~Exp_mask;
word0(rv) |= Bias << Exp_shift1;
for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
@@ -633,14 +646,14 @@ strtodg
if (e1 &= ~15) {
e1 = (unsigned int)e1 >> 4;
while(e1 >= (1 << (n_bigtens-1))) {
- e2 += ((word0(rv) & Exp_mask)
+ e2 += (unsigned int)((word0(rv) & Exp_mask)
>> Exp_shift1) - Bias;
word0(rv) &= ~Exp_mask;
word0(rv) |= Bias << Exp_shift1;
dval(rv) *= tinytens[n_bigtens-1];
e1 -= 1 << (n_bigtens-1);
}
- e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias;
+ e2 += (unsigned int)((word0(rv) & Exp_mask) >> Exp_shift1) - Bias;
word0(rv) &= ~Exp_mask;
word0(rv) |= Bias << Exp_shift1;
for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)