Compare commits

...

3 Commits

Author SHA1 Message Date
e9f12785f9 Mark Vector2 as having an ABI defined memory layout
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-28 22:20:46 +00:00
3efe246ed0 Fix mismatched type in parse_signed 2023-04-27 21:11:49 +00:00
40f4c37dc8 Fix parse_signed returning an unsigned integer 2023-04-27 21:02:38 +00:00
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ pub fn Unsigned(comptime bits: comptime_int) type {
}});
}
pub const Vector2 = struct {
pub const Vector2 = extern struct {
x: f32,
y: f32,

View File

@ -44,7 +44,7 @@ pub fn parse_float(comptime bits: comptime_int, utf8: []const u8) ParseError!mat
return result * factor;
}
pub fn parse_signed(comptime bits: comptime_int, utf8: []const u8) IntParseError!math.Unsigned(bits) {
pub fn parse_signed(comptime bits: comptime_int, utf8: []const u8) IntParseError!math.Signed(bits) {
// ""
if (utf8.len == 0) return error.BadSyntax;
@ -53,7 +53,7 @@ pub fn parse_signed(comptime bits: comptime_int, utf8: []const u8) IntParseError
// "-"
if (is_negative and (utf8.len == 1)) return error.BadSyntax;
var result: math.Unsigned(bits) = 0;
var result: math.Signed(bits) = 0;
{
var index: usize = 0;