all repos — tint2 @ 9aa50104dbfb520bb853471112e9c994ed1e4736

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fix warning ISO C does not support __FUNCTION__

"warning: ISO C does not support ‘__FUNCTION__’ predefined identifier"

Among others -Wpedantic now warns about non-standard predefined identifiers.
The fix is either to use the standard predefined identifier __func__ (since C99),
or to use the __extension__ keyword.
fafryd dz1125.bug.tracker@gmail.com
commit

9aa50104dbfb520bb853471112e9c994ed1e4736

parent

3320ee8e058cc51231753f4d96de4fd30734cb15

5 files changed, 45 insertions(+), 45 deletions(-)

jump to
M src/main.csrc/main.c

@@ -104,7 +104,7 @@

// Change name of desktops else if (at == server.atom._NET_DESKTOP_NAMES) { if (debug) - fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_DESKTOP_NAMES\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_DESKTOP_NAMES\n", __func__, __LINE__); update_desktop_names(); } // Change desktops

@@ -112,7 +112,7 @@ else if (at == server.atom._NET_NUMBER_OF_DESKTOPS || at == server.atom._NET_DESKTOP_GEOMETRY ||

at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA || at == server.atom._NET_CURRENT_DESKTOP) { if (debug) - fprintf(stderr, "tint2: %s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d: win = root, atom = ?? desktops changed\n", __func__, __LINE__); if (!taskbar_enabled) return; int old_num_desktops = server.num_desktops;

@@ -202,7 +202,7 @@ }

// Window list else if (at == server.atom._NET_CLIENT_LIST) { if (debug) - fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_CLIENT_LIST\n", __func__, __LINE__); taskbar_refresh_tasklist(); update_all_taskbars_visibility(); schedule_panel_redraw();

@@ -210,12 +210,12 @@ }

// Change active else if (at == server.atom._NET_ACTIVE_WINDOW) { if (debug) - fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __func__, __LINE__); reset_active_task(); schedule_panel_redraw(); } else if (at == server.atom._XROOTPMAP_ID || at == server.atom._XROOTMAP_ID) { if (debug) - fprintf(stderr, "tint2: %s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d: win = root, atom = _XROOTPMAP_ID\n", __func__, __LINE__); // change Wallpaper for (int i = 0; i < num_panels; i++) { set_panel_background(&panels[i]);

@@ -234,7 +234,7 @@ if (debug) {

char *atom_name = XGetAtomName(server.display, at); fprintf(stderr, "%s %d: win = %ld, task = %s, atom = %s\n", - __FUNCTION__, + __func__, __LINE__, win, task ? (task->title ? task->title : "??") : "null",

@@ -243,7 +243,7 @@ XFree(atom_name);

} if (!task) { if (debug) - fprintf(stderr, "tint2: %s %d\n", __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: %s %d\n", __func__, __LINE__); if (at == server.atom._NET_WM_STATE) { // xfce4 sends _NET_WM_STATE after minimized to tray, so we need to check if window is mapped // if it is mapped and not set as skip_taskbar, we must add it to our task list

@@ -277,7 +277,7 @@ int count;

Atom *atom_state = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int j = 0; j < count; j++) { char *atom_state_name = XGetAtomName(server.display, atom_state[j]); - fprintf(stderr, "tint2: %s %d: _NET_WM_STATE = %s\n", __FUNCTION__, __LINE__, atom_state_name); + fprintf(stderr, "tint2: %s %d: _NET_WM_STATE = %s\n", __func__, __LINE__, atom_state_name); XFree(atom_state_name); } XFree(atom_state);
M src/panel.hsrc/panel.h

@@ -165,7 +165,7 @@ gboolean resize_panel(void *obj);

void render_panel(Panel *panel); void shrink_panel(Panel *panel); void _schedule_panel_redraw(const char *file, const char *function, const int line); -#define schedule_panel_redraw() _schedule_panel_redraw(__FILE__, __FUNCTION__, __LINE__) +#define schedule_panel_redraw() _schedule_panel_redraw(__FILE__, __func__, __LINE__) void set_panel_items_order(Panel *p); void place_panel_all_desktops(Panel *p);
M src/systray/systraybar.csrc/systray/systraybar.c

@@ -184,7 +184,7 @@

gboolean resize_systray(void *obj) { if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); int size; systray_compute_geometry(&size);

@@ -227,7 +227,7 @@

void draw_systray(void *obj, cairo_t *c) { if (systray_profile) - fprintf(stderr, BLUE "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, BLUE "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __func__, __LINE__); if (systray_composited) { if (render_background) XFreePixmap(server.display, render_background);

@@ -271,7 +271,7 @@

void on_change_systray(void *obj) { if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); if (systray.icons_per_column == 0 || systray.icons_per_row == 0) return;

@@ -301,7 +301,7 @@ traywin->x = posx;

if (systray_profile) fprintf(stderr, "%s:%d win = %lu (%s), parent = %lu, x = %d, y = %d\n", - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name,

@@ -358,7 +358,7 @@

void start_net() { if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); if (net_sel_win) { // protocol already started if (!systray_enabled)

@@ -464,7 +464,7 @@ }

fprintf(stderr, GREEN "tint2: systray started" RESET "\n"); if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); XClientMessageEvent ev; ev.type = ClientMessage; ev.window = server.root_win;

@@ -481,7 +481,7 @@

void handle_systray_event(XClientMessageEvent *e) { if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); Window win; unsigned long opcode = e->data.l[1];

@@ -509,7 +509,7 @@

void stop_net() { if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); if (systray.list_icons) { // remove_icon change systray.list_icons while (systray.list_icons)

@@ -529,7 +529,7 @@ gboolean error;

int window_error_handler(Display *d, XErrorEvent *e) { if (systray_profile) - fprintf(stderr, RED "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, RED "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __func__, __LINE__); error = TRUE; if (e->error_code != BadWindow) { fprintf(stderr, RED "tint2: systray: error code %d" RESET "\n", e->error_code);

@@ -623,7 +623,7 @@ XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);

char *name = get_window_name(win); if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name); + fprintf(stderr, "tint2: [%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __func__, __LINE__, win, name); Panel *panel = systray.area.panel; // Get the process ID of the application that created the window

@@ -748,14 +748,14 @@ XMapRaised(server.display, traywin->parent);

} if (systray_profile) - fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, "tint2: [%f] %s:%d\n", profiling_get_time(), __func__, __LINE__); // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__); systray.area.resize_needed = TRUE; panel->area.resize_needed = TRUE;

@@ -770,7 +770,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -832,7 +832,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -846,7 +846,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -903,7 +903,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -917,7 +917,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -963,7 +963,7 @@ if (systray_profile)

fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__); systray.area.resize_needed = TRUE; panel->area.resize_needed = TRUE;

@@ -1086,7 +1086,7 @@ if (systray_profile)

fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__); schedule_panel_redraw(); refresh_systray = TRUE;

@@ -1165,7 +1165,7 @@ if (systray_profile)

fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__); schedule_panel_redraw(); refresh_systray = TRUE;

@@ -1177,7 +1177,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1212,7 +1212,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1230,7 +1230,7 @@ if (systray_profile)

fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1250,7 +1250,7 @@ if (systray_profile)

fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1381,7 +1381,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1419,7 +1419,7 @@ // if (systray_profile)

// fprintf(stderr, // YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", // profiling_get_time(), - // __FUNCTION__, + // __func__, // __LINE__, // traywin->win, // traywin->name);

@@ -1433,7 +1433,7 @@ if (systray_profile)

fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1466,7 +1466,7 @@ if (systray_profile)

fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), - __FUNCTION__, + __func__, __LINE__, traywin->win, traywin->name);

@@ -1500,7 +1500,7 @@

void refresh_systray_icons() { if (systray_profile) - fprintf(stderr, BLUE "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); + fprintf(stderr, BLUE "tint2: [%f] %s:%d" RESET "\n", profiling_get_time(), __func__, __LINE__); TrayWindow *traywin; GSList *l; for (l = systray.list_icons; l; l = l->next) {
M src/taskbar/task.csrc/taskbar/task.c

@@ -93,7 +93,7 @@ "Task %d %s",

(int)win, task_template.title ? task_template.title : "null"); - // fprintf(stderr, "tint2: %s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ? + // fprintf(stderr, "tint2: %s %d: win = %ld, task = %s\n", __func__, __LINE__, win, task_template.title ? // task_template.title : "??"); // fprintf(stderr, "tint2: new task %s win %u: desktop %d, monitor %d\n", new_task.title, win, new_task.desktop, monitor);

@@ -118,7 +118,7 @@ task_instance->win_w = task_template.win_w;

task_instance->win_h = task_template.win_h; task_instance->current_state = TASK_UNDEFINED; // to update the current state later in set_task_state... if (task_instance->desktop == ALL_DESKTOPS && server.desktop != j) { - // fprintf(stderr, "tint2: %s %d: win = %ld hiding task: another desktop\n", __FUNCTION__, __LINE__, win); + // fprintf(stderr, "tint2: %s %d: win = %ld hiding task: another desktop\n", __func__, __LINE__, win); task_instance->area.on_screen = always_show_all_desktop_tasks; } task_instance->title = task_template.title;

@@ -186,7 +186,7 @@ {

if (!task) return; - // fprintf(stderr, "tint2: %s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, task->win, task->title ? task->title : + // fprintf(stderr, "tint2: %s %d: win = %ld, task = %s\n", __func__, __LINE__, task->win, task->title ? task->title : // "??"); if (taskbar_mode == MULTI_DESKTOP) {

@@ -292,7 +292,7 @@ img = imlib_create_image_using_copied_data(w, h, icon_data);

if (0 && img) fprintf(stderr, "%s: Got %dx%d icon via _NET_WM_ICON for %s\n", - __FUNCTION__, + __func__, w, h, task->title ? task->title : "task");

@@ -318,7 +318,7 @@ img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, w, h, 0);

if (0 && img) fprintf(stderr, "%s: Got %dx%d pixmap icon via WM_HINTS for %s\n", - __FUNCTION__, + __func__, w, h, task->title ? task->title : "task");

@@ -783,7 +783,7 @@ }

void task_update_desktop(Task *task) { - // fprintf(stderr, "tint2: %s %d:\n", __FUNCTION__, __LINE__); + // fprintf(stderr, "tint2: %s %d:\n", __func__, __LINE__); Window win = task->win; remove_task(task); task = add_task(win);
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -467,7 +467,7 @@ void taskbar_refresh_tasklist()

{ if (!taskbar_enabled) return; - // fprintf(stderr, "tint2: %s %d:\n", __FUNCTION__, __LINE__); + // fprintf(stderr, "tint2: %s %d:\n", __func__, __LINE__); int num_results; Window *win = server_get_property(server.root_win, server.atom._NET_CLIENT_LIST, XA_WINDOW, &num_results);