Skip to content

Commit

Permalink
make sure enum object_type is signed
Browse files Browse the repository at this point in the history
This allows for keeping the common idiom which consists of using
negative values to signal error conditions by ensuring that the enum
will be a signed type.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Feb 28, 2007
1 parent 0ab1795 commit fef742c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ int safe_create_leading_directories(char *path);
char *enter_repo(char *path, int strict);

enum object_type {
OBJ_BAD = -1,
OBJ_NONE = 0,
OBJ_COMMIT = 1,
OBJ_TREE = 2,
Expand All @@ -271,7 +272,7 @@ enum object_type {
/* 5 for future expansion */
OBJ_OFS_DELTA = 6,
OBJ_REF_DELTA = 7,
OBJ_BAD,
OBJ_MAX,
};

/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
Expand Down

0 comments on commit fef742c

Please sign in to comment.