Mercurial > hg > dmlib
comparison src/dmzlib.c @ 991:acd91a57fe8c
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 28 Feb 2015 05:06:44 +0200 |
parents | 76f3961a044b |
children | 929e43afbdb1 |
comparison
equal
deleted
inserted
replaced
990:76f3961a044b | 991:acd91a57fe8c |
---|---|
476 int dmZLibParseHeader(DMZLibContext * ctx, BOOL checkPNG) | 476 int dmZLibParseHeader(DMZLibContext * ctx, BOOL checkPNG) |
477 { | 477 { |
478 int cmf = dmZGet8(ctx); | 478 int cmf = dmZGet8(ctx); |
479 int flags = dmZGet8(ctx); | 479 int flags = dmZGet8(ctx); |
480 int cm = cmf & 15; | 480 int cm = cmf & 15; |
481 // int cinfo = cmf >> 4; | 481 // cinfo = cmf >> 4; |
482 // window = 1 << (8 + cinfo)... but who cares, we fully buffer output | |
482 | 483 |
483 if ((cmf * 256 + flags) % 31 != 0) | 484 if ((cmf * 256 + flags) % 31 != 0) |
484 { | 485 { |
485 return dmError(DMERR_INVALID_DATA, | 486 return dmError(DMERR_INVALID_DATA, |
486 "Bad zlib header."); | 487 "Bad zlib header."); |
497 { | 498 { |
498 return dmError(DMERR_INVALID_DATA, | 499 return dmError(DMERR_INVALID_DATA, |
499 "Bad or unsupported compression type.\n"); | 500 "Bad or unsupported compression type.\n"); |
500 } | 501 } |
501 | 502 |
502 // window = 1 << (8 + cinfo)... but who cares, we fully buffer output | |
503 return DMERR_OK; | 503 return DMERR_OK; |
504 } | 504 } |
505 | 505 |
506 | 506 |
507 int dmZLibDecode(DMZLibContext * ctx) | 507 int dmZLibDecode(DMZLibContext * ctx) |