-/* $Id: dba.c,v 1.9 2017/01/15 15:28:55 schwarze Exp $ */
+/* $Id: dba.c,v 1.10 2017/02/17 14:43:54 schwarze Exp $ */
/*
* Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
const char *cp1, *cp2;
int diff;
- cp1 = *(char **)vp1;
- cp2 = *(char **)vp2;
+ cp1 = *(const char * const *)vp1;
+ cp2 = *(const char * const *)vp2;
return (diff = *cp2 - *cp1) ? diff :
strcasecmp(cp1 + 1, cp2 + 1);
}
{
const char *cp1, *cp2;
- cp1 = *(char **)vp1;
- cp2 = *(char **)vp2;
+ cp1 = *(const char * const *)vp1;
+ cp2 = *(const char * const *)vp2;
return strcmp(cp1, cp2);
}
{
const struct macro_entry *ep1, *ep2;
- ep1 = *(struct macro_entry **)vp1;
- ep2 = *(struct macro_entry **)vp2;
+ ep1 = *(const struct macro_entry * const *)vp1;
+ ep2 = *(const struct macro_entry * const *)vp2;
return strcmp(ep1->value, ep2->value);
}