r58894

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
User avatar
Black_Fox
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

r58894

Post by Black_Fox »

http://svn.reactos.org/svn/reactos/trun ... hrev=58894 This looks just weird, I guess these should all be the same-typed INTs, WCHARs etc.

vicmarcal
Test Team
Posts: 2732
Joined: Mon Jul 07, 2008 12:35 pm

Re: r58894

Post by vicmarcal »

Maybe for mantaining the same format would be better to have the same variables, but they are compatibles:
int is the same as INT
And
char ** argv is the same as char * argv[]

If my brain is awake enough :)

User avatar
Black_Fox
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

Re: r58894

Post by Black_Fox »

Yes, it should work this way too :-) It's just a bit non-ReactOS/Windows way of writing it.

User avatar
Black_Fox
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

Re: r58894

Post by Black_Fox »

Fixed by Eric Kohl in r58908, thanks!

mrugiero
Posts: 482
Joined: Sun Feb 14, 2010 9:12 am

Re: r58894

Post by mrugiero »

Well, actually is not *exactly* the same. The ones in upper case are macro types. This helps portability, since instead of changing every int to wathever you need to make it work in another platform, you make a definition in a header which makes INT and CHAR what you need them to be in that platform, and let the preprocessor do the work. But ints are the same in all architectures I know (32 bit signed integers) and wchar is defined always as a two bytes char, because it's an unicode character.
argv[] is the same as *argv, it's just easier for the reader to know it's an array and not a single element when written like this argv[].

PascalDragon
Posts: 123
Joined: Wed Aug 04, 2010 7:34 pm

Re: r58894

Post by PascalDragon »

mrugiero wrote:But ints are the same in all architectures I know (32 bit signed integers) and wchar is defined always as a two bytes char, because it's an unicode character.
There are a few platforms where int is 64 bit (see here). Also int is 16 bit on 16-bit x86 and AFAIK you can set it to 8 bit in the AVR compiler.

Regards,
Sven
Free Pascal compiler developer

mrugiero
Posts: 482
Joined: Sun Feb 14, 2010 9:12 am

Re: r58894

Post by mrugiero »

PascalDragon wrote:
mrugiero wrote:But ints are the same in all architectures I know (32 bit signed integers) and wchar is defined always as a two bytes char, because it's an unicode character.
There are a few platforms where int is 64 bit (see here). Also int is 16 bit on 16-bit x86 and AFAIK you can set it to 8 bit in the AVR compiler.

Regards,
Sven
Well, yes, aside from the 64 bits one (which I didn't know about), I meant only the platforms ReactOS is likely to target.

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: r58894

Post by Z98 »

int and INT are the same thing as far as Windows headers are considered. Microsoft was fairly explicit in the sizes of their variable types in order to avoid breaking applications. It is far more dangerous to have auto-sized types than explicitly sized types.

mrugiero
Posts: 482
Joined: Sun Feb 14, 2010 9:12 am

Re: r58894

Post by mrugiero »

Z98 wrote:int and INT are the same thing as far as Windows headers are considered. Microsoft was fairly explicit in the sizes of their variable types in order to avoid breaking applications. It is far more dangerous to have auto-sized types than explicitly sized types.
What would an auto-sized type be?

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: r58894

Post by Z98 »

off_t in Unix land, UINTN in UEFI land are some offhand examples.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], DotBot [Crawler], Yandex [Bot] and 3 guests