Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
74416052
Commit
74416052
authored
Dec 28, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Moved allocating double literal to separated function.
parent
501cad69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
lex.c
dlls/jscript/lex.c
+15
-9
No files found.
dlls/jscript/lex.c
View file @
74416052
...
...
@@ -364,7 +364,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret, WCHAR endc
return
tStringLiteral
;
}
static
literal_t
*
alloc
_int_literal
(
parser_ctx_t
*
ctx
,
LONG
l
)
static
literal_t
*
new
_int_literal
(
parser_ctx_t
*
ctx
,
LONG
l
)
{
literal_t
*
ret
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
...
...
@@ -374,6 +374,15 @@ static literal_t *alloc_int_literal(parser_ctx_t *ctx, LONG l)
return
ret
;
}
static
literal_t
*
new_double_literal
(
parser_ctx_t
*
ctx
,
DOUBLE
d
)
{
literal_t
*
ret
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
ret
->
type
=
LT_DOUBLE
;
ret
->
u
.
dval
=
d
;
return
ret
;
}
literal_t
*
new_boolean_literal
(
parser_ctx_t
*
ctx
,
VARIANT_BOOL
bval
)
{
literal_t
*
ret
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
...
...
@@ -455,10 +464,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
else
exp
+=
e
;
}
*
literal
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
(
*
literal
)
->
type
=
LT_DOUBLE
;
(
*
literal
)
->
u
.
dval
=
(
double
)
d
*
pow
(
10
,
exp
);
*
literal
=
new_double_literal
(
ctx
,
(
DOUBLE
)
d
*
pow
(
10
,
exp
));
return
tNumericLiteral
;
}
...
...
@@ -468,7 +474,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
l
=
*
ctx
->
ptr
++
-
'0'
;
if
(
ctx
->
ptr
==
ctx
->
end
)
{
*
literal
=
alloc
_int_literal
(
ctx
,
l
);
*
literal
=
new
_int_literal
(
ctx
,
l
);
return
tNumericLiteral
;
}
...
...
@@ -489,7 +495,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
return
lex_error
(
ctx
,
E_FAIL
);
}
*
literal
=
alloc
_int_literal
(
ctx
,
l
);
*
literal
=
new
_int_literal
(
ctx
,
l
);
return
tNumericLiteral
;
}
...
...
@@ -498,7 +504,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
return
lex_error
(
ctx
,
E_FAIL
);
}
*
literal
=
alloc
_int_literal
(
ctx
,
0
);
*
literal
=
new
_int_literal
(
ctx
,
0
);
}
while
(
ctx
->
ptr
<
ctx
->
end
&&
isdigitW
(
*
ctx
->
ptr
))
...
...
@@ -523,7 +529,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
}
}
*
literal
=
alloc
_int_literal
(
ctx
,
l
);
*
literal
=
new
_int_literal
(
ctx
,
l
);
return
tNumericLiteral
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment