diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-17 04:52:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-17 04:52:36 +0400 |
commit | ad96dacbc5a7cc61ccf74405927847f243a955b5 (patch) | |
tree | a2b78d3b502b99a1c7e59e8400dfd0807a896125 /source/blender/imbuf/intern | |
parent | 9276fb479ed1c5b472c5d831f52913157efe9288 (diff) |
style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 51 | ||||
-rw-r--r-- | source/blender/imbuf/intern/bmp.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 26 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 15 |
4 files changed, 64 insertions, 34 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 8928774dcb4..7d0c201a07c 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -110,7 +110,8 @@ #endif #endif -int ismovie(const char *UNUSED(filepath)) { +int ismovie(const char *UNUSED(filepath)) +{ return 0; } @@ -126,7 +127,8 @@ static void free_anim_movie(struct anim *UNUSED(anim)) { ; } # define PATHSEPERATOR '/' #endif -static int an_stringdec(const char *string, char* head, char *tail, unsigned short *numlen) { +static int an_stringdec(const char *string, char* head, char *tail, unsigned short *numlen) +{ unsigned short len,nume,nums=0; short i,found=FALSE; @@ -161,11 +163,13 @@ static int an_stringdec(const char *string, char* head, char *tail, unsigned sho } -static void an_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic) { +static void an_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic) +{ BLI_stringenc(string, head, tail, numlen, pic); } -static void free_anim_avi (struct anim *anim) { +static void free_anim_avi (struct anim *anim) +{ #if defined(_WIN32) && !defined(FREE_WINDOWS) int i; #endif @@ -206,7 +210,8 @@ static void free_anim_ffmpeg(struct anim * anim); static void free_anim_redcode(struct anim * anim); #endif -void IMB_free_anim(struct anim * anim) { +void IMB_free_anim(struct anim * anim) +{ if (anim == NULL) { printf("free anim, anim == NULL\n"); return; @@ -229,14 +234,16 @@ void IMB_free_anim(struct anim * anim) { MEM_freeN(anim); } -void IMB_close_anim(struct anim * anim) { +void IMB_close_anim(struct anim * anim) +{ if (anim == NULL) return; IMB_free_anim(anim); } -struct anim * IMB_open_anim( const char * name, int ib_flags, int streamindex) { +struct anim * IMB_open_anim( const char * name, int ib_flags, int streamindex) +{ struct anim * anim; anim = (struct anim*)MEM_callocN(sizeof(struct anim), "anim struct"); @@ -249,7 +256,8 @@ struct anim * IMB_open_anim( const char * name, int ib_flags, int streamindex) { } -static int startavi (struct anim *anim) { +static int startavi (struct anim *anim) +{ AviError avierror; #if defined(_WIN32) && !defined(FREE_WINDOWS) @@ -355,7 +363,8 @@ static int startavi (struct anim *anim) { return 0; } -static ImBuf * avi_fetchibuf (struct anim *anim, int position) { +static ImBuf * avi_fetchibuf (struct anim *anim, int position) +{ ImBuf *ibuf = NULL; int *tmp; int y; @@ -405,7 +414,8 @@ static ImBuf * avi_fetchibuf (struct anim *anim, int position) { extern void do_init_ffmpeg(void); -static int startffmpeg(struct anim * anim) { +static int startffmpeg(struct anim * anim) +{ int i, videoStream; AVCodec *pCodec; @@ -1032,7 +1042,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position, return anim->last_frame; } -static void free_anim_ffmpeg(struct anim * anim) { +static void free_anim_ffmpeg(struct anim * anim) +{ if (anim == NULL) return; if (anim->pCodecCtx) { @@ -1058,7 +1069,8 @@ static void free_anim_ffmpeg(struct anim * anim) { #ifdef WITH_REDCODE -static int startredcode(struct anim * anim) { +static int startredcode(struct anim * anim) +{ anim->redcodeCtx = redcode_open(anim->name); if (!anim->redcodeCtx) { return -1; @@ -1068,7 +1080,8 @@ static int startredcode(struct anim * anim) { return 0; } -static ImBuf * redcode_fetchibuf(struct anim * anim, int position) { +static ImBuf * redcode_fetchibuf(struct anim * anim, int position) +{ struct ImBuf * ibuf; struct redcode_frame * frame; struct redcode_frame_raw * raw_frame; @@ -1099,7 +1112,8 @@ static ImBuf * redcode_fetchibuf(struct anim * anim, int position) { return ibuf; } -static void free_anim_redcode(struct anim * anim) { +static void free_anim_redcode(struct anim * anim) +{ if (anim->redcodeCtx) { redcode_close(anim->redcodeCtx); anim->redcodeCtx = 0; @@ -1113,7 +1127,8 @@ static void free_anim_redcode(struct anim * anim) { /* Geen plaatje, probeer dan volgende animatie te openen */ /* gelukt, haal dan eerste plaatje van animatie */ -static struct ImBuf * anim_getnew(struct anim * anim) { +static struct ImBuf * anim_getnew(struct anim * anim) +{ struct ImBuf *ibuf = NULL; if (anim == NULL) return(NULL); @@ -1175,7 +1190,8 @@ static struct ImBuf * anim_getnew(struct anim * anim) { return(ibuf); } -struct ImBuf * IMB_anim_previewframe(struct anim * anim) { +struct ImBuf * IMB_anim_previewframe(struct anim * anim) +{ struct ImBuf * ibuf = NULL; int position = 0; @@ -1282,7 +1298,8 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position, /***/ -int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc) { +int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc) +{ struct anim_index * idx; if (tc == IMB_TC_NONE) { return anim->duration; diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index a9c2d72b188..77fc6bdf856 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -185,14 +185,16 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags) } /* Couple of helper functions for writing our data */ -static int putIntLSB(unsigned int ui,FILE *ofile) { +static int putIntLSB(unsigned int ui,FILE *ofile) +{ putc((ui>>0)&0xFF,ofile); putc((ui>>8)&0xFF,ofile); putc((ui>>16)&0xFF,ofile); return putc((ui>>24)&0xFF,ofile); } -static int putShortLSB(unsigned short us,FILE *ofile) { +static int putShortLSB(unsigned short us,FILE *ofile) +{ putc((us>>0)&0xFF,ofile); return putc((us>>8)&0xFF,ofile); } diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 568dd7a9fb7..f8082c95f84 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -70,21 +70,24 @@ int imb_is_a_jp2(unsigned char *buf) /** sample error callback expecting a FILE* client object */ -static void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) +{ FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -static void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) +{ FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -static void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) +{ (void)client_data; fprintf(stdout, "[INFO] %s", msg); } @@ -305,7 +308,8 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) #define COMP_48_CS 520833 /*Maximum size per color component for 2K @ 48fps*/ -static int initialise_4K_poc(opj_poc_t *POC, int numres){ +static int initialise_4K_poc(opj_poc_t *POC, int numres) +{ POC[0].tile = 1; POC[0].resno0 = 0; POC[0].compno0 = 0; @@ -323,7 +327,8 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){ return 2; } -static void cinema_parameters(opj_cparameters_t *parameters){ +static void cinema_parameters(opj_cparameters_t *parameters) +{ parameters->tile_size_on = false; parameters->cp_tdx=1; parameters->cp_tdy=1; @@ -356,7 +361,8 @@ static void cinema_parameters(opj_cparameters_t *parameters){ } -static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol){ +static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol) +{ int i; float temp_rate; @@ -442,8 +448,8 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag } -static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) { - +static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) +{ unsigned char *rect; float *rect_float; @@ -662,8 +668,8 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) { /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ -int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) { - +int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) +{ int quality = ibuf->ftype & 0xff; int bSuccess; diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 872b78743be..47dad378eb7 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -199,12 +199,14 @@ int IMB_ispic(const char *filename) -static int isavi (const char *name) { +static int isavi (const char *name) +{ return AVI_is_avi (name); } #ifdef WITH_QUICKTIME -static int isqtime (const char *name) { +static int isqtime (const char *name) +{ return anim_is_quicktime (name); } #endif @@ -240,7 +242,8 @@ void do_init_ffmpeg(void) } } -static int isffmpeg (const char *filename) { +static int isffmpeg (const char *filename) +{ AVFormatContext *pFormatCtx; unsigned int i; int videoStream; @@ -323,7 +326,8 @@ static int isredcode(const char * filename) #endif -int imb_get_anim_type(const char * name) { +int imb_get_anim_type(const char * name) +{ int type; struct stat st; @@ -364,7 +368,8 @@ int imb_get_anim_type(const char * name) { return(0); } -int IMB_isanim(const char *filename) { +int IMB_isanim(const char *filename) +{ int type; if(U.uiflag & USER_FILTERFILEEXTS) { |