From 12e7283e23feff56555eaaa30daaa6cfe6c20d53 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 20 May 2013 20:56:26 +0200 Subject: [PATCH] CFrameBuffer: style fixes Scope of the some variable can be reduced, and waitForIdle(): %d in format string requires a signed integer given in the argument list. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/73cf6e94106c8eacbee1fa559597c368d1aa24db Author: Thilo Graf Date: 2013-05-20 (Mon, 20 May 2013) ------------------ This commit was generated by Migit --- src/driver/framebuffer.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 2e52808d1..38030c3c1 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -161,9 +161,9 @@ void CFrameBuffer::waitForIdle(const char* func) if (count > 512) /* more than 100 are unlikely, */{ if (func != NULL) - fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%04d) [%s]!\n", count, func); + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%04u) [%s]!\n", count, func); else - fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%d)!\n", count); + fprintf(stderr, "CFrameBuffer::waitForIdle: count is big (%u)!\n", count); } } #endif /* USE_NEVIS_GXA */ @@ -693,11 +693,11 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int _write_gxa(gxa_base, GXA_BG_COLOR_REG, (unsigned int) col); /* setup the drawing color */ #endif - int line = 0; if (type && radius) { setCornerFlags(type); radius = limitRadius(dx, dy, radius); + int line = 0; while (line < dy) { int ofl, ofr; if (calcCorners(NULL, &ofl, &ofr, dy, line, radius, type)) { @@ -946,11 +946,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in { struct rawHeader header; int width, height; - int lfd; fb_pixel_t * data; struct rawIcon tmpIcon; std::map::iterator it; - int dsize; if (!getActive()) return false; @@ -967,7 +965,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in data = g_PicViewer->getIcon(newname, &width, &height); if(data) { - dsize = width*height*sizeof(fb_pixel_t); + int dsize = width*height*sizeof(fb_pixel_t); //printf("CFrameBuffer::paintIcon: %s found, data %x size %d x %d\n", newname.c_str(), data, width, height);fflush(stdout); if(cache_size+dsize < ICON_CACHE_SIZE) { cache_size += dsize; @@ -982,7 +980,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in newname = iconBasePath + filename.c_str() + ".raw"; - lfd = open(newname.c_str(), O_RDONLY); + int lfd = open(newname.c_str(), O_RDONLY); if (lfd == -1) { //printf("paintIcon: error while loading icon: %s\n", newname.c_str()); @@ -993,7 +991,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in tmpIcon.width = width = (header.width_hi << 8) | header.width_lo; tmpIcon.height = height = (header.height_hi << 8) | header.height_lo; - dsize = width*height*sizeof(fb_pixel_t); + int dsize = width*height*sizeof(fb_pixel_t); tmpIcon.data = (fb_pixel_t*) cs_malloc_uncached(dsize); data = tmpIcon.data;