OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

pkcs11 message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [pkcs11] Updated Proposal: All constants should have UL suffix


What I started to mumble about on the web site was whether this should actually be a #define or a "static const". I don't actually have a strong opinion, and this might be too much of a change, but if we're turning these into actual ULs, then it may make sense to change these to compilable objects for type safety.

Mike



On 6/12/2013 1:35 PM, Stef Walter wrote:
All numeric constants in the specification section "A. Manifest
Constants" should have the suffix 'UL' on them. This allows the code
like this to return the correct result:

   sizeof(CKO_DATA)

Among other things, it also allows the constants to be passed correctly
to C varargs functions.

Since all document edits for this would be tedious. I'll just give a few
examples:

- #define CKU_SO         0
+ #define CKU_SO         0UL

and

- #define CKA_CLASS      0x00000000
+ #define CKA_CLASS      0x00000000UL

and

- #define CKA_WRAP_TEMPLATE	(CKF_ARRAY_ATTRIBUTE|0x00000211)
+ #define CKA_WRAP_TEMPLATE	(CKF_ARRAY_ATTRIBUTE|0x00000211UL)

Above applies to every constant in the specification section "A.
Manifest Constants". All of the constants in this section are intended
for use with CK_ULONG or types defined as CK_ULONG.

In addition the reference headers should be updated. All of the numeric
#define'd constants in the reference headers should have the suffix UL,
with the exception of:

CRYPTOKI_VERSION_MAJOR
CRYPTOKI_VERSION_MINOR
CRYPTOKI_VERSION_AMENDMENT
CK_TRUE
CK_FALSE

Cheers,

Stef

---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]