summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2009-02-18 18:52:13 +0000
committerShawn O. Pearce <spearce@spearce.org>2009-03-17 18:59:26 -0700
commita9984a4e60291958a7cf0045758f47db3d214040 (patch)
tree42608eb49e4be32002462b51e86065368b342c05 /src/odb.c
parentfc3c3a2083e9f6f89e6bd53e9420e70d1e357c9b (diff)
downloadlibgit2-a9984a4e60291958a7cf0045758f47db3d214040.tar.gz
Fix some (digital-mars) compiler warnings
In particular, conditional expressions which contain an assignment statement, where the expression type is not explicitly made to be boolean, elicits the following message: warning 2: possible unintended assignment Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/odb.c b/src/odb.c
index f34fd002b..2ca59d57a 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -558,7 +558,7 @@ static int pack_openidx_v1(git_pack *p)
size_t expsz;
int j;
- if (!(im_fanout = git__malloc(sizeof(*im_fanout) * 256)))
+ if ((im_fanout = git__malloc(sizeof(*im_fanout) * 256)) == NULL)
return GIT_ERROR;
im_fanout[0] = decode32(&src_fanout[0]);
@@ -615,7 +615,7 @@ static int pack_openidx_v2(git_pack *p)
uint32_t *im_fanout;
int j;
- if (!(im_fanout = git__malloc(sizeof(*im_fanout) * 256)))
+ if ((im_fanout = git__malloc(sizeof(*im_fanout) * 256)) == NULL)
return GIT_ERROR;
im_fanout[0] = decode32(&src_fanout[0]);
@@ -751,11 +751,11 @@ static int scan_one_pack(void *state, char *name)
if (gitfo_exists(name))
return 0;
- if (!(r = git__malloc(sizeof(*r))))
+ if ((r = git__malloc(sizeof(*r))) == NULL)
return GIT_ERROR;
*d = '\0'; /* "pack-abc.pack" -_> "pack-abc" */
- if (!(r->pack = alloc_pack(s + 1))) {
+ if ((r->pack = alloc_pack(s + 1)) == NULL) {
free(r);
return GIT_ERROR;
}
@@ -811,7 +811,7 @@ static git_packlist *packlist_get(git_odb *db)
git_packlist *pl;
gitlck_lock(&db->lock);
- if ((pl = db->packlist))
+ if ((pl = db->packlist) != NULL)
pl->refcnt++;
else
pl = scan_packs(db);