diff options
-rwxr-xr-x | src/arch/isa_parser.py | 2 | ||||
-rw-r--r-- | src/arch/x86/isa/decoder/one_byte_opcodes.isa | 2 | ||||
-rw-r--r-- | src/base/stats/mysql.cc | 1 | ||||
-rw-r--r-- | util/style.py | 21 |
4 files changed, 14 insertions, 12 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 2db7c6aa6..bd45a8313 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -128,7 +128,7 @@ class ISAParser(Grammar): # Integer literal def t_INTLIT(self, t): - r'(0x[\da-fA-F]+)|\d+' + r'-?(0x[\da-fA-F]+)|\d+' try: t.value = int(t.value,0) except ValueError: diff --git a/src/arch/x86/isa/decoder/one_byte_opcodes.isa b/src/arch/x86/isa/decoder/one_byte_opcodes.isa index d6cfdc593..0225657c4 100644 --- a/src/arch/x86/isa/decoder/one_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/one_byte_opcodes.isa @@ -419,7 +419,7 @@ // extend it, and there's no easy way to specify only checking // the first byte. 0x5: decode IMMEDIATE { - 0xffffffffffffff80: + -0x80: SyscallInst::int80('xc->syscall(Rax)', IsSyscall); default: int_Ib(); } diff --git a/src/base/stats/mysql.cc b/src/base/stats/mysql.cc index 1e3ab0f84..cfac9a226 100644 --- a/src/base/stats/mysql.cc +++ b/src/base/stats/mysql.cc @@ -29,6 +29,7 @@ */ #include <cassert> +#include <cstdio> #include <map> #include <sstream> #include <string> diff --git a/util/style.py b/util/style.py index 2c2714f0c..606d5984b 100644 --- a/util/style.py +++ b/util/style.py @@ -65,7 +65,7 @@ def whitespace_file(filename): if filename.startswith("SCons"): return True - return True + return False format_types = ( 'C', 'C++' ) def format_file(filename): @@ -77,11 +77,11 @@ def format_file(filename): def checkwhite_line(line): match = lead.search(line) if match and match.group(1).find('\t') != -1: - return True + return False match = trail.search(line) if match: - return True + return False return True @@ -275,15 +275,15 @@ def do_check_whitespace(ui, repo, *files, **args): if args.get('auto', False): result = 'f' else: - result = ui.prompt("(a)bort, (i)gnore, or (f)ix?", "^[aif]$", "a") + while True: + result = ui.prompt("(a)bort, (i)gnore, or (f)ix?", default='a') + if result in 'aif': + break + if result == 'a': return True - elif result == 'i': - pass elif result == 'f': fixwhite(repo.wjoin(name), args['tabsize'], fixonly) - else: - raise util.Abort(_("Invalid response: '%s'") % result) return False @@ -326,7 +326,8 @@ def do_check_whitespace(ui, repo, *files, **args): mod_lines = modified_lines(pctx[0].data(), file_data, len(lines)) if len(pctx) == 2: m2 = modified_lines(pctx[1].data(), file_data, len(lines)) - mod_lines = mod_lines & m2 # only the lines that are new in both + # only the lines that are new in both + mod_lines = mod_lines & m2 else: mod_lines = xrange(0, len(lines)) @@ -353,7 +354,7 @@ def check_whitespace(ui, repo, hooktype, node, parent1, parent2, **kwargs): "This hook is only meant for pretxncommit, not %s" % hooktype args = { 'tabsize' : 8 } - do_check_whitespace(ui, repo, **args) + return do_check_whitespace(ui, repo, **args) def check_format(ui, repo, hooktype, node, parent1, parent2, **kwargs): if hooktype != 'pretxncommit': |