void
hash_buffer(struct mdfour *md, const void *s, size_t len)
{
- mdfour_update(md, (unsigned char *)s, len);
+ mdfour_update(md, (const unsigned char *)s, len);
}
// Return the hash result as a hex string. Caller frees.
unsigned char q = p[ofs];
int i;
for (i = 0; i < tokens[q].num_toks; i++) {
- unsigned char *s = (unsigned char *)tokens[q].toks[i];
- int len = strlen((char *)s);
+ const unsigned char *s = (const unsigned char *)tokens[q].toks[i];
+ int len = strlen((const char *)s);
if (size >= ofs+len && memcmp(&p[ofs], s, len) == 0) {
int j;
for (j = 0; s[j]; j++) {
bool
cct_check_str_eq(const char *file, int line, const char *expression,
- const char *expected, const char *actual, bool free1,
- bool free2)
+ char *expected, char *actual,
+ bool free1, bool free2)
{
bool result;
}
if (free1) {
- free((char *)expected);
+ free(expected);
}
if (free2) {
- free((char *)actual);
+ free(actual);
}
return result;
}
bool cct_check_int_eq(const char *file, int line, const char *expression,
int64_t expected, int64_t actual);
bool cct_check_str_eq(const char *file, int line, const char *expression,
- const char *expected, const char *actual, bool free1,
- bool free2);
+ char *expected, char *actual,
+ bool free1, bool free2);
bool cct_check_args_eq(const char *file, int line, const char *expression,
struct args *expected, struct args *actual,
bool free1, bool free2);
#define N_CONFIG_ITEMS 32
static struct {
char *descr;
- const char *origin;
+ char *origin;
} received_conf_items[N_CONFIG_ITEMS];
static size_t n_received_conf_items = 0;
{
(void)context;
received_conf_items[n_received_conf_items].descr = x_strdup(descr);
- received_conf_items[n_received_conf_items].origin = origin;
+ received_conf_items[n_received_conf_items].origin = x_strdup(origin);
++n_received_conf_items;
}
while (n_received_conf_items > 0) {
--n_received_conf_items;
free(received_conf_items[n_received_conf_items].descr);
+ free(received_conf_items[n_received_conf_items].origin);
}
}