diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
| commit | baea09062482674220a3686d488a283e6b9b8821 (patch) | |
| tree | 33df470af1db2be53fabac50762c375951acb84e /src/modules.c | |
| parent | 126050a6357d7ec1fd9901256de50923b6dd7c49 (diff) | |
| parent | 597699243a6f935231ad83e63d22bf6ff9e4e547 (diff) | |
Merge branch 'zero-nones' into dev
Diffstat (limited to 'src/modules.c')
| -rw-r--r-- | src/modules.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules.c b/src/modules.c index 08550f2e..9ebdca09 100644 --- a/src/modules.c +++ b/src/modules.c @@ -51,7 +51,7 @@ bool install_from_modules_ini(Path_t ini_file, bool ask_confirmation) { if (by_line.fn == NULL) return false; OptionalText_t (*next_line)(void *) = by_line.fn; module_info_t info = {}; - for (Text_t line; (line = next_line(by_line.userdata)).length >= 0;) { + for (OptionalText_t line; (line = next_line(by_line.userdata)).tag != TEXT_NONE;) { char *line_str = Text$as_c_string(line); const char *next_section = NULL; if (!strparse(line_str, "[", &next_section, "]")) { @@ -78,13 +78,13 @@ static void read_modules_ini(Path_t ini_file, module_info_t *info) { if (by_line.fn == NULL) return; OptionalText_t (*next_line)(void *) = by_line.fn; find_section:; - for (Text_t line; (line = next_line(by_line.userdata)).length >= 0;) { + for (OptionalText_t line; (line = next_line(by_line.userdata)).tag != TEXT_NONE;) { char *line_str = Text$as_c_string(line); if (line_str[0] == '[' && strncmp(line_str + 1, info->name, strlen(info->name)) == 0 && line_str[1 + strlen(info->name)] == ']') break; } - for (Text_t line; (line = next_line(by_line.userdata)).length >= 0;) { + for (OptionalText_t line; (line = next_line(by_line.userdata)).tag != TEXT_NONE;) { char *line_str = Text$as_c_string(line); if (line_str[0] == '[') goto find_section; if (!strparse(line_str, "version=", &info->version) || !strparse(line_str, "url=", &info->url) @@ -95,7 +95,7 @@ find_section:; } module_info_t get_used_module_info(ast_t *use) { - static Table_t cache = {}; + static Table_t cache = EMPTY_TABLE; TypeInfo_t *cache_type = Table$info(Pointer$info("@", &Memory$info), Pointer$info("@", &Memory$info)); module_info_t **cached = Table$get(cache, &use, cache_type); if (cached) return **cached; |
