mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
pkg/fontconfig: const pointers
This commit is contained in:
@ -11,8 +11,8 @@ pub const CharSet = opaque {
|
|||||||
c.FcCharSetDestroy(self.cval());
|
c.FcCharSetDestroy(self.cval());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hasChar(self: *CharSet, cp: u32) bool {
|
pub fn hasChar(self: *const CharSet, cp: u32) bool {
|
||||||
return c.FcCharSetHasChar(self.cval(), cp) == c.FcTrue;
|
return c.FcCharSetHasChar(self.cvalConst(), cp) == c.FcTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn cval(self: *CharSet) *c.struct__FcCharSet {
|
pub inline fn cval(self: *CharSet) *c.struct__FcCharSet {
|
||||||
@ -21,6 +21,13 @@ pub const CharSet = opaque {
|
|||||||
self,
|
self,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn cvalConst(self: *const CharSet) *const c.struct__FcCharSet {
|
||||||
|
return @ptrCast(
|
||||||
|
*const c.struct__FcCharSet,
|
||||||
|
self,
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
test "create" {
|
test "create" {
|
||||||
|
@ -11,8 +11,8 @@ pub const LangSet = opaque {
|
|||||||
c.FcLangSetDestroy(self.cval());
|
c.FcLangSetDestroy(self.cval());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hasLang(self: *LangSet, lang: [:0]const u8) bool {
|
pub fn hasLang(self: *const LangSet, lang: [:0]const u8) bool {
|
||||||
return c.FcLangSetHasLang(self.cval(), lang.ptr) == c.FcTrue;
|
return c.FcLangSetHasLang(self.cvalConst(), lang.ptr) == c.FcTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn cval(self: *LangSet) *c.struct__FcLangSet {
|
pub inline fn cval(self: *LangSet) *c.struct__FcLangSet {
|
||||||
@ -21,6 +21,13 @@ pub const LangSet = opaque {
|
|||||||
self,
|
self,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn cvalConst(self: *const LangSet) *const c.struct__FcLangSet {
|
||||||
|
return @ptrCast(
|
||||||
|
*const c.struct__FcLangSet,
|
||||||
|
self,
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
test "create" {
|
test "create" {
|
||||||
|
Reference in New Issue
Block a user