Fix invalid c types with fontconfig

This commit is contained in:
Mitchell Hashimoto
2022-09-23 13:14:08 -07:00
parent 1a2b684b0e
commit 3bd9ed5952
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ pub const Pattern = opaque {
pub fn add(self: *Pattern, prop: Property, value: Value, append: bool) bool { pub fn add(self: *Pattern, prop: Property, value: Value, append: bool) bool {
return c.FcPatternAdd( return c.FcPatternAdd(
self.cval(), self.cval(),
prop.cval(), prop.cval().ptr,
value.cval(), value.cval(),
if (append) c.FcTrue else c.FcFalse, if (append) c.FcTrue else c.FcFalse,
) == c.FcTrue; ) == c.FcTrue;
@ -39,7 +39,7 @@ pub const Pattern = opaque {
var val: c.struct__FcValue = undefined; var val: c.struct__FcValue = undefined;
try @intToEnum(Result, c.FcPatternGet( try @intToEnum(Result, c.FcPatternGet(
self.cval(), self.cval(),
prop.cval(), prop.cval().ptr,
@intCast(c_int, id), @intCast(c_int, id),
&val, &val,
)).toError(); )).toError();

View File

@ -57,7 +57,7 @@ pub const Value = union(Type) {
.@"void" => undefined, .@"void" => undefined,
.integer => |v| .{ .i = @intCast(c_int, v) }, .integer => |v| .{ .i = @intCast(c_int, v) },
.double => |v| .{ .d = v }, .double => |v| .{ .d = v },
.string => |v| .{ .s = v }, .string => |v| .{ .s = v.ptr },
.@"bool" => |v| .{ .b = if (v) c.FcTrue else c.FcFalse }, .@"bool" => |v| .{ .b = if (v) c.FcTrue else c.FcFalse },
.matrix => |v| .{ .m = @ptrCast(*const c.struct__FcMatrix, v) }, .matrix => |v| .{ .m = @ptrCast(*const c.struct__FcMatrix, v) },
.char_set => |v| .{ .c = @ptrCast(*const c.struct__FcCharSet, v) }, .char_set => |v| .{ .c = @ptrCast(*const c.struct__FcCharSet, v) },