mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-07 23:02:23 +00:00
Rework code using return value of LoaderSymbol as a function pointer.
The patch removes all macros in the format
define xf86_sym ((type (*)(argument-list))LoaderSymbol("sym"))
creates a new macro in the format
define xf86_sym sym
and ensures "sym" is a "visible" symbol.
The patch doesn't add or remove features, and is source and binary
compatible with previous shared objects (with the difference that it
requires the dlloader).
These symbols are a special case, as, due to the fact that LoaderSymbol
was being used to reference them, they are not easily found by "automated"
tools that check for missing symbols. And now it also have the benefit
that the compiler/loader "knows what is going on".
This commit is contained in:
parent
fc70839431
commit
87a7fb7438
17 changed files with 163 additions and 163 deletions
|
|
@ -44,14 +44,22 @@ typedef struct {
|
|||
#define UDA1380_ADDR_1 0x30
|
||||
#define UDA1380_ADDR_2 0x34
|
||||
|
||||
UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr);
|
||||
Bool uda1380_init(UDA1380Ptr t);
|
||||
void uda1380_shutdown(UDA1380Ptr t);
|
||||
void uda1380_setvolume(UDA1380Ptr t, INT32);
|
||||
void uda1380_mute(UDA1380Ptr t, Bool);
|
||||
void uda1380_setparameters(UDA1380Ptr t);
|
||||
void uda1380_getstatus(UDA1380Ptr t);
|
||||
void uda1380_dumpstatus(UDA1380Ptr t);
|
||||
#define xf86_Detect_uda1380 Detect_uda1380
|
||||
extern UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr);
|
||||
#define xf86_uda1380_init uda1380_init
|
||||
extern Bool uda1380_init(UDA1380Ptr t);
|
||||
#define xf86_uda1380_shutdown uda1380_shutdown
|
||||
extern void uda1380_shutdown(UDA1380Ptr t);
|
||||
#define xf86_uda1380_setvolume uda1380_setvolume
|
||||
extern void uda1380_setvolume(UDA1380Ptr t, INT32);
|
||||
#define xf86_uda1380_mute uda1380_mute
|
||||
extern void uda1380_mute(UDA1380Ptr t, Bool);
|
||||
#define xf86_uda1380_setparameters uda1380_setparameters
|
||||
extern void uda1380_setparameters(UDA1380Ptr t);
|
||||
#define xf86_uda1380_getstatus uda1380_getstatus
|
||||
extern void uda1380_getstatus(UDA1380Ptr t);
|
||||
#define xf86_uda1380_dumpstatus uda1380_dumpstatus
|
||||
extern void uda1380_dumpstatus(UDA1380Ptr t);
|
||||
|
||||
#define UDA1380SymbolsList \
|
||||
"Detect_uda1380", \
|
||||
|
|
@ -63,13 +71,4 @@ void uda1380_dumpstatus(UDA1380Ptr t);
|
|||
"uda1380_getstatus", \
|
||||
"uda1380_dumpstatus"
|
||||
|
||||
#define xf86_Detect_uda1380 ((UDA1380Ptr (*)(I2CBusPtr, I2CSlaveAddr))LoaderSymbol("Detect_uda1380"))
|
||||
#define xf86_uda1380_init ((Bool (*)(UDA1380Ptr))LoaderSymbol("uda1380_init"))
|
||||
#define xf86_uda1380_shutdown ((void (*)(UDA1380Ptr))LoaderSymbol("uda1380_shutdown"))
|
||||
#define xf86_uda1380_setvolume ((void (*)(UDA1380Ptr, CARD16))LoaderSymbol("uda1380_setvolume"))
|
||||
#define xf86_uda1380_mute ((void (*)(UDA1380Ptr, Bool))LoaderSymbol("uda1380_mute"))
|
||||
#define xf86_uda1380_setparameters ((void (*)(UDA1380Ptr))LoaderSymbol("uda1380_setparameters"))
|
||||
#define xf86_uda1380_getstatus ((void (*)(UDA1380Ptr))LoaderSymbol("uda1380_getstatus"))
|
||||
#define xf86_uda1380_dumpstatus ((void (*)(UDA1380Ptr))LoaderSymbol("uda1380_dumpstatus"))
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue