{"thread":{"id":"7003","subject":"[PATCH] make sure enum object_type is signed","startedAt":"2007-02-28T01:38:31Z","lastAt":"2007-02-28T01:38:31Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35751","messageId":"alpine.LRH.0.82.0702272028100.29426@xanadu.home","threadId":"7003","inReplyTo":null,"subject":"[PATCH] make sure enum object_type is signed","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-02-28T01:38:31Z","receivedAt":"2007-02-28T01:38:31Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"This allows for keeping the common idiom which consists of using \nnegative values to signal error conditions by ensuring that the enum \nwill be a signed type.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n---\n\nPer early discussion.\n\ndiff --git a/cache.h b/cache.h\nindex 0117b7e..ec72c0c 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -263,6 +263,7 @@ int safe_create_leading_directories(char *path);\n char *enter_repo(char *path, int strict);\n \n enum object_type {\n+\tOBJ_BAD = -1,\n \tOBJ_NONE = 0,\n \tOBJ_COMMIT = 1,\n \tOBJ_TREE = 2,\n@@ -271,7 +272,7 @@ enum object_type {\n \t/* 5 for future expansion */\n \tOBJ_OFS_DELTA = 6,\n \tOBJ_REF_DELTA = 7,\n-\tOBJ_BAD,\n+\tOBJ_MAX,\n };\n \n /* Read and unpack a sha1 file into memory, write memory to a sha1 file */\n"}]}