{"thread":{"id":"12741","subject":"[PATCH] (tig) Fix signed char comparison where char is unsigned by default.","startedAt":"2008-03-18T08:47:43Z","lastAt":"2008-03-18T08:47:43Z","messageCount":1,"participants":["Russell Steicke"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72349","messageId":"20080318084743.GA16827@maggie.localnet","threadId":"12741","inReplyTo":null,"subject":"[PATCH] (tig) Fix signed char comparison where char is unsigned by default.","fromName":"Russell Steicke","fromEmail":"russellsteicke@gmail.com","sentAt":"2008-03-18T08:47:43Z","receivedAt":"2008-03-18T08:47:43Z","isPatch":true,"sender":{"key":"russellsteicke@gmail.com","avatar":null},"body":"tig uses a char as a flag, and expects that to have three\nvalues: TRUE, FALSE, and -1.  When char is unsigned char (such\nas on PPC), this fails with the compiler warning \"comparison is\nalways false due to limited range of data type\".\n\nSo explicitly make the flag a signed char.\n\nDetecting the int8_t type with the autoconf macro\nAC_CREATE_STDINT_H would probably be a better fix.\n\nSigned-off-by: Russell Steicke <russellsteicke@gmail.com>\n---\n tig.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/tig.c b/tig.c\nindex 89a4c5d..448ce20 100644\n--- a/tig.c\n+++ b/tig.c\n@@ -434,7 +434,7 @@ static iconv_t opt_iconv\t\t= ICONV_NONE;\n static char opt_search[SIZEOF_STR]\t= \"\";\n static char opt_cdup[SIZEOF_STR]\t= \"\";\n static char opt_git_dir[SIZEOF_STR]\t= \"\";\n-static char opt_is_inside_work_tree\t= -1; /* set to TRUE or FALSE */\n+static signed char opt_is_inside_work_tree\t= -1; /* set to TRUE or FALSE */\n static char opt_editor[SIZEOF_STR]\t= \"\";\n \n enum option_type {\n-- \n1.5.4.4\n\n\n-- \nRussell Steicke\n\n-- Fortune says:\nEverything I like is either illegal, immoral or fattening.\n\t\t-- Alexander Woollcott\n"}]}