One could ask what the point is with these SAF defined replacements for 
primitive types ?

If the only definition is the provided binding to C then they are 
totally redundant. If the idea is to allow some kind of language portability
then the binding to C should be regarded as more of an example than a
hard binding. 

I would go for (2) since it is the least intrusive and avoids a new
questionable redundant definition of a primitive type. 



---

** [tickets:#625] osaf: Support constant strings in SAF APIs**

**Status:** unassigned
**Created:** Wed Nov 13, 2013 11:25 AM UTC by Anders Widell
**Last Updated:** Wed Nov 13, 2013 11:25 AM UTC
**Owner:** nobody

There is a fundamental problem with the **SaStringT** type as it is currently 
defined:

    typedef char* SaStringT;

When **SaStringT** is defined like this, it is impossible to declare a string 
constant using it. For example, a variable decleared like this:

    const SaStringT x;

has the following meaning:

    char *const x;

i.e., it is only the pointer **x** that is constant, not the string that it is 
pointing to.

There are two possible ways to support constant strings in the SAF APIs:

1) Introduce a new type **SaCharT**, and use **SaCharT** pointers in the API 
calls instead of **SaStringT**. Since **SaStringT** is defined as a character 
pointer, it should be possible to replace occurrences of **SaStringT** with ** 
SaCharT* ** without breaking backwards compatibility.

2) Replace the **SaStringT** typedef with a C preprocessor macro, like this:

    #define SaStringT char*



---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to