summaryrefslogtreecommitdiff
path: root/wrapinvert.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-22 13:40:02 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-22 13:40:02 +0000
commit93c4564e8ac992770faaef793163d6bb1bb1392e (patch)
treee72e1bf8e7d9d35970ea53c929ca17dc85e0ac5f /wrapinvert.py
parent2d90f82877e6d180e1debd4472bbac3083ea47ad (diff)
downloadgpsd-93c4564e8ac992770faaef793163d6bb1bb1392e.tar.gz
Added the bit-reversal machinery for big-endian machines.
Diffstat (limited to 'wrapinvert.py')
-rwxr-xr-xwrapinvert.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wrapinvert.py b/wrapinvert.py
index 93cf0bc8..65a56c31 100755
--- a/wrapinvert.py
+++ b/wrapinvert.py
@@ -1,13 +1,14 @@
#!/usr/bin/python
#
# Wrap bitfield references in rtcm.c in inversion macros.
+# FIXME: should be enhanced to replace macros already present
import sys, re, getopt
state = 0
ids = {}
-refmatch = "[a-z_]*->w[0-9]+\.%s" # Match a bitfield reference
+refmatch = "[a-z_]*->w[0-9]+\.%s(?![a-z_])" # Match a bitfield reference
(options, arguments) = getopt.getopt(sys.argv[1:], "l")
list = False;
@@ -64,6 +65,7 @@ while True:
# Do the actual substitutions
for key in keys:
m = re.compile(refmatch % key).search(line)
+ #sys.stderr.write("Looking for: %s\n" % refmatch % key)
if m:
line = line[:m.start(0)] + ids[key] + "(" + m.group(0) + ")" + line[m.end(0):]
if not list: