mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-13 19:22:58 +00:00
Apply a few minor formatting fixes.
This commit is contained in:
parent
1c1cf26ac1
commit
168607829d
@ -65,7 +65,7 @@ void clean_up(void *memtofree1, void *memtofree2);
|
||||
void clean_up_without_threads(void *memtofree1, void *memtofree2);
|
||||
|
||||
template <typename... Args>
|
||||
inline void gettextize_format(const char *format, Args &&... args) {
|
||||
inline void gettextize_format(const char *format, Args &&...args) {
|
||||
fprintf(stderr, _(format), args...);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ inline void gettextize_format(const char *format, Args &&... args) {
|
||||
inline void gettextize_format(const char *format) { fputs(_(format), stderr); }
|
||||
|
||||
template <typename... Args>
|
||||
void NORM_ERR(const char *format, Args &&... args) {
|
||||
void NORM_ERR(const char *format, Args &&...args) {
|
||||
fprintf(stderr, PACKAGE_NAME ": ");
|
||||
gettextize_format(format, args...);
|
||||
fputs("\n", stderr);
|
||||
@ -83,7 +83,7 @@ void NORM_ERR(const char *format, Args &&... args) {
|
||||
/* critical error */
|
||||
template <typename... Args>
|
||||
inline void CRIT_ERR(void *memtofree1, void *memtofree2, const char *format,
|
||||
Args &&... args) {
|
||||
Args &&...args) {
|
||||
NORM_ERR(format, args...);
|
||||
clean_up(memtofree1, memtofree2);
|
||||
exit(EXIT_FAILURE);
|
||||
@ -91,7 +91,7 @@ inline void CRIT_ERR(void *memtofree1, void *memtofree2, const char *format,
|
||||
|
||||
template <typename... Args>
|
||||
inline void THREAD_CRIT_ERR(void *memtofree1, void *memtofree2,
|
||||
const char *format, Args &&... args) {
|
||||
const char *format, Args &&...args) {
|
||||
NORM_ERR(format, args...);
|
||||
clean_up_without_threads(memtofree1, memtofree2);
|
||||
return;
|
||||
|
@ -312,7 +312,7 @@ class state : private std::mutex {
|
||||
// allocate a new lua userdata of appropriate size, and create a object in it
|
||||
// pushes the userdata on stack and returns the pointer
|
||||
template <typename T, typename... Args>
|
||||
T *createuserdata(Args &&... args);
|
||||
T *createuserdata(Args &&...args);
|
||||
|
||||
using std::mutex::lock;
|
||||
using std::mutex::try_lock;
|
||||
@ -365,7 +365,7 @@ class stack_sentry {
|
||||
};
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T *state::createuserdata(Args &&... args) {
|
||||
T *state::createuserdata(Args &&...args) {
|
||||
stack_sentry s(*this);
|
||||
|
||||
void *t = newuserdata(sizeof(T));
|
||||
|
@ -42,7 +42,7 @@ template <typename Callback>
|
||||
class callback_handle;
|
||||
void run_all_callbacks();
|
||||
template <typename Callback, typename... Params>
|
||||
callback_handle<Callback> register_cb(uint32_t period, Params &&... params);
|
||||
callback_handle<Callback> register_cb(uint32_t period, Params &&...params);
|
||||
|
||||
namespace priv {
|
||||
class callback_base {
|
||||
@ -88,7 +88,7 @@ class callback_base {
|
||||
|
||||
template <typename Callback, typename... Params>
|
||||
friend callback_handle<Callback> conky::register_cb(uint32_t period,
|
||||
Params &&... params);
|
||||
Params &&...params);
|
||||
|
||||
friend void conky::run_all_callbacks();
|
||||
|
||||
@ -140,11 +140,11 @@ class callback_handle : private std::shared_ptr<Callback> {
|
||||
friend void conky::run_all_callbacks();
|
||||
template <typename Callback_, typename... Params>
|
||||
friend callback_handle<Callback_> register_cb(uint32_t period,
|
||||
Params &&... params);
|
||||
Params &&...params);
|
||||
};
|
||||
|
||||
template <typename Callback, typename... Params>
|
||||
callback_handle<Callback> register_cb(uint32_t period, Params &&... params) {
|
||||
callback_handle<Callback> register_cb(uint32_t period, Params &&...params) {
|
||||
return std::dynamic_pointer_cast<Callback>(
|
||||
priv::callback_base::do_register_cb(priv::callback_base::handle(
|
||||
new Callback(period, std::forward<Params>(params)...))));
|
||||
|
Loading…
Reference in New Issue
Block a user