summaryrefslogtreecommitdiff
path: root/src/mwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mwindow.c')
-rw-r--r--src/mwindow.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/src/mwindow.c b/src/mwindow.c
index cf2427349..c126fa2bd 100644
--- a/src/mwindow.c
+++ b/src/mwindow.c
@@ -1,26 +1,8 @@
/*
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
+ * Copyright (C) 2009-2011 the libgit2 contributors
*
- * In addition to the permissions in the GNU General Public License,
- * the authors give you unlimited permission to link the compiled
- * version of this file into combinations with other programs,
- * and to distribute those combinations without any restriction
- * coming from the use of this file. (The General Public License
- * restrictions do apply in other respects; for example, they cover
- * modification of the file, and distribution when not linked into
- * a combined executable.)
- *
- * This file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING. If not, write to
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
*/
#include "common.h"
@@ -31,11 +13,11 @@
#define DEFAULT_WINDOW_SIZE \
(sizeof(void*) >= 8 \
- ? 1 * 1024 * 1024 * 1024 \
+ ? 1 * 1024 * 1024 * 1024 \
: 32 * 1024 * 1024)
#define DEFAULT_MAPPED_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((1024 * 1024) * (sizeof(void*) >= 8 ? 8192ULL : 256UL))
/*
* We need this because each process is only allowed a specific amount
@@ -183,7 +165,7 @@ static git_mwindow *new_window(git_mwindow_file *mwf, git_file fd, git_off_t siz
ctl.mapped += (size_t)len;
while(ctl.mapped_limit < ctl.mapped &&
- git_mwindow_close_lru(mwf) == GIT_SUCCESS) {}
+ git_mwindow_close_lru(mwf) == GIT_SUCCESS) {}
/* FIXME: Shouldn't we error out if there's an error in closing lru? */
@@ -211,7 +193,7 @@ cleanup:
* enough space. Don't forget to add it to your list
*/
unsigned char *git_mwindow_open(git_mwindow_file *mwf, git_mwindow **cursor,
- git_off_t offset, int extra, unsigned int *left)
+ git_off_t offset, int extra, unsigned int *left)
{
git_mwindow *w = *cursor;
@@ -259,7 +241,7 @@ int git_mwindow_file_register(git_mwindow_file *mwf)
int error;
if (ctl.windowfiles.length == 0 &&
- (error = git_vector_init(&ctl.windowfiles, 8, NULL)) < GIT_SUCCESS)
+ (error = git_vector_init(&ctl.windowfiles, 8, NULL)) < GIT_SUCCESS)
return error;
return git_vector_insert(&ctl.windowfiles, mwf);