Changeset 22123 for branches


Ignore:
Timestamp:
Feb 14, 2016, 2:29:03 PM (10 years ago)
Author:
rousseau
Message:

Corrected some string related mismatches [odin]

In 'heapstring.h', 'strncasecmp' is mapped to 'lstrncmpiA', but the
latter used 'int' for the length and not 'size_t'. According to the C++
language documentation, 'size_t' is an 'unsigned int'.

Location:
branches/swt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/swt/include/heapstring.h

    r21916 r22123  
    88
    99#include <odin.h>
    10 
     10#include <string.h>
    1111#include <wine/unicode.h>
    1212//SvL: strcase -> case insensitive!
     
    3434int    WIN32API lstrcmpA       (LPCSTR arg1, LPCSTR  arg2);
    3535int    WIN32API lstrcmpW       (LPCWSTR arg1, LPCWSTR arg2);
    36 int    WIN32API lstrncmpA      (LPCSTR arg1, LPCSTR  arg2, int i);
    37 int    WIN32API lstrncmpW      (LPCWSTR arg1, LPCWSTR arg2, int i);
    38 int    WIN32API lstrncmpiA     (LPCSTR arg1, LPCSTR  arg2, int i);
    39 int    WIN32API lstrncmpiW     (LPCWSTR arg1, LPCWSTR arg2, int i);
     36int    WIN32API lstrncmpA      (LPCSTR arg1, LPCSTR  arg2, size_t l);
     37int    WIN32API lstrncmpW      (LPCWSTR arg1, LPCWSTR arg2, size_t l);
     38int    WIN32API lstrncmpiA     (LPCSTR arg1, LPCSTR  arg2, size_t l);
     39int    WIN32API lstrncmpiW     (LPCWSTR arg1, LPCWSTR arg2, size_t l);
    4040#define lstrcmpniW lstrncmpiW
    4141LPSTR  WIN32API lstrcpyA       (LPSTR arg1, LPCSTR  arg2);
  • branches/swt/include/win/winbase.h

    r22081 r22123  
    22712271INT       WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
    22722272#define     lstrcmpi WINELIB_NAME_AW(lstrcmpi)
    2273 int       WINAPI lstrncmpiA(LPCSTR, LPCSTR, int);
    2274 int       WINAPI lstrncmpiW(LPCWSTR, LPCWSTR, int);
     2273int       WINAPI lstrncmpiA(LPCSTR, LPCSTR, size_t);
     2274int       WINAPI lstrncmpiW(LPCWSTR, LPCWSTR, size_t);
    22752275#define     lstrncmpi WINELIB_NAME_AW(lstrncmpi)
    22762276
  • branches/swt/src/kernel32/heapstring.cpp

    r21916 r22123  
    198198 *****************************************************************************/
    199199
    200 int WIN32API lstrncmpA(LPCSTR arg1, LPCSTR arg2, int l)
     200int WIN32API lstrncmpA(LPCSTR arg1, LPCSTR arg2, size_t l)
    201201{
    202202  dprintf2(("KERNEL32: lstrncmpA(%s,%s,%d)\n",
     
    219219 * Author    : Przemyslaw Dobrowolski
    220220 *****************************************************************************/
    221 int WIN32API lstrncmpiA(LPCSTR str1, LPCSTR str2, INT n )
     221int WIN32API lstrncmpiA(LPCSTR str1, LPCSTR str2, size_t l)
    222222{
    223223  INT firstch,lastch;
    224224  INT result = 0;
    225225
    226   if (n)
     226  if (l)
    227227  {
    228228    do
     
    232232      str1++;
    233233      str2++;
    234     } while (--n && *str1 && *str2 && firstch == lastch);
     234    } while (--l && *str1 && *str2 && firstch == lastch);
    235235
    236236    result = firstch - lastch;
     
    240240}
    241241//TODO: Don't know if this is completely correct
    242 int WIN32API lstrncmpiW(LPCWSTR str1, LPCWSTR str2, int n)
     242int WIN32API lstrncmpiW(LPCWSTR str1, LPCWSTR str2, size_t l)
    243243{
    244244  INT firstch,lastch;
    245245  INT result = 0;
    246246
    247   if (n)
     247  if (l)
    248248  {
    249249    do
     
    253253      str1++;
    254254      str2++;
    255     } while (--n && *str1 && *str2 && firstch == lastch);
     255    } while (--l && *str1 && *str2 && firstch == lastch);
    256256
    257257    result = firstch - lastch;
     
    300300 *****************************************************************************/
    301301
    302 int WIN32API lstrncmpW(LPCWSTR arg1, LPCWSTR arg2, int l)
     302int WIN32API lstrncmpW(LPCWSTR arg1, LPCWSTR arg2, size_t l)
    303303{
    304304  dprintf2(("KERNEL32: lstrncmpW(%08xh,%08xh,%d)\n",
Note: See TracChangeset for help on using the changeset viewer.