ReactOS  0.4.15-dev-3173-g40ee59d
wcstod.c
Go to the documentation of this file.
1 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
2 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
3 #include <stdlib.h>
4 
5 
6 /*
7  * @implemented
8  */
9 #if 0 //FIXME: Compare with wcstod in wcs.c
10 double wcstod(const wchar_t *s, wchar_t **sret)
11 {
12  long double r; /* result */
13  int e; /* exponent */
14  long double d; /* scale */
15  int sign; /* +- 1.0 */
16  int esign;
17  int i;
18  int flags=0;
19 
20  r = 0.0;
21  sign = 1;
22  e = 0;
23  esign = 1;
24 
25  while ((*s == L' ') || (*s == L'\t'))
26  s++;
27 
28  if (*s == L'+')
29  s++;
30  else if (*s == L'-')
31  {
32  sign = -1;
33  s++;
34  }
35 
36  while ((*s >= L'0') && (*s <= L'9'))
37  {
38  flags |= 1;
39  r *= 10.0;
40  r += *s - L'0';
41  s++;
42  }
43 
44  if (*s == L'.')
45  {
46  d = 0.1L;
47  s++;
48  while ((*s >= L'0') && (*s <= L'9'))
49  {
50  flags |= 2;
51  r += d * (*s - L'0');
52  s++;
53  d *= 0.1L;
54  }
55  }
56 
57  if (flags == 0)
58  {
59  if (sret)
60  *sret = (wchar_t *)s;
61  return 0;
62  }
63 
64  if ((*s == L'e') || (*s == L'E'))
65  {
66  s++;
67  if (*s == L'+')
68  s++;
69  else if (*s == L'-')
70  {
71  s++;
72  esign = -1;
73  }
74  if ((*s < L'0') || (*s > L'9'))
75  {
76  if (sret)
77  *sret = (wchar_t *)s;
78  return r;
79  }
80 
81  while ((*s >= L'0') && (*s <= L'9'))
82  {
83  e *= 10;
84  e += *s - L'0';
85  s++;
86  }
87  }
88 
89  if (esign < 0)
90  for (i = 1; i <= e; i++)
91  r *= 0.1L;
92  else
93  for (i = 1; i <= e; i++)
94  r *= 10.0;
95 
96  if (sret)
97  *sret = (wchar_t *)s;
98  return r * sign;
99 }
100 #endif
static size_t double int int int * sign
Definition: printf.c:69
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define e
Definition: ke_i.h:82
GLbitfield flags
Definition: glext.h:7161
static const WCHAR L[]
Definition: oid.c:1250
GLdouble s
Definition: gl.h:2039
_Check_return_ double __cdecl wcstod(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define d
Definition: ke_i.h:81