您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GIT_UNUSED函数代码示例

51自学网 2021-06-01 20:53:00
  C++
这篇教程C++ GIT_UNUSED函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GIT_UNUSED函数的典型用法代码示例。如果您正苦于以下问题:C++ GIT_UNUSED函数的具体用法?C++ GIT_UNUSED怎么用?C++ GIT_UNUSED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GIT_UNUSED函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: git_transport_ssh_with_paths

int git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *payload){#ifdef GIT_SSH	git_strarray *paths = (git_strarray *) payload;	git_transport *transport;	transport_smart *smart;	ssh_subtransport *t;	int error;	git_smart_subtransport_definition ssh_definition = {		git_smart_subtransport_ssh,		0, /* no RPC */		NULL,	};	if (paths->count != 2) {		giterr_set(GITERR_SSH, "invalid ssh paths, must be two strings");		return GIT_EINVALIDSPEC;	}	if ((error = git_transport_smart(&transport, owner, &ssh_definition)) < 0)		return error;	smart = (transport_smart *) transport;	t = (ssh_subtransport *) smart->wrapped;	t->cmd_uploadpack = git__strdup(paths->strings[0]);	GITERR_CHECK_ALLOC(t->cmd_uploadpack);	t->cmd_receivepack = git__strdup(paths->strings[1]);	GITERR_CHECK_ALLOC(t->cmd_receivepack);	*out = transport;	return 0;#else	GIT_UNUSED(owner);	GIT_UNUSED(payload);	assert(out);	*out = NULL;	giterr_set(GITERR_INVALID, "Cannot create SSH transport. Library was built without SSH support");	return -1;#endif}
开发者ID:CODECOMMUNITY,项目名称:libgit2,代码行数:43,


示例2: GIT_INLINE

GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache){	GIT_UNUSED(cache); /* avoid warning if threading is off */	if (git_mutex_lock(&cache->lock) < 0) {		giterr_set(GITERR_OS, "Unable to get attr cache lock");		return -1;	}	return 0;}
开发者ID:1336,项目名称:libgit2,代码行数:10,


示例3: cred_cb

static int cred_cb(git_cred **cred, const char *url, const char *user_from_url,		   unsigned int allowed_types, void *payload){	const char *remote_user = cl_getenv("GITTEST_REMOTE_USER");	const char *pubkey = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY");	const char *privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY");	const char *passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE");	GIT_UNUSED(url); GIT_UNUSED(user_from_url); GIT_UNUSED(payload);	if (allowed_types & GIT_CREDTYPE_USERNAME)		return git_cred_username_new(cred, remote_user);	if (allowed_types & GIT_CREDTYPE_SSH_KEY)		return git_cred_ssh_key_new(cred, remote_user, pubkey, privkey, passphrase);	giterr_set(GITERR_NET, "unexpected cred type");	return -1;}
开发者ID:DavidMolinari,项目名称:sonic-pi,代码行数:19,


示例4: interrupt_cb

static int interrupt_cb(const char *reference_name, void *payload){	int *count = (int *)payload;	GIT_UNUSED(reference_name);	(*count)++;	return (*count == 11);}
开发者ID:0CV0,项目名称:libgit2,代码行数:10,


示例5: _ssh_close

static int _ssh_close(git_smart_subtransport *subtransport){	ssh_subtransport *t = (ssh_subtransport *) subtransport;	assert(!t->current_stream);	GIT_UNUSED(t);	return 0;}
开发者ID:KindDragon,项目名称:libgit2,代码行数:10,


示例6: checkout_cancel_cb

static int checkout_cancel_cb(	git_checkout_notify_t why,	const char *path,	const git_diff_file *b,	const git_diff_file *t,	const git_diff_file *w,	void *payload){	struct checkout_cancel_at *ca = payload;	GIT_UNUSED(why); GIT_UNUSED(b); GIT_UNUSED(t); GIT_UNUSED(w);	ca->count++;	if (!strcmp(path, ca->filename))		return ca->error;	return 0;}
开发者ID:Kat7984,项目名称:libgit2,代码行数:19,


示例7: tag_list_cb

static int tag_list_cb(const char *tag_name, git_oid *oid, void *data){	tag_filter_data *filter = (tag_filter_data *)data;	GIT_UNUSED(oid);	if (!*filter->pattern || p_fnmatch(filter->pattern, tag_name + GIT_REFS_TAGS_DIR_LEN, 0) == 0)		return git_vector_insert(filter->taglist, git__strdup(tag_name + GIT_REFS_TAGS_DIR_LEN));	return 0;}
开发者ID:2020sebastian,项目名称:libgit2,代码行数:10,


示例8: count_me

static int count_me(const git_config_entry *entry, void *payload){	int *n = (int *) payload;	GIT_UNUSED(entry);	(*n)++;	return 0;}
开发者ID:1336,项目名称:libgit2,代码行数:10,


示例9: rebase_init_merge

static int rebase_init_merge(	git_rebase *rebase,	git_repository *repo,	const git_annotated_commit *branch,	const git_annotated_commit *upstream,	const git_annotated_commit *onto){	git_reference *head_ref = NULL;	git_commit *onto_commit = NULL;	git_buf reflog = GIT_BUF_INIT;	git_buf state_path = GIT_BUF_INIT;	int error;	GIT_UNUSED(upstream);	if ((error = git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR)) < 0)		goto done;	rebase->state_path = git_buf_detach(&state_path);	GITERR_CHECK_ALLOC(rebase->state_path);	if (branch->ref_name) {		rebase->orig_head_name = git__strdup(branch->ref_name);		GITERR_CHECK_ALLOC(rebase->orig_head_name);	} else {		rebase->head_detached = 1;	}	rebase->onto_name = git__strdup(rebase_onto_name(onto));	GITERR_CHECK_ALLOC(rebase->onto_name);	rebase->quiet = rebase->options.quiet;	git_oid_cpy(&rebase->orig_head_id, git_annotated_commit_id(branch));	git_oid_cpy(&rebase->onto_id, git_annotated_commit_id(onto));	if ((error = rebase_setupfiles(rebase)) < 0 ||		(error = git_buf_printf(&reflog,			"rebase: checkout %s", rebase_onto_name(onto))) < 0 ||		(error = git_commit_lookup(			&onto_commit, repo, git_annotated_commit_id(onto))) < 0 ||		(error = git_checkout_tree(repo,			(git_object *)onto_commit, &rebase->options.checkout_options)) < 0 ||		(error = git_reference_create(&head_ref, repo, GIT_HEAD_FILE,			git_annotated_commit_id(onto), 1, reflog.ptr)) < 0)		goto done;done:	git_reference_free(head_ref);	git_commit_free(onto_commit);	git_buf_free(&reflog);	git_buf_free(&state_path);	return error;}
开发者ID:Corillian,项目名称:libgit2,代码行数:55,


示例10: default_remote_create

static int default_remote_create(		git_remote **out,		git_repository *repo,		const char *name,		const char *url,		void *payload){	GIT_UNUSED(payload);	return git_remote_create(out, repo, name, url);}
开发者ID:ethomson,项目名称:libgit2,代码行数:11,


示例11: p_mkdir

int p_mkdir(const char *path, mode_t mode){	git_win32_path buf;	GIT_UNUSED(mode);	if (utf8_to_16_with_errno(buf, path) < 0)		return -1;	return _wmkdir(buf);}
开发者ID:DaneTheory,项目名称:libgit2,代码行数:11,


示例12: cb_status__single

int cb_status__single(const char *p, unsigned int s, void *payload){	status_entry_single *data = (status_entry_single *)payload;	GIT_UNUSED(p);	data->count++;	data->status = s;	return 0;}
开发者ID:2020sebastian,项目名称:libgit2,代码行数:11,


示例13: checkout_conflict_count_cb

static int checkout_conflict_count_cb(	git_checkout_notify_t why,	const char *path,	const git_diff_file *b,	const git_diff_file *t,	const git_diff_file *w,	void *payload){	size_t *n = payload;	GIT_UNUSED(why);	GIT_UNUSED(path);	GIT_UNUSED(b);	GIT_UNUSED(t);	GIT_UNUSED(w);	(*n)++;	return 0;}
开发者ID:Kat7984,项目名称:libgit2,代码行数:20,


示例14: p_mkdir

int p_mkdir(const char *path, mode_t mode){	git_win32_path buf;	GIT_UNUSED(mode);	if (git_win32_path_from_utf8(buf, path) < 0)		return -1;	return _wmkdir(buf);}
开发者ID:1336,项目名称:libgit2,代码行数:11,


示例15: checkout_notify_cb

static int checkout_notify_cb(	git_checkout_notify_t why,	const char *path,	const git_diff_file *baseline,	const git_diff_file *target,	const git_diff_file *workdir,	void *payload){	struct update_submodule_cb_payload *update_payload = payload;	GIT_UNUSED(why);	GIT_UNUSED(path);	GIT_UNUSED(baseline);	GIT_UNUSED(target);	GIT_UNUSED(workdir);	update_payload->checkout_notify_called = 1;	return 0;}
开发者ID:CODECOMMUNITY,项目名称:libgit2,代码行数:20,


示例16: aborting_progress_cb

int aborting_progress_cb(	git_stash_apply_progress_t progress,	void *payload){	GIT_UNUSED(payload);	if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED)		return -44;	return 0;}
开发者ID:Angeldude,项目名称:sonic-pi,代码行数:11,


示例17: cb_cred_access_token

// callback: tries the access_token passed in through the payload ONCE//           and returns GIT_EAUTH if called for a second timeint cb_cred_access_token(git_cred **out, const char *url, const char *username_from_url,  unsigned int allowed_types, void *payload) {  GIT_UNUSED(url);  GIT_UNUSED(username_from_url);  if (allowed_types & GIT_CREDTYPE_USERPASS_PLAINTEXT) {    struct credentials_s *credentials = payload;    if (credentials->count > 0) {      git_error_set_str(GIT_ERROR_CALLBACK, "Invalid token");      return GIT_EAUTH;    } else {      credentials->count++;      return git_cred_userpass_plaintext_new(out, "x-access-token", credentials->access_token);    }  }  return GIT_PASSTHROUGH;}
开发者ID:backhub,项目名称:gitfetch,代码行数:22,


示例18: git_tls_stream_new

int git_tls_stream_new(git_stream **out, const char *host, const char *port){	if (tls_ctor)		return tls_ctor(out, host, port);#ifdef GIT_SECURE_TRANSPORT	return git_stransport_stream_new(out, host, port);#elif defined(GIT_OPENSSL)	return git_openssl_stream_new(out, host, port);#elif defined(GIT_MBEDTLS)	return git_mbedtls_stream_new(out, host, port);#else	GIT_UNUSED(out);	GIT_UNUSED(host);	GIT_UNUSED(port);	giterr_set(GITERR_SSL, "there is no TLS stream available");	return -1;#endif}
开发者ID:csware,项目名称:libgit2,代码行数:21,


示例19: notify_cb__basic

static int notify_cb__basic(	const git_diff *diff_so_far,	const git_diff_delta *delta_to_add,	const char *matched_pathspec,	void *payload){	basic_payload *exp = (basic_payload *)payload;	basic_payload *e;	GIT_UNUSED(diff_so_far);	GIT_UNUSED(matched_pathspec);	for (e = exp; e->path; e++) {		if (strcmp(e->path, delta_to_add->new_file.path) == 0) {			cl_assert_equal_i(e->t, delta_to_add->status);			return 0;		}	}	cl_assert(0);	return GIT_ENOTFOUND;}
开发者ID:Angeldude,项目名称:sonic-pi,代码行数:21,


示例20: winhttp_uploadpack

static int winhttp_uploadpack(	winhttp_subtransport *t,	winhttp_stream *s){	GIT_UNUSED(t);	s->service = upload_pack_service;	s->service_url = upload_pack_service_url;	s->verb = post_verb;	return 0;}
开发者ID:DavidMolinari,项目名称:sonic-pi,代码行数:12,


示例21: winhttp_receivepack_ls

static int winhttp_receivepack_ls(	winhttp_subtransport *t,	winhttp_stream *s){	GIT_UNUSED(t);	s->service = receive_pack_service;	s->service_url = receive_pack_ls_service_url;	s->verb = get_verb;	return 0;}
开发者ID:DavidMolinari,项目名称:sonic-pi,代码行数:12,


示例22: cb_status__expected_path

static int cb_status__expected_path(const char *p, unsigned int s, void *payload){	const char *expected_path = (const char *)payload;	GIT_UNUSED(s);	if (payload == NULL)		cl_fail("Unexpected path");	cl_assert_equal_s(expected_path, p);	return 0;}
开发者ID:ralpheav,项目名称:PM_GIT,代码行数:13,


示例23: openssl_write

ssize_t openssl_write(git_stream *stream, const char *data, size_t len, int flags){	openssl_stream *st = (openssl_stream *) stream;	int ret;	GIT_UNUSED(flags);	if ((ret = SSL_write(st->ssl, data, len)) <= 0) {		return ssl_set_error(st->ssl, ret);	}	return ret;}
开发者ID:Angolier,项目名称:sonic-pi,代码行数:13,


示例24: net_set_error

static void net_set_error(const char *str){	int size, error = WSAGetLastError();	LPSTR err_str = NULL;	size = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,			     0, error, 0, (LPSTR)&err_str, 0, 0);	GIT_UNUSED(size);	giterr_set(GITERR_NET, "%s: %s", str, err_str);	LocalFree(err_str);}
开发者ID:jmendeth,项目名称:node-gitteh,代码行数:13,


示例25: cl_fake_home_cleanup

void cl_fake_home_cleanup(void *payload){	char *restore = _cl_restore_home;	_cl_restore_home = NULL;	GIT_UNUSED(payload);	if (restore) {		cl_git_pass(git_libgit2_opts(			GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, restore));		git__free(restore);	}}
开发者ID:Angeldude,项目名称:sonic-pi,代码行数:13,


示例26: checkout_create_the_new

static int checkout_create_the_new(	void *cb_data, const git_diff_delta *delta, float progress){	int error = 0;	struct checkout_diff_data *data = cb_data;	git_checkout_opts *opts = data->checkout_opts;	bool do_checkout = false, do_notify = false;	GIT_UNUSED(progress);	data->stats->processed++;	if (delta->status == GIT_DELTA_MODIFIED ||		delta->status == GIT_DELTA_TYPECHANGE)	{		if ((opts->checkout_strategy & GIT_CHECKOUT_OVERWRITE_MODIFIED) != 0)			do_checkout = true;		else if (opts->skipped_notify_cb != NULL)			do_notify = !data->create_submodules;	}	else if (delta->status == GIT_DELTA_DELETED &&			 (opts->checkout_strategy & GIT_CHECKOUT_CREATE_MISSING) != 0)		do_checkout = true;	if (do_notify) {		if (opts->skipped_notify_cb(			delta->old_file.path, &delta->old_file.oid,			delta->old_file.mode, opts->notify_payload))		{			giterr_clear();			error = GIT_EUSER;		}	}	if (do_checkout) {		bool is_submodule = S_ISGITLINK(delta->old_file.mode);		if (is_submodule)			data->found_submodules = true;		if (!is_submodule && !data->create_submodules)			error = checkout_blob(data, &delta->old_file);		else if (is_submodule && data->create_submodules)			error = checkout_submodule(data, &delta->old_file);	}	if (error)		data->error = error;	return error;}
开发者ID:spritetong,项目名称:tortoisegit-libgit2-utf8,代码行数:51,


示例27: remote_mirror_cb

static int remote_mirror_cb(git_remote **out, git_repository *repo,			    const char *name, const char *url, void *payload){	int error;	git_remote *remote;	GIT_UNUSED(payload);	if ((error = git_remote_create_with_fetchspec(&remote, repo, name, url, "+refs/*:refs/*")) < 0)		return error;	*out = remote;	return 0;}
开发者ID:RsrchBoy,项目名称:p5-Git-Raw,代码行数:14,


示例28: failing_chunked_source_cb

static int failing_chunked_source_cb(	char *content, size_t max_length, void *payload){	int *count = (int *)payload;	GIT_UNUSED(max_length);	(*count)--;	if (*count == 0)		return -1234;	strcpy(content, textual_content);	return (int)strlen(textual_content);}
开发者ID:1336,项目名称:libgit2,代码行数:14,


示例29: stransport_write

static ssize_t stransport_write(git_stream *stream, const char *data, size_t len, int flags){	stransport_stream *st = (stransport_stream *) stream;	size_t data_len, processed;	OSStatus ret;	GIT_UNUSED(flags);	data_len = len;	if ((ret = SSLWrite(st->ctx, data, data_len, &processed)) != noErr)		return stransport_error(ret);	return processed;}
开发者ID:csware,项目名称:libgit2,代码行数:14,


示例30: can_link

static bool can_link(const char *src, const char *dst, int link){#ifdef GIT_WIN32	GIT_UNUSED(src);	GIT_UNUSED(dst);	GIT_UNUSED(link);	return false;#else	struct stat st_src, st_dst;	if (!link)		return false;	if (p_stat(src, &st_src) < 0)		return false;	if (p_stat(dst, &st_dst) < 0)		return false;	return st_src.st_dev == st_dst.st_dev;#endif}
开发者ID:ethomson,项目名称:libgit2,代码行数:23,



注:本文中的GIT_UNUSED函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GKI_freebuf函数代码示例
C++ GITERR_CHECK_ALLOC函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。