Re: [PATCH] Check SHA256 sum of git-$VER.tar.gz after downloading

2015-03-08 Thread John Keeping
On Sat, Mar 07, 2015 at 06:35:10PM -0500, Todd Zullinger wrote: John Keeping wrote: I still think we can't rely on `gpg --recv-keys` though, we would have to distribute the key with CGit and possible also do something to avoid importing it into the user's keyring by default. If the

[PATCH 02/13] Avoid non-ANSI function declarations

2015-03-08 Thread John Keeping
Sparse says things like: warning: non-ANSI function declaration of function 'calc_ttl' Signed-off-by: John Keeping j...@keeping.me.uk --- cgit.c| 2 +- filter.c | 2 +- ui-diff.c | 2 +- ui-refs.c | 4 ++-- ui-repolist.c | 6 +++--- ui-shared.c | 12

[PATCH 00/13] Fixes for problems detected by Sparse

2015-03-08 Thread John Keeping
Sparse[0] detects several potential problems in CGit, which are all fixed by this set of patches. Most of these are style issues that are correct either way (using integer zero as a NULL pointer), but I think there is value in keeping the build clean of Sparse warnings. [0]

[PATCH 01/13] Makefile: add a target to run CGit through sparse

2015-03-08 Thread John Keeping
Signed-off-by: John Keeping j...@keeping.me.uk --- Makefile | 3 +++ cgit.mk | 9 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed329e8..42ed230 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,9 @@ all:: cgit cgit:

[PATCH 13/13] html: avoid using a plain integer as a NULL pointer

2015-03-08 Thread John Keeping
Sparse complains about this table because we use the integer zero as the NULL pointer. Use this as an opportunity to reformat the table so that it always contains 8 elements per row, making it easier to see which values are being set and which are not. Signed-off-by: John Keeping

[PATCH 08/13] ui-shared: make cgit_doctype 'static'

2015-03-08 Thread John Keeping
This is not used outside this file and is not declared. Signed-off-by: John Keeping j...@keeping.me.uk --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 6d3cfa9..d4c4bb9 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -11,7 +11,7 @@

[PATCH 09/13] ui-stats: make cgit_period definitions 'static const'

2015-03-08 Thread John Keeping
These definitions should not be modified (and never are) so we can move them to .rodata. Signed-off-by: John Keeping j...@keeping.me.uk --- ui-stats.c | 14 +++--- ui-stats.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui-stats.c b/ui-stats.c index

[PATCH 10/13] ui-shared: avoid initializing static variable to zero

2015-03-08 Thread John Keeping
Sparse complains that we are using a plain integer as a NULL pointer here, but in fact we do not have to specify a value for this variable at all since it has static storage duration and thus will be initialized to NULL by the compiler. Signed-off-by: John Keeping j...@keeping.me.uk ---

[PATCH 12/13] cache: don't use an integer as a NULL pointer

2015-03-08 Thread John Keeping
Signed-off-by: John Keeping j...@keeping.me.uk --- cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.c b/cache.c index 900b161..cd99812 100644 --- a/cache.c +++ b/cache.c @@ -411,7 +411,7 @@ int cache_ls(const char *path) DIR *dir; struct dirent

[PATCH 07/13] ui-repolist: make sortcolumn definitions 'static const'

2015-03-08 Thread John Keeping
These are not used outside this file and are not declared; they are also never modified. Signed-off-by: John Keeping j...@keeping.me.uk --- ui-repolist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-repolist.c b/ui-repolist.c index a6d0321..2453a7f 100644 ---

[PATCH 03/13] Avoid signed bitfields

2015-03-08 Thread John Keeping
Bitfields are only defined for unsigned types. Detected by sparse. Signed-off-by: John Keeping j...@keeping.me.uk --- ui-blob.c | 4 ++-- ui-diff.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui-blob.c b/ui-blob.c index a025bca..388a017 100644 --- a/ui-blob.c +++

[PATCH 05/13] shared: make some variables 'static'

2015-03-08 Thread John Keeping
These are not used outside this file and are not declared. Signed-off-by: John Keeping j...@keeping.me.uk --- shared.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared.c b/shared.c index ae17d78..a99173b 100644 --- a/shared.c +++ b/shared.c @@ -284,8 +284,8 @@

[PATCH 04/13] scan-tree: make some variables 'static'

2015-03-08 Thread John Keeping
These are not used outside this file and are not declared. Signed-off-by: John Keeping j...@keeping.me.uk --- scan-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scan-tree.c b/scan-tree.c index e900ad9..8e3cf52 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -45,8