Add Socket Libraries.

Add Posix functions for porting compatibility.
Fix compliance issues with ISO/IEC 9899:199409
New Functions:
  setenv(), fparseln(), GetFileNameFromPath(), rename(),
  realpath(), setprogname(), getprogname(), strlcat(), strlcpy(),
  strsep(), setitimer(), getitimer(), timegm(), getopt(), basename(),
  mkstemp(), ffs(), vsnprintf(), snprintf(), getpass(), usleep(), select(),
  writev(), strcasecmp(), getcwd(), chdir(), tcgetpgrp(), getpgrp(), gettimeofday(),
  bcopy(), 


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12061 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
darylm503
2011-07-30 00:30:44 +00:00
parent f766dd76fd
commit d7ce700605
199 changed files with 36115 additions and 686 deletions

View File

@@ -1056,8 +1056,6 @@ reswitch: switch (ch) {
xdigs = xdigs_upper;
expchar = 'P';
}
if (prec >= 0)
prec++;
if (flags & LONGDBL) {
fparg.ldbl = GETARG(long double);
dtoaresult =
@@ -1092,10 +1090,8 @@ reswitch: switch (ch) {
case 'e':
case 'E':
expchar = ch;
if (prec < 0) /* account for digit before decpt */
prec = DEFPREC + 1;
else
prec++;
if (prec < 0)
prec = DEFPREC;
goto fp_begin;
case 'f':
case 'F':
@@ -1165,10 +1161,8 @@ fp_common:
case 'e':
case 'E':
expchar = ch;
if (prec < 0) /* account for digit before decpt */
prec = DEFPREC /* + 1*/ ;
else
prec++;
if (prec < 0)
prec = DEFPREC;
goto fp_begin;
case 'f':
case 'F':
@@ -1242,16 +1236,21 @@ fp_begin:
/*
* Make %[gG] smell like %[eE], but
* trim trailing zeroes if no # flag.
*
* Note: The precision field used with [gG] is the number significant
* digits to print. When converting to [eE] the digit before the
* decimal must not be included in the precision value.
*/
if (!(flags & ALT))
prec = ndig;
prec = ndig - 1;
}
}
if (expchar) {
dprec = prec; /* In some cases dprec will not be set. Make sure it is set now */
expsize = exponent(expstr, expt - 1, expchar);
size = expsize + prec;
if (prec > 1 || flags & ALT)
++size;
size = expsize + prec + 1; /* Leading digit + exponent string + precision */
if (prec >= 1 || flags & ALT)
++size; /* Decimal point is added to character count */
} else {
/* space for digits before decimal point */
if (expt > 0)
@@ -1322,7 +1321,7 @@ fp_begin:
* defined manner.''
* -- ANSI X3J11
*/
ujval = (uintmax_t)GETARG(void *);
ujval = (uintmax_t) (UINTN) GETARG(void *);
base = 16;
xdigs = xdigs_lower;
flags = flags | INTMAXT;
@@ -1332,7 +1331,7 @@ fp_begin:
flags |= LONGINT;
/*FALLTHROUGH*/
case 's':
if ((flags & LONGINT) != MULTI) {
if (((flags & LONGINT) ? 1:0) != MULTI) {
if ((result = GETARG(CHAR_T *)) == NULL)
result = STRCONST("(null)");
} else {
@@ -1538,7 +1537,7 @@ number: if ((dprec = prec) >= 0)
PRINTANDPAD(result, convbuf + ndig, prec,
zeroes);
} else { /* %[eE] or sufficiently long %[gG] */
if (prec > 1 || flags & ALT) {
if (prec >= 1 || flags & ALT) {
buf[0] = *result++;
buf[1] = *decimal_point;
PRINT(buf, 2);
@@ -2003,8 +2002,6 @@ cvt(double value, int ndigits, int flags, char *sign, int *decpt, int ch,
*decpt = -ndigits + 1;
bp += *decpt;
}
if (value == 0) /* kludge for __dtoa irregularity */
rve = bp;
while (rve < bp)
*rve++ = '0';
}