authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-11 15:06:20-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-11 15:06:20-05:00
logca180d3f02914d282505752a1d2fe08e175f9d99
tree07205165370989989e32b2db75eb943dea24556f
parentf7173f4f081bdc200732cc9f7d58d3d54f9b0205

std.io.parseUnsigned buf parameter is const

fixes padding in printf See #258

3 files changed, 4 insertions(+), 4 deletions(-)

src/analyze.cpp+1-1
......@@ -3302,7 +3302,7 @@ bool ir_get_var_is_comptime(VariableTableEntry *var) {
33023302}
33033303
33043304bool const_values_equal(ConstExprValue *a, ConstExprValue *b) {
3305 assert(a->type == b->type);
3305 assert(a->type->id == b->type->id);
33063306 assert(a->special == ConstValSpecialStatic);
33073307 assert(b->special == ConstValSpecialStatic);
33083308 switch (a->type->id) {
std/io.zig+1-1
......@@ -469,7 +469,7 @@ pub const InStream = struct {
469469 }
470470};
471471
472pub fn parseUnsigned(comptime T: type, buf: []u8, radix: u8) -> %T {
472pub fn parseUnsigned(comptime T: type, buf: []const u8, radix: u8) -> %T {
473473 var x: T = 0;
474474
475475 for (buf) |c| {
test/run_tests.cpp+2-2
......@@ -319,9 +319,9 @@ pub const b_text = a_text;
319319const io = @import("std").io;
320320
321321pub fn main(args: [][]u8) -> %void {
322 %%io.stdout.printf("Hello, world!\n");
322 %%io.stdout.printf("Hello, world!\n{d4} {x3}\n", u32(12), u16(0x12));
323323}
324 )SOURCE", "Hello, world!\n");
324 )SOURCE", "Hello, world!\n0012 012\n");
325325
326326
327327 add_simple_case_libc("number literals", R"SOURCE(