winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
895 discussions
Start a n
N
ew thread
Jacek Caban : vbscript: Treat only ASCII digits as digits.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: a35adb1950b4eaadc0c53b77a6bd9dd89e1a73cf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a35adb1950b4eaadc0c53b77…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 21:28:32 2019 +0100 vbscript: Treat only ASCII digits as digits. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/lex.c | 14 +++++++------- dlls/vbscript/vbregexp.c | 4 ++-- dlls/vbscript/vbscript.h | 5 +++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 005e7c3d58..197285c98e 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -214,7 +214,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.') return *ctx->ptr++; - while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { + while(ctx->ptr < ctx->end && is_digit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) { exp++; @@ -223,7 +223,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) else d = hlp; } - while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { + while(ctx->ptr < ctx->end && is_digit(*ctx->ptr)) { exp++; ctx->ptr++; } @@ -232,7 +232,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) use_int = FALSE; ctx->ptr++; - while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { + while(ctx->ptr < ctx->end && is_digit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) break; @@ -240,7 +240,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) d = hlp; exp--; } - while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) + while(ctx->ptr < ctx->end && is_digit(*ctx->ptr)) ctx->ptr++; } @@ -255,7 +255,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) ctx->ptr++; } - if(!iswdigit(*ctx->ptr)) { + if(!is_digit(*ctx->ptr)) { FIXME("Invalid numeric literal\n"); return 0; } @@ -266,7 +266,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) e = e*10 + *(ctx->ptr++) - '0'; if(sign == -1 && -e+exp < -(INT_MAX/100)) { /* The literal will be rounded to 0 anyway. */ - while(iswdigit(*ctx->ptr)) + while(is_digit(*ctx->ptr)) ctx->ptr++; *(double*)ret = 0; return tDouble; @@ -276,7 +276,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) FIXME("Invalid numeric literal\n"); return 0; } - } while(iswdigit(*ctx->ptr)); + } while(is_digit(*ctx->ptr)); exp += sign*e; } diff --git a/dlls/vbscript/vbregexp.c b/dlls/vbscript/vbregexp.c index ac667da442..60c99772d3 100644 --- a/dlls/vbscript/vbregexp.c +++ b/dlls/vbscript/vbregexp.c @@ -1560,14 +1560,14 @@ static HRESULT WINAPI RegExp2_Replace(IRegExp2 *iface, BSTR source, VARIANT repl default: { DWORD idx; - if(!iswdigit(ptr[1])) { + if(!is_digit(ptr[1])) { hres = strbuf_append(&buf, ptr, 1); prev_ptr = ptr + 1; break; } idx = ptr[1] - '0'; - if(iswdigit(ptr[2]) && idx * 10 + (ptr[2] - '0') <= state->paren_count) { + if(is_digit(ptr[2]) && idx * 10 + (ptr[2] - '0') <= state->paren_count) { idx = idx * 10 + (ptr[2] - '0'); prev_ptr = ptr + 3; }else if(idx && idx <= state->paren_count) { diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 04a9b8372d..ef5cee23bf 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -373,6 +373,11 @@ static inline BOOL is_int32(double d) return INT32_MIN <= d && d <= INT32_MAX && (double)(int)d == d; } +static inline BOOL is_digit(WCHAR c) +{ + return '0' <= c && c <= '9'; +} + HRESULT create_regexp(IDispatch**) DECLSPEC_HIDDEN; BSTR string_replace(BSTR,BSTR,BSTR,int,int) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : jscript: Treat only ASCII digits as digits.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: f34cecbae27a484f1aa026840dc6d224ffa0b65d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f34cecbae27a484f1aa02684…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 21:26:08 2019 +0100 jscript: Treat only ASCII digits as digits. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/array.c | 4 ++-- dlls/jscript/dispex.c | 2 +- dlls/jscript/global.c | 18 ++++++++++-------- dlls/jscript/jscript.h | 5 +++++ dlls/jscript/json.c | 2 +- dlls/jscript/jsutils.c | 6 +++--- dlls/jscript/lex.c | 30 +++++++++++++++--------------- dlls/jscript/string.c | 4 ++-- dlls/jscript/tests/api.js | 1 + 9 files changed, 40 insertions(+), 32 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f34cecbae27a484f1aa0…
1
0
0
0
Michael Stefaniuc : vbscript: Remove redundant NULL checks before SysFreeString().
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: 8b7e38c542d0939c3f8cbd6d7c3d417fa801e1dc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b7e38c542d0939c3f8cbd6d…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Fri Nov 8 21:07:09 2019 +0100 vbscript: Remove redundant NULL checks before SysFreeString(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/global.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 8d4150ad70..a4442960d9 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -2948,19 +2948,19 @@ static HRESULT Err_Raise(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VA error = (code & ~0xffff) ? map_hres(code) : MAKE_VBSERROR(code); if(source) { - if(ctx->ei.bstrSource) SysFreeString(ctx->ei.bstrSource); + SysFreeString(ctx->ei.bstrSource); ctx->ei.bstrSource = source; } if(!ctx->ei.bstrSource) ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); if(description) { - if(ctx->ei.bstrDescription) SysFreeString(ctx->ei.bstrDescription); + SysFreeString(ctx->ei.bstrDescription); ctx->ei.bstrDescription = description; } if(!ctx->ei.bstrDescription) ctx->ei.bstrDescription = get_vbscript_error_string(error); if(helpfile) { - if(ctx->ei.bstrHelpFile) SysFreeString(ctx->ei.bstrHelpFile); + SysFreeString(ctx->ei.bstrHelpFile); ctx->ei.bstrHelpFile = helpfile; } if(args_cnt >= 5)
1
0
0
0
Jacek Caban : configure: Get rid of no longer needed __builtin_clz check.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: a94c8d5b6b68b883d3951b0064f39d427d269b25 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a94c8d5b6b68b883d3951b00…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 20:03:06 2019 +0100 configure: Get rid of no longer needed __builtin_clz check. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 33 --------------------------------- configure.ac | 9 --------- include/config.h.in | 3 --- 3 files changed, 45 deletions(-) diff --git a/configure b/configure index f1797bf603..ad0b149b7d 100755 --- a/configure +++ b/configure @@ -19490,39 +19490,6 @@ done LIBS="$ac_save_LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5 -$as_echo_n "checking for __builtin_clz... " >&6; } -if ${ac_cv_have___builtin_clz+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -return __builtin_clz(1) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_have___builtin_clz="yes" -else - ac_cv_have___builtin_clz="no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___builtin_clz" >&5 -$as_echo "$ac_cv_have___builtin_clz" >&6; } -if test "$ac_cv_have___builtin_clz" = "yes" -then - -$as_echo "#define HAVE___BUILTIN_CLZ 1" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 $as_echo_n "checking for __builtin_popcount... " >&6; } if ${ac_cv_have___builtin_popcount+:} false; then : diff --git a/configure.ac b/configure.ac index e5003f769c..4f651efbd5 100644 --- a/configure.ac +++ b/configure.ac @@ -2738,15 +2738,6 @@ AC_CHECK_FUNCS(\ ) LIBS="$ac_save_LIBS" -dnl Check for __builtin_clz -AC_CACHE_CHECK([for __builtin_clz], ac_cv_have___builtin_clz, - AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[return __builtin_clz(1)]])], - [ac_cv_have___builtin_clz="yes"], [ac_cv_have___builtin_clz="no"])) -if test "$ac_cv_have___builtin_clz" = "yes" -then - AC_DEFINE(HAVE___BUILTIN_CLZ, 1, [Define to 1 if you have the `__builtin_clz' built-in function.]) -fi - dnl Check for __builtin_popcount AC_CACHE_CHECK([for __builtin_popcount], ac_cv_have___builtin_popcount, AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[return __builtin_popcount(1)]])], diff --git a/include/config.h.in b/include/config.h.in index 9c7a49ae9a..858ee9bfd8 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1304,9 +1304,6 @@ /* Define to 1 if you have the `_spawnvp' function. */ #undef HAVE__SPAWNVP -/* Define to 1 if you have the `__builtin_clz' built-in function. */ -#undef HAVE___BUILTIN_CLZ - /* Define to 1 if you have the `__builtin_popcount' built-in function. */ #undef HAVE___BUILTIN_POPCOUNT
1
0
0
0
Jacek Caban : widl: Use strmake in get_name.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: c15f83a2a32d0026e22c8e3bf14231482d756d31 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c15f83a2a32d0026e22c8e3b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 20:01:43 2019 +0100 widl: Use strmake in get_name. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/header.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 61fadcf72f..c00a3e1bb3 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -180,18 +180,16 @@ static void write_namespace_end(FILE *header, struct namespace *namespace) const char *get_name(const var_t *v) { - static char buffer[256]; - + static char *buffer; + free( buffer ); if (is_attr( v->attrs, ATTR_PROPGET )) - strcpy( buffer, "get_" ); - else if (is_attr( v->attrs, ATTR_PROPPUT )) - strcpy( buffer, "put_" ); - else if (is_attr( v->attrs, ATTR_PROPPUTREF )) - strcpy( buffer, "putref_" ); - else - buffer[0] = 0; - strcat( buffer, v->name ); - return buffer; + return buffer = strmake( "get_%s", v->name ); + if (is_attr( v->attrs, ATTR_PROPPUT )) + return buffer = strmake( "put_%s", v->name ); + if (is_attr( v->attrs, ATTR_PROPPUTREF )) + return buffer = strmake( "putref_%s", v->name ); + buffer = NULL; + return v->name; } static void write_fields(FILE *h, var_list_t *fields)
1
0
0
0
Jacek Caban : widl: Don't use fixed size buffer in ctl2_encode_string.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: d5c745e4670b0fa226bbd3f006c6373c41a9da56 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d5c745e4670b0fa226bbd3f0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 20:01:31 2019 +0100 widl: Don't use fixed size buffer in ctl2_encode_string. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/write_msft.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index a573351e23..dc0a6cb45b 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -342,11 +342,14 @@ static int ctl2_encode_string( const char *string, /* [I] The string to encode. */ char **result) /* [O] A pointer to a pointer to receive the encoded string. */ { - int length; - static char converted_string[0x104]; + char *converted_string; + size_t length, size; int offset; length = strlen(string); + size = (length + 5) & ~3; + if (length < 3) size += 4; + converted_string = xmalloc(size); memcpy(converted_string + 2, string, length); #ifdef WORDS_BIGENDIAN @@ -365,8 +368,7 @@ static int ctl2_encode_string( for (offset = (4 - (length + 2)) & 3; offset; offset--) converted_string[length + offset + 1] = 0x57; *result = converted_string; - - return (length + 5) & ~3; + return size; } /**************************************************************************** @@ -604,6 +606,7 @@ static int ctl2_alloc_string( string_space = typelib->typelib_segment_data[MSFT_SEG_STRING] + offset; memcpy(string_space, encoded_string, length); + free(encoded_string); return offset; } @@ -684,6 +687,7 @@ static int alloc_importfile( importfile->lcid = typelib->typelib_header.lcid2; importfile->version = major_version | (minor_version << 16); memcpy(&importfile->filename, encoded_string, length); + free(encoded_string); return offset; }
1
0
0
0
Jacek Caban : widl: Don't use fixed size buffer in ctl2_encode_name.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: 908c2bec28be49dcfebc7b8b1d07fa50bbfff496 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=908c2bec28be49dcfebc7b8b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 8 20:01:23 2019 +0100 widl: Don't use fixed size buffer in ctl2_encode_name. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/write_msft.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 0e6ef087e5..a573351e23 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -291,27 +291,27 @@ static int ctl2_encode_name( const char *name, /* [I] The name string to encode. */ char **result) /* [O] A pointer to a pointer to receive the encoded name. */ { - int length; - static char converted_name[0x104]; + char *converted_name; + size_t length, size; int offset; int value; length = strlen(name); + size = (length + 7) & ~3; + converted_name = xmalloc(size + 1); memcpy(converted_name + 4, name, length); - converted_name[length + 4] = 0; - value = lhash_val_of_name_sys(typelib->typelib_header.varflags & 0x0f, typelib->typelib_header.lcid, converted_name + 4); #ifdef WORDS_BIGENDIAN converted_name[3] = length & 0xff; - converted_name[2] = 0x00; + converted_name[2] = length >> 8; converted_name[1] = value; converted_name[0] = value >> 8; #else converted_name[0] = length & 0xff; - converted_name[1] = 0x00; + converted_name[1] = length >> 8; converted_name[2] = value; converted_name[3] = value >> 8; #endif @@ -320,7 +320,7 @@ static int ctl2_encode_name( *result = converted_name; - return (length + 7) & ~3; + return size; } /**************************************************************************** @@ -548,7 +548,11 @@ static int ctl2_alloc_name( length = ctl2_encode_name(typelib, name, &encoded_name); offset = ctl2_find_name(typelib, encoded_name); - if (offset != -1) return offset; + if (offset != -1) + { + free(encoded_name); + return offset; + } offset = ctl2_alloc_segment(typelib, MSFT_SEG_NAME, length + 8, 0); @@ -565,6 +569,7 @@ static int ctl2_alloc_name( typelib->typelib_header.nametablecount += 1; typelib->typelib_header.nametablechars += *encoded_name; + free(encoded_name); return offset; }
1
0
0
0
Gabriel Ivăncescu : vbscript: Implement script persistence.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: e2eb099a943f82f18a9efeea5a6175ccb88680de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e2eb099a943f82f18a9efeea…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Nov 8 18:19:06 2019 +0100 vbscript: Implement script persistence. Persistent code has to be re-executed if the script is uninitialized and then reinitialized and restarted. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 5 ++++- dlls/vbscript/vbscript.c | 12 ++++++++++++ dlls/vbscript/vbscript.h | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 9c18e2bf27..de45961ad6 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -1997,8 +1997,11 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli class->next = script->classes; script->classes = ctx.classes; + code->last_class = class; } + code->is_persistent = (flags & SCRIPTTEXT_ISPERSISTENT) != 0; + if(TRACE_ON(vbscript_disas)) dump_code(&ctx); @@ -2016,7 +2019,7 @@ HRESULT compile_procedure(script_ctx_t *script, const WCHAR *src, const WCHAR *d vbscode_t *code; HRESULT hres; - hres = compile_script(script, src, delimiter, flags, &code); + hres = compile_script(script, src, delimiter, flags & ~SCRIPTTEXT_ISPERSISTENT, &code); if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 47fa4562f4..07763fa3d7 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -130,6 +130,7 @@ IDispatch *lookup_named_item(script_ctx_t *ctx, const WCHAR *name, unsigned flag static void release_script(script_ctx_t *ctx) { + vbscode_t *code, *code_next; class_desc_t *class_desc; unsigned i; @@ -148,6 +149,17 @@ static void release_script(script_ctx_t *ctx) ctx->global_funcs_cnt = 0; ctx->global_funcs_size = 0; + LIST_FOR_EACH_ENTRY_SAFE(code, code_next, &ctx->code_list, vbscode_t, entry) + { + if(code->is_persistent) + { + code->pending_exec = TRUE; + if(code->last_class) code->last_class->next = NULL; + } + else + release_vbscode(code); + } + while(!list_empty(&ctx->named_items)) { named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry); diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 9f14e147ba..04a9b8372d 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -341,6 +341,7 @@ struct _vbscode_t { BOOL option_explicit; BOOL pending_exec; + BOOL is_persistent; function_t main_code; IDispatch *context; @@ -349,6 +350,8 @@ struct _vbscode_t { unsigned bstr_cnt; heap_pool_t heap; + class_desc_t *last_class; + struct list entry; };
1
0
0
0
Gabriel Ivăncescu : vbscript: Avoid special casing the global function when compiling a function's variables.
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: 71ce853032fd3c9bd6a54f48e6a7795ad4f42c90 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=71ce853032fd3c9bd6a54f48…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Nov 8 18:18:57 2019 +0100 vbscript: Avoid special casing the global function when compiling a function's variables. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 77 ++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 45 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 7b6649ec56..9c18e2bf27 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -56,7 +56,6 @@ typedef struct { dim_decl_t *dim_decls; dim_decl_t *dim_decls_tail; - dynamic_var_t *global_vars; const_decl_t *const_decls; const_decl_t *global_consts; @@ -1479,43 +1478,19 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f if(func->var_cnt) { dim_decl_t *dim_decl; + unsigned i; - if(func->type == FUNC_GLOBAL) { - dynamic_var_t *new_var; - - func->var_cnt = 0; - - for(dim_decl = ctx->dim_decls; dim_decl; dim_decl = dim_decl->next) { - new_var = compiler_alloc(ctx->code, sizeof(*new_var)); - if(!new_var) - return E_OUTOFMEMORY; - - new_var->name = compiler_alloc_string(ctx->code, dim_decl->name); - if(!new_var->name) - return E_OUTOFMEMORY; - - V_VT(&new_var->v) = VT_EMPTY; - new_var->is_const = FALSE; - new_var->array = NULL; - - new_var->next = ctx->global_vars; - ctx->global_vars = new_var; - } - }else { - unsigned i; + func->vars = compiler_alloc(ctx->code, func->var_cnt * sizeof(var_desc_t)); + if(!func->vars) + return E_OUTOFMEMORY; - func->vars = compiler_alloc(ctx->code, func->var_cnt * sizeof(var_desc_t)); - if(!func->vars) + for(dim_decl = ctx->dim_decls, i=0; dim_decl; dim_decl = dim_decl->next, i++) { + func->vars[i].name = compiler_alloc_string(ctx->code, dim_decl->name); + if(!func->vars[i].name) return E_OUTOFMEMORY; - - for(dim_decl = ctx->dim_decls, i=0; dim_decl; dim_decl = dim_decl->next, i++) { - func->vars[i].name = compiler_alloc_string(ctx->code, dim_decl->name); - if(!func->vars[i].name) - return E_OUTOFMEMORY; - } - - assert(i == func->var_cnt); } + + assert(i == func->var_cnt); } if(func->array_cnt) { @@ -1809,12 +1784,13 @@ static BOOL lookup_script_identifier(script_ctx_t *script, const WCHAR *identifi static HRESULT check_script_collisions(compile_ctx_t *ctx, script_ctx_t *script) { + unsigned i, var_cnt = ctx->code->main_code.var_cnt; + var_desc_t *vars = ctx->code->main_code.vars; class_desc_t *class; - dynamic_var_t *var; - for(var = ctx->global_vars; var; var = var->next) { - if(lookup_script_identifier(script, var->name)) { - FIXME("%s: redefined\n", debugstr_w(var->name)); + for(i = 0; i < var_cnt; i++) { + if(lookup_script_identifier(script, vars[i].name)) { + FIXME("%s: redefined\n", debugstr_w(vars[i].name)); return E_FAIL; } } @@ -1894,10 +1870,10 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli function_t *new_func, *func_iter; function_decl_t *func_decl; class_decl_t *class_decl; - dynamic_var_t *var_iter; compile_ctx_t ctx; vbscode_t *code; size_t cnt; + unsigned i; HRESULT hres; if (!src) src = L""; @@ -1912,7 +1888,6 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli ctx.funcs = NULL; ctx.func_decls = NULL; - ctx.global_vars = NULL; ctx.classes = NULL; ctx.labels = NULL; ctx.global_consts = NULL; @@ -1952,9 +1927,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli return compile_error(script, hres); } - cnt = script->global_vars_cnt; - for(var_iter = ctx.global_vars; var_iter; var_iter = var_iter->next) - cnt++; + cnt = script->global_vars_cnt + ctx.code->main_code.var_cnt; if(cnt > script->global_vars_size) { dynamic_var_t **new_vars; if(script->global_vars) @@ -1982,8 +1955,22 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli script->global_funcs_size = cnt; } - for(var_iter = ctx.global_vars; var_iter; var_iter = var_iter->next) - script->global_vars[script->global_vars_cnt++] = var_iter; + for(i = 0; i < ctx.code->main_code.var_cnt; i++) { + dynamic_var_t *var = compiler_alloc(ctx.code, sizeof(*var)); + if(!var) { + release_compiler(&ctx); + return compile_error(script, E_OUTOFMEMORY); + } + + var->name = ctx.code->main_code.vars[i].name; + V_VT(&var->v) = VT_EMPTY; + var->is_const = FALSE; + var->array = NULL; + + script->global_vars[script->global_vars_cnt + i] = var; + } + + script->global_vars_cnt += ctx.code->main_code.var_cnt; for(func_iter = ctx.funcs; func_iter; func_iter = func_iter->next) { unsigned i;
1
0
0
0
Francois Gouget : kernel32: Match the Windows 10 1709+ GetConsoleFontInfo().
by Alexandre Julliard
08 Nov '19
08 Nov '19
Module: wine Branch: master Commit: 31046449e6a0ff2c47b4bfb1f1ad2f08a168c4f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=31046449e6a0ff2c47b4bfb1…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Nov 6 16:46:09 2019 +0100 kernel32: Match the Windows 10 1709+ GetConsoleFontInfo(). That is return the same 'E_NOTIMPL' error code. Remove the todo_wine-s but keep the tests in case we want to implement the API for compatibility with older Windows versions. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/console.c | 2 +- dlls/kernel32/tests/console.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 03df90c7e1..4c0bee2caf 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1711,7 +1711,7 @@ COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index) BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, CONSOLE_FONT_INFO *info) { FIXME("(%p %d %u %p): stub!\n", hConsole, maximize, numfonts, info); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */); return FALSE; } diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 97bea44e19..a22051deaf 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2847,7 +2847,7 @@ static void test_GetConsoleFontInfo(HANDLE std_output) pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); if (!pGetNumberOfConsoleFonts) { - win_skip("GetNumberOfConsoleFonts is not available\n"); + skip("GetNumberOfConsoleFonts is not available\n"); return; } @@ -2873,17 +2873,17 @@ static void test_GetConsoleFontInfo(HANDLE std_output) HeapFree(GetProcessHeap(), 0, cfi); return; } - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), FALSE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(std_output, FALSE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); GetConsoleScreenBufferInfo(std_output, &csbi); win_width = csbi.srWindow.Right - csbi.srWindow.Left + 1; @@ -2895,11 +2895,11 @@ static void test_GetConsoleFontInfo(HANDLE std_output) memset(cfi, 0, memsize); ret = pGetConsoleFontInfo(std_output, FALSE, num_fonts, cfi); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(cfi[index].dwFontSize.X == win_width, "got %d, expected %d\n", - cfi[index].dwFontSize.X, win_width); - todo_wine ok(cfi[index].dwFontSize.Y == win_height, "got %d, expected %d\n", - cfi[index].dwFontSize.Y, win_height); + ok(ret, "got %d, expected non-zero\n", ret); + ok(cfi[index].dwFontSize.X == win_width, "got %d, expected %d\n", + cfi[index].dwFontSize.X, win_width); + ok(cfi[index].dwFontSize.Y == win_height, "got %d, expected %d\n", + cfi[index].dwFontSize.Y, win_height); for (i = 0; i < num_fonts; i++) { @@ -2907,32 +2907,32 @@ static void test_GetConsoleFontInfo(HANDLE std_output) tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); tmp_w = (double)orig_font.X / tmp_font.X * win_width; tmp_h = (double)orig_font.Y / tmp_font.Y * win_height; - todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); - todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); + ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); + ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); } SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(NULL, TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(std_output, TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); memset(cfi, 0, memsize); ret = pGetConsoleFontInfo(std_output, TRUE, num_fonts, cfi); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(cfi[index].dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n", - cfi[index].dwFontSize.X, csbi.dwMaximumWindowSize.X); - todo_wine ok(cfi[index].dwFontSize.Y == csbi.dwMaximumWindowSize.Y, "got %d, expected %d\n", - cfi[index].dwFontSize.Y, csbi.dwMaximumWindowSize.Y); + ok(ret, "got %d, expected non-zero\n", ret); + ok(cfi[index].dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n", + cfi[index].dwFontSize.X, csbi.dwMaximumWindowSize.X); + ok(cfi[index].dwFontSize.Y == csbi.dwMaximumWindowSize.Y, "got %d, expected %d\n", + cfi[index].dwFontSize.Y, csbi.dwMaximumWindowSize.Y); for (i = 0; i < num_fonts; i++) { @@ -2940,8 +2940,8 @@ static void test_GetConsoleFontInfo(HANDLE std_output) tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); tmp_w = (double)orig_font.X / tmp_font.X * csbi.dwMaximumWindowSize.X; tmp_h = (double)orig_font.Y / tmp_font.Y * csbi.dwMaximumWindowSize.Y; - todo_wine ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); - todo_wine ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); + ok(cfi[i].dwFontSize.X == tmp_w, "got %d, expected %d\n", cfi[i].dwFontSize.X, tmp_w); + ok(cfi[i].dwFontSize.Y == tmp_h, "got %d, expected %d\n", cfi[i].dwFontSize.Y, tmp_h); } HeapFree(GetProcessHeap(), 0, cfi);
1
0
0
0
← Newer
1
...
66
67
68
69
70
71
72
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200