diff options
author | Mike Frysinger <vapier@gentoo.org> | 2018-06-21 22:47:42 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2018-06-21 22:47:42 -0400 |
commit | fd06f7f83c5e78bf5b7f5397746b4e5ee4366250 (patch) | |
tree | 7b49e7e14c1b3a3d71cec56edf591f7a4600ee3d /src/gd_filename.c | |
parent | aac77143ddeb561216d9fe63546d17a1d2156bae (diff) | |
download | libgd-fd06f7f83c5e78bf5b7f5397746b4e5ee4366250.tar.gz |
clean up trailing whitespace/newlines
This is preparation for adding some linting checks for new commits from
people. Shouldn't be any functional changes here (tests still pass!).
Diffstat (limited to 'src/gd_filename.c')
-rw-r--r-- | src/gd_filename.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gd_filename.c b/src/gd_filename.c index fd61677..d668b01 100644 --- a/src/gd_filename.c +++ b/src/gd_filename.c @@ -28,7 +28,7 @@ static void BGD_STDCALL writejpeg(gdImagePtr im, FILE *out) { static void BGD_STDCALL writewbmp(gdImagePtr im, FILE *out) { int fg = gdImageColorClosest(im, 0, 0, 0); - + gdImageWBMP(im, fg, out); }/* writejpeg*/ @@ -61,7 +61,7 @@ static struct FileType { {".jpeg", gdImageCreateFromJpeg, writejpeg, NULL}, #endif -#ifdef HAVE_LIBTIFF +#ifdef HAVE_LIBTIFF {".tiff", gdImageCreateFromTiff, gdImageTiff, NULL}, {".tif" , gdImageCreateFromTiff, gdImageTiff, NULL}, #endif @@ -90,7 +90,7 @@ ftype(const char *filename) { /* Find the file extension (i.e. the last period in the string. */ ext = strrchr(filename, '.'); if (!ext) return NULL; - + for (n = 0; Types[n].ext; n++) { if (strcasecmp(ext, Types[n].ext) == 0) { return &Types[n]; @@ -103,7 +103,7 @@ ftype(const char *filename) { /* Function: gdSupportsFileType - + Tests if a given file type is supported by GD. Given the name of an image file (which does not have to exist), @@ -145,7 +145,7 @@ ftype(const char *filename) { GD_TRUE (1) if the file type is supported, GD_FALSE (0) if not. */ -BGD_DECLARE(int) +BGD_DECLARE(int) gdSupportsFileType(const char *filename, int writing) { struct FileType *entry = ftype(filename); return !!entry && (!writing || !!entry->writer); @@ -159,7 +159,7 @@ gdSupportsFileType(const char *filename, int writing) { Given the path to a file, <gdImageCreateFromFile> will open the file, read its contents with the appropriate _gdImageCreateFrom*_ - function and return it. + function and return it. File type is determined by the filename extension, so having an incorrect extension will probably not work. For example, renaming @@ -179,12 +179,12 @@ gdSupportsFileType(const char *filename, int writing) { */ -BGD_DECLARE(gdImagePtr) +BGD_DECLARE(gdImagePtr) gdImageCreateFromFile(const char *filename) { struct FileType *entry = ftype(filename); FILE *fh; gdImagePtr result; - + if (!entry) return NULL; if (entry->loader) return entry->loader((char *)filename); if (!entry->reader) return NULL; @@ -193,7 +193,7 @@ gdImageCreateFromFile(const char *filename) { if (!fh) return NULL; result = entry->reader(fh); - + fclose(fh); return result; @@ -235,7 +235,7 @@ gdImageCreateFromFile(const char *filename) { */ -BGD_DECLARE(int) +BGD_DECLARE(int) gdImageFile(gdImagePtr im, const char *filename) { struct FileType *entry = ftype(filename); FILE *fh; @@ -251,4 +251,3 @@ gdImageFile(gdImagePtr im, const char *filename) { return GD_TRUE; }/* gdImageFile*/ - |