Skip to content

Commit 8f29c69

Browse files
committed
fixed dodac.c string code
1 parent e9ca0e0 commit 8f29c69

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

source/dodac.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ bool sizeprime(void const * const element) {
554554
}
555555

556556
size_t stringhshmurmur(void const * const element) {
557-
char const * string = element;
557+
char const * string = *((char**)element);
558558
size_t hash = DODAC_SEED;
559559

560560
// One-byte-at-a-time hash based on Murmur's mix
@@ -569,15 +569,15 @@ size_t stringhshmurmur(void const * const element) {
569569
}
570570

571571
int stringcmp(void const * const a, void const * const b) {
572-
return strcmp(a, b);
572+
return strcmp(*((char**)(a)), *((char**)(b)));
573573
}
574574

575575
int stringrcmp(void const * const a, void const * const b) {
576-
return strcmp(b, a);
576+
return strcmp(*((char**)(b)), *((char**)(a)));
577577
}
578578

579579
bool stringprint(void * const element, void * const format) {
580-
printf(format ? format : STRING_FORMAT, (char*)format);
580+
printf(format ? format : STRING_FORMAT, *(char**)element);
581581
return true;
582582
}
583583

0 commit comments

Comments
 (0)