idnode: Fix sorting for bool and time types
This commit is contained in:
parent
c2680b5f0c
commit
0e6c737626
1 changed files with 10 additions and 4 deletions
14
src/idnode.c
14
src/idnode.c
|
@ -424,8 +424,11 @@ idnode_get_bool
|
|||
const property_t *p = idnode_find_prop(self, key);
|
||||
if (p->islist) return 1;
|
||||
if (p) {
|
||||
void *ptr = self;
|
||||
ptr += p->off;
|
||||
const void *ptr;
|
||||
if (p->get)
|
||||
ptr = p->get(self);
|
||||
else
|
||||
ptr = ((void*)self) + p->off;
|
||||
switch (p->type) {
|
||||
case PT_BOOL:
|
||||
*b = *(int*)ptr;
|
||||
|
@ -447,8 +450,11 @@ idnode_get_time
|
|||
const property_t *p = idnode_find_prop(self, key);
|
||||
if (p->islist) return 1;
|
||||
if (p) {
|
||||
void *ptr = self;
|
||||
ptr += p->off;
|
||||
const void *ptr;
|
||||
if (p->get)
|
||||
ptr = p->get(self);
|
||||
else
|
||||
ptr = ((void*)self) + p->off;
|
||||
switch (p->type) {
|
||||
case PT_TIME:
|
||||
*tm = *(time_t*)ptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue