Misc: Modify function attributes
- Remove the const function attribute from get_time_*(), since the functions they call that actually get the time probably access global variables or have other behaviors unacceptable for const functions. - Change the const function attribute on win_has_frame() to pure, as it accesses memory its parameter points to, which is invalid for a const function.
This commit is contained in:
parent
c156abb0e8
commit
20e996494b
|
@ -1475,7 +1475,7 @@ timespec_subtract(struct timespec *result,
|
||||||
/**
|
/**
|
||||||
* Get current time in struct timeval.
|
* Get current time in struct timeval.
|
||||||
*/
|
*/
|
||||||
static inline struct timeval __attribute__((const))
|
static inline struct timeval
|
||||||
get_time_timeval(void) {
|
get_time_timeval(void) {
|
||||||
struct timeval tv = { 0, 0 };
|
struct timeval tv = { 0, 0 };
|
||||||
|
|
||||||
|
@ -1490,7 +1490,7 @@ get_time_timeval(void) {
|
||||||
*
|
*
|
||||||
* Note its starting time is unspecified.
|
* Note its starting time is unspecified.
|
||||||
*/
|
*/
|
||||||
static inline struct timespec __attribute__((const))
|
static inline struct timespec
|
||||||
get_time_timespec(void) {
|
get_time_timespec(void) {
|
||||||
struct timespec tm = { 0, 0 };
|
struct timespec tm = { 0, 0 };
|
||||||
|
|
||||||
|
|
|
@ -500,7 +500,7 @@ update_reg_ignore_expire(session_t *ps, const win *w) {
|
||||||
/**
|
/**
|
||||||
* Check whether a window has WM frames.
|
* Check whether a window has WM frames.
|
||||||
*/
|
*/
|
||||||
static inline bool __attribute__((const))
|
static inline bool __attribute__((pure))
|
||||||
win_has_frame(const win *w) {
|
win_has_frame(const win *w) {
|
||||||
return w->a.border_width
|
return w->a.border_width
|
||||||
|| w->frame_extents.top || w->frame_extents.left
|
|| w->frame_extents.top || w->frame_extents.left
|
||||||
|
|
Loading…
Reference in New Issue