kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=a9a568ffe380371511ba9699b9d0203db4c45491

commit a9a568ffe380371511ba9699b9d0203db4c45491
Author: Kim Woelders <[email protected]>
Date:   Sat May 10 14:37:15 2014 +0200

    Debug printout cleanups.
---
 src/borders.c     | 23 +++++++++--------------
 src/comms.c       |  8 +++-----
 src/config.c      |  8 ++++----
 src/desktops.c    | 36 ++++++++++++++++++------------------
 src/econfig.c     | 12 ++++++------
 src/edge.c        |  4 ++--
 src/eimage.c      |  8 ++++----
 src/emodule.c     |  4 ++--
 src/events.c      | 27 +++++++++++++--------------
 src/ewin-ops.c    |  2 +-
 src/ewmh.c        |  2 +-
 src/extinitwin.c  | 16 ++++++++--------
 src/focus.c       | 22 +++++++++++-----------
 src/handlers.c    |  4 ++--
 src/hints.c       |  8 ++++----
 src/hiwin.c       |  8 ++++----
 src/icccm.c       |  8 ++++----
 src/iclass.c      |  8 ++++----
 src/ipc.c         |  2 +-
 src/main.c        |  2 +-
 src/menus.c       |  6 +++---
 src/misc.c        |  8 ++++----
 src/mod-misc.c    |  4 ++--
 src/session.c     | 28 ++++++++++++++--------------
 src/snaps.c       |  4 ++--
 src/sound_load.c  |  6 +++---
 src/text.c        |  4 ++--
 src/windowmatch.c | 14 +++++++-------
 28 files changed, 139 insertions(+), 147 deletions(-)

diff --git a/src/borders.c b/src/borders.c
index 448aeeb..16fe2dc 100644
--- a/src/borders.c
+++ b/src/borders.c
@@ -86,8 +86,8 @@ BorderWinpartITclassApply(EWin * ewin, int i, int force)
       return;
 
 #if 0                          /* Debug */
-   Eprintf("BorderWpITApply: %#lx %#lx %2d %d %s\n",
-          EwinGetClientXwin(ewin), EoGetWin(ewin), i, force,
+   Eprintf("%s: %#x %#x %2d %d %s\n", __func__,
+          EwinGetClientXwin(ewin), EoGetXwin(ewin), i, force,
           EwinGetTitle(ewin));
 #endif
 
@@ -220,9 +220,8 @@ EwinBorderDraw(EWin * ewin, int do_shape, int do_paint)
    int                 i;
 
 #if 0                          /* Debug */
-   Eprintf("EwinBorderDraw %#lx %s d=%d s=%d p=%d\n",
-          EwinGetClientXwin(ewin), EoGetName(ewin), EoGetDeskNum(ewin),
-          do_shape, do_paint);
+   Eprintf("%s: %#x %s s=%d p=%d\n", __func__,
+          EwinGetClientXwin(ewin), EoGetName(ewin), do_shape, do_paint);
 #endif
 
    for (i = 0; i < ewin->border->num_winparts; i++)
@@ -452,7 +451,7 @@ EwinBorderCalcSizes(EWin * ewin, int propagate)
      }
 
 #if 0                          /* Debug */
-   Eprintf("EwinBorderCalcSizes prop=%d reshape=%d\n", propagate, reshape);
+   Eprintf("%s: prop=%d reshape=%d\n", __func__, propagate, reshape);
 #endif
    if (reshape)
       ewin->update.shape = 1;
@@ -885,8 +884,7 @@ BorderWinpartEventMouseDown(EWinBit * wbit, XEvent * ev)
 
    wbit->state = STATE_CLICKED;
 #if DEBUG_BORDER_EVENTS
-   Eprintf("BorderWinpartEventMouseDown %#lx %d\n", WinGetXwin(wbit->win),
-          wbit->state);
+   Eprintf("%s: %#x %d\n", __func__, WinGetXwin(wbit->win), wbit->state);
 #endif
    BorderWinpartChange(ewin, part, 0);
 
@@ -924,8 +922,7 @@ BorderWinpartEventMouseUp(EWinBit * wbit, XEvent * ev)
    else
       wbit->state = STATE_NORMAL;
 #if DEBUG_BORDER_EVENTS
-   Eprintf("BorderWinpartEventMouseUp %#lx %d\n", WinGetXwin(wbit->win),
-          wbit->state);
+   Eprintf("%s: %#x %d\n", __func__, WinGetXwin(wbit->win), wbit->state);
 #endif
    BorderWinpartChange(ewin, part, 0);
 
@@ -944,8 +941,7 @@ BorderWinpartEventEnter(EWinBit * wbit, XEvent * ev)
    int                 part = wbit - ewin->bits;
 
 #if DEBUG_BORDER_EVENTS
-   Eprintf("BorderWinpartEventEnter %#lx %d\n", WinGetXwin(wbit->win),
-          wbit->state);
+   Eprintf("%s: %#x %d\n", __func__, WinGetXwin(wbit->win), wbit->state);
 #endif
    if (wbit->state == STATE_CLICKED)
       wbit->left = 0;
@@ -963,8 +959,7 @@ BorderWinpartEventLeave(EWinBit * wbit, XEvent * ev)
    int                 part = wbit - ewin->bits;
 
 #if DEBUG_BORDER_EVENTS
-   Eprintf("BorderWinpartEventLeave %#lx %d\n", WinGetXwin(wbit->win),
-          wbit->state);
+   Eprintf("%s: %#x %d\n", __func__, WinGetXwin(wbit->win), wbit->state);
 #endif
    if (wbit->state == STATE_CLICKED)
       wbit->left = 1;
diff --git a/src/comms.c b/src/comms.c
index b020709..f1d8fea 100644
--- a/src/comms.c
+++ b/src/comms.c
@@ -224,7 +224,7 @@ ClientHandleComms(XClientMessageEvent * ev)
       return;
 
    if (EDebug(EDBUG_TYPE_IPC))
-      Eprintf("ClientHandleComms: %s\n", s);
+      Eprintf("%s: %s\n", __func__, s);
 
    if (!strncmp(s, "set ", 4))
      {
@@ -258,8 +258,7 @@ ClientHandleRootEvents(Win win __UNUSED__, XEvent * ev, 
void *prm __UNUSED__)
    Client             *c;
 
 #if 0
-   Eprintf("ClientHandleRootEvents: type=%d win=%#lx\n", ev->type,
-          ev->xany.window);
+   Eprintf("%s: type=%d win=%#lx\n", __func__, ev->type, ev->xany.window);
 #endif
    switch (ev->type)
      {
@@ -276,8 +275,7 @@ static void
 ClientHandleCommsEvents(Win win __UNUSED__, XEvent * ev, void *prm __UNUSED__)
 {
 #if 0
-   Eprintf("ClientHandleCommsEvents: type=%d win=%#lx\n", ev->type,
-          ev->xany.window);
+   Eprintf("%s: type=%d win=%#lx\n", __func__, ev->type, ev->xany.window);
 #endif
    switch (ev->type)
      {
diff --git a/src/config.c b/src/config.c
index e5d22c6..87a3a20 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2012 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -171,7 +171,7 @@ GetLine(char *s, int size, FILE * f)
       *so = '\0';
 
    if (EDebug(EDBUG_TYPE_CONFIG) > 1)
-      Eprintf("GetLine %s\n", s);
+      Eprintf("%s: %s\n", __func__, s);
 
    return s;
 }
@@ -235,7 +235,7 @@ ConfigFilePreparse(const char *src, const char *dst, const 
char *themepath)
    const char         *variant;
 
    if (EDebug(EDBUG_TYPE_CONFIG))
-      Eprintf("ConfigFilePreparse %s -> %s\n", src, dst);
+      Eprintf("%s: %s -> %s\n", __func__, src, dst);
 
    /* When themepath is NULL it shouldn't be used, but this is consistent
     * with old behavior */
@@ -556,7 +556,7 @@ ConfigFileLoad(const char *name, const char *themepath,
    FILE               *fs;
 
    if (EDebug(EDBUG_TYPE_CONFIG))
-      Eprintf("ConfigFileLoad %s\n", name);
+      Eprintf("%s: %s\n", __func__, name);
 
    file = ConfigFileFind(name, themepath, preparse);
    if (!file)
diff --git a/src/desktops.c b/src/desktops.c
index 5c9249b..07d7a8b 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -509,11 +509,11 @@ DeskBackgroundConfigure(Desk * dsk)
    unsigned int        pixel = dsk->bg.pixel;
 
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf
-        ("DeskBackgroundConfigure %d v=%d %#x/%#x: ext=%d pmap=%#x/%#x 
pixel=%#x/%#x\n",
-         dsk->num, dsk->viewable, EoGetXwin(dsk), EobjGetXwin(dsk->bg.o),
-         BackgroundIsNone(dsk->bg.bg), pmap, dsk->bg.pmap_set, pixel,
-         dsk->bg.pixel);
+      Eprintf("%s: %d v=%d %#x/%#x: ext=%d pmap=%#x/%#x pixel=%#x/%#x\n",
+             __func__,
+             dsk->num, dsk->viewable, EoGetXwin(dsk), EobjGetXwin(dsk->bg.o),
+             BackgroundIsNone(dsk->bg.bg), pmap, dsk->bg.pmap_set, pixel,
+             dsk->bg.pixel);
 
 #if USE_COMPOSITE
    if (dsk->bg.o_bg)
@@ -582,7 +582,7 @@ DeskBackgroundRefresh(Desk * dsk, int why)
    int                 reconfigure = 0;
 
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskBackgroundRefresh %d v=%d why=%d pmap=%#x pixel=%#x\n",
+      Eprintf("%s: %d v=%d why=%d pmap=%#x pixel=%#x\n", __func__,
              dsk->num, dsk->viewable, why, pmap, pixel);
 
    switch (why)
@@ -785,7 +785,7 @@ DeskSetDirtyStack(Desk * dsk, EObj * eo)
    if (EobjGetType(eo) == EOBJ_TYPE_EWIN)
       dsk->stack.update_client_list = 1;
    if (EDebug(EDBUG_TYPE_STACKING))
-      Eprintf("DeskSetDirtyStack %d (%d): %s\n", dsk->num, dsk->stack.dirty,
+      Eprintf("%s: %d (%d): %s\n", __func__, dsk->num, dsk->stack.dirty,
              EobjGetName(eo));
 }
 
@@ -1193,7 +1193,7 @@ static void
 _DeskGotoStart(Desk * dsk)
 {
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskGoto %d\n", dsk->num);
+      Eprintf("%s: %d\n", __func__, dsk->num);
 
    ModulesSignal(ESIGNAL_DESK_SWITCH_START, NULL);
 
@@ -1210,7 +1210,7 @@ _DeskGotoEnd(Desk * dsk)
    ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
 
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskGoto %d done\n", dsk->num);
+      Eprintf("%s: %d\n", __func__, dsk->num);
 }
 
 static int
@@ -1329,7 +1329,7 @@ DeskRaise(unsigned int desk)
    dsk = _DeskGet(desk);
 
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskRaise(%d) current=%d\n", desk, desks.current->num);
+      Eprintf("%s: %d current=%d\n", __func__, desk, desks.current->num);
 
    DeskSwitchStart();
    DeskEnter(dsk);
@@ -1354,7 +1354,7 @@ DeskLower(unsigned int desk)
    MoveToDeskBottom(dsk);
 
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskLower(%d) %d -> %d\n", desk, desks.current->num,
+      Eprintf("%s: %d %d -> %d\n", __func__, desk, desks.current->num,
              desks.order[0]);
 
    desks.previous = desks.current = DeskGet(desks.order[0]);
@@ -1422,7 +1422,7 @@ DeskRestackSimple(Desk * dsk)
    eo->stacked = 1;
 
    if (EDebug(EDBUG_TYPE_STACKING))
-      Eprintf("DeskRestackSimple %#x %s\n", EobjGetXwin(eo), EobjGetName(eo));
+      Eprintf("%s: %#x %s\n", __func__, EobjGetXwin(eo), EobjGetName(eo));
 
    if (i < num - 1)
      {
@@ -1436,7 +1436,7 @@ DeskRestackSimple(Desk * dsk)
      }
    value_mask = CWSibling | CWStackMode;
    if (EDebug(EDBUG_TYPE_STACKING))
-      Eprintf("DeskRestackSimple %#10x %s %#10lx\n", EobjGetXwin(eo),
+      Eprintf("%s: %#10x %s %#10lx\n", __func__, EobjGetXwin(eo),
              (xwc.stack_mode == Above) ? "Above" : "Below", xwc.sibling);
    XConfigureWindow(disp, EobjGetXwin(eo), value_mask, &xwc);
 }
@@ -1478,7 +1478,7 @@ DeskRestack(Desk * dsk)
 
    if (EDebug(EDBUG_TYPE_STACKING))
      {
-       Eprintf("DeskRestack %d (%d):\n", dsk->num, dsk->stack.dirty);
+       Eprintf("%s: %d (%d):\n", __func__, dsk->num, dsk->stack.dirty);
        for (i = 0; i < tot; i++)
           Eprintf(" win=%#10x parent=%#10x\n", wl[i],
                   EXWindowGetParent(wl[i]));
@@ -1692,7 +1692,7 @@ static void
 _DeskCurrentGotoAreaStart(int pax, int pay, int ax, int ay)
 {
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskCurrentGotoArea %d,%d\n", ax, ay);
+      Eprintf("%s: %d,%d\n", __func__, ax, ay);
 
    ModulesSignal(ESIGNAL_AREA_SWITCH_START, NULL);
 
@@ -2018,7 +2018,7 @@ static void
 DeskRootResize(int root, int w, int h)
 {
    if (EDebug(EDBUG_TYPE_DESKS))
-      Eprintf("DeskRootResize %d %dx%d\n", root, w, h);
+      Eprintf("%s: %d %dx%d\n", __func__, root, w, h);
 
    if (root && (VROOT != RROOT))
      {
@@ -2061,7 +2061,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
        /* Possible race here? */
        pmap = HintsGetRootPixmap(EoGetWin(dsk));
        if (EDebug(EDBUG_TYPE_DESKS))
-          Eprintf("DeskPropertyChange win=%#lx _XROOTPMAP_ID=%#x\n",
+          Eprintf("%s: win=%#lx _XROOTPMAP_ID=%#x\n", __func__,
                   ev->xany.window, pmap);
        if (ev->xany.window != WinGetXwin(VROOT))
           return;
@@ -2076,7 +2076,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
    else if (ev->xproperty.atom == E_XROOTCOLOR_PIXEL)
      {
        if (EDebug(EDBUG_TYPE_DESKS))
-          Eprintf("DeskPropertyChange win=%#lx _XROOTCOLOR_PIXEL\n",
+          Eprintf("%s: win=%#lx _XROOTCOLOR_PIXEL\n", __func__,
                   ev->xany.window);
        if (ev->xany.window != WinGetXwin(VROOT))
           return;
diff --git a/src/econfig.c b/src/econfig.c
index 0ff69d9..9adaef4 100644
--- a/src/econfig.c
+++ b/src/econfig.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2010 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -158,7 +158,7 @@ CfgItemLoad(ECfgFile * ecf, const char *prefix, const 
CfgItem * ci, int dflt)
       name = ci->name;
 
    if (EDebug(EDBUG_TYPE_CONFIG) > 1)
-      Eprintf("CfgItemLoad %s\n", name);
+      Eprintf("%s: %s\n", __func__, name);
 
    if (!ci->ptr)
       return;
@@ -180,7 +180,7 @@ CfgItemSave(ECfgFile * ecf, const char *prefix, const 
CfgItem * ci)
       name = ci->name;
 
    if (EDebug(EDBUG_TYPE_CONFIG) > 1)
-      Eprintf("CfgItemSave %s\n", name);
+      Eprintf("%s: %s\n", __func__, name);
 
    if (!ci->ptr)
       return;
@@ -205,7 +205,7 @@ _ConfigurationLoad(const char *file, int dflt)
    ECfgFile           *ecf;
 
    if (EDebug(EDBUG_TYPE_CONFIG))
-      Eprintf("ConfigurationLoad\n");
+      Eprintf("%s\n", __func__);
 
    ecf = e16_db_open_read(file);
    /* NB! We have to assign the defaults even if it doesn't exist */
@@ -248,7 +248,7 @@ ConfigurationSave(void)
    ECfgFile           *ecf;
 
    if (EDebug(EDBUG_TYPE_CONFIG))
-      Eprintf("ConfigurationSave\n");
+      Eprintf("%s\n", __func__);
 
    ecf = e16_db_open(ConfigurationGetFile(buf, sizeof(buf)));
    if (!ecf)
@@ -414,7 +414,7 @@ ConfigurationSet(const char *params)
    p = strchr(params, '.');
    if (!p)
      {
-       Eprintf("ConfigurationSet - missed: %s\n", params);
+       Eprintf("%s: missed: %s\n", __func__, params);
        return;
      }
 
diff --git a/src/edge.c b/src/edge.c
index 17224f4..c4ad043 100644
--- a/src/edge.c
+++ b/src/edge.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2012 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -113,7 +113,7 @@ EdgeEvent(int dir)
    static int          lastdir = -1;
 
 #if 0
-   Eprintf("EdgeEvent %d -> %d\n", lastdir, dir);
+   Eprintf("%s: %d -> %d\n", __func__, lastdir, dir);
 #endif
    if (lastdir == dir || Conf.desks.edge_flip_mode == EDGE_FLIP_OFF)
       return;
diff --git a/src/eimage.c b/src/eimage.c
index e30bec7..711cf65 100644
--- a/src/eimage.c
+++ b/src/eimage.c
@@ -567,8 +567,8 @@ ScaleTile(Win wsrc, EX_Drawable src, Win wdst, EX_Pixmap 
dst,
    tw = (int)((float)(stw * scale * dw) / sw + .5f);
    th = (int)((float)(sth * scale * dh) / sh + .5f);
 #if 0
-   Eprintf("ScaleTile: Tile %#lx %dx%d -> %dx%d T %dx%d -> %dx%d\n", src,
-          stw, sth, tw, th, scale * dw, scale * dh, dw, dh);
+   Eprintf("%s: Tile %#x %dx%d -> %dx%d T %dx%d -> %dx%d\n", __func__,
+          src, stw, sth, tw, th, scale * dw, scale * dh, dw, dh);
 #endif
    tim =
       EImageGrabDrawableScaled(wsrc, src, NoXID, 0, 0, stw, sth, tw, th, 0, 0);
@@ -598,8 +598,8 @@ EDrawableDumpImage(EX_Drawable draw, const char *txt)
       imlib_create_image_from_drawable(NoXID, 0, 0, w, h, !EServerIsGrabbed());
    imlib_context_set_image(im);
    imlib_image_set_format("png");
-   sprintf(buf, "%s-%#lx-%d.png", txt, draw, seqn++);
-   Eprintf("EDrawableDumpImage: %s\n", buf);
+   sprintf(buf, "%s-%#x-%d.png", txt, draw, seqn++);
+   Eprintf("%s: %s\n", __func__, buf);
    imlib_save_image(buf);
    imlib_free_image_and_decache();
 }
diff --git a/src/emodule.c b/src/emodule.c
index f474749..32647a5 100644
--- a/src/emodule.c
+++ b/src/emodule.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2009 Kim Woelders
+ * Copyright (C) 2003-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -96,7 +96,7 @@ ModuleConfigShow(const char *name, const char *item)
    int                 i;
 
 #if 0
-   Eprintf("ModuleConfigShow: %s:%s\n", name, item);
+   Eprintf("%s: %s:%s\n", __func__, name, item);
 #endif
    em = EModuleFind(name);
    if (!em)
diff --git a/src/events.c b/src/events.c
index 6265a76..f71a8ec 100644
--- a/src/events.c
+++ b/src/events.c
@@ -589,7 +589,7 @@ EventsCompress(XEvent * evq, int count)
    if (EDebug(EDBUG_TYPE_COMPRESSION))
       for (i = 0; i < count; i++)
         if (evq[i].type)
-           Eprintf("EventsCompress-1 %3d %s w=%#lx\n", i,
+           Eprintf("%s-1 %3d %s w=%#lx\n", __func__, i,
                    EventName(evq[i].type), evq[i].xany.window);
 #endif
 
@@ -621,7 +621,7 @@ EventsCompress(XEvent * evq, int count)
               }
 #if ENABLE_DEBUG_EVENTS
             if (n && EDebug(EDBUG_TYPE_COMPRESSION))
-               Eprintf("EventsCompress n=%4d %s %#lx x,y = %d,%d\n",
+               Eprintf("%s: n=%4d %s %#lx x,y = %d,%d\n", __func__,
                        n, EventName(type), ev->xmotion.window,
                        ev->xmotion.x, ev->xmotion.y);
 #endif
@@ -652,7 +652,7 @@ EventsCompress(XEvent * evq, int count)
               }
 #if ENABLE_DEBUG_EVENTS
             if (EDebug(EDBUG_TYPE_COMPRESSION))
-               Eprintf("EventsCompress n=%4d %s %#lx\n",
+               Eprintf("%s: n=%4d %s %#lx\n", __func__,
                        1, EventName(type), ev->xcrossing.window);
 #endif
             break;
@@ -741,7 +741,7 @@ EventsCompress(XEvent * evq, int count)
               }
 #if ENABLE_DEBUG_EVENTS
             if (EDebug(EDBUG_TYPE_COMPRESSION))
-               Eprintf("EventsCompress n=%4d %s %#lx x=%4d-%4d y=%4d-%4d\n",
+               Eprintf("%s: n=%4d %s %#lx x=%4d-%4d y=%4d-%4d\n", __func__,
                        n, EventName(type), ev->xexpose.window, xa, xb, ya, yb);
 #endif
             break;
@@ -759,7 +759,7 @@ EventsCompress(XEvent * evq, int count)
               }
 #if ENABLE_DEBUG_EVENTS
             if (n && EDebug(EDBUG_TYPE_COMPRESSION))
-               Eprintf("EventsCompress n=%4d %s %#lx\n",
+               Eprintf("%s: n=%4d %s %#lx\n", __func__,
                        n, EventName(type), ev->xmotion.window);
 #endif
             break;
@@ -777,7 +777,7 @@ EventsCompress(XEvent * evq, int count)
    if (EDebug(EDBUG_TYPE_COMPRESSION))
       for (i = 0; i < count; i++)
         if (evq[i].type)
-           Eprintf("EventsCompress-2 %3d %s w=%#lx\n", i,
+           Eprintf("%s-2 %3d %s w=%#lx\n", __func__, i,
                    EventName(evq[i].type), evq[i].xany.window);
 #endif
 }
@@ -958,7 +958,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
    evq = *evq_p;
 
    if (EDebug(EDBUG_TYPE_EVENTS) > 1)
-      Eprintf("EventsProcess-B %d\n", n);
+      Eprintf("%s-B %d\n", __func__, n);
 
    for (i = count = 0; i < n; i++)
      {
@@ -974,7 +974,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
      }
 
    if (EDebug(EDBUG_TYPE_EVENTS) > 1)
-      Eprintf("EventsProcess-E %d/%d\n", count, n);
+      Eprintf("%s-E %d/%d\n", __func__, count, n);
 
    if (n > *evq_f)
       *evq_f = n;
@@ -1013,8 +1013,8 @@ EventsMain(void)
             evq_fetch =
                (pfetch > evq_fetch) ? pfetch : (3 * evq_fetch + pfetch) / 4;
             if (EDebug(EDBUG_TYPE_EVENTS) > 1)
-               Eprintf("EventsMain - Alloc/fetch/pfetch/peak=%d/%d/%d/%d)\n",
-                       evq_alloc, evq_fetch, pfetch, count);
+               Eprintf("%s - Alloc/fetch/pfetch/peak=%d/%d/%d/%d)\n",
+                       __func__, evq_alloc, evq_fetch, pfetch, count);
             if ((evq_ptr) && ((evq_alloc - evq_fetch) > 64))
               {
                  evq_alloc = 0;
@@ -1076,10 +1076,9 @@ EventsMain(void)
          }
 
        if (EDebug(EDBUG_TYPE_EVENTS))
-          Eprintf
-             ("EventsMain - count=%d xfd=%d:%d dtl=%.6lf dt=%.6lf\n",
-              count, pfds[0].fd, FD_ISSET(pfds[0].fd, &fdset),
-              dtl * 1e-3, dt * 1e-3);
+          Eprintf("%s: count=%d xfd=%d:%d dtl=%.6lf dt=%.6lf\n", __func__,
+                  count, pfds[0].fd, FD_ISSET(pfds[0].fd, &fdset),
+                  dtl * 1e-3, dt * 1e-3);
 
        if (count <= 0)
           continue;            /* Timeout (or error) */
diff --git a/src/ewin-ops.c b/src/ewin-ops.c
index e8ed8b7..29a4a30 100644
--- a/src/ewin-ops.c
+++ b/src/ewin-ops.c
@@ -179,7 +179,7 @@ doEwinMoveResize(EWin * ewin, Desk * dsk, int x, int y, int 
w, int h, int flags)
    call_depth++;
 
    if (EDebug(EDBUG_TYPE_MOVERESIZE))
-      Eprintf("doEwinMoveResize(%d,%d) %#x f=%x d=%d %d+%d %d*%d %s\n",
+      Eprintf("%s(%d,%d) %#x f=%x d=%d %d+%d %d*%d %s\n", __func__,
              call_depth, Mode.mode, EwinGetClientXwin(ewin), flags,
              (dsk) ? (int)dsk->num : -1, x, y, w, h, EwinGetTitle(ewin));
 
diff --git a/src/ewmh.c b/src/ewmh.c
index 416a50c..9161b91 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -664,7 +664,7 @@ EWMH_GetWindowUserTime(EWin * ewin __UNUSED__)
    if (num <= 0)
       return;
 
-   Eprintf("EWMH_GetWindowUserTime %#x\n", ts);
+   Eprintf("%s %#x\n", __func__, ts);
 #endif
 }
 
diff --git a/src/extinitwin.c b/src/extinitwin.c
index c0fade7..b545504 100644
--- a/src/extinitwin.c
+++ b/src/extinitwin.c
@@ -151,7 +151,7 @@ ExtInitWinMain(void)
    EiwLoopFunc        *eiwc_loop_func;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("ExtInitWinMain enter\n");
+      Eprintf("%s: enter\n", __func__);
 
    err = EDisplayOpen(NULL, -1);
    if (err)
@@ -218,7 +218,7 @@ ExtInitWinMain(void)
 
           Esnprintf(s, sizeof(s), "pix/wait%i.png", i);
           if (EDebug(EDBUG_TYPE_SESSION) > 1)
-             Eprintf("ExtInitWinCreate - child %s\n", s);
+             Eprintf("%s: child %s\n", __func__, s);
 
           im = ThemeImageLoad(s);
           if (im)
@@ -236,7 +236,7 @@ ExtInitWinMain(void)
    }
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("ExtInitWinMain exit\n");
+      Eprintf("%s: exit\n", __func__);
 
    EDisplayClose();
 
@@ -251,7 +251,7 @@ ExtInitWinCreate(void)
    EX_Atom             a;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("ExtInitWinCreate\n");
+      Eprintf("%s\n", __func__);
 
    a = ex_atom_get("ENLIGHTENMENT_RESTART_SCREEN");
    ESync(0);
@@ -264,7 +264,7 @@ ExtInitWinCreate(void)
        for (;;)
          {
             if (EDebug(EDBUG_TYPE_SESSION))
-               Eprintf("ExtInitWinCreate - parent\n");
+               Eprintf("%s: parent\n", __func__);
 
             /* Hack to give the child some space. Not foolproof. */
             sleep(1);
@@ -276,7 +276,7 @@ ExtInitWinCreate(void)
 
        win = win_ex;
        if (EDebug(EDBUG_TYPE_SESSION))
-          Eprintf("ExtInitWinCreate - parent - %#x\n", win);
+          Eprintf("%s: parent - %#x\n", __func__, win);
 
        return win;
      }
@@ -284,7 +284,7 @@ ExtInitWinCreate(void)
    /* Child - Create the init window */
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("ExtInitWinCreate - child\n");
+      Eprintf("%s: child\n", __func__);
 
    /* Clean up inherited stuff */
 
@@ -320,7 +320,7 @@ ExtInitWinKill(void)
       return;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("Kill init window %#x\n", init_win_ext);
+      Eprintf("%s: %#x\n", __func__, init_win_ext);
    XUnmapWindow(disp, init_win_ext);
    init_win_ext = NoXID;
 }
diff --git a/src/focus.c b/src/focus.c
index 6e4bdff..f266b73 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -61,7 +61,7 @@ FocusEnable(int on)
      }
 
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("FocusEnable inhibit=%d\n", focus_inhibit);
+      Eprintf("%s: inhibit=%d\n", __func__, focus_inhibit);
 }
 
 /*
@@ -74,7 +74,7 @@ FocusEwinValid(EWin * ewin, int want_on_screen, int click, 
int want_visible)
       return 0;
 
 #if 0
-   Eprintf("FocusEwinValid %#x %s: st=%d sh=%d inh=%d cl=%d(%d) vis=%d(%d)\n",
+   Eprintf("%s: %#x %s: st=%d sh=%d inh=%d cl=%d(%d) vis=%d(%d)\n", __func__,
           EwinGetClientXwin(ewin), EwinGetTitle(ewin),
           ewin->state.state, EoIsShown(ewin), ewin->state.inhibit_focus,
           click, ewin->props.focusclick, want_visible, ewin->state.visibility);
@@ -224,7 +224,7 @@ ClickGrabsSet(EWin * ewin)
             GrabButtonSet(AnyButton, AnyModifier, EwinGetClientConWin(ewin),
                           ButtonPressMask, ECSR_PGRAB, 1);
             if (EDebug(EDBUG_TYPE_GRABS))
-               Eprintf("ClickGrabsSet: %#x set %s\n",
+               Eprintf("%s: %#x set %s\n", __func__,
                        EwinGetClientXwin(ewin), EwinGetTitle(ewin));
             ewin->state.click_grab_isset = 1;
          }
@@ -236,7 +236,7 @@ ClickGrabsSet(EWin * ewin)
             GrabButtonRelease(AnyButton, AnyModifier,
                               EwinGetClientConWin(ewin));
             if (EDebug(EDBUG_TYPE_GRABS))
-               Eprintf("ClickGrabsSet: %#x unset %s\n",
+               Eprintf("%s: %#x unset %s\n", __func__,
                        EwinGetClientXwin(ewin), EwinGetTitle(ewin));
             ewin->state.click_grab_isset = 0;
          }
@@ -291,7 +291,7 @@ doFocusToEwin(EWin * ewin, int why)
       return;
 
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("doFocusToEWin %#x %s why=%d\n",
+      Eprintf("%s: %#x %s why=%d\n", __func__,
              (ewin) ? EwinGetClientXwin(ewin) : 0,
              (ewin) ? EwinGetTitle(ewin) : "None", why);
 
@@ -466,7 +466,7 @@ void
 FocusToEWin(EWin * ewin, int why)
 {
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("FocusToEWin(%d) %#x %s why=%d\n", focus_inhibit,
+      Eprintf("%s(%d) %#x %s why=%d\n", __func__, focus_inhibit,
              (ewin) ? EwinGetClientXwin(ewin) : 0,
              (ewin) ? EwinGetTitle(ewin) : "None", why);
 
@@ -622,7 +622,7 @@ FocusHandleEnter(EWin * ewin, XEvent * ev)
        ev->xcrossing.detail == NotifyNonlinearVirtual)
      {
        if (EDebug(1))
-          Eprintf("Previously ignored: focused: %s, enter: %s\n",
+          Eprintf("%s: Previously ignored: focused: %s, enter: %s\n", __func__,
                   EoGetNameSafe(Mode.focuswin), EoGetNameSafe(ewin));
      }
 #endif
@@ -632,7 +632,7 @@ FocusHandleEnter(EWin * ewin, XEvent * ev)
        /* This event was caused by a request older than the latest
         * focus assignment request - ignore */
        if (EDebug(EDBUG_TYPE_FOCUS))
-          Eprintf("FocusHandleEnter: Ignore serial < %#x\n", focus_request);
+          Eprintf("%s: Ignore serial < %#x\n", __func__, focus_request);
        return;
      }
 
@@ -669,7 +669,7 @@ FocusHandleLeave(EWin * ewin, XEvent * ev)
        /* This event was caused by a request older than the latest
         * focus assignment request - ignore */
        if (EDebug(EDBUG_TYPE_FOCUS))
-          Eprintf("FocusHandleLeave: Ignore serial < %#x\n", focus_request);
+          Eprintf("%s: Ignore serial < %#x\n", __func__, focus_request);
        return;
      }
 
@@ -687,7 +687,7 @@ FocusHandleChange(EWin * ewin __UNUSED__, XEvent * ev 
__UNUSED__)
 {
 #if 0                          /* Debug */
    if (ewin == Mode.focuswin && ev->type == FocusOut)
-      Eprintf("??? Lost focus: %s\n", EwinGetTitle(ewin));
+      Eprintf("%s: ??? Lost focus: %s\n", __func__, EwinGetTitle(ewin));
 #endif
 }
 
@@ -701,7 +701,7 @@ FocusHandleClick(EWin * ewin, Win win)
 
    /* Allow click to pass thorugh */
    if (EDebug(EDBUG_TYPE_GRABS))
-      Eprintf("FocusHandleClick %#x %#x\n", WinGetXwin(win),
+      Eprintf("%s: %#x %#x\n", __func__, WinGetXwin(win),
              EwinGetContainerXwin(ewin));
    if (win == EwinGetClientConWin(ewin))
      {
diff --git a/src/handlers.c b/src/handlers.c
index 9b75c55..ae4d217 100644
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2008 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -35,7 +35,7 @@ SignalHandler(int sig)
    Mode.wm.in_signal_handler = 1;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SignalHandler signal=%d\n", sig);
+      Eprintf("%s: signal=%d\n", __func__, sig);
 
    switch (sig)
      {
diff --git a/src/hints.c b/src/hints.c
index 99995cb..f4e012e 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -270,7 +270,7 @@ HintsProcessPropertyChange(EWin * ewin, XEvent * ev)
 #if 0
    if (EDebug(1))
      {
-       Eprintf("HintsProcessPropertyChange:\n");
+       Eprintf("%s:\n", __func__);
        EventShow(ev);
      }
 #endif
@@ -289,7 +289,7 @@ HintsProcessClientClientMessage(EWin * ewin, 
XClientMessageEvent * event)
 #endif
    if (EDebug(1))
      {
-       Eprintf("HintsProcessClientClientMessage:\n");
+       Eprintf("%s:\n", __func__);
        EventShow((XEvent *) event);
      }
 }
@@ -307,7 +307,7 @@ HintsProcessRootClientMessage(XClientMessageEvent * event)
 #endif
    if (EDebug(1))
      {
-       Eprintf("HintsProcessRootClientMessage:\n");
+       Eprintf("%s:\n", __func__);
        EventShow((XEvent *) event);
      }
 }
@@ -560,7 +560,7 @@ EHintsSetInfoOnAll(void)
    EWin               *const *lst;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SetEInfoOnAll\n");
+      Eprintf("%s\n", __func__);
 
    lst = EwinListGetAll(&num);
    for (i = 0; i < num; i++)
diff --git a/src/hiwin.c b/src/hiwin.c
index d33ec2f..00c106b 100644
--- a/src/hiwin.c
+++ b/src/hiwin.c
@@ -217,7 +217,7 @@ HiwinEwinEvent(Win win __UNUSED__, XEvent * ev, void *prm)
    Hiwin              *phi = (Hiwin *) prm;
 
 #if DEBUG_HIWIN
-   Eprintf("HiwinEwinEvent type=%d %s\n", ev->type, EwinGetTitle(phi->ewin));
+   Eprintf("%s: type=%d %s\n", __func__, ev->type, EwinGetTitle(phi->ewin));
 #endif
 
    switch (ev->type)
@@ -269,7 +269,7 @@ HiwinInit(Hiwin * phi, EWin * ewin)
    if (phi->ewin)
      {
 #if DEBUG_HIWIN
-       Eprintf("Unregister %s\n", EwinGetTitle(phi->ewin));
+       Eprintf("%s: Unregister %s\n", __func__, EwinGetTitle(phi->ewin));
 #endif
        EventCallbackUnregister(EoGetWin(phi->ewin), HiwinEwinEvent, phi);
      }
@@ -281,7 +281,7 @@ HiwinInit(Hiwin * phi, EWin * ewin)
    if (phi->ewin)
      {
 #if DEBUG_HIWIN
-       Eprintf("Register %s\n", EwinGetTitle(phi->ewin));
+       Eprintf("%s: Register %s\n", __func__, EwinGetTitle(phi->ewin));
 #endif
        EventCallbackRegister(EoGetWin(phi->ewin), HiwinEwinEvent, phi);
      }
@@ -392,7 +392,7 @@ HiwinShow(Hiwin * phi, EWin * ewin, int zoom, int confine)
      }
 
 #if DEBUG_HIWIN
-   Eprintf("HiwinShow %s zoom=%d->%d step=%d %d,%d %dx%d\n",
+   Eprintf("%s: %s zoom=%d->%d step=%d %d,%d %dx%d\n", __func__,
           EoGetName(ewin), phi->zoom, zoom, step, x, y, w, h);
 #endif
 
diff --git a/src/icccm.c b/src/icccm.c
index d490453..4ba1d2e 100644
--- a/src/icccm.c
+++ b/src/icccm.c
@@ -369,7 +369,7 @@ ICCCM_Cmap(EWin * ewin)
 
  set_cmap:
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("ICCCM_Cmap %#x\n", ccmap);
+      Eprintf("%s: %#x\n", __func__, ccmap);
    XInstallColormap(disp, ccmap);
    Mode.current_cmap = ccmap;
 }
@@ -380,11 +380,11 @@ ICCCM_Focus(const EWin * ewin)
    if (EDebug(EDBUG_TYPE_FOCUS))
      {
        if (ewin)
-          Eprintf("ICCCM_Focus T=%#x R=%#x %#x %s\n", Mode.events.time,
+          Eprintf("%s: T=%#x R=%#x %#x %s\n", __func__, Mode.events.time,
                   (int)NextRequest(disp), EwinGetClientXwin(ewin),
                   EwinGetTitle(ewin));
        else
-          Eprintf("ICCCM_Focus T=%#x R=%#x None\n", Mode.events.time,
+          Eprintf("%s: T=%#x R=%#x None\n", __func__, Mode.events.time,
                   (int)NextRequest(disp));
      }
 
@@ -922,7 +922,7 @@ EwinSyncRequestWait(EWin * ewin)
    tus = GetTimeUs();
    XSyncAwait(disp, xswc, 2);
    if (EDebug(EDBUG_TYPE_SYNC))
-      Eprintf("Sync t=%#lx c=%llx: Delay=%u us\n",
+      Eprintf("%s: t=%#lx c=%llx: Delay=%u us\n", __func__,
              xswc[0].trigger.counter, ewin->ewmh.sync_request_count,
              GetTimeUs() - tus);
 }
diff --git a/src/iclass.c b/src/iclass.c
index 5d7324b..c06014c 100644
--- a/src/iclass.c
+++ b/src/iclass.c
@@ -292,7 +292,7 @@ ImagestateRealize(ImageState * is)
      {
 #define S(s) ((s) ? (s) : "(null)")
        Eprintf
-          ("ImagestateRealize: Hmmm... is->im is NULL (im_file=%s 
real_file=%s)\n",
+          ("%s: Hmmm... is->im is NULL (im_file=%s real_file=%s)\n", __func__,
            S(is->im_file), S(is->real_file));
        Efree(is->real_file);
        is->real_file = NULL;
@@ -795,7 +795,7 @@ pt_get_bg_image(Win win, int w, int h, int use_root)
      }
    ETranslateCoordinates(win, cr, 0, 0, &xx, &yy, NULL);
 #if 0
-   Eprintf("pt_get_bg_image %#lx %d %d %d %d\n", win, xx, yy, w, h);
+   Eprintf("%s: %#x %d %d %d %d\n", __func__, WinGetXwin(win), xx, yy, w, h);
 #endif
    if (xx < WinGetW(VROOT) && yy < WinGetH(VROOT) && xx + w >= 0 && yy + h >= 
0)
      {
@@ -907,7 +907,7 @@ ImagestateMakePmapMask(ImageState * is, Win win, PmapMask * 
pmm,
    else
      {
 #if 0
-       Eprintf("ImagestateMakePmapMask %#lx %d %d\n", win, w, h);
+       Eprintf("%s: %#x %d %d\n", __func__, WinGetXwin(win), w, h);
 #endif
      }
 
@@ -1286,7 +1286,7 @@ ImageclassApplyCopy(ImageClass * ic, Win win, int w, int 
h,
    else
      {
        if (pmm->pmap)
-          Eprintf("ImageclassApplyCopy: Hmm... pmm->pmap already set\n");
+          Eprintf("%s: Hmm... pmm->pmap already set\n", __func__);
 
        pmm->type = 0;
        pmm->pmap = ECreatePixmap(win, w, h, 0);
diff --git a/src/ipc.c b/src/ipc.c
index 64801d6..6367062 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -1711,7 +1711,7 @@ IpcExec(const char *params)
    const IpcItem     **lst, *ipc;
 
    if (EDebug(EDBUG_TYPE_IPC))
-      Eprintf("IpcExec: %s\n", params);
+      Eprintf("%s: %s\n", __func__, params);
 
    cmd[0] = 0;
    num = 0;
diff --git a/src/main.c b/src/main.c
index 46a7676..e7d7819 100644
--- a/src/main.c
+++ b/src/main.c
@@ -319,7 +319,7 @@ EExit(int exitcode)
    int                 i;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("EExit(%d)\n", exitcode);
+      Eprintf("%s: %d\n", __func__, exitcode);
 
    if (disp)
      {
diff --git a/src/menus.c b/src/menus.c
index c578a1f..8c067e8 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -1602,7 +1602,7 @@ MenuHandleEvents(Win win __UNUSED__, XEvent * ev, void 
*prm)
    Menu               *m = (Menu *) prm;
 
 #if DEBUG_MENU_EVENTS
-   Eprintf("MenuHandleEvents %d\n", ev->type);
+   Eprintf("%s: %d\n", __func__, ev->type);
 #endif
    switch (ev->type)
      {
@@ -1623,7 +1623,7 @@ MenuItemHandleEvents(Win win __UNUSED__, XEvent * ev, 
void *prm)
    MenuItem           *mi = (MenuItem *) prm;
 
 #if DEBUG_MENU_EVENTS
-   Eprintf("MenuItemHandleEvents %d\n", ev->type);
+   Eprintf("%s: %d\n", __func__, ev->type);
 #endif
    switch (ev->type)
      {
@@ -1646,7 +1646,7 @@ static void
 MenuMaskerHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm __UNUSED__)
 {
 #if DEBUG_MENU_EVENTS
-   Eprintf("MenuMaskerHandleEvents %d\n", ev->type);
+   Eprintf("%s: %d\n", __func__, ev->type);
 #endif
 
    switch (ev->type)
diff --git a/src/misc.c b/src/misc.c
index 9552eb5..c36db5b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2013 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -171,17 +171,17 @@ ModLoadSym(const char *lib, const char *sym, const char 
*name)
 
    Esnprintf(buf, sizeof(buf), "%s/lib%s_%s.so", EDirLib(), lib, name);
    if (EDebug(1))
-      Eprintf("ModLoad %s\n", buf);
+      Eprintf("%s: %s\n", __func__, buf);
    h = dlopen(buf, RTLD_NOW | RTLD_LOCAL);
    if (!h)
-      Eprintf("*** ModLoad %s: %s\n", buf, dlerror());
+      Eprintf("*** %s: %s: %s\n", __func__, buf, dlerror());
    if (!h)
       return NULL;
 
    Esnprintf(buf, sizeof(buf), "%s_%s", sym, name);
    h = dlsym(h, buf);
    if (!h)
-      Eprintf("*** ModLoad %s: %s\n", buf, dlerror());
+      Eprintf("*** %s: %s: %s\n", __func__, buf, dlerror());
 
    return h;
 }
diff --git a/src/mod-misc.c b/src/mod-misc.c
index de9f25c..8e04146 100644
--- a/src/mod-misc.c
+++ b/src/mod-misc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2012 Kim Woelders
+ * Copyright (C) 2003-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -236,7 +236,7 @@ autosave(void)
       return;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("autosave\n");
+      Eprintf("%s\n", __func__);
 
    SnapshotsSaveReal();
 
diff --git a/src/session.c b/src/session.c
index 28e1823..4c73502 100644
--- a/src/session.c
+++ b/src/session.c
@@ -93,7 +93,7 @@ set_save_props(SmcConn smc_conn, int master_flag)
    char                bufs[32], bufm[32];
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("set_save_props\n");
+      Eprintf("%s\n", __func__);
 
    programProp.name = (char *)SmProgram;
    programProp.type = (char *)SmARRAY8;
@@ -248,7 +248,7 @@ static void
 callback_save_yourself2(SmcConn smc_conn, SmPointer client_data __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("callback_save_yourself2\n");
+      Eprintf("%s\n", __func__);
 
    set_save_props(smc_conn, Mode.wm.master);
    SmcSaveYourselfDone(smc_conn, True);
@@ -262,7 +262,7 @@ callback_save_yourself(SmcConn smc_conn, SmPointer 
client_data __UNUSED__,
                       int interact_style __UNUSED__, Bool fast __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("callback_save_yourself\n");
+      Eprintf("%s\n", __func__);
 
    SmcRequestSaveYourselfPhase2(smc_conn, callback_save_yourself2, NULL);
 }
@@ -271,7 +271,7 @@ static void
 callback_die(SmcConn smc_conn __UNUSED__, SmPointer client_data __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("callback_die\n");
+      Eprintf("%s\n", __func__);
 
    SessionExit(EEXIT_EXIT, NULL);
 }
@@ -281,14 +281,14 @@ callback_save_complete(SmcConn smc_conn __UNUSED__,
                       SmPointer client_data __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("callback_save_complete\n");
+      Eprintf("%s\n", __func__);
 }
 
 static void
 callback_shutdown_cancelled(SmcConn smc_conn, SmPointer client_data __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("callback_shutdown_cancelled\n");
+      Eprintf("%s\n", __func__);
 
    SmcSaveYourselfDone(smc_conn, False);
 }
@@ -303,7 +303,7 @@ static void
 ice_io_error_handler(IceConn connection __UNUSED__)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("ice_io_error_handler\n");
+      Eprintf("%s\n", __func__);
 
    /* The less we do here the better - the default handler does an
     * exit(1) instead of closing the losing connection. */
@@ -462,7 +462,7 @@ static void
 SessionSave(int shutdown)
 {
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SessionSave(%d)\n", shutdown);
+      Eprintf("%s: %d\n", __func__, shutdown);
 
    SnapshotsSaveReal();
 
@@ -489,7 +489,7 @@ doSMExit(int mode, const char *params)
    const char         *ss;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("doSMExit: mode=%d prm=%p\n", mode, params);
+      Eprintf("%s: mode=%d prm=%p\n", __func__, mode, params);
 
    restarting = 1;
 
@@ -520,7 +520,7 @@ doSMExit(int mode, const char *params)
        EDisplayClose();
 
        if (EDebug(EDBUG_TYPE_SESSION))
-          Eprintf("doSMExit: exec %s\n", params);
+          Eprintf("%s: exec %s\n", __func__, params);
        Eexec(params);
        break;
 
@@ -557,7 +557,7 @@ doSMExit(int mode, const char *params)
           l += Esnprintf(s + l, sizeof(s) - l, " -t %s", ss);
 
        if (EDebug(EDBUG_TYPE_SESSION))
-          Eprintf("doSMExit: exec %s\n", s);
+          Eprintf("%s: exec %s\n", __func__, s);
 
        Eexec(s);
        break;
@@ -663,7 +663,7 @@ SessionExit(int mode, const char *param)
       return;
 
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SessionExit: mode=%d(%d) prm=%s\n", mode, Mode.wm.exit_mode,
+      Eprintf("%s: mode=%d(%d) prm=%s\n", __func__, mode, Mode.wm.exit_mode,
              param);
 
    if (Mode.wm.exiting)
@@ -689,7 +689,7 @@ SessionExit(int mode, const char *param)
        if (!Mode.wm.exiting)
           break;
        /* This may be possible during nested signal handling */
-       Eprintf("SessionExit already in progress ... now exiting\n");
+       Eprintf("%s: already in progress ... now exiting\n", __func__);
        exit(1);
        break;
 
@@ -724,7 +724,7 @@ SessionRunProg(const char *prog, const char *params)
        s = prog;
      }
    if (EDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SessionRunProg: %s\n", s);
+      Eprintf("%s: %s\n", __func__, s);
    Esystem(s);
 }
 
diff --git a/src/snaps.c b/src/snaps.c
index ea9a325..002761b 100644
--- a/src/snaps.c
+++ b/src/snaps.c
@@ -529,7 +529,7 @@ SnapshotEwinUpdate(const EWin * ewin, unsigned int flags)
       return;
 
 #if 0
-   Eprintf("SnapshotEwinUpdate %s: %#x\n", EwinGetTitle(ewin), flags);
+   Eprintf("%s: %s: %#x\n", __func__, EwinGetTitle(ewin), flags);
 #endif
 
    if (flags & sn->use_flags)
@@ -1157,7 +1157,7 @@ SnapshotsSaveReal(void)
    Esnprintf(buf, sizeof(buf), "%s.snapshots", EGetSavePrefix());
 
    if (EDebug(EDBUG_TYPE_SNAPS))
-      Eprintf("SnapshotsSaveReal: %s\n", buf);
+      Eprintf("%s: %s\n", __func__, buf);
    E_mv(s, buf);
    if (!isfile(buf))
       Alert(_("Error saving snaps file"));
diff --git a/src/sound_load.c b/src/sound_load.c
index 6a5cb59..74e389a 100644
--- a/src/sound_load.c
+++ b/src/sound_load.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2013 Kim Woelders
+ * Copyright (C) 2004-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -56,7 +56,7 @@ SoundSampleGetData(const char *file, SoundSampleData * ssd)
    ssd->data = EMALLOC(unsigned char, ssd->size);
 
    if (EDebug(EDBUG_TYPE_SOUND))
-      Eprintf("SoundSampleGetData frames=%u chan=%u width=%u rate=%u\n",
+      Eprintf("%s: frames=%u chan=%u width=%u rate=%u\n", __func__,
              frame_count, ssd->channels, ssd->bit_per_sample, ssd->rate);
 
    frames_read =
@@ -101,7 +101,7 @@ SoundSampleGetData(const char *file, SoundSampleData * ssd)
    ssd->data = EMALLOC(unsigned char, ssd->size);
 
    if (EDebug(EDBUG_TYPE_SOUND))
-      Eprintf("SoundSampleGetData frames=%u chan=%u width=%u rate=%u\n",
+      Eprintf("%s: frames=%u chan=%u width=%u rate=%u\n", __func__,
              frame_count, ssd->channels, ssd->bit_per_sample, ssd->rate);
 
    frames_read = sf_readf_short(sf, (short *)ssd->data, frame_count);
diff --git a/src/text.c b/src/text.c
index b07f91b..4470bcb 100644
--- a/src/text.c
+++ b/src/text.c
@@ -774,7 +774,7 @@ TextStateLoadFont(TextState * ts)
    if (!ts->ops)
       Eprintf("*** Unable to load font \"%s\"\n", ts->fontname);
    else if (EDebug(EDBUG_TYPE_FONTS))
-      Eprintf("TextStateLoadFont %s: type=%d\n", ts->fontname, ts->type);
+      Eprintf("%s: %s: type=%d\n", __func__, ts->fontname, ts->type);
    return;
 }
 
@@ -885,7 +885,7 @@ TextstateTextDraw(TextState * ts, Win win, EX_Drawable draw,
      }
 
 #if 0
-   Eprintf("TextstateTextDraw %d,%d %dx%d(%dx%d): %s\n", x, y, w, h,
+   Eprintf("%s: %d,%d %dx%d(%dx%d): %s\n", __func__, x, y, w, h,
           textwidth_limit, textheight_limit, text);
 #endif
 
diff --git a/src/windowmatch.c b/src/windowmatch.c
index df8df88..f23f29c 100644
--- a/src/windowmatch.c
+++ b/src/windowmatch.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2005-2013 Kim Woelders
+ * Copyright (C) 2005-2014 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -301,7 +301,7 @@ WindowMatchDecode(const char *line)
    num = MatchFind(MatchType, match);
    if (num <= 0)
      {
-       Eprintf("WindowMatchDecode: Error (%s): %s\n", match, line);
+       Eprintf("%s: Error (%s): %s\n", __func__, match, line);
        err = 1;
        goto done;
      }
@@ -357,7 +357,7 @@ WindowMatchDecode(const char *line)
        break;
 
       case_error:
-       Eprintf("WindowMatchDecode: Error (%s): %s\n", value, line);
+       Eprintf("%s: Error (%s): %s\n", __func__, value, line);
        err = 1;
        goto done;
      }
@@ -365,7 +365,7 @@ WindowMatchDecode(const char *line)
    wm->op = MatchFind(MatchOp, op);
    if (wm->op <= 0)
      {
-       Eprintf("WindowMatchDecode: Error (%s): %s\n", op, line);
+       Eprintf("%s: Error (%s): %s\n", __func__, op, line);
        err = 1;
        goto done;
      }
@@ -389,7 +389,7 @@ WindowMatchDecode(const char *line)
      case MATCH_OP_WINOP:
        if (WindowMatchEobjOpsParse(NULL, args))
          {
-            Eprintf("WindowMatchDecode: Error (%s): %s\n", args, line);
+            Eprintf("%s: Error (%s): %s\n", __func__, args, line);
             err = 1;
             goto done;
          }
@@ -603,7 +603,7 @@ WindowMatchEwinBorder(const EWin * ewin)
 
    wm = WindowMatchType(ewin, MATCH_OP_BORDER);
 #if 0
-   Eprintf("WindowMatchEwinBorder %s %s\n", EwinGetTitle(ewin),
+   Eprintf("%s: %s %s\n", __func__, EwinGetTitle(ewin),
           (wm) ? BorderGetName(wm->border) : "???");
 #endif
    if (wm)
@@ -618,7 +618,7 @@ WindowMatchEwinIcon(const EWin * ewin)
 
    wm = WindowMatchType(ewin, MATCH_OP_ICON);
 #if 0
-   Eprintf("WindowMatchEwinIcon %s %s\n", EwinGetTitle(ewin),
+   Eprintf("%s: %s %s\n", __func__, EwinGetTitle(ewin),
           (wm) ? wm->args : "???");
 #endif
    if (wm)

-- 


Reply via email to