gpt4 book ai didi

c++ - 警告 : 'struct curl_fileinfo' declared inside parameter list

转载 作者:太空宇宙 更新时间:2023-11-04 11:34:51 25 4
gpt4 key购买 nike

<分区>

我的代码如下:

#include <curl/curl.h>
struct callback_data {
FILE *output;
char *path; //to specify the entire path
char *fname; //Full file name of current download
char *msg; //message for display
};

static long file_is_comming(struct curl_fileinfo *finfo, struct callback_data *data, int remains);

static long file_is_downloaded(struct callback_data *data);

static size_t write_it(char *buff, size_t size, size_t nmemb,
struct callback_data *data);

static long file_is_comming(struct curl_fileinfo *finfo, struct callback_data *data, int remains)
{
printf("%3d %40s %10luB ", remains, finfo->filename, (unsigned long)finfo->size);

printf("dest path = %s \n", data->path);
if(finfo->filetype == CURLFILETYPE_FILE) {

data->fname = (char *)malloc( (sizeof(char *)) *
(strlen(finfo->filename) + strlen(data->path)+1));

sprintf(data->fname, "%s%s", data->path, finfo->filename);
data->output = fopen(data->fname, "w");
printf("dest file name = %s \n", data->fname);

if(!data->output) {
return CURL_CHUNK_BGN_FUNC_FAIL;
}
}

return CURL_CHUNK_BGN_FUNC_OK;
}

警告是:

warning: 'struct curl_fileinfo' declared inside parameter list
warning: 'struct curl_fileinfo' declared inside parameter list
utils-curl.h:15: warning: its scope is only this definition or declaration, which is probably not what you want
utils-curl.c:3: warning: 'struct curl_fileinfo' declared inside parameter list
utils-curl.c:4: error: conflicting types for 'file_is_comming'
utils-curl.h:15: error: previous declaration of 'file_is_comming' was here

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