From f429055b4f0ebb45e80878b09ef17be3da0d0dff Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 16 Jun 2013 17:57:42 +0200 Subject: [PATCH] wmaker: Added 'const' attribute to function 'ShrinkString' The function contained an internal statement that would have discarded the const attribute, but as this statement is actually useless it have been simply removed. Signed-off-by: Christophe CURIS --- src/misc.c | 4 ++-- src/misc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc.c b/src/misc.c index 6b3336d9..9bcd6b8c 100644 --- a/src/misc.c +++ b/src/misc.c @@ -256,7 +256,7 @@ void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int t eatExpose(); } -char *ShrinkString(WMFont * font, char *string, int width) +char *ShrinkString(WMFont *font, const char *string, int width) { int w, w1 = 0; int p; @@ -296,7 +296,7 @@ char *ShrinkString(WMFont * font, char *string, int width) } strcat(text, "..."); width -= WMWidthOfString(font, "...", 3); - pos = string; + p1 = 0; p2 = p; t = (p2 - p1) / 2; diff --git a/src/misc.h b/src/misc.h index 39b4d328..251afff6 100644 --- a/src/misc.h +++ b/src/misc.h @@ -35,7 +35,7 @@ void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int t void ParseWindowName(WMPropList * value, char **winstance, char **wclass, char *where); void SendHelperMessage(WScreen * scr, char type, int workspace, char *msg); -char *ShrinkString(WMFont * font, char *string, int width); +char *ShrinkString(WMFont *font, const char *string, int width); char *FindImage(char *paths, char *file); char *ExpandOptions(WScreen * scr, char *cmdline); char *GetShortcutString(char *text);