IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 22 years ago

Closed 22 years ago

Last modified 22 years ago

#106 closed defect (fixed)

return value of psImageWriteSection

Reported by: robert.desonia@… Owned by: Paul Price
Priority: high Milestone:
Component: PSLib SDRS Version: unspecified
Severity: trivial Keywords:
Cc:

Description

Abit petty, but could we tweak the definition of the return value of
psImageWriteSection to 0 for success (as it is now) and non-zero (instead of
just 1) for error? This matches the more traditional C definition of such a
status return, where a non-zero return can signify one of many possible error
conditions.

Additionally, the C99 bool could be used instead, but then I'd recommend TRUE
for success. I'd prefer to use int, however, as it is handy for debugging to
have multiple non-zero return values cooresponding to the various error conditions.

-rdd

Change History (8)

comment:1 by eugene, 22 years ago

Status: newassigned

we have been moving to bool for the return value for most of the other
functions. you are supposed to get error information from psError if an error
is raised, at least that is the way it is supposed to work. let's go with bool
for return type and TRUE for success, FALSE for failure. I think we should be
consistent on that, and a quick look through the other functions gives:

bool psListAdd(psList *list, void *data, int where); (not specified)
bool psListRemove(psList *list, void *data, int which); (TRUE = success)
bool psHashAdd(psHash *table, char *key, void *data); (not specified)
bool psHashRemove(psHash *table, char *key);(TRUE = success)

bool psMetadataAddItem();(TRUE = success)
bool psMetadataAdd(); (TRUE = success)
bool psMetadataRemove(); (TRUE = success)

comment:2 by robert.desonia@…, 22 years ago

Made change in the implementation; make sure the SDRS text reflects this change
as well.

comment:3 by eugene, 22 years ago

Resolution: fixed
Status: assignedclosed

added to latest (05) SDRS.

comment:4 by Eric.VanAlst@…, 22 years ago

Resolution: fixed
Status: closedreopened

The resolution specifies function psImageWriteSection should return type bool,
but this is not currently specified in SDR-06 section 4.6.5.

comment:5 by eugene, 22 years ago

Owner: changed from eugene to Paul Price
Status: reopenednew

comment:6 by Paul Price, 22 years ago

Resolution: fixed
Status: newclosed

Changed SDRS so that psImageWriteSection returns a bool:

bool psImageWriteSection(const psImage *input, int x, int y, int z,

const char *extname, int extnum, const char *filename);

comment:7 by Paul Price, 22 years ago

Keywords: VERIFIED added

Should be fixed in SDRS-07 and ADD-06 (7 September 2004).

comment:8 by Paul Price, 22 years ago

Keywords: VERIFIED removed
Note: See TracTickets for help on using tickets.