Skip to content

Commit 1a02246

Browse files
authored
Merge pull request #275 from davidben/func-cast
Fix invalid function pointer cast in cpuinfo.c
2 parents d6120c7 + 8cb442f commit 1a02246

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/x86/linux/cpuinfo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ struct proc_cpuinfo_parser_state {
8383
static bool parse_line(
8484
const char* line_start,
8585
const char* line_end,
86-
struct proc_cpuinfo_parser_state state[restrict static 1],
86+
void* context,
8787
uint64_t line_number) {
88+
struct proc_cpuinfo_parser_state* restrict state = context;
8889
/* Empty line. Skip. */
8990
if (line_start == line_end) {
9091
return true;
@@ -215,5 +216,5 @@ bool cpuinfo_x86_linux_parse_proc_cpuinfo(
215216
.processors = processors,
216217
};
217218
return cpuinfo_linux_parse_multiline_file(
218-
"/proc/cpuinfo", BUFFER_SIZE, (cpuinfo_line_callback)parse_line, &state);
219+
"/proc/cpuinfo", BUFFER_SIZE, parse_line, &state);
219220
}

0 commit comments

Comments
 (0)