[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: include: Remove 'l' modifier from numeric constants in d3d9caps.h
From:       Kai Tietz <ktietz70 () googlemail ! com>
Date:       2011-10-26 11:38:06
Message-ID: CAEwic4aG=s+gxfx2bsU21X7dxb9YSRcK1-2f2jY1K7gZ=EZ2LQ () mail ! gmail ! com
[Download RAW message or body]

2011/10/26 Dmitry Timoshkov <dmitry@baikal.ru>:
> Chris Robinson <chris.kcat@gmail.com> wrote:
>
>> For Wine it doesn't really matter, since we can't use C++. For mingw-w64,
>> however, it could be a big problem if it's not properly typed as a long.
>> Overloads and template types would silently use 'int' where it should be using
>> 'long', and you wouldn't necessarily know until you see odd behavior in the
>> app.
>
> What kind of odd behaviour? Both int and long are 32-bit in win32 and win64.
>
> --
> Dmitry.

See as example for C++:

#include <stdio.h>

void foo (int i) { printf ("int i == %d\n", i); }
void foo (long i) { printf ("long i == %ld\n", i); }

int main ()
{
  foo (1);
  foo (1L);
  return 0;
}

if you compile this program and execute it, then you will see the
following output:

$ ./tst.exe
int i == 1
long i == 1

C++ has the ability to have for same function name different
implementation for different argument types. Means, argument types
getting part of function's signature. So you might see the cause what
is different about suffixed/non-suffixed values for C++.

Regards,
Kai


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic