This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via e0193a071feaf04b54c65348bf11db0d8db6c4ac (commit) via f701094e0e12d08c7f236d086f21887385240097 (commit) via dc0555059702ca7ce621ebda8c8aa934da6aadd2 (commit) via 5465a3982ed5266489faac926e1eb6f3288fdb35 (commit) via 0ae6c2fe86b9fb25483cfd7389096912441a3400 (commit) from f41246cb1b727024fe62f46daceefc3e810e330a (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/e0193a071feaf04b54c65348bf11db0d8db6c...
commit e0193a071feaf04b54c65348bf11db0d8db6c4ac Author: Cyril Hrubis metan@ucw.cz Date: Fri Jun 13 23:38:58 2014 +0200
loaders: Rename Match functions + constify + doc
* Rename MatchExtension to LoaderByFilename and MatchSignature to LoaderBySignature
* Constify GP_Loader arguments where possible
* Update loaders docs
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/build/syms/Loaders_symbols.txt b/build/syms/Loaders_symbols.txt index 20b54d9d..bb834f97 100644 --- a/build/syms/Loaders_symbols.txt +++ b/build/syms/Loaders_symbols.txt @@ -81,8 +81,9 @@ GP_PSD GP_SaveTmpFile GP_LoadTmpFile
-GP_MatchSignature -GP_MatchExtension +GP_LoaderBySignature +GP_LoaderByFilename +GP_LoaderLoadImage GP_ReadImage GP_LoadImage GP_SaveImage diff --git a/demos/spiv/image_list.c b/demos/spiv/image_list.c index 9d7a3ff4..be6532c0 100644 --- a/demos/spiv/image_list.c +++ b/demos/spiv/image_list.c @@ -69,7 +69,7 @@ static int dir_filter(const struct dirent *d)
//TODO: filter out directories
- if (GP_MatchExtension(d->d_name) == NULL) + if (!GP_LoaderByFilename(d->d_name)) return 0;
GP_DEBUG(4, "Adding file '%s'", d->d_name); diff --git a/doc/loaders.txt b/doc/loaders.txt index c1d94e8e..0b83df55 100644 --- a/doc/loaders.txt +++ b/doc/loaders.txt @@ -36,7 +36,7 @@ returned. 'write()', ... | 'ENOENT' if file doesn't exist | 'EACCES' if process doesn't have rights to open the file -| 'ENOSYS' if GFXprim wasn't compiled with particular library support +| 'ENOSYS' if GFXprim wasn't compiled with particular format support | 'ENOMEM' if returned by 'malloc()' | 'EIO', 'EINVAL' invalid image data (wrong signature, wrong or too short header or image data) @@ -110,12 +110,12 @@ Advanced Interface ------------------------------------------------------------------------------- typedef struct GP_Loader { /* - * Loads an image. + * Reads an image from an IO stream. * - * Returns allocated and initialized bitmap on success, NULL on failure - * and errno must be set. + * Returns newly allocated context cotaining the loaded image or in + * case of failure NULL and errno is set. */ - GP_Context *(*Load)(const char *src_path, GP_ProgressCallback *callback); + GP_Context *(*Read)(GP_IO *io, GP_ProgressCallback *callback);
/* * Save an image. @@ -126,6 +126,14 @@ typedef struct GP_Loader { GP_ProgressCallback *callback);
/* + * GP_PIXEL_UNKNOWN terminated array of formats loader supports for save. + * + * This is _NOT_ a complete list loaders is able to save, due to automatic + * conversions (i.e. RGB888 vs BRG888). + */ + const GP_PixelType *save_ptypes; + + /* * The buffer is filled with 32 bytes from an image start, returns 1 if * image signature was found zero otherwise. */ @@ -136,49 +144,49 @@ typedef struct GP_Loader { */ const char *fmt_name;
- /* don't touch */ - struct GP_Loader *next; - /* * NULL terminated array of file extensions. */ const char *extensions[]; } GP_Loader; - -/* - * List loaders into the stdout. - */ -void GP_ListLoaders(void); - -/* - * Register a loader. - */ -void GP_LoaderRegister(GP_Loader *self); - -/* - * Unregister loader. - */ -void GP_LoaderUnregister(GP_Loader *self); -------------------------------------------------------------------------------
The 'GP_Loader' structure describes an image loader.
-The 'Load', 'Save' and 'Match' functions could be NULL if the particular +The 'Read', 'Save' and 'Match' functions could be NULL if the particular functionality is not implemented.
The 'fmt_name' is a short string that describes the format. For example: 'Netbpm portable pixmap'.
-The extensions is NULL-terminated array of strings that holds all possible +The 'extensions' is NULL-terminated array of strings that holds all possible extensions that are commonly used for this image format.
-All internal loaders are all described in list of this structures which is -used to implement functions such as 'GP_LoadImage()'. +[source,c] +------------------------------------------------------------------------------- +#include <loaders/GP_Loader.h> +/* or */ +#include <GP.h> + +void GP_ListLoaders(void);
-You can print currently active loaders via the 'GP_ListLoaders()'. Register and -unregister your own loaders by 'GP_LoaderRegister()' and -'GP_LoaderUnregister()'. Once image loader is registered the generic loading -functions can use it to load and save images. +int GP_LoaderRegister(const GP_Loader *self); + +void GP_LoaderUnregister(const GP_Loader *self); +------------------------------------------------------------------------------- + +The 'GP_ListLoaders()' function prints all currently registered loaders and +their capabilities into the stdout. + +You can register and unregister your own loader by 'GP_LoaderRegister()' and +'GP_LoaderUnregister()'. Once image loader is registered it's automatically +used by all loaders functions. + +The 'GP_LoaderRegister()' can fail (return non-zero) if you try to register +loader that is allready registered or if the loaders table is full (the table +size is compile time constant and there should be space for at least fifty +user defined loaders). I this cases the errno would be set to 'EEXIST' or +'ENOSPC' respectively.
TIP: For example usage see image loader registration link:example_loader_registration.html[example]. @@ -189,7 +197,7 @@ link:example_loader_registration.html[example]. /* or */ #include <GP.h>
-const GP_Loader *GP_MatchSignature(const void *buf) +const GP_Loader *GP_LoaderBySignature(const void *buf) -------------------------------------------------------------------------------
Returns pointer to image loader accordingly to image signature or NULL if no @@ -202,15 +210,30 @@ bytes long. /* or */ #include <GP.h>
-const GP_Loader *GP_MatchExtension(const char *path) +const GP_Loader *GP_LoaderByFilename(const char *path) -------------------------------------------------------------------------------
Matches loader by the file extension. This function does not check that the -file exists or that it could be opened it only looks at the extension (i.e. -string after the dot) and matches it against known extensions. +file exists or that it could be opened etc. It only looks at the file +extension (i.e. string at the end of the path after a dot) and matches it +against extensions defined by loaders. + +[source,c] +------------------------------------------------------------------------------- +#include <loaders/GP_Loader.h> +/* or */ +#include <GP.h> + +GP_Context *GP_LoaderLoadImage(const GP_Loader *self, const char *src_path, + GP_ProgressCallback *callback); +------------------------------------------------------------------------------- + +Loads an image given a loader structure. + +Returns NULL and sets errno to 'ENOSYS' loader 'Read()' callback is NULL.
-WARNING: If you attempt to modify the content of the structure the behavior is - undefined. Most likely the program will crash. +Otherwise prepares a link:loaders_io.html[GP_IO] from the 'src_path' file, +calls the 'Read()' callbacks and closes the 'IO' before the call returns.
[[PNG]] PNG Loader diff --git a/include/loaders/GP_Loader.h b/include/loaders/GP_Loader.h index 5277fb41..90aeebb7 100644 --- a/include/loaders/GP_Loader.h +++ b/include/loaders/GP_Loader.h @@ -120,19 +120,20 @@ typedef struct GP_Loader { * Takes pointer to buffer at least 32 bytes long and returns a pointer to * matched loader or NULL. */ -const GP_Loader *GP_MatchSignature(const void *buf); +const GP_Loader *GP_LoaderBySignature(const void *buf);
/* - * Tries to match loader by extension. Returns NULL if no loader was found. + * Tries to match loader by filename extension. Returns NULL if no loader was + * found. */ -const GP_Loader *GP_MatchExtension(const char *path); +const GP_Loader *GP_LoaderByFilename(const char *path);
/* * Registers additional loader. * * Returns zero on success, non-zero if table of loaders was is full. */ -int GP_LoaderRegister(GP_Loader *self); +int GP_LoaderRegister(const GP_Loader *self);
/* * Unregisters a loader. @@ -141,7 +142,7 @@ int GP_LoaderRegister(GP_Loader *self); * * You can unregister them using this function if you want. */ -void GP_LoaderUnregister(GP_Loader *self); +void GP_LoaderUnregister(const GP_Loader *self);
/* * Generic LoadImage for a given loader. diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c index aa8911b2..12ca2fc8 100644 --- a/libs/loaders/GP_Loader.c +++ b/libs/loaders/GP_Loader.c @@ -41,7 +41,7 @@
#define MAX_LOADERS 64
-static GP_Loader *loaders[MAX_LOADERS] = { +static const GP_Loader *loaders[MAX_LOADERS] = { &GP_JPG, &GP_PNG, &GP_TIFF, @@ -69,7 +69,7 @@ static unsigned int get_last_loader(void) return i - 1; }
-int GP_LoaderRegister(GP_Loader *self) +int GP_LoaderRegister(const GP_Loader *self) { unsigned int i;
@@ -99,7 +99,7 @@ int GP_LoaderRegister(GP_Loader *self) return 0; }
-void GP_LoaderUnregister(GP_Loader *self) +void GP_LoaderUnregister(const GP_Loader *self) { unsigned int i, last = get_last_loader();
@@ -146,7 +146,7 @@ void GP_ListLoaders(void) } }
-static struct GP_Loader *loader_by_extension(const char *ext) +static const GP_Loader *loader_by_extension(const char *ext) { unsigned int i, j;
@@ -178,7 +178,7 @@ static const char *get_ext(const char *path) return path + i + 1; }
-static struct GP_Loader *loader_by_filename(const char *path) +const GP_Loader *GP_LoaderByFilename(const char *path) { const char *ext = get_ext(path);
@@ -216,7 +216,7 @@ static const GP_Loader *loader_by_signature(const char *path)
fclose(f);
- ret = GP_MatchSignature(buf); + ret = GP_LoaderBySignature(buf);
if (ret == NULL) errno = ENOSYS; @@ -254,7 +254,7 @@ GP_Context *GP_ReadImage(GP_IO *io, GP_ProgressCallback *callback) return NULL; }
- loader = GP_MatchSignature(buf); + loader = GP_LoaderBySignature(buf);
if (!loader) { GP_DEBUG(1, "Failed to find a loader by signature for" @@ -325,7 +325,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) GP_Context *img; const GP_Loader *ext_load = NULL, *sig_load;
- ext_load = loader_by_filename(src_path); + ext_load = GP_LoaderByFilename(src_path);
if (ext_load) { img = GP_LoaderLoadImage(ext_load, src_path, callback); @@ -387,7 +387,7 @@ out: int GP_SaveImage(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback) { - struct GP_Loader *l = loader_by_filename(dst_path); + const GP_Loader *l = GP_LoaderByFilename(dst_path);
if (l == NULL) { errno = EINVAL; @@ -401,7 +401,7 @@ int GP_SaveImage(const GP_Context *src, const char *dst_path, return 1; }
-const GP_Loader *GP_MatchSignature(const void *buf) +const GP_Loader *GP_LoaderBySignature(const void *buf) { unsigned int i;
@@ -416,8 +416,3 @@ const GP_Loader *GP_MatchSignature(const void *buf)
return NULL; } - -const GP_Loader *GP_MatchExtension(const char *path) -{ - return loader_by_filename(path); -} diff --git a/tests/loaders/Loader.c b/tests/loaders/Loader.c index 4494825e..dcc9b921 100644 --- a/tests/loaders/Loader.c +++ b/tests/loaders/Loader.c @@ -117,7 +117,7 @@ static int loader_by_extension(void) return TST_FAILED; }
- loader = GP_MatchExtension("file.jpg"); + loader = GP_LoaderByFilename("file.jpg");
if (loader != &GP_JPG) { tst_msg("Failed to get JPEG loader"); @@ -126,7 +126,7 @@ static int loader_by_extension(void) tst_msg("Succeded to get JPEG loader"); }
- loader = GP_MatchExtension("file.test"); + loader = GP_LoaderByFilename("file.test");
if (loader != &test_loader) { tst_msg("Failed to get registered TEST loader"); @@ -155,7 +155,7 @@ const struct tst_suite tst_suite = { .tst_fn = register_loader_twice, .flags = TST_CHECK_MALLOC},
- {.name = "MatchExtension()", + {.name = "LoaderByFilename()", .tst_fn = loader_by_extension, .flags = TST_CHECK_MALLOC},
http://repo.or.cz/w/gfxprim.git/commit/f701094e0e12d08c7f236d086f21887385240...
commit f701094e0e12d08c7f236d086f21887385240097 Author: Cyril Hrubis metan@ucw.cz Date: Fri Jun 13 23:28:32 2014 +0200
loaders; GP_Loader: Fix typo in loaders table.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c index 442a8329..aa8911b2 100644 --- a/libs/loaders/GP_Loader.c +++ b/libs/loaders/GP_Loader.c @@ -48,7 +48,7 @@ static GP_Loader *loaders[MAX_LOADERS] = { &GP_GIF, &GP_BMP, &GP_PBM, - &GP_PNM, + &GP_PGM, &GP_PPM, &GP_PNM, &GP_JP2,
http://repo.or.cz/w/gfxprim.git/commit/dc0555059702ca7ce621ebda8c8aa934da6aa...
commit dc0555059702ca7ce621ebda8c8aa934da6aadd2 Author: Cyril Hrubis metan@ucw.cz Date: Fri Jun 13 23:22:38 2014 +0200
loaders: Add save_ptypes to GP_Loader structure
Add save_ptypes, an array of pixel types supported by the Loader's Save() method.
Note that these arrays does _NOT_ describe all formats that could be saved by the loader because most of the loaders use LineConvert() for trivial conversions (i.e. RGB888 to BRG888 to xRGB888 etc.)
Convinient interface to query if particular pixel type coud be saved by particular loader will be added later.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/loaders_register.c b/demos/c_simple/loaders_register.c index 246394a5..4c596c40 100644 --- a/demos/c_simple/loaders_register.c +++ b/demos/c_simple/loaders_register.c @@ -90,8 +90,14 @@ static int save(const GP_Context *img, const char *dst_path, return 0; }
+static GP_PixelType save_ptypes[] = { + GP_PIXEL_G2, + GP_PIXEL_UNKNOWN, +}; + GP_Loader loader = { .Save = save, + .save_ptypes = save_ptypes, .fmt_name = "ASCII Art", .extensions = {"txt", NULL}, }; diff --git a/include/loaders/GP_Loader.h b/include/loaders/GP_Loader.h index 6f07d2ea..5277fb41 100644 --- a/include/loaders/GP_Loader.h +++ b/include/loaders/GP_Loader.h @@ -92,6 +92,14 @@ typedef struct GP_Loader { int (*Save)(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback);
/* + * GP_PIXEL_UNKNOWN terminated array of formats loader supports for save. + * + * This is _NOT_ a complete list loaders is able to save, due to automatic + * conversions (i.e. RGB888 vs BRG888). + */ + const GP_PixelType *save_ptypes; + + /* * The buffer is filled with 32 bytes from an image start, returns 1 if * image signature was found zero otherwise. */ diff --git a/libs/loaders/GP_BMP.c b/libs/loaders/GP_BMP.c index 4313e2de..2d042bf2 100644 --- a/libs/loaders/GP_BMP.c +++ b/libs/loaders/GP_BMP.c @@ -895,6 +895,7 @@ int GP_SaveBMP(const GP_Context *src, const char *dst_path, struct GP_Loader GP_BMP = { .Read = GP_ReadBMP, .Save = GP_SaveBMP, + .save_ptypes = out_pixel_types, .Match = GP_MatchBMP,
.fmt_name = "BMP", diff --git a/libs/loaders/GP_JPG.c b/libs/loaders/GP_JPG.c index ea891712..dfca66fa 100644 --- a/libs/loaders/GP_JPG.c +++ b/libs/loaders/GP_JPG.c @@ -577,6 +577,7 @@ struct GP_Loader GP_JPG = { #ifdef HAVE_JPEG .Read = GP_ReadJPG, .Save = GP_SaveJPG, + .save_ptypes = out_pixel_types, #endif .Match = GP_MatchJPG,
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c index 763e819b..442a8329 100644 --- a/libs/loaders/GP_Loader.c +++ b/libs/loaders/GP_Loader.c @@ -127,9 +127,17 @@ void GP_ListLoaders(void) printf("Format: %sn", loaders[i]->fmt_name); printf("Read:t%sn", loaders[i]->Read ? "Yes" : "No"); printf("Save:t%sn", loaders[i]->Save ? "Yes" : "No"); + if (loaders[i]->save_ptypes) { + printf("Saves Pixel Types: "); + for (j = 0; loaders[i]->save_ptypes[j]; j++) { + GP_PixelType ptype = loaders[i]->save_ptypes[j]; + printf("%s ", GP_PixelTypeName(ptype)); + } + printf("n"); + } printf("Match:t%sn", loaders[i]->Match ? "Yes" : "No"); printf("Extensions: "); - for (j = 0; loaders[i]->extensions[j] != NULL; j++) + for (j = 0; loaders[i]->extensions[j]; j++) printf("%s ", loaders[i]->extensions[j]); printf("n");
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c index 1a73c9a8..deabf9ab 100644 --- a/libs/loaders/GP_PNG.c +++ b/libs/loaders/GP_PNG.c @@ -386,6 +386,20 @@ int GP_LoadPNGMetaData(const char *src_path, GP_MetaData *data) return ret; }
+static GP_PixelType save_ptypes[] = { + GP_PIXEL_BGR888, + GP_PIXEL_RGB888, + GP_PIXEL_G1, + GP_PIXEL_G2, + GP_PIXEL_G4, + GP_PIXEL_G8, +#ifdef GP_PIXEL_G16 + GP_PIXEL_G16, +#endif + GP_PIXEL_RGBA8888, + GP_PIXEL_UNKNOWN, +}; + /* * Maps gfxprim Pixel Type to the PNG format */ @@ -637,6 +651,7 @@ GP_Loader GP_PNG = { #ifdef HAVE_LIBPNG .Read = GP_ReadPNG, .Save = GP_SavePNG, + .save_ptypes = save_ptypes, #endif .Match = GP_MatchPNG,
diff --git a/libs/loaders/GP_PNM.c b/libs/loaders/GP_PNM.c index 93bc1b68..ba459183 100644 --- a/libs/loaders/GP_PNM.c +++ b/libs/loaders/GP_PNM.c @@ -712,6 +712,11 @@ GP_Context *GP_ReadPBM(GP_IO *io, GP_ProgressCallback *callback) return read_bitmap(&buf, &header, callback); }
+static GP_PixelType pbm_save_pixels[] = { + GP_PIXEL_G1, + GP_PIXEL_UNKNOWN, +}; + int GP_SavePBM(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback) { @@ -879,6 +884,14 @@ static int pixel_to_depth(GP_Pixel pixel) } }
+static GP_PixelType pgm_save_pixels[] = { + GP_PIXEL_G1, + GP_PIXEL_G2, + GP_PIXEL_G4, + GP_PIXEL_G8, + GP_PIXEL_UNKNOWN, +}; + int GP_SavePGM(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback) { @@ -1131,6 +1144,15 @@ GP_Context *GP_ReadPNM(GP_IO *io, GP_ProgressCallback *callback) return ret; }
+static GP_PixelType pnm_save_pixels[] = { + GP_PIXEL_G1, + GP_PIXEL_G2, + GP_PIXEL_G4, + GP_PIXEL_G8, + GP_PIXEL_RGB888, + GP_PIXEL_UNKNOWN, +}; + int GP_SavePNM(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback) { @@ -1174,6 +1196,7 @@ GP_Context *GP_LoadPNM(const char *src_path, GP_ProgressCallback *callback) struct GP_Loader GP_PBM = { .Read = GP_ReadPBM, .Save = GP_SavePBM, + .save_ptypes = pbm_save_pixels, .Match = GP_MatchPBM,
.fmt_name = "Netpbm portable Bitmap", @@ -1183,6 +1206,7 @@ struct GP_Loader GP_PBM = { struct GP_Loader GP_PGM = { .Read = GP_ReadPGM, .Save = GP_SavePGM, + .save_ptypes = pgm_save_pixels, .Match = GP_MatchPGM,
.fmt_name = "Netpbm portable Graymap", @@ -1192,6 +1216,7 @@ struct GP_Loader GP_PGM = { struct GP_Loader GP_PPM = { .Read = GP_ReadPPM, .Save = GP_SavePPM, + .save_ptypes = ppm_save_pixels, .Match = GP_MatchPPM,
.fmt_name = "Netpbm portable Pixmap", @@ -1201,6 +1226,7 @@ struct GP_Loader GP_PPM = { struct GP_Loader GP_PNM = { .Read = GP_ReadPNM, .Save = GP_SavePNM, + .save_ptypes = pnm_save_pixels, /* * Avoid double Match * This format is covered by PBM, PGM and PPM diff --git a/libs/loaders/GP_TIFF.c b/libs/loaders/GP_TIFF.c index bcc23b21..400d6734 100644 --- a/libs/loaders/GP_TIFF.c +++ b/libs/loaders/GP_TIFF.c @@ -632,6 +632,17 @@ static int save_rgb(TIFF *tiff, const GP_Context *src, return 0; }
+static GP_PixelType save_ptypes[] = { + GP_PIXEL_BGR888, + GP_PIXEL_RGB888, + GP_PIXEL_xRGB8888, + GP_PIXEL_G1, + GP_PIXEL_G2, + GP_PIXEL_G4, + GP_PIXEL_G8, + GP_PIXEL_UNKNOWN, +}; + int GP_SaveTIFF(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback) { @@ -746,6 +757,7 @@ struct GP_Loader GP_TIFF = { #ifdef HAVE_TIFF .Read = GP_ReadTIFF, .Save = GP_SaveTIFF, + .save_ptypes = save_ptypes, #endif .Match = GP_MatchTIFF,
http://repo.or.cz/w/gfxprim.git/commit/5465a3982ed5266489faac926e1eb6f3288fd...
commit 5465a3982ed5266489faac926e1eb6f3288fdb35 Author: Cyril Hrubis metan@ucw.cz Date: Fri Jun 13 14:51:51 2014 +0200
core: include: Fix non-linux compatibility ifdefs
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/include/core/GP_ByteOrder.h b/include/core/GP_ByteOrder.h index f756d45a..7fac23a8 100644 --- a/include/core/GP_ByteOrder.h +++ b/include/core/GP_ByteOrder.h @@ -30,6 +30,9 @@ # include <endian.h> #else /* BSD Family */ # include <machine/endian.h> +# define __BYTE_ORDER _BYTE_ORDER +# define __BIG_ENDIAN _BIG_ENDIAN +# define __LITTLE_ENDIAN _LITTLE_ENDIAN #endif
#endif /* CORE_GP_BYTE_ORDER_H */ diff --git a/include/core/GP_TempAlloc.h b/include/core/GP_TempAlloc.h index 925b112e..e17adffb 100644 --- a/include/core/GP_TempAlloc.h +++ b/include/core/GP_TempAlloc.h @@ -47,7 +47,9 @@ #ifndef CORE_GP_TEMP_ALLOC_H #define CORE_GP_TEMP_ALLOC_H
-#include <alloca.h> +#ifdef __linux__ +# include <alloca.h> +#endif #include <stdlib.h>
#include "core/GP_Common.h"
http://repo.or.cz/w/gfxprim.git/commit/0ae6c2fe86b9fb25483cfd7389096912441a3...
commit 0ae6c2fe86b9fb25483cfd7389096912441a3400 Author: Cyril Hrubis metan@ucw.cz Date: Fri Jun 13 14:47:55 2014 +0200
demos, tests: Use /bin/sh instead of /bin/bash
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/bogoman/runtest.sh b/demos/bogoman/runtest.sh index 07947072..dac7bc8b 100755 --- a/demos/bogoman/runtest.sh +++ b/demos/bogoman/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/demos/c_simple/runtest.sh b/demos/c_simple/runtest.sh index 07947072..dac7bc8b 100755 --- a/demos/c_simple/runtest.sh +++ b/demos/c_simple/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/demos/grinder/runtest.sh b/demos/grinder/runtest.sh index 163c76c4..eed2e0e5 100755 --- a/demos/grinder/runtest.sh +++ b/demos/grinder/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/demos/particle/runtest.sh b/demos/particle/runtest.sh index 07947072..dac7bc8b 100755 --- a/demos/particle/runtest.sh +++ b/demos/particle/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/demos/py_simple/runpytest.sh b/demos/py_simple/runpytest.sh index 264af15a..9afbb927 100755 --- a/demos/py_simple/runpytest.sh +++ b/demos/py_simple/runpytest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run python test with dynamically linked libGP. # diff --git a/demos/spiv/runtest.sh b/demos/spiv/runtest.sh index 07947072..dac7bc8b 100755 --- a/demos/spiv/runtest.sh +++ b/demos/spiv/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/demos/ttf2img/runtest.sh b/demos/ttf2img/runtest.sh index 07947072..dac7bc8b 100755 --- a/demos/ttf2img/runtest.sh +++ b/demos/ttf2img/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. # diff --git a/tests/drivers/runtest.sh b/tests/drivers/runtest.sh index ff2a001d..fc29b596 100755 --- a/tests/drivers/runtest.sh +++ b/tests/drivers/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Run dynamically linked test. #
-----------------------------------------------------------------------
Summary of changes: build/syms/Loaders_symbols.txt | 5 +- demos/bogoman/runtest.sh | 2 +- demos/c_simple/loaders_register.c | 6 ++ demos/c_simple/runtest.sh | 2 +- demos/grinder/runtest.sh | 2 +- demos/particle/runtest.sh | 2 +- demos/py_simple/runpytest.sh | 2 +- demos/spiv/image_list.c | 2 +- demos/spiv/runtest.sh | 2 +- demos/ttf2img/runtest.sh | 2 +- doc/loaders.txt | 97 +++++++++++++++++++++++-------------- include/core/GP_ByteOrder.h | 3 + include/core/GP_TempAlloc.h | 4 +- include/loaders/GP_Loader.h | 19 +++++-- libs/loaders/GP_BMP.c | 1 + libs/loaders/GP_JPG.c | 1 + libs/loaders/GP_Loader.c | 37 ++++++++------- libs/loaders/GP_PNG.c | 15 ++++++ libs/loaders/GP_PNM.c | 26 ++++++++++ libs/loaders/GP_TIFF.c | 12 +++++ tests/drivers/runtest.sh | 2 +- tests/loaders/Loader.c | 6 +- 22 files changed, 176 insertions(+), 74 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.