This is more code refactoring than micro-optimization. Modern compilers may skip optimizations in some places, so we strictly make it clear to them that we need common variable to determine const result strlen() function.
From: Herman Semenov GermanAizek@yandex.ru
--- dlls/crypt32/base64.c | 3 ++- dlls/crypt32/unixlib.c | 11 ++++++----- dlls/ntdll/actctx.c | 8 +++++--- dlls/ntdll/unix/file.c | 12 +++++++----- dlls/ntdll/unix/loader.c | 14 +++++++++----- dlls/ntdll/unix/loadorder.c | 5 +++-- dlls/winebus.sys/bus_udev.c | 5 +++-- dlls/wineps.drv/ps.c | 6 ++++-- dlls/wldap32/init.c | 15 ++++++++++----- dlls/wldap32/winldap_private.h | 5 +++-- 10 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index 298756ca541..25690c0c919 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -109,6 +109,7 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep, ptr = out_buf; end = ptr + *out_len; i = 0; + size_t len_sep = strlen(sep); while (div > 0 && ptr < end) { /* first char is the first 6 bits of the first byte*/ @@ -127,7 +128,7 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep, div--;
if (i && i % 64 == 0) - ptr += stradd(ptr, end, sep, strlen(sep)); + ptr += stradd(ptr, end, sep, len_sep); }
switch(pad_bytes) diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c index 5a255442fdf..ab37d5da621 100644 --- a/dlls/crypt32/unixlib.c +++ b/dlls/crypt32/unixlib.c @@ -509,18 +509,19 @@ static void import_certs_from_file( int fd )
if (!fp) return; TRACE("\n"); + static const char header[] = "-----BEGIN CERTIFICATE-----"; + static const char trailer[] = "-----END CERTIFICATE-----"; + size_t len_header = strlen(header); + size_t len_trailer = strlen(trailer); while (fgets(line, sizeof(line), fp)) { - static const char header[] = "-----BEGIN CERTIFICATE-----"; - static const char trailer[] = "-----END CERTIFICATE-----"; - - if (!strncmp(line, header, strlen(header))) + if (!strncmp(line, header, len_header)) { TRACE("begin new certificate\n"); in_cert = TRUE; reset_buffer(&saved_cert); } - else if (!strncmp(line, trailer, strlen(trailer))) + else if (!strncmp(line, trailer, len_trailer)) { TRACE("end of certificate, adding cert\n"); in_cert = FALSE; diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index a4581d05b91..6439c761b10 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -4272,6 +4272,7 @@ static void get_comserver_datalen(const struct entity_array *entities, const str { unsigned int i;
+ size_t len_dll_name = (wcslen(dll->name)+1)*sizeof(WCHAR); for (i = 0; i < entities->num; i++) { struct entity *entity = &entities->base[i]; @@ -4307,7 +4308,7 @@ static void get_comserver_datalen(const struct entity_array *entities, const str if (entity->u.comclass.progid) *len += aligned_string_len((wcslen(entity->u.comclass.progid)+1)*sizeof(WCHAR));
- *module_len += (wcslen(dll->name)+1)*sizeof(WCHAR); + *module_len += len_dll_name; }
*count += 1; @@ -4321,6 +4322,7 @@ static void add_comserver_record(const struct guidsection_header *section, const { unsigned int i;
+ size_t len_module = wcslen(L"MSCOREE.DLL")*sizeof(WCHAR); for (i = 0; i < entities->num; i++) { struct entity *entity = &entities->base[i]; @@ -4338,7 +4340,7 @@ static void add_comserver_record(const struct guidsection_header *section, const else progid_len = 0;
- module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(L"MSCOREE.DLL")*sizeof(WCHAR); + module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : len_module;
/* setup new index entry */ RtlInitUnicodeString(&str, entity->u.comclass.clsid); @@ -4404,7 +4406,7 @@ static void add_comserver_record(const struct guidsection_header *section, const clrdata->size = sizeof(*clrdata); clrdata->res[0] = 0; clrdata->res[1] = 2; /* FIXME: unknown field */ - clrdata->module_len = wcslen(L"MSCOREE.DLL")*sizeof(WCHAR); + clrdata->module_len = len_module; clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR); clrdata->name_len = wcslen(entity->u.comclass.name)*sizeof(WCHAR); clrdata->name_offset = clrdata->size; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 8bc69557057..810cc445c85 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3397,10 +3397,11 @@ done: TRACE( "%s -> %s\n", wine_dbgstr_longlong(file_id), debugstr_a(unix_name) ); *unix_name_ret = unix_name;
- nt_name->MaximumLength = (strlen(unix_name) + 1) * sizeof(WCHAR); + size_t len_unix_name = strlen(unix_name); + nt_name->MaximumLength = ( + 1) * sizeof(WCHAR); if ((nt_name->Buffer = malloc( nt_name->MaximumLength ))) { - DWORD i, len = ntdll_umbstowcs( unix_name, strlen(unix_name), nt_name->Buffer, strlen(unix_name) ); + DWORD i, len = ntdll_umbstowcs( unix_name, len_unix_name, nt_name->Buffer, len_unix_name ); nt_name->Buffer[len] = 0; nt_name->Length = len * sizeof(WCHAR); for (i = 0; i < len; i++) if (nt_name->Buffer[i] == '/') nt_name->Buffer[i] = '\'; @@ -3743,10 +3744,11 @@ NTSTATUS WINAPI wine_nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char * char *name = buffer;
/* remove dosdevices prefix for z: drive if it points to the Unix root */ - if (!strncmp( buffer, config_dir, strlen(config_dir) ) && - !strncmp( buffer + strlen(config_dir), "/dosdevices/z:/", 15 )) + size_t len_config_dir = strlen(config_dir); + if (!strncmp( buffer, config_dir, len_config_dir ) && + !strncmp( buffer + len_config_dir, "/dosdevices/z:/", 15 )) { - char *p = buffer + strlen(config_dir) + 14; + char *p = buffer + len_config_dir + 14; *p = 0; if (!stat( buffer, &st1 ) && !stat( "/", &st2 ) && st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 68cd4f50420..c35e3eeea9c 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -540,7 +540,8 @@ static void preloader_exec( char **argv ) if (!(p = strrchr( argv[1], '/' ))) p = argv[1]; else p++;
- if (strlen(p) > 2 && !strcmp( p + strlen(p) - 2, "64" )) preloader = "wine64-preloader"; + size_t len_p = strlen( p ); + if (len_p > 2 && !strcmp( p + len_p - 2, "64" )) preloader = "wine64-preloader"; argv[0] = malloc( p - argv[1] + strlen(preloader) + 1 ); memcpy( argv[0], argv[1], p - argv[1] ); strcpy( argv[0] + (p - argv[1]), preloader ); @@ -1254,17 +1255,19 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T } }
+ size_t len_so_dir = strlen(so_dir); + size_t len_pe_dir = strlen(pe_dir); for (i = 0; dll_paths[i]; i++) { ptr = file + pos; file[pos + len + 1] = 0; - ptr = prepend( ptr, pe_dir, strlen(pe_dir) ); + ptr = prepend( ptr, pe_dir, len_pe_dir ); ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) ); status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, limit_low, limit_high, load_machine, prefer_native ); /* use so dir for unix lib */ ptr = file + pos; - ptr = prepend( ptr, so_dir, strlen(so_dir) ); + ptr = prepend( ptr, so_dir, len_so_dir ); ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) ); if (status != STATUS_DLL_NOT_FOUND) goto done; if (try_so) @@ -1487,8 +1490,9 @@ NTSTATUS load_main_exe( const WCHAR *dos_name, const char *unix_name, const WCHA
if (!dos_name) { - dos_name = tmp = malloc( (strlen(unix_name) + 1) * sizeof(WCHAR) ); - ntdll_umbstowcs( unix_name, strlen(unix_name) + 1, tmp, strlen(unix_name) + 1 ); + size_t len_unix_name = strlen(unix_name) + 1; + dos_name = tmp = malloc( len_unix_name * sizeof(WCHAR) ); + ntdll_umbstowcs( unix_name, len_unix_name, tmp, len_unix_name ); } contains_path = (wcschr( dos_name, '/' ) || wcschr( dos_name, '\' ) || diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c index aa987a80186..dc40d0cd7e3 100644 --- a/dlls/ntdll/unix/loadorder.c +++ b/dlls/ntdll/unix/loadorder.c @@ -230,8 +230,9 @@ static void init_load_order(void) init_done = TRUE;
if (!overrides) return; - order = entry = malloc( (strlen(overrides) + 1) * sizeof(WCHAR) ); - ntdll_umbstowcs( overrides, strlen(overrides) + 1, order, strlen(overrides) + 1 ); + size_t len_overrides = strlen( overrides ) + 1; + order = entry = malloc( len_overrides * sizeof(WCHAR) ); + ntdll_umbstowcs( overrides, len_overrides, order, len_overrides ); while (*entry) { while (*entry == ';') entry++; diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 561f0cdc0e4..627b793cae8 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1491,6 +1491,7 @@ static void process_inotify_event(int fd) ssize_t bytes; int n, len;
+ size_t len_buf_event = strlen(buf.event.name); if ((bytes = read(fd, &buf, sizeof(buf))) < 0) WARN("read failed: %u %s\n", errno, strerror(errno)); else while (bytes > 0) @@ -1499,7 +1500,7 @@ static void process_inotify_event(int fd) { if (buf.event.wd == dev_watch) { - if (sscanf(buf.event.name, "hidraw%u%n", &n, &len) != 1 || len != strlen(buf.event.name)) + if (sscanf(buf.event.name, "hidraw%u%n", &n, &len) != 1 || len != len_buf_event) WARN("ignoring %s, name doesn't match hidraw%%u\n", debugstr_a(buf.event.name)); else if (buf.event.mask & (IN_DELETE | IN_MOVED_FROM)) maybe_remove_devnode(buf.event.name, "/dev"); @@ -1514,7 +1515,7 @@ static void process_inotify_event(int fd) #ifdef HAS_PROPER_INPUT_HEADER else if (buf.event.wd == devinput_watch) { - if (sscanf(buf.event.name, "event%u%n", &n, &len) != 1 || len != strlen(buf.event.name)) + if (sscanf(buf.event.name, "event%u%n", &n, &len) != 1 || len != len_buf_event) WARN("ignoring %s, name doesn't match event%%u\n", debugstr_a(buf.event.name)); else if (buf.event.mask & (IN_DELETE | IN_MOVED_FROM)) maybe_remove_devnode(buf.event.name, "/dev/input"); diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index 7a8feeaedb8..44026508ff3 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -481,7 +481,8 @@ INT PSDRV_WriteFooter( print_ctx *ctx ) sprintf(buf, psfooter, ctx->bbox.left, ctx->bbox.top, ctx->bbox.right, ctx->bbox.bottom, ctx->job.PageNo);
- if( write_spool( ctx, buf, strlen(buf) ) != strlen(buf) ) { + size_t len_buf = strlen(buf); + if( write_spool( ctx, buf, len_buf ) != len_buf ) { WARN("WriteSpool error\n"); ret = 0; } @@ -577,7 +578,8 @@ INT PSDRV_WriteNewPage( print_ctx *ctx ) GetDeviceCaps(ctx->hdc, ASPECTX), GetDeviceCaps(ctx->hdc, ASPECTY), xtrans, ytrans, rotation);
- if( write_spool( ctx, buf, strlen(buf) ) != strlen(buf) ) { + size_t len_buf = strlen(buf); + if( write_spool( ctx, buf, len_buf) != len_buf ) { WARN("WriteSpool error\n"); return 0; } diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index 44fc44ee485..882b713476a 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -124,11 +124,13 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum
sprintf( port, ":%lu", portnumber );
+ size_t len_port = strlen( port ); + size_t len_scheme = strlen( scheme ); for (v = hostnames; *v; v++) { if (!has_ldap_scheme( *v )) { - size += strlen( scheme ); + size += len_scheme; q = *v; } else @@ -138,7 +140,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum size += strlen( *v );
if (!strchr( q, ':' )) - size += strlen( port ); + size += len_port;
i++; } @@ -147,18 +149,21 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum if (!(res = malloc( size + 1 ))) return NULL;
p = res; + size_t len_scheme = strlen( scheme ); + size_t len_sep = strlen( sep ); + size_t len_port = strlen( port ); for (v = hostnames; *v; v++) { if (v != hostnames) { strcpy( p, sep ); - p += strlen( sep ); + p += len_sep; }
if (!has_ldap_scheme( *v )) { strcpy( p, scheme ); - p += strlen( scheme ); + p += len_scheme; q = *v; } else @@ -171,7 +176,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum if (!strchr( q, ':' )) { strcpy( p, port ); - p += strlen( port ); + p += len_port; } } return res; diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h index d75ba425774..8ee5c0c8181 100644 --- a/dlls/wldap32/winldap_private.h +++ b/dlls/wldap32/winldap_private.h @@ -624,7 +624,8 @@ static inline WCHAR *strnAtoW( const char *str, DWORD in_len, DWORD *out_len )
static inline char *strreplace( const char *s, const char *before, const char *after ) { - char *ret = malloc( strlen( s ) + strlen( after ) / strlen( before ) + 1 ); + size_t len_before = strlen( before ); + char *ret = malloc( strlen( s ) + strlen( after ) / len_before + 1 ); char *cur, *prev = ret; if (ret) { @@ -633,7 +634,7 @@ static inline char *strreplace( const char *s, const char *before, const char *a { strncat( ret, prev, cur - prev ); strcat( ret, after ); - prev = cur + strlen( before ); + prev = cur + len_before; } strncat( ret, prev, cur - prev ); }
From: Herman Semenov GermanAizek@yandex.ru
--- tools/sfnt2fon/sfnt2fon.c | 5 +++-- tools/widl/typegen.c | 6 +++++- tools/widl/typetree.c | 3 ++- tools/winebuild/import.c | 10 ++++++---- tools/winedump/search.c | 7 ++++--- tools/winegcc/winegcc.c | 9 ++++++--- 6 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/tools/sfnt2fon/sfnt2fon.c b/tools/sfnt2fon/sfnt2fon.c index bf31124aa25..4b13806a706 100644 --- a/tools/sfnt2fon/sfnt2fon.c +++ b/tools/sfnt2fon/sfnt2fon.c @@ -887,8 +887,9 @@ int main(int argc, char **argv) name, info[i]->hdr.fi.dfPoints ); strcpy(resident_name, name); } else { - snprintf(non_resident_name + strlen(non_resident_name), - sizeof(non_resident_name) - strlen(non_resident_name), + size_t len_n_res_name = strlen(non_resident_name); + snprintf(non_resident_name + len_n_res_name, + sizeof(non_resident_name) - len_n_res_name, ",%d", info[i]->hdr.fi.dfPoints ); } } diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index c29bbba1c1c..c0c247486fe 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1270,7 +1270,11 @@ static unsigned int write_new_procformatstring_type(FILE *file, int indent, cons if (flags & IsBasetype) strcat( buffer, " base type," ); if (flags & IsByValue) strcat( buffer, " by value," ); if (flags & IsSimpleRef) strcat( buffer, " simple ref," ); - if (flags >> 13) snprintf( buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), " srv size=%u,", (flags >> 13) * 8 ); + if (flags >> 13) + { + size_t len_buf = strlen(buffer); + snprintf( buffer + len_buf, sizeof(buffer) - len_buf, " srv size=%u,", (flags >> 13) * 8 ); + } strcpy( buffer + strlen( buffer ) - 1, " */" ); print_file( file, indent, "NdrFcShort(0x%hx),\t%s\n", flags, buffer ); print_file( file, indent, "NdrFcShort(0x%x), /* stack offset = %u */\n", diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index af41906c42b..719d0afbe52 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -327,10 +327,11 @@ static char *format_parameterized_type_c_name(type_t *type, typeref_list_t *para else pos += append_namespaces(&buf, &len, pos, type->namespace, "_", "__C", type->name, NULL); }
+ size_t len_ns_prefix = strlen(ns_prefix); for (i = 0; i < ARRAY_SIZE(parameterized_type_shorthands); ++i) { if ((tmp = strstr(buf, parameterized_type_shorthands[i][0])) && - (tmp - buf) == strlen(ns_prefix) + (abi_prefix ? 5 : 0)) + (tmp - buf) == len_ns_prefix + (abi_prefix ? 5 : 0)) { tmp += strlen(parameterized_type_shorthands[i][0]); strcpy(buf, parameterized_type_shorthands[i][1]); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 6aee0fa98f8..77349142c12 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -569,6 +569,8 @@ void read_undef_symbols( DLLSPEC *spec, struct strarray files ) if (!(f = popen( cmd, "r" ))) fatal_error( "Cannot execute '%s'\n", cmd );
+ size_t len_import_ord = strlen( import_ord_prefix ); + size_t len_import_func = strlen( import_func_prefix ); while (fgets( buffer, sizeof(buffer), f )) { char *p = buffer + strlen(buffer) - 1; @@ -578,10 +580,10 @@ void read_undef_symbols( DLLSPEC *spec, struct strarray files ) while (*p == ' ') p++; if (p[0] == 'U' && p[1] == ' ' && p[2]) p += 2; if (prefix_len && !strncmp( p, name_prefix, prefix_len )) p += prefix_len; - if (!strncmp( p, import_func_prefix, strlen(import_func_prefix) )) - add_undef_import( p + strlen( import_func_prefix ), 0 ); - else if (!strncmp( p, import_ord_prefix, strlen(import_ord_prefix) )) - add_undef_import( p + strlen( import_ord_prefix ), 1 ); + if (!strncmp( p, import_func_prefix, len_import_func )) + add_undef_import( p + len_import_func, 0 ); + else if (!strncmp( p, import_ord_prefix, len_import_ord )) + add_undef_import( p + len_import_ord, 1 ); else if (use_msvcrt || !find_name( p, stdc_functions )) strarray_add( &undef_symbols, xstrdup( p )); } diff --git a/tools/winedump/search.c b/tools/winedump/search.c index 632d5de7aae..cc09ad104f1 100644 --- a/tools/winedump/search.c +++ b/tools/winedump/search.c @@ -119,11 +119,12 @@ BOOL symbol_search (parsed_symbol *sym) if (VERBOSE) puts (grep_buff);
+ size_t len_sym = strlen (sym->symbol); while ((iter = strstr (iter, sym->symbol))) { if (iter > grep_buff && (iter[-1] == ' ' || iter[-1] == '*') && - (iter[strlen (sym->symbol)] == ' ' || - iter[strlen (sym->symbol)] == '(')) + (iter[len_sym] == ' ' || + iter[len_sym] == '(')) { if (VERBOSE) printf ("Prototype '%s' looks OK, processing\n", grep_buff); @@ -138,7 +139,7 @@ BOOL symbol_search (parsed_symbol *sym) puts ("Failed, trying next"); } else - iter += strlen (sym->symbol); + iter += len_sym; } } pclose (f_grep); diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 5b60c57daf7..bfcc00a1d2c 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -541,6 +541,8 @@ static char *get_lib_dir( struct options *opts ) build_len = strlen( build_multiarch ); target_len = strlen( target_multiarch );
+ size_t len_path = strlen("/arm-linux-gnueabi"); + size_t len_winecrt = strlen(winecrt0); for (i = 0; i < ARRAY_SIZE(stdlibpath); i++) { const char *root = (i && opts->sysroot) ? opts->sysroot : ""; @@ -548,7 +550,7 @@ static char *get_lib_dir( struct options *opts )
if (!stdlibpath[i]) continue; buffer = xmalloc( strlen(root) + strlen(stdlibpath[i]) + - strlen("/arm-linux-gnueabi") + strlen(winecrt0) + 1 ); + len_path + len_winecrt + 1 ); strcpy( buffer, root ); strcat( buffer, stdlibpath[i] ); p = buffer + strlen(buffer); @@ -1473,9 +1475,10 @@ static int is_option( struct options *opts, int i, const char *option, const cha *option_arg = opts->args.str[i + 1]; return 1; } - if (!strncmp( opts->args.str[i], option, strlen(option) ) && opts->args.str[i][strlen(option)] == '=') + size_t len_opt = strlen(option); + if (!strncmp( opts->args.str[i], option, len_opt ) && opts->args.str[i][len_opt] == '=') { - *option_arg = opts->args.str[i] + strlen(option) + 1; + *option_arg = opts->args.str[i] + len_opt + 1; return 1; } return 0;
From: Herman Semenov GermanAizek@yandex.ru
--- programs/winevdm/winevdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/winevdm/winevdm.c b/programs/winevdm/winevdm.c index 87c25f0d191..6ee71b10bd8 100644 --- a/programs/winevdm/winevdm.c +++ b/programs/winevdm/winevdm.c @@ -148,7 +148,8 @@ static void start_dosbox( const char *appname, const char *args ) p += sprintf( p, "\nconfig -securemode\n" ); p += sprintf( p, "%s %s\n", app, args ); p += sprintf( p, "exit\n" ); - if (WriteFile( file, buffer, strlen(buffer), &written, NULL ) && written == strlen(buffer)) + size_t len_buf = strlen(buffer); + if (WriteFile( file, buffer, len_buf, &written, NULL ) && written == len_buf) { const char *args[5]; char *config_file = wine_get_unix_file_name( config );
From: Herman Semenov GermanAizek@yandex.ru
--- libs/jxr/jxrgluelib/JXRGluePFC.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libs/jxr/jxrgluelib/JXRGluePFC.c b/libs/jxr/jxrgluelib/JXRGluePFC.c index f6f2e29c397..b6eb52babcb 100644 --- a/libs/jxr/jxrgluelib/JXRGluePFC.c +++ b/libs/jxr/jxrgluelib/JXRGluePFC.c @@ -2212,10 +2212,11 @@ ERR PKFormatConverter_InitializeConvert(PKFormatConverter* pFC, const PKPixelFor //================================ pFC->enPixelFormat = enPFTo;
+ size_t len_pExt = strlen(pExt); if (pExt != NULL && IsEqualGUID(&enPFTo, &GUID_PKPixelFormat24bppRGB) && - 0 == PKStrnicmp(pExt, ".bmp", strlen(pExt))) + 0 == PKStrnicmp(pExt, ".bmp", len_pExt)) enPFTo = GUID_PKPixelFormat24bppBGR; - if (pExt != NULL && (0 == PKStrnicmp(pExt, ".tif", strlen(pExt)) || 0 == PKStrnicmp(pExt, ".tiff", strlen(pExt)))) + if (pExt != NULL && (0 == PKStrnicmp(pExt, ".tif", len_pExt) || 0 == PKStrnicmp(pExt, ".tiff", len_pExt))) { if (IsEqualGUID(&enPFTo, &GUID_PKPixelFormat32bppBGRA)) enPFTo = GUID_PKPixelFormat32bppRGBA;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150880
Your paranoid android.
=== debian11 (build log) ===
../wine/dlls/wldap32/init.c:152:12: error: redefinition of ‘len_scheme’ ../wine/dlls/wldap32/init.c:154:12: error: redefinition of ‘len_port’ Task: The win32 Wine build failed
=== debian11b (build log) ===
../wine/dlls/wldap32/init.c:152:12: error: redefinition of ‘len_scheme’ ../wine/dlls/wldap32/init.c:154:12: error: redefinition of ‘len_port’ Task: The wow64 Wine build failed
Alfred Agrell (@Alcaro) commented about dlls/ntdll/unix/file.c:
TRACE( "%s -> %s\n", wine_dbgstr_longlong(file_id), debugstr_a(unix_name) ); *unix_name_ret = unix_name;
nt_name->MaximumLength = (strlen(unix_name) + 1) * sizeof(WCHAR);
size_t len_unix_name = strlen(unix_name);
nt_name->MaximumLength = ( + 1) * sizeof(WCHAR);
are you _sure_ that's what you meant to commit?
This merge request was closed by Alexandre Julliard.
Please don't do that sort of thing, it's making the code worse for no benefit.