mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 22:55:47 +00:00
commit
3f3f6225f8
@ -61,6 +61,7 @@ ok Pierre Habouzit <madcoder@debian.org>
|
|||||||
ok Pieter de Bie <pdebie@ai.rug.nl>
|
ok Pieter de Bie <pdebie@ai.rug.nl>
|
||||||
ok René Scharfe <rene.scharfe@lsrfire.ath.cx>
|
ok René Scharfe <rene.scharfe@lsrfire.ath.cx>
|
||||||
ign Robert Shearman <rob@codeweavers.com> (imap-send)
|
ign Robert Shearman <rob@codeweavers.com> (imap-send)
|
||||||
|
ok Sebastian Schuberth <sschuberth@gmail.com>
|
||||||
ok Shawn O. Pearce <spearce@spearce.org>
|
ok Shawn O. Pearce <spearce@spearce.org>
|
||||||
ok Steffen Prohaska <prohaska@zib.de>
|
ok Steffen Prohaska <prohaska@zib.de>
|
||||||
ok Sven Verdoolaege <skimo@kotnet.org>
|
ok Sven Verdoolaege <skimo@kotnet.org>
|
||||||
|
@ -106,7 +106,7 @@ GIT_EXTERN(const void *) git_blob_rawcontent(git_blob *blob);
|
|||||||
* @param blob pointer to the blob
|
* @param blob pointer to the blob
|
||||||
* @return size on bytes
|
* @return size on bytes
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_blob_rawsize(git_blob *blob);
|
GIT_EXTERN(size_t) git_blob_rawsize(git_blob *blob);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a file from the working folder of a repository
|
* Read a file from the working folder of a repository
|
||||||
|
@ -36,7 +36,7 @@ const void *git_blob_rawcontent(git_blob *blob)
|
|||||||
return blob->odb_object->raw.data;
|
return blob->odb_object->raw.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_blob_rawsize(git_blob *blob)
|
size_t git_blob_rawsize(git_blob *blob)
|
||||||
{
|
{
|
||||||
assert(blob);
|
assert(blob);
|
||||||
return blob->odb_object->raw.len;
|
return blob->odb_object->raw.len;
|
||||||
|
@ -135,7 +135,7 @@ static int cvar_match_section(const char *local, const char *input)
|
|||||||
{
|
{
|
||||||
char *first_dot;
|
char *first_dot;
|
||||||
char *local_sp = strchr(local, ' ');
|
char *local_sp = strchr(local, ' ');
|
||||||
int comparison_len;
|
size_t comparison_len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the local section name doesn't contain a space, then we can
|
* If the local section name doesn't contain a space, then we can
|
||||||
@ -198,7 +198,8 @@ static int cvar_normalize_name(cvar_t *var, char **output)
|
|||||||
{
|
{
|
||||||
char *section_sp = strchr(var->section, ' ');
|
char *section_sp = strchr(var->section, ' ');
|
||||||
char *quote, *name;
|
char *quote, *name;
|
||||||
int len, ret;
|
size_t len;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The final string is going to be at most one char longer than
|
* The final string is going to be at most one char longer than
|
||||||
@ -245,7 +246,7 @@ static int cvar_normalize_name(cvar_t *var, char **output)
|
|||||||
static char *interiorize_section(const char *orig)
|
static char *interiorize_section(const char *orig)
|
||||||
{
|
{
|
||||||
char *dot, *last_dot, *section, *ret;
|
char *dot, *last_dot, *section, *ret;
|
||||||
int len;
|
size_t len;
|
||||||
|
|
||||||
dot = strchr(orig, '.');
|
dot = strchr(orig, '.');
|
||||||
last_dot = strrchr(orig, '.');
|
last_dot = strrchr(orig, '.');
|
||||||
@ -530,7 +531,7 @@ static char *cfg_readline(diskfile_backend *cfg)
|
|||||||
{
|
{
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
char *line_src, *line_end;
|
char *line_src, *line_end;
|
||||||
int line_len;
|
size_t line_len;
|
||||||
|
|
||||||
line_src = cfg->reader.read_ptr;
|
line_src = cfg->reader.read_ptr;
|
||||||
|
|
||||||
@ -600,7 +601,8 @@ GIT_INLINE(int) config_keychar(int c)
|
|||||||
|
|
||||||
static int parse_section_header_ext(const char *line, const char *base_name, char **section_name)
|
static int parse_section_header_ext(const char *line, const char *base_name, char **section_name)
|
||||||
{
|
{
|
||||||
int buf_len, total_len, pos, rpos;
|
size_t buf_len, total_len;
|
||||||
|
int pos, rpos;
|
||||||
int c, ret;
|
int c, ret;
|
||||||
char *subsection, *first_quote, *last_quote;
|
char *subsection, *first_quote, *last_quote;
|
||||||
int error = GIT_SUCCESS;
|
int error = GIT_SUCCESS;
|
||||||
@ -1100,7 +1102,8 @@ static int is_multiline_var(const char *str)
|
|||||||
static int parse_multiline_variable(diskfile_backend *cfg, const char *first, char **out)
|
static int parse_multiline_variable(diskfile_backend *cfg, const char *first, char **out)
|
||||||
{
|
{
|
||||||
char *line = NULL, *end;
|
char *line = NULL, *end;
|
||||||
int error = GIT_SUCCESS, len, ret;
|
int error = GIT_SUCCESS, ret;
|
||||||
|
size_t len;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
/* Check that the next line exists */
|
/* Check that the next line exists */
|
||||||
|
@ -116,19 +116,19 @@ static int write_deflate(git_filebuf *file, void *source, size_t len)
|
|||||||
z_stream *zs = &file->zs;
|
z_stream *zs = &file->zs;
|
||||||
|
|
||||||
if (len > 0 || file->flush_mode == Z_FINISH) {
|
if (len > 0 || file->flush_mode == Z_FINISH) {
|
||||||
zs->next_in = (void *)source;
|
zs->next_in = source;
|
||||||
zs->avail_in = len;
|
zs->avail_in = (uInt)len;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int have;
|
size_t have;
|
||||||
|
|
||||||
zs->next_out = file->z_buf;
|
zs->next_out = file->z_buf;
|
||||||
zs->avail_out = file->buf_size;
|
zs->avail_out = (uInt)file->buf_size;
|
||||||
|
|
||||||
result = deflate(zs, file->flush_mode);
|
result = deflate(zs, file->flush_mode);
|
||||||
assert(result != Z_STREAM_ERROR);
|
assert(result != Z_STREAM_ERROR);
|
||||||
|
|
||||||
have = file->buf_size - zs->avail_out;
|
have = file->buf_size - (size_t)zs->avail_out;
|
||||||
|
|
||||||
if (p_write(file->fd, file->z_buf, have) < GIT_SUCCESS)
|
if (p_write(file->fd, file->z_buf, have) < GIT_SUCCESS)
|
||||||
return git__throw(GIT_EOSERR, "Failed to write to file");
|
return git__throw(GIT_EOSERR, "Failed to write to file");
|
||||||
|
@ -99,7 +99,7 @@ static int cache_cmp(const void *a, const void *b)
|
|||||||
int git_indexer_new(git_indexer **out, const char *packname)
|
int git_indexer_new(git_indexer **out, const char *packname)
|
||||||
{
|
{
|
||||||
git_indexer *idx;
|
git_indexer *idx;
|
||||||
unsigned int namelen;
|
size_t namelen;
|
||||||
int ret, error;
|
int ret, error;
|
||||||
|
|
||||||
assert(out && packname);
|
assert(out && packname);
|
||||||
@ -186,7 +186,8 @@ static void index_path(char *path, git_indexer *idx)
|
|||||||
int git_indexer_write(git_indexer *idx)
|
int git_indexer_write(git_indexer *idx)
|
||||||
{
|
{
|
||||||
git_mwindow *w = NULL;
|
git_mwindow *w = NULL;
|
||||||
int error, namelen;
|
int error;
|
||||||
|
size_t namelen;
|
||||||
unsigned int i, long_offsets = 0, left;
|
unsigned int i, long_offsets = 0, left;
|
||||||
struct git_pack_idx_header hdr;
|
struct git_pack_idx_header hdr;
|
||||||
char filename[GIT_PATH_MAX];
|
char filename[GIT_PATH_MAX];
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
: 32 * 1024 * 1024)
|
: 32 * 1024 * 1024)
|
||||||
|
|
||||||
#define DEFAULT_MAPPED_LIMIT \
|
#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
|
* We need this because each process is only allowed a specific amount
|
||||||
|
@ -183,19 +183,19 @@ static void init_stream(z_stream *s, void *out, size_t len)
|
|||||||
{
|
{
|
||||||
memset(s, 0, sizeof(*s));
|
memset(s, 0, sizeof(*s));
|
||||||
s->next_out = out;
|
s->next_out = out;
|
||||||
s->avail_out = len;
|
s->avail_out = (uInt)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_stream_input(z_stream *s, void *in, size_t len)
|
static void set_stream_input(z_stream *s, void *in, size_t len)
|
||||||
{
|
{
|
||||||
s->next_in = in;
|
s->next_in = in;
|
||||||
s->avail_in = len;
|
s->avail_in = (uInt)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_stream_output(z_stream *s, void *out, size_t len)
|
static void set_stream_output(z_stream *s, void *out, size_t len)
|
||||||
{
|
{
|
||||||
s->next_out = out;
|
s->next_out = out;
|
||||||
s->avail_out = len;
|
s->avail_out = (uInt)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -243,10 +243,10 @@ static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen)
|
|||||||
memset(&zs, 0x0, sizeof(zs));
|
memset(&zs, 0x0, sizeof(zs));
|
||||||
|
|
||||||
zs.next_out = out;
|
zs.next_out = out;
|
||||||
zs.avail_out = outlen;
|
zs.avail_out = (uInt)outlen;
|
||||||
|
|
||||||
zs.next_in = in;
|
zs.next_in = in;
|
||||||
zs.avail_in = inlen;
|
zs.avail_in = (uInt)inlen;
|
||||||
|
|
||||||
if (inflateInit(&zs) < Z_OK)
|
if (inflateInit(&zs) < Z_OK)
|
||||||
return git__throw(GIT_ERROR, "Failed to inflate buffer");
|
return git__throw(GIT_ERROR, "Failed to inflate buffer");
|
||||||
|
@ -404,7 +404,7 @@ int packfile_unpack_compressed(
|
|||||||
|
|
||||||
memset(&stream, 0, sizeof(stream));
|
memset(&stream, 0, sizeof(stream));
|
||||||
stream.next_out = buffer;
|
stream.next_out = buffer;
|
||||||
stream.avail_out = size + 1;
|
stream.avail_out = (uInt)size + 1;
|
||||||
|
|
||||||
st = inflateInit(&stream);
|
st = inflateInit(&stream);
|
||||||
if (st != Z_OK) {
|
if (st != Z_OK) {
|
||||||
|
@ -118,9 +118,9 @@ Return:
|
|||||||
return GIT_SUCCESS;
|
return GIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void git__strntolower(char *str, int len)
|
void git__strntolower(char *str, size_t len)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < len; ++i) {
|
for (i = 0; i < len; ++i) {
|
||||||
str[i] = (char) tolower(str[i]);
|
str[i] = (char) tolower(str[i]);
|
||||||
|
@ -90,7 +90,7 @@ GIT_INLINE(int) git__is_sizet(git_off_t p)
|
|||||||
|
|
||||||
extern char *git__strtok(char **end, const char *sep);
|
extern char *git__strtok(char **end, const char *sep);
|
||||||
|
|
||||||
extern void git__strntolower(char *str, int len);
|
extern void git__strntolower(char *str, size_t len);
|
||||||
extern void git__strtolower(char *str);
|
extern void git__strtolower(char *str);
|
||||||
|
|
||||||
extern int git__fnmatch(const char *pattern, const char *name, int flags);
|
extern int git__fnmatch(const char *pattern, const char *name, int flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user