From 45371d9e214ee9795a0fc34409e429ff6ef0636c Mon Sep 17 00:00:00 2001 From: nls Date: Sat, 10 Oct 2009 09:57:03 +0000 Subject: [PATCH] Slight const police and avoid copying a lang string git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23065 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/pitchscreen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c index 78d049be1..8f542e8f2 100644 --- a/apps/gui/pitchscreen.c +++ b/apps/gui/pitchscreen.c @@ -199,7 +199,7 @@ static void pitchscreen_draw(struct screen *display, int max_lines, #endif ) { - unsigned char* ptr; + const char* ptr; char buf[32]; int w, h; bool show_lang_pitch; @@ -318,10 +318,10 @@ static void pitchscreen_draw(struct screen *display, int max_lines, { if(at_limit) { - snprintf(buf, sizeof(buf), "%s", str(LANG_STRETCH_LIMIT)); - display->getstringsize(buf, &w, &h); + const char * const p = str(LANG_STRETCH_LIMIT); + display->getstringsize(p, &w, &h); display->putsxy((pitch_viewports[PITCH_MID].width / 2) - (w / 2), - (pitch_viewports[PITCH_MID].height / 2) + h, buf); + (pitch_viewports[PITCH_MID].height / 2) + h, p); if (w > width_used) width_used = w; } -- 2.11.4.GIT