diff options
Diffstat (limited to 'src/Fl_XPM_Image.cxx')
| -rw-r--r-- | src/Fl_XPM_Image.cxx | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/src/Fl_XPM_Image.cxx b/src/Fl_XPM_Image.cxx index 1345cbad9..93ef75df2 100644 --- a/src/Fl_XPM_Image.cxx +++ b/src/Fl_XPM_Image.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fl_XPM_Image routines. // // Copyright 1997-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // // Contents: // @@ -35,7 +33,7 @@ // 'hexdigit()' - Convert a hex digit to an integer. // -static int hexdigit(int x) { // I - Hex digit... +static int hexdigit(int x) { // I - Hex digit... if (isdigit(x)) return x-'0'; if (isupper(x)) return x-'A'+10; if (islower(x)) return x-'a'+10; @@ -70,35 +68,35 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) { if (*q == '\\') switch (*++q) { case '\r': case '\n': - if (!fgets(q,(int) (buffer+MAXSIZE+20-q),f)) { /* no problem if we hit EOF */ } break; + if (!fgets(q,(int) (buffer+MAXSIZE+20-q),f)) { /* no problem if we hit EOF */ } break; case 0: - break; + break; case 'x': { - q++; - int n = 0; - for (int x = 0; x < 2; x++) { - int xd = hexdigit(*q); - if (xd > 15) break; - n = (n<<4)+xd; - q++; - } - *myp++ = n; + q++; + int n = 0; + for (int x = 0; x < 2; x++) { + int xd = hexdigit(*q); + if (xd > 15) break; + n = (n<<4)+xd; + q++; + } + *myp++ = n; } break; default: { - int c = *q++; - if (c>='0' && c<='7') { - c -= '0'; - for (int x=0; x<2; x++) { - int xd = hexdigit(*q); - if (xd>7) break; - c = (c<<3)+xd; - q++; - } - } - *myp++ = c; + int c = *q++; + if (c>='0' && c<='7') { + c -= '0'; + for (int x=0; x<2; x++) { + int xd = hexdigit(*q); + if (xd>7) break; + c = (c<<3)+xd; + q++; + } + } + *myp++ = c; } break; } else { - *myp++ = *q++; + *myp++ = *q++; } } *myp++ = 0; @@ -110,7 +108,7 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) { malloc_size += INITIALLINES; } // first line has 4 ints: width, height, ncolors, chars_per_pixel - // followed by color segment: + // followed by color segment: // if ncolors < 0 this is FLTK (non standard) compressed colormap - all colors coded in single line of 4*ncolors bytes // otherwise - ncolor lines of at least chars_per_pixel bytes // followed by pic segment: H lines of at least chars_per_pixel*W bytes @@ -138,8 +136,3 @@ bad_data: delete[] new_data; if (f) fclose(f); } - - -// -// End of "$Id$". -// |
