Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
398412cc
Unverified
Commit
398412cc
authored
5 years ago
by
Patrick Steinhardt
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5143 from libgit2/ethomson/warnings
ci: build with ENABLE_WERROR on Windows
parents
5c87b5a8
a3afda9f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
28 additions
and
28 deletions
+28
-28
ci/build.ps1
+1
-1
examples/blame.c
+2
-2
examples/clone.c
+3
-3
examples/describe.c
+1
-1
examples/general.c
+1
-1
examples/index-pack.c
+1
-1
examples/merge.c
+2
-2
examples/show-index.c
+1
-1
src/win32/w32_stack.c
+4
-4
src/win32/w32_stack.h
+3
-3
tests/clar.c
+4
-4
tests/clar.h
+3
-3
tests/clar/print.h
+1
-1
tests/trace/windows/stacktrace.c
+1
-1
No files found.
ci/build.ps1
View file @
398412cc
...
...
@@ -18,7 +18,7 @@ Write-Host "####################################################################
Write-Host
"## Configuring build environment"
Write-Host
"##############################################################################"
Invoke-Expression
"cmake
${
SourceDirectory
}
-DBUILD_EXAMPLES=ON
${
Env
:CMAKE_OPTIONS
}
"
Invoke-Expression
"cmake
${
SourceDirectory
}
-DBUILD_EXAMPLES=ON
-DENABLE_WERROR=ON
${
Env
:CMAKE_OPTIONS
}
"
if
(
$LastExitCode
-ne 0
)
{
[
Environment]::Exit
(
$LastExitCode
)
}
Write-Host
""
...
...
This diff is collapsed.
Click to expand it.
examples/blame.c
View file @
398412cc
...
...
@@ -33,7 +33,7 @@ static void parse_opts(struct opts *o, int argc, char *argv[]);
int
lg2_blame
(
git_repository
*
repo
,
int
argc
,
char
*
argv
[])
{
int
line
,
break_on_null_hunk
;
size
_t
i
,
rawsize
;
git_off
_t
i
,
rawsize
;
char
spec
[
1024
]
=
{
0
};
struct
opts
o
=
{
0
};
const
char
*
rawdata
;
...
...
@@ -91,7 +91,7 @@ int lg2_blame(git_repository *repo, int argc, char *argv[])
i
=
0
;
break_on_null_hunk
=
0
;
while
(
i
<
rawsize
)
{
const
char
*
eol
=
memchr
(
rawdata
+
i
,
'\n'
,
rawsize
-
i
);
const
char
*
eol
=
memchr
(
rawdata
+
i
,
'\n'
,
(
size_t
)(
rawsize
-
i
)
);
char
oid
[
10
]
=
{
0
};
const
git_blame_hunk
*
hunk
=
git_blame_get_hunk_byline
(
blame
,
line
);
...
...
This diff is collapsed.
Click to expand it.
examples/clone.c
View file @
398412cc
...
...
@@ -17,9 +17,9 @@ static void print_progress(const progress_data *pd)
0
;
int
checkout_percent
=
pd
->
total_steps
>
0
?
(
100
*
pd
->
completed_steps
)
/
pd
->
total_steps
?
(
int
)((
100
*
pd
->
completed_steps
)
/
pd
->
total_steps
)
:
0
;
in
t
kbytes
=
pd
->
fetch_progress
.
received_bytes
/
1024
;
size_
t
kbytes
=
pd
->
fetch_progress
.
received_bytes
/
1024
;
if
(
pd
->
fetch_progress
.
total_objects
&&
pd
->
fetch_progress
.
received_objects
==
pd
->
fetch_progress
.
total_objects
)
{
...
...
@@ -27,7 +27,7 @@ static void print_progress(const progress_data *pd)
pd
->
fetch_progress
.
indexed_deltas
,
pd
->
fetch_progress
.
total_deltas
);
}
else
{
printf
(
"net %3d%% (%4
d
kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4"
PRIuZ
"/%4"
PRIuZ
") %s
\n
"
,
printf
(
"net %3d%% (%4
"
PRIuZ
"
kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4"
PRIuZ
"/%4"
PRIuZ
") %s
\n
"
,
network_percent
,
kbytes
,
pd
->
fetch_progress
.
received_objects
,
pd
->
fetch_progress
.
total_objects
,
index_percent
,
pd
->
fetch_progress
.
indexed_objects
,
pd
->
fetch_progress
.
total_objects
,
...
...
This diff is collapsed.
Click to expand it.
examples/describe.c
View file @
398412cc
...
...
@@ -54,7 +54,7 @@ static void opts_add_commit(describe_options *opts, const char *commit)
assert
(
opts
!=
NULL
);
sz
=
++
opts
->
commit_count
*
sizeof
(
opts
->
commits
[
0
]);
opts
->
commits
=
xrealloc
(
opts
->
commits
,
sz
);
opts
->
commits
=
xrealloc
(
(
void
*
)
opts
->
commits
,
sz
);
opts
->
commits
[
opts
->
commit_count
-
1
]
=
commit
;
}
...
...
This diff is collapsed.
Click to expand it.
examples/general.c
View file @
398412cc
...
...
@@ -624,7 +624,7 @@ static void revwalking(git_repository *repo)
static
void
index_walking
(
git_repository
*
repo
)
{
git_index
*
index
;
unsigned
in
t
i
,
ecount
;
size_
t
i
,
ecount
;
printf
(
"
\n
*Index Walking*
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
examples/index-pack.c
View file @
398412cc
...
...
@@ -11,7 +11,7 @@
# define read _read
# define close _close
#define ssize_t
unsigned
int
#define ssize_t int
#else
# include <unistd.h>
#endif
...
...
This diff is collapsed.
Click to expand it.
examples/merge.c
View file @
398412cc
...
...
@@ -57,7 +57,7 @@ static void opts_add_refish(merge_options *opts, const char *refish)
assert
(
opts
!=
NULL
);
sz
=
++
opts
->
heads_count
*
sizeof
(
opts
->
heads
[
0
]);
opts
->
heads
=
xrealloc
(
opts
->
heads
,
sz
);
opts
->
heads
=
xrealloc
(
(
void
*
)
opts
->
heads
,
sz
);
opts
->
heads
[
opts
->
heads_count
-
1
]
=
refish
;
}
...
...
@@ -355,7 +355,7 @@ int lg2_merge(git_repository *repo, int argc, char **argv)
}
cleanup:
free
(
opts
.
heads
);
free
(
(
char
**
)
opts
.
heads
);
free
(
opts
.
annotated
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
examples/show-index.c
View file @
398412cc
...
...
@@ -17,7 +17,7 @@
int
lg2_show_index
(
git_repository
*
repo
,
int
argc
,
char
**
argv
)
{
git_index
*
index
;
unsigned
in
t
i
,
ecount
;
size_
t
i
,
ecount
;
char
*
dir
=
"."
;
size_t
dirlen
;
char
out
[
GIT_OID_HEXSZ
+
1
];
...
...
This diff is collapsed.
Click to expand it.
src/win32/w32_stack.c
View file @
398412cc
...
...
@@ -76,7 +76,7 @@ int git_win32__stack_compare(
}
int
git_win32__stack_format
(
char
*
pbuf
,
in
t
buf_len
,
char
*
pbuf
,
size_
t
buf_len
,
const
git_win32__stack__raw_data
*
pdata
,
const
char
*
prefix
,
const
char
*
suffix
)
{
...
...
@@ -91,10 +91,10 @@ int git_win32__stack_format(
}
s
;
IMAGEHLP_LINE64
line
;
in
t
buf_used
=
0
;
size_
t
buf_used
=
0
;
unsigned
int
k
;
char
detail
[
MY_MAX_FILENAME
*
2
];
/* filename plus space for function name and formatting */
in
t
detail_len
;
size_
t
detail_len
;
if
(
!
g_win32_stack_initialized
)
{
git_error_set
(
GIT_ERROR_INVALID
,
"git_win32_stack not initialized."
);
...
...
@@ -171,7 +171,7 @@ int git_win32__stack_format(
}
int
git_win32__stack
(
char
*
pbuf
,
in
t
buf_len
,
char
*
pbuf
,
size_
t
buf_len
,
int
skip
,
const
char
*
prefix
,
const
char
*
suffix
)
{
...
...
This diff is collapsed.
Click to expand it.
src/win32/w32_stack.h
View file @
398412cc
...
...
@@ -38,7 +38,7 @@ typedef void (*git_win32__stack__aux_cb_alloc)(unsigned int *aux_id);
* @param aux_msg A buffer where a formatted message should be written.
* @param aux_msg_len The size of the buffer.
*/
typedef
void
(
*
git_win32__stack__aux_cb_lookup
)(
unsigned
int
aux_id
,
char
*
aux_msg
,
unsigned
in
t
aux_msg_len
);
typedef
void
(
*
git_win32__stack__aux_cb_lookup
)(
unsigned
int
aux_id
,
char
*
aux_msg
,
size_
t
aux_msg_len
);
/**
* Register an "aux" data provider to augment our C stacktrace data.
...
...
@@ -116,7 +116,7 @@ int git_win32__stack_compare(
* @param suffix String written after each frame; defaults to "\n".
*/
int
git_win32__stack_format
(
char
*
pbuf
,
in
t
buf_len
,
char
*
pbuf
,
size_
t
buf_len
,
const
git_win32__stack__raw_data
*
pdata
,
const
char
*
prefix
,
const
char
*
suffix
);
...
...
@@ -132,7 +132,7 @@ int git_win32__stack_format(
* @param suffix String written after each frame; defaults to "\n".
*/
int
git_win32__stack
(
char
*
pbuf
,
in
t
buf_len
,
char
*
pbuf
,
size_
t
buf_len
,
int
skip
,
const
char
*
prefix
,
const
char
*
suffix
);
...
...
This diff is collapsed.
Click to expand it.
tests/clar.c
View file @
398412cc
...
...
@@ -96,7 +96,7 @@ fixture_path(const char *base, const char *fixture_name);
struct
clar_error
{
const
char
*
file
;
in
t
line_number
;
size_
t
line_number
;
const
char
*
error_msg
;
char
*
description
;
...
...
@@ -589,7 +589,7 @@ void clar__skip(void)
void
clar__fail
(
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
error_msg
,
const
char
*
description
,
int
should_abort
)
...
...
@@ -621,7 +621,7 @@ void clar__fail(
void
clar__assert
(
int
condition
,
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
error_msg
,
const
char
*
description
,
int
should_abort
)
...
...
@@ -634,7 +634,7 @@ void clar__assert(
void
clar__assert_equal
(
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
err
,
int
should_abort
,
const
char
*
fmt
,
...
...
This diff is collapsed.
Click to expand it.
tests/clar.h
View file @
398412cc
...
...
@@ -141,7 +141,7 @@ void clar__skip(void);
void
clar__fail
(
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
error
,
const
char
*
description
,
int
should_abort
);
...
...
@@ -149,14 +149,14 @@ void clar__fail(
void
clar__assert
(
int
condition
,
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
error
,
const
char
*
description
,
int
should_abort
);
void
clar__assert_equal
(
const
char
*
file
,
in
t
line
,
size_
t
line
,
const
char
*
err
,
int
should_abort
,
const
char
*
fmt
,
...
...
This diff is collapsed.
Click to expand it.
tests/clar/print.h
View file @
398412cc
...
...
@@ -20,7 +20,7 @@ static void clar_print_error(int num, const struct clar_report *report, const st
{
printf
(
" %d) Failure:
\n
"
,
num
);
printf
(
"%s::%s [%s:%
d
]
\n
"
,
printf
(
"%s::%s [%s:%
"
PRIuZ
"
]
\n
"
,
report
->
suite
,
report
->
test
,
error
->
file
,
...
...
This diff is collapsed.
Click to expand it.
tests/trace/windows/stacktrace.c
View file @
398412cc
...
...
@@ -132,7 +132,7 @@ static void aux_cb_alloc__1(unsigned int *aux_id)
*
aux_id
=
aux_counter
++
;
}
static
void
aux_cb_lookup__1
(
unsigned
int
aux_id
,
char
*
aux_msg
,
unsigned
in
t
aux_msg_len
)
static
void
aux_cb_lookup__1
(
unsigned
int
aux_id
,
char
*
aux_msg
,
size_
t
aux_msg_len
)
{
p_snprintf
(
aux_msg
,
aux_msg_len
,
"
\t
QQ%08x
\n
"
,
aux_id
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment