diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2009-11-07 15:33:10 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2009-11-07 15:33:10 +0000 |
commit | 4191ef0a93b880436b72d8e9e869defbecf34542 (patch) | |
tree | e0cad032e7365a23954f6eaf303f2e627e0fc9d4 /maskaudit.py | |
parent | e6adb858218a6f609c0f643df69bbc3a75a18424 (diff) | |
download | gpsd-4191ef0a93b880436b72d8e9e869defbecf34542.tar.gz |
whitespace, and fix the printing of empty masks
Diffstat (limited to 'maskaudit.py')
-rwxr-xr-x | maskaudit.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/maskaudit.py b/maskaudit.py index adc6231a..f64b0805 100755 --- a/maskaudit.py +++ b/maskaudit.py @@ -73,26 +73,26 @@ const char *gpsd_maskdump(gps_mask_t set) { static char buf[%d]; const struct { - gps_mask_t mask; - const char *name; + gps_mask_t mask; + const char *name; } *sp, names[] = {""" % (maxout + 3,) for (flag, value) in source.primitive_masks: stem = flag if stem.endswith("_SET"): stem = stem[:-4] - print " {%s,\t\"%s\"}," % (flag, stem) + print "\t{%s,\t\"%s\"}," % (flag, stem) print '''\ }; + bzero(buf, sizeof(buf)); buf[0] = '{'; - buf[1] = '\\0'; for (sp = names; sp < names + sizeof(names)/sizeof(names[0]); sp++) - if ((set & sp->mask)!=0) { - (void)strlcat(buf, sp->name, sizeof(buf)); - (void)strlcat(buf, "|", sizeof(buf)); - } - if (buf[0] != \'\\0\') - buf[strlen(buf)-1] = \'\\0\'; + if ((set & sp->mask)!=0) { + (void)strlcat(buf, sp->name, sizeof(buf)); + (void)strlcat(buf, "|", sizeof(buf)); + } + if (buf[1] != \'\\0\') + buf[strlen(buf)-1] = \'\\0\'; (void)strlcat(buf, "}", sizeof(buf)); return buf; } |