In some plx functions, we return a Status term currently that indicates the return value of the X funcions. Instead, it would be cleaner to simply fail the call with PL_fail in case of an X error.
We already have functions that do the latter.
Also, all X calls in plx functions should be double checked whether they all propagate errors if they fail, than the client-side code should also be double checked if it handles the error cases.
Update: instead of plain PL_fail calls, use ones like this:
return (foreign_t)PL_warning("xrr_query_extension: XRRQueryExtension() failed!");
and adjust the existing ones to this style (e.g. remove arity indicators, because PL_TRY with __func__ doesn't get them either). Or event better, create a new macro for the above pattern with __func__ to shorten this kind of error handling too...
Update: PL_warning does not simply return a failure, but also starts the tracer, effectively crashing plwm. So instead, we should log with something else (puts, printf, etc.) then return FALSE.
Update: success of build_list() is never checked. It should be.
In some plx functions, we return a
Statusterm currently that indicates the return value of the X funcions. Instead, it would be cleaner to simply fail the call withPL_failin case of an X error.We already have functions that do the latter.
Also, all X calls in plx functions should be double checked whether they all propagate errors if they fail, than the client-side code should also be double checked if it handles the error cases.
Update: instead of plainPL_failcalls, use ones like this:and adjust the existing ones to this style (e.g. remove arity indicators, becausePL_TRYwith__func__doesn't get them either). Or event better, create a new macro for the above pattern with__func__to shorten this kind of error handling too...Update:
PL_warningdoes not simply return a failure, but also starts the tracer, effectively crashing plwm. So instead, we should log with something else (puts,printf, etc.) thenreturn FALSE.Update: success of
build_list()is never checked. It should be.