From d6f9ed712516e68dc7c3cf8221479d6f1cef8db6 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 20 Jan 2023 15:36:40 +0100 Subject: [PATCH] Split clkoff initialization --- src/emu/clkoff.c | 12 ++++++++---- src/emu/clkoff.h | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emu/clkoff.c b/src/emu/clkoff.c index f5fd041..6b2c43c 100644 --- a/src/emu/clkoff.c +++ b/src/emu/clkoff.c @@ -106,19 +106,23 @@ cindex(struct clkoff *table) return 0; } -int -clkoff_init(struct clkoff *table, FILE *file) +void +clkoff_init(struct clkoff *table) { memset(table, 0, sizeof(struct clkoff)); +} +int +clkoff_load(struct clkoff *table, FILE *file) +{ if (cparse(table, file) != 0) { - err("clkoff_init: failed parsing clock table\n"); + err("clkoff_load: failed parsing clock table\n"); return -1; } /* Create index array */ if (cindex(table) != 0) { - err("clkoff_init: failed indexing table\n"); + err("clkoff_load: failed indexing table\n"); return -1; } diff --git a/src/emu/clkoff.h b/src/emu/clkoff.h index aecd9cc..c080105 100644 --- a/src/emu/clkoff.h +++ b/src/emu/clkoff.h @@ -24,7 +24,8 @@ struct clkoff { struct clkoff_entry **index; }; -int clkoff_init(struct clkoff *table, FILE *file); +void clkoff_init(struct clkoff *table); +int clkoff_load(struct clkoff *table, FILE *file); int clkoff_count(struct clkoff *table); struct clkoff_entry *clkoff_get(struct clkoff *table, int i);