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/avi/intern/avi.c | |
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/avi/intern/avi.c')
-rw-r--r-- | source/blender/avi/intern/avi.c | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c index a021695b7c9..c6fdd2e1adc 100644 --- a/source/blender/avi/intern/avi.c +++ b/source/blender/avi/intern/avi.c @@ -63,7 +63,8 @@ char *tcc_to_char (unsigned int tcc); /* implemetation */ -unsigned int GET_FCC (FILE *fp) { +unsigned int GET_FCC (FILE *fp) +{ unsigned char tmp[4]; tmp[0] = getc(fp); @@ -74,7 +75,8 @@ unsigned int GET_FCC (FILE *fp) { return FCC (tmp); } -unsigned int GET_TCC (FILE *fp) { +unsigned int GET_TCC (FILE *fp) +{ char tmp[5]; tmp[0] = getc(fp); @@ -85,7 +87,8 @@ unsigned int GET_TCC (FILE *fp) { return FCC (tmp); } -char *fcc_to_char (unsigned int fcc) { +char *fcc_to_char (unsigned int fcc) +{ DEBUG_FCC[0]= (fcc)&127; DEBUG_FCC[1]= (fcc>>8)&127; DEBUG_FCC[2]= (fcc>>16)&127; @@ -94,7 +97,8 @@ char *fcc_to_char (unsigned int fcc) { return DEBUG_FCC; } -char *tcc_to_char (unsigned int tcc) { +char *tcc_to_char (unsigned int tcc) +{ DEBUG_FCC[0]= (tcc)&127; DEBUG_FCC[1]= (tcc>>8)&127; DEBUG_FCC[2]= 0; @@ -103,7 +107,8 @@ char *tcc_to_char (unsigned int tcc) { return DEBUG_FCC; } -int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num) { +int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num) +{ int cur_stream; if (movie == NULL) @@ -121,7 +126,8 @@ int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num) { return -AVI_ERROR_FOUND; } -static int fcc_get_stream (int fcc) { +static int fcc_get_stream (int fcc) +{ char fccs[4]; fccs[0] = fcc; @@ -132,7 +138,8 @@ static int fcc_get_stream (int fcc) { return 10*(fccs[0]-'0') + (fccs[1]-'0'); } -static int fcc_is_data (int fcc) { +static int fcc_is_data (int fcc) +{ char fccs[4]; fccs[0] = fcc; @@ -148,7 +155,8 @@ static int fcc_is_data (int fcc) { return 1; } -AviError AVI_print_error (AviError in_error) { +AviError AVI_print_error (AviError in_error) +{ int error; if ((int) in_error < 0) @@ -190,12 +198,14 @@ AviError AVI_print_error (AviError in_error) { return in_error; } /* -void AVI_set_debug (int mode) { +void AVI_set_debug (int mode) +{ AVI_DEBUG= mode; } */ /* -int AVI_is_avi (char *name) { +int AVI_is_avi (char *name) +{ FILE *fp; int ret; @@ -216,7 +226,8 @@ int AVI_is_avi (char *name) { } */ -int AVI_is_avi (const char *name) { +int AVI_is_avi (const char *name) +{ int temp, fcca, j; AviMovie movie= {NULL}; AviMainHeader header; @@ -407,7 +418,8 @@ int AVI_is_avi (const char *name) { } -AviError AVI_open_movie (const char *name, AviMovie *movie) { +AviError AVI_open_movie (const char *name, AviMovie *movie) +{ int temp, fcca, size, j; DEBUG_PRINT("opening movie\n"); @@ -619,7 +631,11 @@ AviError AVI_open_movie (const char *name, AviMovie *movie) { movie->entries[temp].Offset = GET_FCC (movie->fp); movie->entries[temp].Size = GET_FCC (movie->fp); - if (AVI_DEBUG) printf ("Index entry %04d: ChunkId:%s Flags:%d Offset:%d Size:%d\n", temp, fcc_to_char(movie->entries[temp].ChunkId), movie->entries[temp].Flags, movie->entries[temp].Offset, movie->entries[temp].Size); + if (AVI_DEBUG) { + printf("Index entry %04d: ChunkId:%s Flags:%d Offset:%d Size:%d\n", + temp, fcc_to_char(movie->entries[temp].ChunkId), movie->entries[temp].Flags, + movie->entries[temp].Offset, movie->entries[temp].Size); + } } /* Some AVI's have offset entries in absolute coordinates @@ -637,7 +653,8 @@ AviError AVI_open_movie (const char *name, AviMovie *movie) { return AVI_ERROR_NONE; } -void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream) { +void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream) +{ int cur_frame=-1, temp, i=0, rewind=1; void *buffer; @@ -681,7 +698,8 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream) return buffer; } -AviError AVI_close (AviMovie *movie) { +AviError AVI_close (AviMovie *movie) +{ int i; fclose (movie->fp); @@ -703,7 +721,8 @@ AviError AVI_close (AviMovie *movie) { return AVI_ERROR_NONE; } -AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...) { +AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...) +{ va_list ap; AviList list; AviChunk chunk; @@ -892,7 +911,8 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...) { return AVI_ERROR_NONE; } -AviError AVI_write_frame (AviMovie *movie, int frame_num, ...) { +AviError AVI_write_frame (AviMovie *movie, int frame_num, ...) +{ AviList list; AviChunk chunk; AviIndexEntry *temp; @@ -999,7 +1019,8 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...) { return AVI_ERROR_NONE; } -AviError AVI_close_compress (AviMovie *movie) { +AviError AVI_close_compress (AviMovie *movie) +{ int temp, movi_size, i; fseek (movie->fp, 0L, SEEK_END); |