diff options
author | Drew DeVault <drew@ddevault.org> | 2025-03-21 10:39:56 +0100 |
---|---|---|
committer | Alexey Yerin <yyp@disroot.org> | 2025-03-21 13:19:35 +0300 |
commit | 62d0add1ec396dffae114545fc0427efc6c7153a (patch) | |
tree | ecf0922022d417b5e568abbd8869400a5757d843 | |
parent | 9e2c2490872c6324fac644ca539a65f31c575f26 (diff) |
all: nomem updates
Signed-off-by: Drew DeVault <drew@ddevault.org>
-rw-r--r-- | cmd/demo/main.ha | 10 | ||||
-rw-r--r-- | cmd/demo4/main.ha | 10 | ||||
-rw-r--r-- | cmd/hare-gi/ident.ha | 4 | ||||
-rw-r--r-- | format/fastxml/types.ha | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/cmd/demo/main.ha b/cmd/demo/main.ha index af7c60c..8f9151b 100644 --- a/cmd/demo/main.ha +++ b/cmd/demo/main.ha @@ -9,7 +9,7 @@ use types::c; fn about_clicked(btn: *gtk::Button, data: *opaque) void = { let dialog = gtk::about_dialog_new(): *gtk::AboutDialog; const authors: []*c::char = [ - c::fromstr("Harriet?"), + c::nulstr("Harriet?\0"), null: *c::char, ]; gtk::about_dialog_set_license_type( @@ -22,7 +22,7 @@ fn about_clicked(btn: *gtk::Button, data: *opaque) void = { ); gtk::about_dialog_set_website( dialog, - c::fromstr("https://git.sr.ht/~yerinalexey/hare-gi"), + c::nulstr("https://git.sr.ht/~yerinalexey/hare-gi\0"), ); gtk::widget_show_all(dialog); }; @@ -30,11 +30,11 @@ fn about_clicked(btn: *gtk::Button, data: *opaque) void = { fn activate(app: *gio::Application, data: *opaque) void = { const app = app: *gtk::Application; - let button = gtk::button_new_with_label(c::fromstr("About")): *gtk::Button; + let button = gtk::button_new_with_label(c::nulstr("About\0")): *gtk::Button; gtk::button_connect_clicked(button, &about_clicked, null); let headerbar = gtk::header_bar_new(): *gtk::HeaderBar; - gtk::header_bar_set_title(headerbar, c::fromstr("hare-gi demo")); + gtk::header_bar_set_title(headerbar, c::nulstr("hare-gi demo\0")); gtk::header_bar_set_show_close_button(headerbar, glib::TRUE); gtk::header_bar_pack_end(headerbar, button); @@ -45,7 +45,7 @@ fn activate(app: *gio::Application, data: *opaque) void = { export fn main() void = { let app = gtk::application_new( - c::fromstr("hare_gi.example"), + c::nulstr("hare_gi.example\0"), gio::ApplicationFlags::FLAGS_NONE, ): *gtk::Application; gio::application_connect_activate(app, &activate, null); diff --git a/cmd/demo4/main.ha b/cmd/demo4/main.ha index ea8649c..97693eb 100644 --- a/cmd/demo4/main.ha +++ b/cmd/demo4/main.ha @@ -9,7 +9,7 @@ use types::c; fn about_clicked(btn: *gtk4::Button, data: *opaque) void = { let dialog = gtk4::about_dialog_new(); const authors: []*c::char = [ - c::fromstr("Harriet?"), + c::nulstr("Harriet?\0"), null: *c::char, ]; gtk4::about_dialog_set_license_type( @@ -22,7 +22,7 @@ fn about_clicked(btn: *gtk4::Button, data: *opaque) void = { ); gtk4::about_dialog_set_website( dialog: *gtk4::AboutDialog, - c::fromstr("https://git.sr.ht/~yerinalexey/hare-gi"), + c::nulstr("https://git.sr.ht/~yerinalexey/hare-gi\0"), ); gtk4::widget_show(dialog); @@ -31,11 +31,11 @@ fn about_clicked(btn: *gtk4::Button, data: *opaque) void = { fn activate(app: *gio::Application, data: *opaque) void = { const app = app: *gtk4::Application; - let button = gtk4::button_new_with_label(c::fromstr("About")); + let button = gtk4::button_new_with_label(c::nulstr("About\0")); gtk4::button_connect_clicked(button: *gtk4::Button, &about_clicked, null); let headerbar = gtk4::header_bar_new(); - let title = gtk4::label_new(c::fromstr("hare-gi demo")); + let title = gtk4::label_new(c::nulstr("hare-gi demo\0")); gtk4::header_bar_set_title_widget(headerbar: *gtk4::HeaderBar, title); gtk4::header_bar_set_show_title_buttons(headerbar: *gtk4::HeaderBar, glib::TRUE); gtk4::header_bar_pack_end(headerbar: *gtk4::HeaderBar, button); @@ -47,7 +47,7 @@ fn activate(app: *gio::Application, data: *opaque) void = { export fn main() void = { let app = gtk4::application_new( - c::fromstr("hare_gi.example"), + c::nulstr("hare_gi.example\0"), gio::ApplicationFlags::FLAGS_NONE, ): *gio::Application; gio::application_connect_activate(app, &activate, null); diff --git a/cmd/hare-gi/ident.ha b/cmd/hare-gi/ident.ha index 1305192..c66944b 100644 --- a/cmd/hare-gi/ident.ha +++ b/cmd/hare-gi/ident.ha @@ -24,12 +24,12 @@ fn fix_identifier(s: str) str = { let iter = strings::iter(s); const first = strings::next(&iter) as rune; if (!ascii::isalpha(first) && first != '_') { - return fmt::bsprintf(buf, "_{}", s); + return fmt::bsprintf(buf, "_{}", s)!; }; for (let keyword .. keywords) { if (s == keyword) { - return fmt::bsprintf(buf, "{}_", s); + return fmt::bsprintf(buf, "{}_", s)!; }; }; return s; diff --git a/format/fastxml/types.ha b/format/fastxml/types.ha index f998a97..c0e57d6 100644 --- a/format/fastxml/types.ha +++ b/format/fastxml/types.ha @@ -56,7 +56,7 @@ export fn strerror(err: error) const str = { static let buf: [2048]u8 = [0...]; match (err) { case let err: syntaxerr => - return fmt::bsprintf(buf, "Syntax error on line {}", err: size); + return fmt::bsprintf(buf, "Syntax error on line {}", err: size)!; case utf8::invalid => return "Document is not valid UTF-8"; case let err: io::error => |