libextractor

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

commit 249e00b4792205fa50fe83dadb1caac4f8e4b3e4
parent a3e6889feea0b719996ee26b766754cf77501741
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 13 Nov 2009 11:09:22 +0000

cleaning up types

Diffstat:
Msrc/plugins/debextractor.c | 8+++-----
Msrc/plugins/id3v23extractor.c | 18++++++++----------
2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/plugins/debextractor.c b/src/plugins/debextractor.c @@ -63,7 +63,7 @@ stndup (const char *str, size_t n) typedef struct { - char *text; + const char *text; EXTRACTOR_KeywordType type; } Matches; @@ -242,13 +242,11 @@ static struct EXTRACTOR_Keywords * processControlTGZ (const unsigned char *data, size_t size, struct EXTRACTOR_Keywords *prev) { - size_t bufSize; + uint32_t bufSize; char *buf; z_stream strm; - bufSize = - data[size - 4] + 256 * data[size - 3] + 65536 * data[size - 2] + - 256 * 65536 * data[size - 1]; + bufSize = data[size - 4] + (data[size - 3] << 8) + (data[size - 2] << 16) + (data[size - 1] << 24); if (bufSize > MAX_CONTROL_SIZE) return prev; diff --git a/src/plugins/id3v23extractor.c b/src/plugins/id3v23extractor.c @@ -18,7 +18,6 @@ Boston, MA 02111-1307, USA. */ - #define DEBUG_EXTRACT_ID3v23 0 #include "platform.h" @@ -51,7 +50,7 @@ addKeyword (EXTRACTOR_KeywordList * oldhead, typedef struct { - char *text; + const char *text; EXTRACTOR_KeywordType type; } Matches; @@ -110,10 +109,13 @@ libextractor_id3v23_extract (const char *filename, int unsync; int extendedHdr; int experimental; - unsigned int tsize; - unsigned int pos; - unsigned int ehdrSize; - unsigned int padding; + uint32_t tsize; + uint32_t pos; + uint32_t ehdrSize; + uint32_t padding; + uint32_t csize; + int i; + uint16_t flags; if ((size < 16) || (data[0] != 0x49) || @@ -147,10 +149,6 @@ libextractor_id3v23_extract (const char *filename, while (pos < tsize) { - size_t csize; - int i; - unsigned short flags; - if (pos + 10 > tsize) return prev; csize =