Commit Graph

1835 Commits

Author SHA1 Message Date
Martin Storsjo 1fecaae973 ucrtbase: Handle the _s variant of vsscanf.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:37 +09:00
Martin Storsjo 4a79e54917 ucrtbase: Handle the C99 'z' size_t specifier for integers.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:32 +09:00
Martin Storsjo 494572ed4d msvcrt: Interpret 'I' as size_t size specifier for integer conversions.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:27 +09:00
Martin Storsjo b9d0f5d562 ucrtbase: Implement the new printf corner case behaviour.
Check the option flags whether the new or old legacy behaviours are
wanted.

For _MSVCR_VER < 140, don't check the option flags but hardcode them to
TRUE. (This avoids having to manually add all three flags into every
caller of pf_printf.) Mask out any other flags, to avoid other
out-of-range flags to be interpreted as the other flags (positional
params, invoke invalid param handler).

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:12 +09:00
Martin Storsjo 1d17e85026 msvcrt: Ignore 'N' as format length modifier for pointers, just like 'F'.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:07 +09:00
Martin Storsjo 1c8412d9e5 msvcrt: Refactor pf_printf to take options as flags instead of as BOOL parameter.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:18:56 +09:00
Martin Storsjo b09aadd202 ucrtbase: Handle the swprintf style termination and return values.
When neither the "legacy vsprintf null termination" nor the "standard
snprintf behaviour" flags are specified, the functions return -2 when
the output string didn't fit (similar to old style msvcrt _snprintf that
returned -1), but they are null terminated (similar to the C99 snprintf
style behaviour). This is the same way as the C99 swprintf function
behaves.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:18:42 +09:00
Martin Storsjo fcf9ec8080 ucrtbase: Add defines for the printf/scanf options constants.
Avoid using hardcoded magic numbers for these options.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-02 23:02:24 +09:00
Martin Storsjo 2a74c9a8ed ucrtbase: Fix the function name in a comment.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-02 23:02:23 +09:00
Martin Storsjo 436eb3639c ucrtbase: Implement vsscanf.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-29 21:20:09 +09:00
Martin Storsjo 255a7fe067 ucrtbase: Implement some printf functions.
Not all functions are implemented (yet not all variants are
implemented in the normal msvcrt either).

The new functions are more generalized and are C99 compliant.
They take an options parameter that e.g. for the snprintf
family of functions indicate whether the truncation and return
value should be handled as before or in the standards compliant
way.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-28 22:31:24 +09:00
Martin Storsjo bf4493404c msvcrt: Remove a stray semicolon.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-15 23:35:29 +09:00
Nikolay Sivov d8623f8241 msvcrt/tests: Use matching type to get array element count (PVS-Studio).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-13 18:41:17 +09:00
Sebastian Lackner 4e941a9289 msvcrt: Pass cookie reference to msvcrt_local_unwind4 instead of value.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
2015-10-05 22:27:13 +09:00
Martin Storsjo 8578702e06 ucrtbase: Make the strtod implementation C99 compatible.
Add a test for ucrtbase that verifies these aspects of the C99
behaviour of strtod.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-02 20:50:10 +09:00
Piotr Caban aa612612b7 msvcr60: Fix _mbscoll implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-02 15:38:35 +09:00
Piotr Caban 07762576c4 msvcrt: Add i386 __CxxExceptionFilter implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-01 16:32:34 +09:00
Piotr Caban f9bae3e5a2 msvcrt: Only create locale categories that have changed in setlocale function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:13 +02:00
Piotr Caban f075043273 msvcrt: Use create_locinfo helper in setlocale implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:12 +02:00
Piotr Caban ca8ef840ad msvcrt: Add create_locinfo helper function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:10 +02:00
Piotr Caban 905daf251a msvcrt: Pass pthreadlocinfo to set_lc_locale_name function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:04 +02:00
Piotr Caban d04c895b91 msvcrt: Pass pthreadlocinfo to update_threadlocinfo_category helper function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:00 +02:00
Piotr Caban ecac39c19b msvcrt: Add _wctime32_s implementation. 2015-09-15 17:02:11 +09:00
Piotr Caban 09a727c33c msvcr120: Add fmin implementation. 2015-09-14 16:47:52 +09:00
Piotr Caban b408b5a9a4 msvcrt/tests: Fix tolower test failures. 2015-09-14 16:47:52 +09:00
Andrey Gusev d3177504b1 Assorted spelling and typos fixes. 2015-08-31 20:18:46 +09:00
Martin Storsjo 8edbd9b381 msvcrt: Test that the normal strtod doesn't handle the "NAN" string. 2015-08-31 14:50:42 +09:00
Martin Storsjo a4d5bf99d4 ucrtbase: Add stub functions for narrow environment. 2015-08-28 13:15:06 +09:00
Martin Storsjo 9303c6eeed ucrtbase: Hook up _crt_atexit. 2015-08-27 17:10:08 +09:00
Daniel Lehman e26131fea3 msvcrt: Use msvcrt free instead of HeapFree on tls data. 2015-08-26 14:15:13 +09:00
Carlo Bramini 21a14e9612 msvcrt: SEEK_* macros from GLIBC should be replaced with safer MSVCRT_SEEK_* macros. 2015-08-19 08:39:02 +09:00
Andrey Gusev 5cdcd4493f Assorted spelling and typos fixes. 2015-08-18 15:00:13 +09:00
Carlo Bramini 13f34481b2 msvcrt: Use MSVCRT_xxx macros instead of the same ones from GLIBC. 2015-08-17 14:51:50 +09:00
Carlo Bramini 9b495caacf msvcrt: Call SetFilePointer() with correct parameters. 2015-08-17 14:51:46 +09:00
Francois Gouget f8a7d6ed74 Assorted spelling fixes. 2015-08-07 23:50:48 +09:00
Iván Matellanes ea2798f1ce msvcrt: _setmode should check if file descriptor is valid. 2015-08-05 23:45:50 +09:00
Daniel Lehman a7c7bc9180 msvcr110: Add Concurrency::details::_GetConcurrency. 2015-07-29 21:44:03 +02:00
Piotr Caban 2294d3ba45 msvcrt: Don't call DeleteCriticalSection on static critical section. 2015-07-16 21:21:07 +09:00
Piotr Caban cf20731447 msvcrt: Add _mbscat_s_l implementation. 2015-07-07 16:52:20 +09:00
Piotr Caban 0eb112aa6e msvcrt: Add ismbblead_l implementation. 2015-07-07 16:52:20 +09:00
Sebastian Lackner abbb361733 msvcrt: Set *end to NULL when strtod is called with NULL pointer string. 2015-06-29 19:07:50 +09:00
Michael Müller ffcb4e0724 msvcrt/tests: Add additional tests for atof / strtod functions.
From: Michael Müller <michael@fds-team.de>
2015-06-29 19:07:50 +09:00
Piotr Caban e9eec98d5c msvcrt: Cache locale string to LCID conversion results. 2015-06-24 22:57:00 +09:00
Piotr Caban d940ac2412 msvcr110: Add __crtGetLocaleInfoEx implementation. 2015-06-22 20:58:31 +09:00
Piotr Caban f55192aabc msvcr120: Add ___lc_locale_name_func implementation. 2015-06-17 20:01:17 +09:00
Piotr Caban 27b7ff73e4 msvcrt: Add _ungetwch implementation. 2015-06-15 14:49:26 +09:00
Piotr Caban d4fab07110 msvcrt: Add _getwche implementation. 2015-06-15 14:49:21 +09:00
Piotr Caban 9a10a71638 msvcrt: Add _getwch implementation. 2015-06-15 14:49:16 +09:00
Piotr Caban de68efdb7d msvcrt: Fix return value of cputws. 2015-06-15 14:49:11 +09:00
Piotr Caban 9ed740377b msvcrt: Fix return value of _cputs. 2015-06-15 14:49:09 +09:00