process-util: replace PTR_TO_PID() and PID_TO_PTR macro by inline functions
This way we gain some typesafety at no cost.
This commit is contained in:
@@ -116,8 +116,13 @@ int sigchld_code_from_string(const char *s) _pure_;
|
||||
int sched_policy_to_string_alloc(int i, char **s);
|
||||
int sched_policy_from_string(const char *s);
|
||||
|
||||
#define PTR_TO_PID(p) ((pid_t) ((uintptr_t) p))
|
||||
#define PID_TO_PTR(p) ((void*) ((uintptr_t) p))
|
||||
static inline pid_t PTR_TO_PID(const void *p) {
|
||||
return (pid_t) ((uintptr_t) p);
|
||||
}
|
||||
|
||||
static inline void* PID_TO_PTR(pid_t pid) {
|
||||
return (void*) ((uintptr_t) pid);
|
||||
}
|
||||
|
||||
void valgrind_summary_hack(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user