commit - 5c860e2997733fa54f69d9b201bc1cf49a3f78b8
commit + 25783624d6d0848cf127e112e4b7648265a35ca4
blob - e8a9594dc6bfdc9057b7fabc1fcfcda43b0ea4af
blob + 0d03e126ff7964bff61f602b55e570eb2f97f80e
--- include/got_error.h
+++ include/got_error.h
};
const struct got_error * got_error(int code);
-const struct got_error *got_error_from_errno();
+const struct got_error *got_error_from_errno(void);
const struct got_error *got_ferror(FILE *, int);
blob - 1a90ea1636849c048da1dabbca508c93bf1c720c
blob + 0cc46638942f0cf3f2194553f0cf7bbf7fb47cef
--- lib/diff.c
+++ lib/diff.c
diff_entry_old_new(struct got_tree_entry *te1, struct got_tree_object *tree2,
struct got_repository *repo, FILE *outfile)
{
- const struct got_error *err;
struct got_tree_entry *te2;
- char hex[SHA1_DIGEST_STRING_LENGTH];
te2 = match_entry_by_name(te1, tree2);
if (te2 == NULL) {
diff_entry_new_old(struct got_tree_entry *te2, struct got_tree_object *tree1,
struct got_repository *repo, FILE *outfile)
{
- const struct got_error *err;
struct got_tree_entry *te1;
te1 = match_entry_by_name(te2, tree1);
blob - e7ec8e7d8d8c5b4d680c4939f2a9f8e1512fbe32
blob + 6190d26337bce49d510b0e369d605e9d98aab9ef
--- lib/object.c
+++ lib/object.c
const struct got_error *err;
struct got_zstream_buf zb;
char *buf;
- size_t len;
const size_t zbsize = 64;
size_t outlen, totlen;
- int i, ret;
+ int i;
buf = calloc(zbsize, sizeof(char));
if (buf == NULL)
free(obj);
}
-static int
-commit_object_valid(struct got_commit_object *commit)
-{
- int i;
- int n;
-
- if (commit == NULL)
- return 0;
-
- n = 0;
- for (i = 0; i < SHA1_DIGEST_LENGTH; i++) {
- if (commit->tree_id->sha1[i] == 0)
- n++;
- }
- if (n == SHA1_DIGEST_LENGTH)
- return 0;
-
- return 1;
-}
-
static const struct got_error *
parse_commit_object(struct got_commit_object **commit, char *buf, size_t len)
{
{
char *p = buf, *space;
const struct got_error *err = NULL;
- char hex[SHA1_DIGEST_STRING_LENGTH];
*te = calloc(1, sizeof(**te));
if (*te == NULL)
{
const struct got_error *err;
size_t remain = len;
- int nentries;
*tree = calloc(1, sizeof(**tree));
if (*tree == NULL)
const struct got_error *err = NULL;
size_t len;
uint8_t *p;
- int i, ret;
if (obj->flags & GOT_OBJ_FLAG_PACKED)
err = read_to_mem(&p, &len, f);
const struct got_error *err = NULL;
size_t len;
uint8_t *p;
- int i, ret;
if (obj->flags & GOT_OBJ_FLAG_PACKED)
err = read_to_mem(&p, &len, f);
blob - a10bec55ed58ab61e168b1b4c6314c9e31cf3d00
blob + 1c07f6346b919626ec160b7bcc0acfa4d83b5e21
--- lib/pack.c
+++ lib/pack.c
while (i < totobj) {
struct got_object_id *oid = &packidx->sorted_ids[i];
- uint32_t offset;
int cmp = got_object_id_cmp(id, oid);
if (cmp == 0)
static void
cache_packidx(struct got_packidx_v2_hdr *packidx, struct got_repository *repo)
{
- struct got_packidx_v2_hdr *p;
int i;
for (i = 0; i < nitems(repo->packidx_cache); i++) {
char *path_packdir;
char hex[SHA1_DIGEST_STRING_LENGTH];
char *sha1str;
- char *path_packidx;
- *path_packfile = NULL;
-
path_packdir = got_repo_get_path_objects_pack(repo);
if (path_packdir == NULL)
return got_error(GOT_ERR_NO_MEM);
int delta_type, size_t delta_size)
{
const struct got_error *err = NULL;
- struct got_object_id base_id;
- uint8_t base_type;
int resolved_type;
- uint64_t base_size;
- size_t base_tslen;
*obj = calloc(1, sizeof(**obj));
if (*obj == NULL)
blob - 9f0d7007ce89105d2222d28c50ae1edf94c03821
blob + 2359a13f176985e5b421c4923d26b0de468bc6c5
--- lib/path.c
+++ lib/path.c
const struct got_error *
got_path_segment_count(int *count, const char *path)
{
- int n = 0;
char *s = strdup(path), *p;
*count = 0;
got_opentemp_named(char **path, FILE **outfile, const char *basepath)
{
const struct got_error *err = NULL;
- int fd, ret;
+ int fd;
if (asprintf(path, "%s-XXXXXX", basepath) == -1) {
*path = NULL;
blob - 3064e1cfe326c7f47a7e0ab1fbe97b1eb62125c2
blob + 4a5ef20dd3967be4acf3dea7bc45f06864a9f48f
--- lib/refs.c
+++ lib/refs.c
const struct got_error *err = NULL;
char *path_ref = NULL;
char *normpath = NULL;
- const char *parent_dir;
char *path_refs = get_refs_dir_path(repo, refname);
if (path_refs == NULL) {
got_ref_dup(struct got_reference *ref)
{
struct got_reference *ret;
- char *name = NULL;
- char *symref = NULL;
ret = calloc(1, sizeof(*ret));
if (ret == NULL)
blob - c75207647a9046ebd37a9653eb4955f10606106d
blob + dcdf5a7af79f2a7ba05e0da2f7131c5e2623d3d0
--- lib/zbuf.c
+++ lib/zbuf.c
const struct got_error *err;
size_t avail;
struct got_zstream_buf zb;
- void *newbuf;
err = got_inflate_init(&zb, 8192);
if (err)
blob - dd454247623767c4d4e65c09c9a876123e36a53f
blob + 0967da59d3efc2b30daf05e0861d351d6bb80739
--- regress/delta/Makefile
+++ regress/delta/Makefile
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lz
DEBUG = -O0 -g
-CFLAGS += -Werror
+CFLAGS = -Werror -Wall -Wstrict-prototypes -Wunused-variable
NOMAN = yes
blob - bba0a308884833e6516a3bc570e9b0c592f98cdf
blob + c54c110488ee7bfb95da2e619b614cc2fa6a8248
--- regress/repository/Makefile
+++ regress/repository/Makefile
CPPFLAGS = -I${.CURDIR}/../../include
LDADD = -lutil -lz
DEBUG = -O0 -g
-CFLAGS += -Werror
+CFLAGS = -Werror -Wall -Wstrict-prototypes -Wunused-variable
NOMAN = yes
blob - 475cdbc31e78afeb06d3c0758cf5cbe0e371040a
blob + 1d2959d7c776ea9687febe894c1e1a9805064b2a
--- regress/repository/repository_test.c
+++ regress/repository/repository_test.c
struct got_object_id *id;
struct got_object *obj;
char *buf;
- int ret;
err = got_repo_open(&repo, repo_path);
if (err != NULL || repo == NULL)
const struct got_error *err;
struct got_repository *repo;
struct got_object *obj;
- int i;
- size_t len;
err = got_repo_open(&repo, repo_path);
if (err != NULL || repo == NULL)
struct got_object *obj2;
struct got_blob_object *blob1;
struct got_blob_object *blob2;
- int i;
- size_t len;
FILE *outfile;
err = got_repo_open(&repo, repo_path);
struct got_object *obj2;
struct got_tree_object *tree1;
struct got_tree_object *tree2;
- int i;
- size_t len;
FILE *outfile;
err = got_repo_open(&repo, repo_path);
int test_ok = 0, failure = 0;
const char *repo_path;
int ch;
- int vflag = 0;
while ((ch = getopt(argc, argv, "v")) != -1) {
switch (ch) {
blob - cb4b123622c451543c9a1a62b6027745ccc179d7
blob + 75af81c5114375f5d995ed0fe39294e659f228f4
--- regress/worktree/Makefile
+++ regress/worktree/Makefile
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz
DEBUG = -O0 -g
-CFLAGS += -Werror
+CFLAGS = -Werror -Wall -Wstrict-prototypes -Wunused-variable
NOMAN = yes