Modify

Opened 12 years ago

Closed 12 years ago

#159 closed defect (invalid)

pcilib_get_data should expect pcilib_error_t or int as error type

Reported by: Matthias Vogelgesang Owned by: Suren A. Chilingaryan
Priority: major Milestone:
Component: pcilib Version:
Keywords: Cc:

Description

For some reason, the usage of error types is not really consistent. The error codes are defined as a pcilib_errot_t (sic!) enum, whereas most functions return int (legal but not good style) and some take a pointer to size_t which is bad for obvious reason.

Please use one type, because I don't want to do wrong type casts to avert compilation errors due to -Werror.

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Suren A. Chilingaryan

Error is declared int everywhere. enum is used just instead of defines. You don't have it anywhere in API functions. For size_t I guess you are referring to this argument 'size_t *size_or_err'. It is actually mainly parameter to return size. At some point I just used opportunity to report errors on NULL without breaking API. So, basically you to pass a size_t variable there for you expect size back. If something fails you may query for error as well. No type conversion needed just use err = size.

comment:2 Changed 12 years ago by Suren A. Chilingaryan

Resolution: invalid
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Suren A. Chilingaryan.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.