warning: passing argument 1 of ‘get_message_head’ from incompatible pointer type [-Wincompatible-pointer-types] 167 | int status_num = get_message_head(parse_msg, message); | ^~~~~~~~~ | | | struct tml_rev * sip_client.c:94:34: note: expected ‘struct rev *’ but argument is of type ‘struct tml_rev *’ 94 | int get_message_head(struct rev *parse_msg, char * message)啥意思
时间: 2024-02-10 07:35:05 浏览: 29
这个警告的意思是你在调用函数 `get_message_head` 时,传递的第一个参数类型与函数定义时的参数类型不兼容。函数定义时的第一个参数类型应该是 `struct rev *`,但你传递的实际参数类型是 `struct tml_rev *`。因此,编译器会发出警告,提示你需要将参数类型改为函数定义时所要求的类型。你需要检查 `get_message_head` 函数的定义和调用处的参数类型是否匹配。
相关问题
passing argument 1 of 'jpeg_read_header' from incompatible pointer type [-Wincompatible-pointer-types]
这个错误是因为`jpeg_read_header`函数的第一个参数类型与你提供的参数类型不匹配。`jpeg_read_header`函数期望的第一个参数是`j_compress_ptr`类型,而你可能错误地传递了其他类型的指针。
确保你正确地创建了`struct jpeg_compress_struct`结构体,并将其地址传递给`jpeg_read_header`函数。以下是一个示例:
```c
void compress_image(const char* input_image, const char* output_image, int quality) {
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
FILE* infile, *outfile;
if ((infile = fopen(input_image, "rb")) == NULL) {
fprintf(stderr, "Can't open %s\n", input_image);
return;
}
if ((outfile = fopen(output_image, "wb")) == NULL) {
fprintf(stderr, "Can't create %s\n", output_image);
fclose(infile);
return;
}
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, outfile);
jpeg_read_header((j_compress_ptr)&cinfo, TRUE);
cinfo.image_quality = quality;
// 继续处理图像压缩...
fclose(outfile);
jpeg_destroy_compress(&cinfo);
fclose(infile);
}
```
在上述代码中,通过将`&cinfo`强制转换为`j_compress_ptr`类型,我们确保将正确类型的指针传递给了`jpeg_read_header`函数。
请注意,为了避免这种类型不匹配的错误,应该确保所有相关的libjpeg函数和结构体都正确地声明和初始化。另外,确保你已经正确引入了`jpeglib.h`头文件,这样才能正确地使用libjpeg库中的函数和结构体。
passing argument 3 of ‘lcd_put_chinese_str’ from incompatible pointer type [-Wincompatible-pointer-types]
这个错误意味着你在调用 `lcd_put_chinese_str` 函数时,第三个参数的类型与函数声明中的类型不匹配。可能是你传递的指针类型与函数声明中的指针类型不同,或者你传递的变量类型与函数声明中的变量类型不同。你需要检查函数声明和调用的参数类型,确保它们匹配。如果需要,可以将参数类型进行强制转换。