From 76b86227951fdb5096572c36a256f07aee76def3 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 18 May 2015 07:31:16 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@13671 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AdvaImg/src/FreeImage/PluginPFM.cpp | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'plugins/AdvaImg/src/FreeImage/PluginPFM.cpp') diff --git a/plugins/AdvaImg/src/FreeImage/PluginPFM.cpp b/plugins/AdvaImg/src/FreeImage/PluginPFM.cpp index 231e8baa22..ea3c46b14e 100644 --- a/plugins/AdvaImg/src/FreeImage/PluginPFM.cpp +++ b/plugins/AdvaImg/src/FreeImage/PluginPFM.cpp @@ -63,11 +63,13 @@ Get an integer value from the actual position pointed by handle static int pfm_get_int(FreeImageIO *io, fi_handle handle) { char c = 0; - BOOL firstchar; + BOOL bFirstChar; // skip forward to start of next number - if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING; + if(!io->read_proc(&c, 1, 1, handle)) { + throw FI_MSG_ERROR_PARSING; + } while (1) { // eat comments @@ -75,15 +77,16 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) { if (c == '#') { // if we're at a comment, read to end of line - firstchar = TRUE; + bFirstChar = TRUE; while (1) { - if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING; + if(!io->read_proc(&c, 1, 1, handle)) { + throw FI_MSG_ERROR_PARSING; + } - if (firstchar && c == ' ') { + if (bFirstChar && c == ' ') { // loop off 1 sp after # - - firstchar = FALSE; + bFirstChar = FALSE; } else if (c == '\n') { break; } @@ -92,11 +95,12 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) { if (c >= '0' && c <='9') { // we've found what we were looking for - break; } - if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING; + if(!io->read_proc(&c, 1, 1, handle)) { + throw FI_MSG_ERROR_PARSING; + } } // we're at the start of a number, continue until we hit a non-number @@ -106,10 +110,13 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) { while (1) { i = (i * 10) + (c - '0'); - if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING; + if(!io->read_proc(&c, 1, 1, handle)) { + throw FI_MSG_ERROR_PARSING; + } - if (c < '0' || c > '9') - break; + if (c < '0' || c > '9') { + break; + } } return i; -- cgit v1.2.3