gpt4 book ai didi

c - 这些错误是什么? (阿夫罗)

转载 作者:行者123 更新时间:2023-11-30 15:01:12 24 4
gpt4 key购买 nike

What are these errors ?

/home/pi/try/client/c/libs/kaa/src/kaa/gen/kaa_logging_gen.c:93:9: error: too many arguments to function ‘avro_binary_encoding.read_char’
avro_binary_encoding.read_char(reader, &record->NodeId);
^
/home/pi/try/client/c/libs/kaa/src/kaa/gen/kaa_logging_gen.c:95:2: error: too many arguments to function ‘avro_binary_encoding.read_char’
avro_binary_encoding.read_char(reader, &record->OnlineStat);
^
/home/pi/try/client/c/libs/kaa/src/kaa/gen/kaa_logging_gen.c:99:2: error: too many arguments to function ‘avro_binary_encoding.read_char’
avro_binary_encoding.read_char(reader, &record->FirmwareVER);

之前我收到错误,他们说 read_char 和 write_char 未声明为函数。但声明该函数后,我仍然遇到错误。但这个功能我们不知道怎么做。

我们对 write_char 和 read_char 所做的是:

static int read_char(avro_reader_t reader)
{
/*
* no-op
*/
AVRO_UNUSED(reader);

return 3;
}

static int write_char(avro_writer_t writer)
{
/*
* no-op
*/
AVRO_UNUSED(writer);

return 3;
}

以下是其他功能的其他示例:

static int read_string(avro_reader_t reader, char **s, int64_t *len)
{
(void)len;
int64_t str_len = 0;
int rval;
check_prefix(rval, read_long(reader, &str_len),
"Cannot read string length: ");
*s = (char *) KAA_MALLOC(str_len + 1);
if (!*s) {
return ENOMEM;
}
(*s)[str_len] = '\0';
AVRO_READ(reader, *s, str_len);
return 0;
}

static int write_string(avro_writer_t writer, const char *s)
{
int64_t len = strlen(s);
return write_bytes(writer, s, len);
}

最佳答案

看起来您已经为使用一个参数定义的函数传递了两个参数

static int read_char(avro_reader_t reader)
static int write_char(avro_writer_t writer)

每个都有一个参数但你用

给他们打电话
avro_binary_encoding.read_char(reader, &record->NodeId);
avro_binary_encoding.read_char(reader, &record->OnlineStat);
avro_binary_encoding.read_char(reader, &record->FirmwareVER);

它传递了 2 个参数。

关于c - 这些错误是什么? (阿夫罗),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41587720/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com