Commit 09df354e by Edward Thomson

odb_loose: HEADER_LEN -> MAX_HEADER_LEN

`MAX_HEADER_LEN` is a more descriptive constant name.
parent 909a1992
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "git2/types.h" #include "git2/types.h"
/* maximum possible header length */ /* maximum possible header length */
#define HEADER_LEN 64 #define MAX_HEADER_LEN 64
typedef struct { /* object header data */ typedef struct { /* object header data */
git_otype type; /* object type */ git_otype type; /* object type */
...@@ -37,7 +37,7 @@ typedef struct { ...@@ -37,7 +37,7 @@ typedef struct {
typedef struct { typedef struct {
git_odb_stream stream; git_odb_stream stream;
git_map map; git_map map;
char start[HEADER_LEN]; char start[MAX_HEADER_LEN];
size_t start_len; size_t start_len;
size_t start_read; size_t start_read;
git_zstream zstream; git_zstream zstream;
...@@ -273,7 +273,7 @@ done: ...@@ -273,7 +273,7 @@ done:
static int read_loose_standard(git_rawobj *out, git_buf *obj) static int read_loose_standard(git_rawobj *out, git_buf *obj)
{ {
git_zstream zstream = GIT_ZSTREAM_INIT; git_zstream zstream = GIT_ZSTREAM_INIT;
unsigned char head[HEADER_LEN], *body = NULL; unsigned char head[MAX_HEADER_LEN], *body = NULL;
size_t decompressed, head_len, body_len, alloc_size; size_t decompressed, head_len, body_len, alloc_size;
obj_hdr hdr; obj_hdr hdr;
int error; int error;
...@@ -387,7 +387,7 @@ static int read_header_loose_standard( ...@@ -387,7 +387,7 @@ static int read_header_loose_standard(
{ {
git_zstream zs = GIT_ZSTREAM_INIT; git_zstream zs = GIT_ZSTREAM_INIT;
obj_hdr hdr; obj_hdr hdr;
unsigned char inflated[HEADER_LEN]; unsigned char inflated[MAX_HEADER_LEN];
size_t header_len, inflated_len = sizeof(inflated); size_t header_len, inflated_len = sizeof(inflated);
int error; int error;
...@@ -822,7 +822,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe ...@@ -822,7 +822,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
{ {
loose_backend *backend; loose_backend *backend;
loose_writestream *stream = NULL; loose_writestream *stream = NULL;
char hdr[HEADER_LEN]; char hdr[MAX_HEADER_LEN];
git_buf tmp_path = GIT_BUF_INIT; git_buf tmp_path = GIT_BUF_INIT;
int hdrlen; int hdrlen;
...@@ -934,7 +934,7 @@ static int loose_backend__readstream_standard( ...@@ -934,7 +934,7 @@ static int loose_backend__readstream_standard(
obj_hdr *hdr, obj_hdr *hdr,
loose_readstream *stream) loose_readstream *stream)
{ {
unsigned char head[HEADER_LEN]; unsigned char head[MAX_HEADER_LEN];
size_t init, head_len; size_t init, head_len;
int error; int error;
...@@ -1038,7 +1038,7 @@ static int loose_backend__write(git_odb_backend *_backend, const git_oid *oid, c ...@@ -1038,7 +1038,7 @@ static int loose_backend__write(git_odb_backend *_backend, const git_oid *oid, c
{ {
int error = 0, header_len; int error = 0, header_len;
git_buf final_path = GIT_BUF_INIT; git_buf final_path = GIT_BUF_INIT;
char header[HEADER_LEN]; char header[MAX_HEADER_LEN];
git_filebuf fbuf = GIT_FILEBUF_INIT; git_filebuf fbuf = GIT_FILEBUF_INIT;
loose_backend *backend; loose_backend *backend;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment