From 7564a339b0063374410348a0d7446013c901203f Mon Sep 17 00:00:00 2001 From: johannes Date: Wed, 7 Feb 2024 19:51:56 +0100 Subject: changed type from char to demochunktype --- src/demo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/demo.c b/src/demo.c index b2c44fd..a176c06 100644 --- a/src/demo.c +++ b/src/demo.c @@ -236,7 +236,7 @@ int readdemochunk(FILE *fp, demochunk *chunk, unsigned char ver) } else { - unsigned char type = (chunkhead & CHUNK_NORMAL_TYPE_MASK) >> 5; + demochunktype type = (demochunktype) ((chunkhead & CHUNK_NORMAL_TYPE_MASK) >> 5); short size = (chunkhead & CHUNK_NORMAL_SIZE_MASK); if (size == 30) @@ -244,7 +244,7 @@ int readdemochunk(FILE *fp, demochunk *chunk, unsigned char ver) else if (size == 31) fread(&size, sizeof(short), 1, fp); - if (type == 1) + if (type == DEMOSNAP) { demosnap *snap = (demosnap *)malloc(sizeof(demosnap)); memset(snap, 0, sizeof(demosnap)); // TODO idk if necessary @@ -274,7 +274,7 @@ int readdemochunk(FILE *fp, demochunk *chunk, unsigned char ver) return -1; } } - else if (type == 2) + else if (type == DEMOMESSAGE) { printf("MESSAGE={"); demomessage *message = (demomessage *)malloc(sizeof(demomessage)); @@ -282,7 +282,7 @@ int readdemochunk(FILE *fp, demochunk *chunk, unsigned char ver) chunk->type = DEMOMESSAGE; chunk->data.message = message; } - else if (type == 3) + else if (type == DEMODELTA) { printf("SNAPSHOT_DELTA={"); demodelta *delta = (demodelta *)malloc(sizeof(demodelta)); -- cgit v1.2.3