forked from old/legacy-imlib2
Re-indent everything using indent-2.2.12
This commit is contained in:
parent
d41d593e4b
commit
2f228adbe1
|
@ -33,7 +33,8 @@ main(int argc, char **argv)
|
|||
im = imlib_load_image_with_error_return(argv[1], &lerr);
|
||||
if (!im)
|
||||
{
|
||||
fprintf(stderr, PROG_NAME ": Error %d loading image: %s\n", lerr, argv[1]);
|
||||
fprintf(stderr, PROG_NAME ": Error %d loading image: %s\n",
|
||||
lerr, argv[1]);
|
||||
return lerr;
|
||||
}
|
||||
|
||||
|
@ -80,9 +81,10 @@ main(int argc, char **argv)
|
|||
break;
|
||||
case IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT:
|
||||
fprintf(stderr, "No saver for format: %s\n", imlib_image_format());
|
||||
/* FALLTHROUGH */
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
fprintf(stderr, "%s: Error %d saving image: %s\n", PROG_NAME, lerr, argv[2]);
|
||||
fprintf(stderr, "%s: Error %d saving image: %s\n",
|
||||
PROG_NAME, lerr, argv[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,12 +103,12 @@ struct _imlib_color {
|
|||
};
|
||||
|
||||
/* Progressive loading callbacks */
|
||||
typedef int (*Imlib_Progress_Function) (Imlib_Image im, char percent,
|
||||
int update_x, int update_y,
|
||||
int update_w, int update_h);
|
||||
typedef void (*Imlib_Data_Destructor_Function) (Imlib_Image im,
|
||||
void *data);
|
||||
typedef void *(*Imlib_Image_Data_Memory_Function) (void *, size_t size);
|
||||
typedef int (*Imlib_Progress_Function)(Imlib_Image im, char percent,
|
||||
int update_x, int update_y,
|
||||
int update_w, int update_h);
|
||||
typedef void (*Imlib_Data_Destructor_Function)(Imlib_Image im,
|
||||
void *data);
|
||||
typedef void *(*Imlib_Image_Data_Memory_Function)(void *, size_t size);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
|
@ -155,8 +155,8 @@ EAPI void imlib_context_set_color_cmya(int cyan, int magenta,
|
|||
int yellow, int alpha);
|
||||
EAPI void imlib_context_set_color_range(Imlib_Color_Range
|
||||
color_range);
|
||||
EAPI void imlib_context_set_image_data_memory_function(Imlib_Image_Data_Memory_Function
|
||||
memory_function);
|
||||
EAPI void imlib_context_set_image_data_memory_function
|
||||
(Imlib_Image_Data_Memory_Function memory_function);
|
||||
EAPI void imlib_context_set_progress_function(Imlib_Progress_Function
|
||||
progress_function);
|
||||
EAPI void imlib_context_set_progress_granularity(char
|
||||
|
@ -193,7 +193,8 @@ EAPI void imlib_context_get_color_cmya(int *cyan, int *magenta,
|
|||
int *yellow, int *alpha);
|
||||
EAPI Imlib_Color *imlib_context_get_imlib_color(void);
|
||||
EAPI Imlib_Color_Range imlib_context_get_color_range(void);
|
||||
EAPI Imlib_Image_Data_Memory_Function imlib_context_get_image_data_memory_function(void);
|
||||
EAPI Imlib_Image_Data_Memory_Function
|
||||
imlib_context_get_image_data_memory_function(void);
|
||||
EAPI Imlib_Progress_Function imlib_context_get_progress_function(void);
|
||||
EAPI char imlib_context_get_progress_granularity(void);
|
||||
EAPI Imlib_Image imlib_context_get_image(void);
|
||||
|
@ -292,11 +293,10 @@ EAPI void imlib_blend_image_onto_image(Imlib_Image source_image,
|
|||
EAPI Imlib_Image imlib_create_image(int width, int height);
|
||||
EAPI Imlib_Image imlib_create_image_using_data(int width, int height,
|
||||
DATA32 * data);
|
||||
EAPI Imlib_Image imlib_create_image_using_data_and_memory_function(int width, int height,
|
||||
DATA32 * data,
|
||||
Imlib_Image_Data_Memory_Function func);
|
||||
EAPI Imlib_Image imlib_create_image_using_copied_data(int width,
|
||||
int height,
|
||||
EAPI Imlib_Image imlib_create_image_using_data_and_memory_function
|
||||
(int width, int height, DATA32 * data,
|
||||
Imlib_Image_Data_Memory_Function func);
|
||||
EAPI Imlib_Image imlib_create_image_using_copied_data(int width, int height,
|
||||
DATA32 * data);
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
EAPI Imlib_Image imlib_create_image_from_drawable(Pixmap mask,
|
||||
|
|
|
@ -69,9 +69,9 @@ if (!(param)) \
|
|||
}
|
||||
|
||||
/* internal typedefs for function pointers */
|
||||
typedef void (*Imlib_Internal_Progress_Function) (void *, char, int, int,
|
||||
int, int);
|
||||
typedef void (*Imlib_Internal_Data_Destructor_Function) (void *, void *);
|
||||
typedef void (*Imlib_Internal_Progress_Function)(void *, char, int, int,
|
||||
int, int);
|
||||
typedef void (*Imlib_Internal_Data_Destructor_Function)(void *, void *);
|
||||
|
||||
struct _imlibcontext;
|
||||
typedef struct _imlibcontext ImlibContext;
|
||||
|
@ -1029,7 +1029,8 @@ imlib_context_get_color_range(void)
|
|||
* Sets the image data memory management function.
|
||||
*/
|
||||
EAPI void
|
||||
imlib_context_set_image_data_memory_function(Imlib_Image_Data_Memory_Function memory_function)
|
||||
imlib_context_set_image_data_memory_function(Imlib_Image_Data_Memory_Function
|
||||
memory_function)
|
||||
{
|
||||
CHECK_CONTEXT(ctx);
|
||||
ctx->image_data_memory_func = memory_function;
|
||||
|
@ -2123,13 +2124,14 @@ imlib_create_image_using_data(int width, int height, DATA32 * data)
|
|||
*
|
||||
**/
|
||||
EAPI Imlib_Image
|
||||
imlib_create_image_using_data_and_memory_function(int width, int height, DATA32 * data, Imlib_Image_Data_Memory_Function func)
|
||||
imlib_create_image_using_data_and_memory_function
|
||||
(int width, int height, DATA32 * data, Imlib_Image_Data_Memory_Function func)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
CHECK_CONTEXT(ctx);
|
||||
CHECK_PARAM_POINTER_RETURN("imlib_create_image_using_data_and_memory_function", "data", data,
|
||||
NULL);
|
||||
CHECK_PARAM_POINTER_RETURN
|
||||
("imlib_create_image_using_data_and_memory_function", "data", data, NULL);
|
||||
if (!IMAGE_DIMENSIONS_OK(width, height))
|
||||
return NULL;
|
||||
im = __imlib_CreateImage(width, height, data);
|
||||
|
|
|
@ -1723,7 +1723,7 @@ __imlib_GetBlendFunction(ImlibOp op, char blend, char merge_alpha, char rgb_src,
|
|||
return NULL;
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
do_mmx = ! !(__imlib_get_cpuid() & CPUID_MMX);
|
||||
do_mmx = !!(__imlib_get_cpuid() & CPUID_MMX);
|
||||
#elif DO_AMD64_ASM
|
||||
do_mmx = 1; // instruction set is always present
|
||||
#endif
|
||||
|
@ -1731,7 +1731,7 @@ __imlib_GetBlendFunction(ImlibOp op, char blend, char merge_alpha, char rgb_src,
|
|||
blend = 0;
|
||||
if (blend && cm && rgb_src && (A_CMOD(cm, 0xff) == 0))
|
||||
return NULL;
|
||||
return ibfuncs[! !do_mmx][opi][! !cm][! !merge_alpha][! !rgb_src][! !blend];
|
||||
return ibfuncs[!!do_mmx][opi][!!cm][!!merge_alpha][!!rgb_src][!!blend];
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -385,8 +385,8 @@ enum _imlibop {
|
|||
|
||||
typedef enum _imlibop ImlibOp;
|
||||
|
||||
typedef void (*ImlibBlendFunction) (DATA32 *, int, DATA32 *, int, int,
|
||||
int, ImlibColorModifier *);
|
||||
typedef void (*ImlibBlendFunction)(DATA32 *, int, DATA32 *, int, int,
|
||||
int, ImlibColorModifier *);
|
||||
|
||||
ImlibBlendFunction __imlib_GetBlendFunction(ImlibOp op, char merge_alpha,
|
||||
char blend, char rgb_src,
|
||||
|
|
|
@ -21,10 +21,10 @@ struct _imlib_external_filter {
|
|||
char *filename;
|
||||
void *handle;
|
||||
char **filters;
|
||||
void (*init_filter) (struct imlib_filter_info * info);
|
||||
void (*deinit_filter) (void);
|
||||
void *(*exec_filter) (char *filter, void *im,
|
||||
pIFunctionParam params);
|
||||
void (*init_filter)(struct imlib_filter_info * info);
|
||||
void (*deinit_filter)(void);
|
||||
void *(*exec_filter)(char *filter, void *im,
|
||||
pIFunctionParam params);
|
||||
ImlibExternalFilter *next;
|
||||
};
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ Imlib_Hash *__imlib_hash_add(Imlib_Hash * hash, const char *key,
|
|||
void *__imlib_hash_find(Imlib_Hash * hash, const char *key);
|
||||
void __imlib_hash_free(Imlib_Hash * hash);
|
||||
void __imlib_hash_foreach(Imlib_Hash * hash,
|
||||
int (*func) (Imlib_Hash * hash,
|
||||
const char *key,
|
||||
void *data, void *fdata),
|
||||
int (*func)(Imlib_Hash * hash,
|
||||
const char *key,
|
||||
void *data, void *fdata),
|
||||
const void *fdata);
|
||||
|
|
|
@ -379,9 +379,9 @@ __imlib_hash_free(Imlib_Hash * hash)
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_hash_foreach(Imlib_Hash * hash, int (*func) (Imlib_Hash * hash,
|
||||
const char *key,
|
||||
void *data, void *fdata),
|
||||
__imlib_hash_foreach(Imlib_Hash * hash, int (*func)(Imlib_Hash * hash,
|
||||
const char *key,
|
||||
void *data, void *fdata),
|
||||
const void *fdata)
|
||||
{
|
||||
int i, size;
|
||||
|
|
|
@ -654,7 +654,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh,
|
|||
|
||||
/* Create an Ximage (shared or not) */
|
||||
xim = __imlib_ShmGetXImage(d, v, p, xatt.depth, x, y, w, h, &shminfo);
|
||||
is_shm = ! !xim;
|
||||
is_shm = !!xim;
|
||||
|
||||
if (!xim)
|
||||
xim = XGetImage(d, p, x, y, w, h, 0xffffffff, ZPixmap);
|
||||
|
@ -669,7 +669,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh,
|
|||
if ((m) && (domask))
|
||||
{
|
||||
mxim = __imlib_ShmGetXImage(d, v, m, 1, 0, 0, w, h, &mshminfo);
|
||||
is_mshm = ! !mxim;
|
||||
is_mshm = !!mxim;
|
||||
if (!mxim)
|
||||
mxim = XGetImage(d, m, 0, 0, w, h, 0xffffffff, ZPixmap);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ static ImlibImagePixmap *pixmaps = NULL;
|
|||
static ImlibLoader *loaders = NULL;
|
||||
static int cache_size = 4096 * 1024;
|
||||
|
||||
__EXPORT__ DATA32 *
|
||||
__imlib_AllocateData(ImlibImage *im, int w, int h)
|
||||
__EXPORT__ DATA32 *
|
||||
__imlib_AllocateData(ImlibImage * im, int w, int h)
|
||||
{
|
||||
if (im->data_memory_func)
|
||||
im->data = im->data_memory_func(NULL, w * h * sizeof(DATA32));
|
||||
|
@ -44,7 +44,7 @@ __imlib_AllocateData(ImlibImage *im, int w, int h)
|
|||
}
|
||||
|
||||
__EXPORT__ void
|
||||
__imlib_FreeData(ImlibImage *im)
|
||||
__imlib_FreeData(ImlibImage * im)
|
||||
{
|
||||
if (im->data)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ __imlib_FreeData(ImlibImage *im)
|
|||
}
|
||||
|
||||
__EXPORT__ void
|
||||
__imlib_ReplaceData(ImlibImage *im, unsigned int *new_data)
|
||||
__imlib_ReplaceData(ImlibImage * im, unsigned int *new_data)
|
||||
{
|
||||
if (im->data)
|
||||
{
|
||||
|
@ -612,7 +612,7 @@ static ImlibLoader *
|
|||
__imlib_ProduceLoader(char *file)
|
||||
{
|
||||
ImlibLoader *l;
|
||||
void (*l_formats) (ImlibLoader * l);
|
||||
void (*l_formats)(ImlibLoader * l);
|
||||
|
||||
l = malloc(sizeof(ImlibLoader));
|
||||
l->num_formats = 0;
|
||||
|
|
|
@ -20,12 +20,11 @@ typedef struct _imlibloader ImlibLoader;
|
|||
typedef struct _imlibimagetag ImlibImageTag;
|
||||
typedef enum _imlib_load_error ImlibLoadError;
|
||||
|
||||
typedef int (*ImlibProgressFunction) (ImlibImage * im, char percent,
|
||||
int update_x, int update_y,
|
||||
int update_w, int update_h);
|
||||
typedef void (*ImlibDataDestructorFunction) (ImlibImage * im,
|
||||
void *data);
|
||||
typedef void *(*ImlibImageDataMemoryFunction) (void *, size_t size);
|
||||
typedef int (*ImlibProgressFunction)(ImlibImage * im, char percent,
|
||||
int update_x, int update_y,
|
||||
int update_w, int update_h);
|
||||
typedef void (*ImlibDataDestructorFunction)(ImlibImage * im, void *data);
|
||||
typedef void *(*ImlibImageDataMemoryFunction)(void *, size_t size);
|
||||
|
||||
enum _iflags {
|
||||
F_NONE = 0,
|
||||
|
@ -50,7 +49,7 @@ struct _imlibimagetag {
|
|||
char *key;
|
||||
int val;
|
||||
void *data;
|
||||
void (*destructor) (ImlibImage * im, void *data);
|
||||
void (*destructor)(ImlibImage * im, void *data);
|
||||
ImlibImageTag *next;
|
||||
};
|
||||
|
||||
|
@ -96,12 +95,12 @@ struct _imlibloader {
|
|||
int num_formats;
|
||||
char **formats;
|
||||
void *handle;
|
||||
char (*load) (ImlibImage * im,
|
||||
ImlibProgressFunction progress,
|
||||
char progress_granularity, char immediate_load);
|
||||
char (*save) (ImlibImage * im,
|
||||
ImlibProgressFunction progress,
|
||||
char progress_granularity);
|
||||
char (*load)(ImlibImage * im,
|
||||
ImlibProgressFunction progress,
|
||||
char progress_granularity, char immediate_load);
|
||||
char (*save)(ImlibImage * im,
|
||||
ImlibProgressFunction progress,
|
||||
char progress_granularity);
|
||||
ImlibLoader *next;
|
||||
};
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ void __imlib_RGBASetupContext(Context * ct);
|
|||
void __imlib_RGBA_init(void *rd, void *gd, void *bd, int depth,
|
||||
DATA8 palette_type);
|
||||
|
||||
typedef void (*ImlibRGBAFunction) (DATA32 *, int, DATA8 *,
|
||||
int, int, int, int, int);
|
||||
typedef void (*ImlibMaskFunction) (DATA32 *, int, DATA8 *,
|
||||
int, int, int, int, int, int);
|
||||
typedef void (*ImlibRGBAFunction)(DATA32 *, int, DATA8 *,
|
||||
int, int, int, int, int);
|
||||
typedef void (*ImlibMaskFunction)(DATA32 *, int, DATA8 *,
|
||||
int, int, int, int, int, int);
|
||||
ImlibRGBAFunction __imlib_GetRGBAFunction(int depth, unsigned long rm,
|
||||
unsigned long gm, unsigned long bm,
|
||||
char hiq, DATA8 palette_type);
|
||||
|
|
|
@ -1195,7 +1195,7 @@ __imlib_GetPointDrawFunction(ImlibOp op, char dst_alpha, char blend)
|
|||
if (opi == -1)
|
||||
return NULL;
|
||||
|
||||
return ptfuncs[opi][! !dst_alpha][! !blend];
|
||||
return ptfuncs[opi][!!dst_alpha][!!blend];
|
||||
}
|
||||
|
||||
ImlibSpanDrawFunction
|
||||
|
@ -1223,7 +1223,7 @@ __imlib_GetSpanDrawFunction(ImlibOp op, char dst_alpha, char blend)
|
|||
if (opi == -1)
|
||||
return NULL;
|
||||
|
||||
return spanfuncs[opi][! !dst_alpha][! !blend];
|
||||
return spanfuncs[opi][!!dst_alpha][!!blend];
|
||||
}
|
||||
|
||||
ImlibShapedSpanDrawFunction
|
||||
|
@ -1251,5 +1251,5 @@ __imlib_GetShapedSpanDrawFunction(ImlibOp op, char dst_alpha, char blend)
|
|||
if (opi == -1)
|
||||
return NULL;
|
||||
|
||||
return shapedspanfuncs[opi][! !dst_alpha][! !blend];
|
||||
return shapedspanfuncs[opi][!!dst_alpha][!!blend];
|
||||
}
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
#include "common.h"
|
||||
|
||||
typedef void (*ImlibPointDrawFunction) (DATA32, DATA32 *);
|
||||
typedef void (*ImlibPointDrawFunction)(DATA32, DATA32 *);
|
||||
|
||||
ImlibPointDrawFunction
|
||||
__imlib_GetPointDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
||||
typedef void (*ImlibSpanDrawFunction) (DATA32, DATA32 *, int);
|
||||
typedef void (*ImlibSpanDrawFunction)(DATA32, DATA32 *, int);
|
||||
|
||||
ImlibSpanDrawFunction
|
||||
__imlib_GetSpanDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
||||
typedef void (*ImlibShapedSpanDrawFunction) (DATA8 *, DATA32, DATA32 *,
|
||||
int);
|
||||
typedef void (*ImlibShapedSpanDrawFunction)(DATA8 *, DATA32, DATA32 *,
|
||||
int);
|
||||
|
||||
ImlibShapedSpanDrawFunction
|
||||
__imlib_GetShapedSpanDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
|
|
@ -104,7 +104,7 @@ context_create(const char *filename)
|
|||
goto fail_close;
|
||||
}
|
||||
node->id = ptr->id + 1;
|
||||
if (UNLIKELY(! !last))
|
||||
if (UNLIKELY(!!last))
|
||||
{
|
||||
node->next = last->next;
|
||||
last->next = node;
|
||||
|
|
|
@ -129,7 +129,7 @@ loadchunks(char *name, ILBM * ilbm, int full)
|
|||
break; /* Out of memory. */
|
||||
|
||||
s = fread(c->data, 1, c->size, f);
|
||||
if (s != (size_t) c->size)
|
||||
if (s != (size_t)c->size)
|
||||
break; /* Error or short file. */
|
||||
|
||||
seek = 0;
|
||||
|
|
|
@ -236,7 +236,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
{
|
||||
}
|
||||
|
||||
if ((size_t) ss.st_size < sizeof(tga_header) + header->idLength +
|
||||
if ((size_t)ss.st_size < sizeof(tga_header) + header->idLength +
|
||||
(footer_present ? sizeof(tga_footer) : 0))
|
||||
{
|
||||
munmap(seg, ss.st_size);
|
||||
|
|
|
@ -343,7 +343,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
rgba_image.progress_granularity = progress_granularity;
|
||||
rast = (uint32 *) _TIFFmalloc(sizeof(uint32) * num_pixels);
|
||||
|
||||
if ((!rast) || (!__imlib_AllocateData(im, im->w, im->h))) /* Error checking */
|
||||
if ((!rast) || (!__imlib_AllocateData(im, im->w, im->h))) /* Error checking */
|
||||
{
|
||||
fprintf(stderr, "imlib2-tiffloader: Out of memory\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue