Skip to content

Commit a916428

Browse files
committed
Fix MSVC build
1 parent ce6b065 commit a916428

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/umka_const.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static int64_t constCompare(const Consts *consts, Const *lhs, const Const *rhs,
111111
const double diff = lhs->realVal - rhs->realVal;
112112
return (diff == 0.0) ? 0 : (diff > 0.0) ? 1 : -1;
113113
}
114-
case TYPE_PTR: return lhs->ptrVal - rhs->ptrVal;
114+
case TYPE_PTR: return (char *)lhs->ptrVal - (char *)rhs->ptrVal;
115115
case TYPE_WEAKPTR: return lhs->weakPtrVal - rhs->weakPtrVal;
116116
case TYPE_STR:
117117
{

src/umka_vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ static int64_t doCompare(Slot lhs, Slot rhs, const Type *type, Error *error)
845845
const double diff = lhs.realVal - rhs.realVal;
846846
return (diff == 0.0) ? 0 : (diff > 0.0) ? 1 : -1;
847847
}
848-
case TYPE_PTR: return lhs.ptrVal - rhs.ptrVal;
848+
case TYPE_PTR: return (char *)lhs.ptrVal - (char *)rhs.ptrVal;
849849
case TYPE_WEAKPTR: return lhs.weakPtrVal - rhs.weakPtrVal;
850850
case TYPE_STR:
851851
{

0 commit comments

Comments
 (0)