Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
29ff1449
Commit
29ff1449
authored
Mar 05, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added jsstr_flush helper and use it in array_join.
parent
0effd926
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
array.c
dlls/jscript/array.c
+4
-13
jsstr.h
dlls/jscript/jsstr.h
+7
-0
No files found.
dlls/jscript/array.c
View file @
29ff1449
...
...
@@ -286,15 +286,10 @@ static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, cons
if
(
SUCCEEDED
(
hres
))
ret
=
jsstr_alloc_buf
(
len
);
if
(
ret
)
{
unsigned
tmplen
;
ptr
=
ret
->
str
;
if
(
str_tab
[
0
])
{
tmplen
=
jsstr_length
(
str_tab
[
0
]);
memcpy
(
ptr
,
str_tab
[
0
]
->
str
,
tmplen
*
sizeof
(
WCHAR
));
ptr
+=
tmplen
;
}
if
(
str_tab
[
0
])
ptr
+=
jsstr_flush
(
str_tab
[
0
],
ptr
);
for
(
i
=
1
;
i
<
length
;
i
++
)
{
if
(
seplen
)
{
...
...
@@ -302,13 +297,9 @@ static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, cons
ptr
+=
seplen
;
}
if
(
str_tab
[
i
])
{
tmplen
=
jsstr_length
(
str_tab
[
i
]);
memcpy
(
ptr
,
str_tab
[
i
]
->
str
,
tmplen
*
sizeof
(
WCHAR
));
ptr
+=
tmplen
;
}
if
(
str_tab
[
i
])
ptr
+=
jsstr_flush
(
str_tab
[
i
],
ptr
);
}
*
ptr
=
0
;
}
else
{
hres
=
E_OUTOFMEMORY
;
}
...
...
dlls/jscript/jsstr.h
View file @
29ff1449
...
...
@@ -59,6 +59,13 @@ static inline BOOL jsstr_eq(jsstr_t *str1, jsstr_t *str2)
return
len
==
jsstr_length
(
str2
)
&&
!
memcmp
(
str1
->
str
,
str2
->
str
,
len
*
sizeof
(
WCHAR
));
}
static
inline
unsigned
jsstr_flush
(
jsstr_t
*
str
,
WCHAR
*
buf
)
{
unsigned
len
=
jsstr_length
(
str
);
memcpy
(
buf
,
str
->
str
,
len
*
sizeof
(
WCHAR
));
return
len
;
}
static
inline
jsstr_t
*
jsstr_substr
(
jsstr_t
*
str
,
unsigned
off
,
unsigned
len
)
{
return
jsstr_alloc_len
(
str
->
str
+
off
,
len
);
...
...
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