Commit 9c8190fb authored by Geoff Simmons's avatar Geoff Simmons

silence a warning from clang

parent eb3f1e37
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "vqueue.h" #include "vqueue.h"
#include "vsb.h" #include "vsb.h"
#include "vmb.h" #include "vmb.h"
#include "common/common.h"
#define __offsetof(st, m) offsetof(st,m) #define __offsetof(st, m) offsetof(st,m)
...@@ -73,8 +74,8 @@ static txhead_t freetxhead; ...@@ -73,8 +74,8 @@ static txhead_t freetxhead;
static rechead_t freerechead; static rechead_t freerechead;
static chunkhead_t freechunkhead; static chunkhead_t freechunkhead;
static char bogus_rec; static const char bogus_rec;
rec_t * const magic_end_rec = (rec_t * const) &bogus_rec; const void * const magic_end_rec = &bogus_rec;
static void static void
data_Cleanup(void) data_Cleanup(void)
...@@ -268,7 +269,7 @@ DATA_Init(void) ...@@ -268,7 +269,7 @@ DATA_Init(void)
} }
txn[i].recs[idx]->hdrs = (rec_t **) calloc(nhdrs + 1, txn[i].recs[idx]->hdrs = (rec_t **) calloc(nhdrs + 1,
sizeof(rec_t *)); sizeof(rec_t *));
txn[i].recs[idx]->hdrs[nhdrs] = magic_end_rec; txn[i].recs[idx]->hdrs[nhdrs] = TRUST_ME(magic_end_rec);
} }
VSTAILQ_INSERT_TAIL(&freetxhead, &txn[i], freelist); VSTAILQ_INSERT_TAIL(&freetxhead, &txn[i], freelist);
} }
......
...@@ -31,4 +31,4 @@ ...@@ -31,4 +31,4 @@
#include "varnishevent.h" #include "varnishevent.h"
extern rec_t * const magic_end_rec; extern const void * const magic_end_rec;
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#include "common/common.h"
#include "minunit.h" #include "minunit.h"
#include "../varnishevent.h" #include "../varnishevent.h"
...@@ -376,7 +378,7 @@ static const char ...@@ -376,7 +378,7 @@ static const char
fill_rec(&records[idx], &chunks[idx * CHUNKS_PER_REC], fill_rec(&records[idx], &chunks[idx * CHUNKS_PER_REC],
CHUNKS_PER_REC); CHUNKS_PER_REC);
} }
rec_nodes[i].hdrs[HDRS_PER_NODE] = magic_end_rec; rec_nodes[i].hdrs[HDRS_PER_NODE] = TRUST_ME(magic_end_rec);
} }
DATA_Clear_Tx(&tx, &local_freetx, &local_freerec, &local_freechunk, DATA_Clear_Tx(&tx, &local_freetx, &local_freerec, &local_freechunk,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment