#1 Burning Software

It is currently Thu Dec 19, 2024 11:06 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Constness of input parameters
PostPosted: Thu Nov 20, 2008 10:20 am 
Offline

Joined: Wed Nov 19, 2008 9:45 am
Posts: 4
Hello Support,

I'm using the C-interface of the starburn engine and I noticed that in several functions input parameters are declared as 'PCHAR' which is defined as 'char *'. I guess (and hope) that these are in fact const . Would be great to change the declaration to something like 'const char *'.
Can I trust that the input strings are not changed inside the functions?

Regards,

Dave


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 8:53 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
See declarations. There are IN and OUT parameters declared. So PCHAR is NOT "const char *". At least - not always.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 9:30 am 
Offline

Joined: Wed Nov 19, 2008 9:45 am
Posts: 4
Well,

I know that PCHAR is not 'const char *', and my compiler too has some knowledge about that, but for example StarBurn_ISO9660JolietFileTree_BuildImage is declared with
...
IN PCHAR p__PCHAR__VolumeSetName Pointer to the volume set.
IN PCHAR p__PCHAR__PublisherPreparerName Pointer to the publisher and preparer name.
IN PCHAR p__PCHAR__ApplictionName Pointer to the application name.

It is IMHO clear that these parameters are input only and const.
If this is the case, they should be declared as such. Otherwise the compiler
will complain when using const char *.

Regards,

Dave


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 11:28 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
In this case - yes, you're absolutely correct!

david wrote:
Well,

I know that PCHAR is not 'const char *', and my compiler too has some knowledge about that, but for example StarBurn_ISO9660JolietFileTree_BuildImage is declared with
...
IN PCHAR p__PCHAR__VolumeSetName Pointer to the volume set.
IN PCHAR p__PCHAR__PublisherPreparerName Pointer to the publisher and preparer name.
IN PCHAR p__PCHAR__ApplictionName Pointer to the application name.

It is IMHO clear that these parameters are input only and const.
If this is the case, they should be declared as such. Otherwise the compiler
will complain when using const char *.

Regards,

Dave


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group