#247 closed defect (fixed)
Return Value for New psMetadataLookup Functions
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Section 5.3.3 adds new functions:
psS32 psMetadataLookupS32(const psMetadata *md, const char *key);
psF64 psMetadataLookupF64(const psMetadata *md, const char *key);
If the key is not found, 0.0 is to be returned. What if the key is found and
its value really is 0.0? Perhaps a third argument for status should be added to
these functions, which could be checked to determine if the key was found? I'm
not sure that you'd want to put an error statement directly in these functions,
since there may be times when you don't care if the item was found.
Note:
See TracTickets
for help on using tickets.

this solution sounds good to me.
I have modified the SDRS to reflect the suggestion:
void *psMetadataLookupPtr(bool *status, const psMetadata *md, const char *key);
psS32 psMetadataLookupS32(bool *status, const psMetadata *md, const char *key);
psF64 psMetadataLookupF64(bool *status, const psMetadata *md, const char *key);