#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.253 2016/09/13 13:14:44 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.254 2016/10/24 15:21:07 christos Exp $")
#endif /* lint */
#include "magic.h"
ml = mlist->next;
for (ml = mlist->next; (next = ml->next) != NULL; ml = next) {
if (ml->map)
- apprentice_unmap(ml->map);
+ apprentice_unmap(CAST(struct magic_map *, ml->map));
free(ml);
if (ml == mlist)
break;
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.83 2016/06/20 16:08:14 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.84 2016/10/17 15:25:34 christos Exp $")
#endif
#include <assert.h>
cep->ce_namlen = rlen;
np = CAST(const uint16_t *, CAST(const void *, (b + 16)));
- if (CAST(const char *, np + cep->ce_namlen) > eb) {
+ if (RCAST(const char *, np + cep->ce_namlen) > eb) {
cep->ce_namlen = 0;
break;
}
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.98 2016/06/28 16:38:26 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.99 2016/09/16 12:12:05 christos Exp $")
#endif
#include "magic.h"
{ "\004\"M\030",4, lz4_args }, /* LZ4 */
{ "\x28\xB5\x2F\xFD", 4, zstd_args }, /* zstd */
#ifdef ZLIBSUPPORT
- { zlibcmp, 0, zlib_args }, /* zlib */
+ { RCAST(const void *, zlibcmp), 0, zlib_args }, /* zlib */
#endif
};
continue;
#ifdef ZLIBSUPPORT
if (compr[i].maglen == 0)
- zm = (CAST(int (*)(const unsigned char *),
+ zm = (RCAST(int (*)(const unsigned char *),
CCAST(void *, compr[i].magic)))(buf);
else
#endif
return rn - n;
default:
n -= rv;
- buf = ((char *)buf) + rv;
+ buf = CAST(char *, CCAST(void *, buf)) + rv;
break;
}
while (n > 0);
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: der.c,v 1.8 2016/07/15 00:56:04 christos Exp $")
+FILE_RCSID("@(#)$File: der.c,v 1.9 2016/10/24 15:19:08 christos Exp $")
#endif
#endif
static int
der_data(char *buf, size_t blen, uint32_t tag, const void *q, uint32_t len)
{
- const uint8_t *d = q;
+ const uint8_t *d = CAST(const uint8_t *, q);
switch (tag) {
case DER_TAG_PRINTABLE_STRING:
case DER_TAG_UTF8_STRING:
int32_t
der_offs(struct magic_set *ms, struct magic *m, size_t nbytes)
{
- const uint8_t *b = CAST(const void *, ms->search.s);
+ const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
if (gettag(b, &offs, len) == DER_BAD)
int
der_cmp(struct magic_set *ms, struct magic *m)
{
- const uint8_t *b = CAST(const void *, ms->search.s);
+ const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
const char *s = m->value.s;
size_t offs = 0, len = ms->search.s_len;
uint32_t tag, tlen;
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.236 2016/07/20 11:27:08 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.237 2016/10/10 20:44:15 christos Exp $")
#endif /* lint */
#include "magic.h"
size_t slen = ms->search.s_len;
char *copy;
if (slen != 0) {
- copy = malloc(slen);
+ copy = CAST(char *, malloc(slen));
if (copy == NULL) {
file_regfree(&rx);
file_error(ms, errno,