mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:55:42 +00:00
Synchronize with trunk.
svn path=/branches/ntvdm/; revision=59499
This commit is contained in:
commit
fb7355f834
594 changed files with 76378 additions and 29859 deletions
|
@ -214,6 +214,8 @@ int SetEnv(const wchar_t *option)
|
|||
wchar_t *woption;
|
||||
char *mboption;
|
||||
int remove, index, count, size, result = 0, found = 0;
|
||||
wchar_t **wnewenv;
|
||||
char **mbnewenv;
|
||||
|
||||
if (option == NULL || (epos = wcschr(option, L'=')) == NULL)
|
||||
return -1;
|
||||
|
@ -261,14 +263,18 @@ int SetEnv(const wchar_t *option)
|
|||
free(*wenvptr);
|
||||
for (count = index; *wenvptr != NULL; wenvptr++, count++)
|
||||
*wenvptr = *(wenvptr + 1);
|
||||
_wenviron = realloc(_wenviron, count * sizeof(wchar_t*));
|
||||
wnewenv = realloc(_wenviron, count * sizeof(wchar_t*));
|
||||
if (wnewenv != NULL)
|
||||
_wenviron = wnewenv;
|
||||
|
||||
/* Remove the option from multibyte environment. We assume
|
||||
* the environments are in sync and the option is at the
|
||||
* same position. */
|
||||
free(_environ[index]);
|
||||
memmove(&_environ[index], &_environ[index+1], (count - index) * sizeof(char*));
|
||||
_environ = realloc(_environ, count * sizeof(char*));
|
||||
mbnewenv = realloc(_environ, count * sizeof(char*));
|
||||
if (mbnewenv != NULL)
|
||||
_environ = mbnewenv;
|
||||
|
||||
result = SetEnvironmentVariableW(name, NULL) ? 0 : -1;
|
||||
}
|
||||
|
@ -303,9 +309,6 @@ int SetEnv(const wchar_t *option)
|
|||
}
|
||||
else
|
||||
{
|
||||
wchar_t **wnewenv;
|
||||
char **mbnewenv;
|
||||
|
||||
/* Get the size of the original environment. */
|
||||
for (count = index; *wenvptr != NULL; wenvptr++, count++)
|
||||
;
|
||||
|
|
|
@ -279,7 +279,7 @@ _FUNCTION_ {
|
|||
/* handle exponent */
|
||||
if (width!=0 && (nch == 'e' || nch == 'E')) {
|
||||
int exponent = 0, negexp = 0;
|
||||
float expcnt;
|
||||
double expcnt, shift;
|
||||
nch = _GETC_(file);
|
||||
if (width>0) width--;
|
||||
/* possible sign on the exponent */
|
||||
|
@ -296,13 +296,15 @@ _FUNCTION_ {
|
|||
if (width>0) width--;
|
||||
}
|
||||
/* update 'cur' with this exponent. */
|
||||
expcnt = negexp ? 0.1f : 10.0f;
|
||||
expcnt = 10;
|
||||
shift = 1.0;
|
||||
while (exponent!=0) {
|
||||
if (exponent&1)
|
||||
cur*=expcnt;
|
||||
shift *= expcnt;
|
||||
exponent/=2;
|
||||
expcnt=expcnt*expcnt;
|
||||
}
|
||||
cur = (negexp ? cur / shift : cur * shift);
|
||||
}
|
||||
st = 1;
|
||||
if (!suppress) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue