 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sat Sep 17, 2005 4:45 pm Post subject: const declarations |
|
|
Some sce*-functions don't change the data, which are passed as pointers, like
int sceKernelUtilsMd5Digest(u8 *data, u32 size, u8 *digest);
so it should be
int sceKernelUtilsMd5Digest(const u8 *data, u32 size, u8 *digest);
The reason is that when I'm using 3'rd party libraries, sometimes the return values are const, which is fine, but then I have to cast it for the sce*-functions, which is not necessary. I don't think that the changes breaks code, but it makes new code more safe and readable. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Sun Sep 18, 2005 12:17 am Post subject: |
|
|
| And what's up with "u8 *"? It should be "void *". This isn't the K&R days :). |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Mon Sep 19, 2005 5:45 am Post subject: |
|
|
| mrbrown wrote: | | And what's up with "u8 *"? It should be "void *". This isn't the K&R days :). |
Yes, this would be fine, too. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|