@matheusbsbs / matheus-bagliano / commits / fef742c4ed
Fork 0

make sure enum object_type is signed

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>

Nicolas Pitre committed Feb 27, 2007 at 20:38 UTC fef742c4ed2be2b3b72f510314b7b2f3a7a7d0a7
1 file changed +2 -1
cache.h
+2 -1
@@ -263,6 +263,7 @@ int safe_create_leading_directories(char *path);
263 char *enter_repo(char *path, int strict);
264
265 enum object_type {
266 + OBJ_BAD = -1,
267 OBJ_NONE = 0,
268 OBJ_COMMIT = 1,
269 OBJ_TREE = 2,
@@ -271,7 +272,7 @@ enum object_type {
272 /* 5 for future expansion */
273 OBJ_OFS_DELTA = 6,
274 OBJ_REF_DELTA = 7,
274 - OBJ_BAD,
275 + OBJ_MAX,
276 };
277
278 /* Read and unpack a sha1 file into memory, write memory to a sha1 file */