Skip to content

Commit

Permalink
git-tar-tree: no more void pointer arithmetic
Browse files Browse the repository at this point in the history
Noticed by Florian Forster: Use a char pointer when adding offsets,
because void pointer arithmetic is a GNU extension.   Const'ify the
function arguments while we're at it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Rene Scharfe authored and Junio C Hamano committed Jun 18, 2006
1 parent 9236cdd commit 6698060
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builtin-tar-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ static unsigned long offset;
static time_t archive_time;

/* tries hard to write, either succeeds or dies in the attempt */
static void reliable_write(void *buf, unsigned long size)
static void reliable_write(const void *data, unsigned long size)
{
const char *buf = data;

while (size > 0) {
long ret = xwrite(1, buf, size);
if (ret < 0) {
Expand Down Expand Up @@ -51,8 +53,9 @@ static void write_if_needed(void)
* queues up writes, so that all our write(2) calls write exactly one
* full block; pads writes to RECORDSIZE
*/
static void write_blocked(void *buf, unsigned long size)
static void write_blocked(const void *data, unsigned long size)
{
const char *buf = data;
unsigned long tail;

if (offset) {
Expand Down

0 comments on commit 6698060

Please sign in to comment.