libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 79b32a7826cd5bd1d212199c258beb25e7449517
parent f55523d806ff684d6d8b2f364fc26c58aa0b5d45
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 13 Jun 2010 09:40:28 +0000

cleaning

Diffstat:
Msrc/common/unzip.c | 30++++++++++++------------------
Msrc/main/extractor.c | 2+-
Msrc/plugins/flv_extractor.c | 16+++++++++-------
Msrc/plugins/jpeg_extractor.c | 2+-
4 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/src/common/unzip.c b/src/common/unzip.c @@ -18,6 +18,12 @@ Boston, MA 02111-1307, USA. */ +/* This code is based in part on + unzip 1.00 Copyright 1998-2003 Gilles Vollant + http://www.winimage.com/zLibDll" +*/ + + #include "platform.h" #include <ctype.h> #include "extractor.h" @@ -94,8 +100,6 @@ typedef struct unz_global_info_s #define SIZEZIPLOCALHEADER (0x1e) -const char unz_copyright[] = - " unzip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; /* EXTRACTOR_unzip_file_info_interntal contain internal info about a file in zipfile*/ typedef struct unz_file_info_internal_s @@ -583,8 +587,6 @@ EXTRACTOR_common_unzip_open2 (const char *path, int err=EXTRACTOR_UNZIP_OK; - if (unz_copyright[0]!=' ') - return NULL; memset (&us, 0, sizeof(us)); us.z_filefunc = *pzlib_filefunc_def; @@ -1007,7 +1009,7 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uLong uMagic,uData,uFlags; uLong size_filename; uLong size_extra_field; - int err=EXTRACTOR_UNZIP_OK; + int err = EXTRACTOR_UNZIP_OK; *piSizeVar = 0; *poffset_local_extrafield = 0; @@ -1015,21 +1017,13 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return EXTRACTOR_UNZIP_ERRNO; - - - if (err==EXTRACTOR_UNZIP_OK) { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK) - err=EXTRACTOR_UNZIP_ERRNO; - else if (uMagic!=0x04034b50) - err=EXTRACTOR_UNZIP_BADZIPFILE; - } + return EXTRACTOR_UNZIP_ERRNO; + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK) + err=EXTRACTOR_UNZIP_ERRNO; + else if (uMagic!=0x04034b50) + err=EXTRACTOR_UNZIP_BADZIPFILE; if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != EXTRACTOR_UNZIP_OK) err=EXTRACTOR_UNZIP_ERRNO; -/* - else if ((err==EXTRACTOR_UNZIP_OK) && (uData!=s->cur_file_info.wVersion)) - err=EXTRACTOR_UNZIP_BADZIPFILE; -*/ if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != EXTRACTOR_UNZIP_OK) err=EXTRACTOR_UNZIP_ERRNO; diff --git a/src/main/extractor.c b/src/main/extractor.c @@ -1650,8 +1650,8 @@ make_shm (int is_tail, CloseHandle (*mappedFile); return 1; } -#endif return 0; +#endif } diff --git a/src/plugins/flv_extractor.c b/src/plugins/flv_extractor.c @@ -689,6 +689,8 @@ static void handleASEnd(unsigned char type, void * value, void * userdata) { double n = *((double *)value); switch (state->currentAttribute) { + case FLV_NONE: /* make gcc happy */ + break; case FLV_STEREO: break; case FLV_ACHANNELS: @@ -1089,11 +1091,11 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) size_t len = MAX_FLV_FORMAT_LINE; n = 0; - if (stinfo->audioRate != -1 && n < len) { + if ( (stinfo->audioRate != -1) && (n < len)) { n += snprintf(s+n, len-n, "%s Hz", FLVAudioSampleRates[stinfo->audioRate]); } - if (stinfo->audioSampleBits != -1 && n < len) { + if ((stinfo->audioSampleBits != -1) && (n < len)) { if (n > 0) n += snprintf(s+n, len-n, ", "); if (n < len) @@ -1101,7 +1103,7 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) FLVAudioSampleSizes[stinfo->audioSampleBits]); } - if (stinfo->audioChannels != -1 && n < len) { + if ((stinfo->audioChannels != -1) && (n < len)) { if (n > 0) n += snprintf(s+n, len-n, ", "); if (n < len) { @@ -1114,21 +1116,21 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) } } - if (stinfo->audioCodec > -1 && stinfo->audioCodec < 12 && - FLVAudioCodecs[stinfo->audioCodec] != NULL && n < len) { + if ((stinfo->audioCodec > -1) && (stinfo->audioCodec < 12) && + (FLVAudioCodecs[stinfo->audioCodec] != NULL) && (n < len)) { if (n > 0) n += snprintf(s+n, len-n, ", "); if (n < len) n += snprintf(s+n, len-n, "%s", FLVAudioCodecs[stinfo->audioCodec]); } - else if (stinfo->audioCodecStr != NULL && n < len) { + else if ((stinfo->audioCodecStr != NULL) && (n < len)) { if (n > 0) n += snprintf(s+n, len-n, ", "); if (n < len) n += snprintf(s+n, len-n, "%s", stinfo->audioCodecStr); } - if (stinfo->audioDataRate != 0.0 && n < len) { + if ((stinfo->audioDataRate != 0.0) && (n < len)) { if (n > 0) n += snprintf(s+n, len-n, ", "); if (n < len) diff --git a/src/plugins/jpeg_extractor.c b/src/plugins/jpeg_extractor.c @@ -81,7 +81,7 @@ next_marker (const unsigned char **data, const unsigned char *end) { c = NEXTC (data, end); } - while ((c == 0xFF) && (c != -1)); + while (c == 0xFF); return c; }