I'm sorry to ask, but could anyone give me the byte lenght of those C Types?
I'm trying to translate OpenTTD to Delphi, and i'm really puzzled by these :
int
uint
Are they Signed/Unsigned 32 bytes or Signed/Unsigned 16 bytes?
Thanks
C Type explanation request
Moderator: OpenTTD Developers
You could've looked it up yourself:
int is signed int 32, uint is unsigned int 32, at least we assume so for OpenTTD.
Btw, why and how are you translating OpenTTD to Delphi?
Code: Select all
typedef unsigned int uint;
typedef unsigned int uint32;
Code: Select all
assert_compile(sizeof(uint32) == 4);
Btw, why and how are you translating OpenTTD to Delphi?
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
I guess I could have found it myself indeed, but it would take me days and days of searching...
I'm a senior delphi programmer at work without any knowledge of C.
So I though that it might be a good idea for me to learn from the pros
Why not do it with OpenTTD.
I downloaded the sources from SourceForge, then I started working on h files, renamed "h.pas". I'm using delphi 7, in order to be able to compile on 2 platforms.
No tools, simply reading and understanding C...
Hard job...
I'm a senior delphi programmer at work without any knowledge of C.
So I though that it might be a good idea for me to learn from the pros
Why not do it with OpenTTD.
I downloaded the sources from SourceForge, then I started working on h files, renamed "h.pas". I'm using delphi 7, in order to be able to compile on 2 platforms.
No tools, simply reading and understanding C...
Hard job...
you know, OpenTTD might be a really bad choice for this since the code is rather complex. Also you learn C best if you code in C. Try some self learning book instead..... translating 126k of code where seasoned C coders might not understand all of it is not a good place to start. Get the source and compile to play it and maybe even try to write a patch for it if you feel like you can manage, but translating all of it.... forget it. It's a project that will take years to do, even if you know the language well
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Well.. I agree that it is quite a pile of work.
On the other hand, drilling into the code gives me the possibility to AT LEAST understand the types of, let say grf files.
Eventually, that could lead me to write a grf editor, or a map editor, or whatever could come up.
I know how to read C, up to a certain point.
I simply want to improve myself in something that I like, Delphi and OpenTTD...
If I could translate it, cool. Otherwise, too bad, but it would have been fun...
Anyway, thanks for the advice, i'll consider it.
On the other hand, drilling into the code gives me the possibility to AT LEAST understand the types of, let say grf files.
Eventually, that could lead me to write a grf editor, or a map editor, or whatever could come up.
I know how to read C, up to a certain point.
I simply want to improve myself in something that I like, Delphi and OpenTTD...
If I could translate it, cool. Otherwise, too bad, but it would have been fun...
Anyway, thanks for the advice, i'll consider it.
Who is online
Users browsing this forum: No registered users and 15 guests