Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
oridb committed Jan 27, 2020
1 parent fe6beae commit 1a5dbff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
6 changes: 2 additions & 4 deletions fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "git.h"

typedef struct Ols Ols;

char *Eperm = "permission denied";
char *Eexist = "does not exist";
char *E2long = "path too long";
Expand Down Expand Up @@ -53,7 +51,7 @@ struct Gitaux {
int qdir;

/* For listing object dir */
Ols *ols;
Objlist *ols;
Object *olslast;
};

Expand Down Expand Up @@ -318,7 +316,7 @@ objgen(int i, Dir *d, void *p)
Object *o;
Crumb *c;
char name[64];
Ols *ols;
Objlist *ols;
Hash h;

aux = p;
Expand Down
10 changes: 5 additions & 5 deletions git.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct Pack Pack;
typedef struct Buf Buf;
typedef struct Dirent Dirent;
typedef struct Idxent Idxent;
typedef struct Ols Ols;
typedef struct Objlist Objlist;

enum {
/* 5k objects should be enough */
Expand Down Expand Up @@ -48,7 +48,7 @@ enum {
Cparsed = 1 << 5,
};

struct Ols {
struct Objlist {
int idx;

int fd;
Expand Down Expand Up @@ -217,9 +217,9 @@ int oshas(Objset *, Object *);
Object *osfind(Objset *, Hash);

/* object listing */
Ols *mkols(void);
int olsnext(Ols *, Hash *);
void olsfree(Ols *);
Objlist *mkols(void);
int olsnext(Objlist *, Hash *);
void olsfree(Objlist *);

/* util functions */
void *emalloc(ulong);
Expand Down
14 changes: 7 additions & 7 deletions ols.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endswith(char *n, char *s)
}

int
olsreadpacked(Ols *ols, Hash *h)
olsreadpacked(Objlist *ols, Hash *h)
{
char *p;
int i, j;
Expand Down Expand Up @@ -79,7 +79,7 @@ olsreadpacked(Ols *ols, Hash *h)


int
olsreadloose(Ols *ols, Hash *h)
olsreadloose(Objlist *ols, Hash *h)
{
char buf[64], *p;
int i, j, n;
Expand Down Expand Up @@ -122,12 +122,12 @@ olsreadloose(Ols *ols, Hash *h)
return -1;
}

Ols*
Objlist*
mkols(void)
{
Ols *ols;
Objlist *ols;

ols = emalloc(sizeof(Ols));
ols = emalloc(sizeof(Objlist));
if((ols->ntop = slurpdir(".git/objects", &ols->top)) == -1)
sysfatal("read top level: %r");
if((ols->npack = slurpdir(".git/objects/pack", &ols->pack)) == -1)
Expand All @@ -137,7 +137,7 @@ mkols(void)
}

void
olsfree(Ols *ols)
olsfree(Objlist *ols)
{
if(ols == nil)
return;
Expand All @@ -150,7 +150,7 @@ olsfree(Ols *ols)
}

int
olsnext(Ols *ols, Hash *h)
olsnext(Objlist *ols, Hash *h)
{
if(ols->stage == 0){
if(olsreadloose(ols, h) != -1){
Expand Down

0 comments on commit 1a5dbff

Please sign in to comment.