class BitmapMeta(CTypeMeta):
- def __new__(metacls, name, bases, attrs, typedef="uint64_t", bits=0,
- **kwargs):
- cls = super().__new__(metacls, name, bases, attrs, typedef=typedef,
- **kwargs)
+ def __new__(metacls, name, bases, attrs,
+ typedef="uint64_t", bits=0, **kwargs):
+ cls = super().__new__(metacls, name, bases, attrs,
+ typedef=typedef, **kwargs)
cls.__bits = bits
return cls
yield from indent(indent(["break;"]))
yield "}"
- class Getter(metaclass=FieldsMappingMeta.GetterMeta, enum=cls,
- struct=struct):
+ class Getter(metaclass=FieldsMappingMeta.GetterMeta,
+ enum=cls, struct=struct):
def c_value(self, prefix="", suffix=""):
yield f"{prefix}{{"
yield from indent([
yield from indent(["return result;"])
yield f"}}{suffix}"
- class Setter(metaclass=FieldsMappingMeta.SetterMeta, enum=cls,
- struct=struct):
+ class Setter(metaclass=FieldsMappingMeta.SetterMeta,
+ enum=cls, struct=struct):
def c_value(self, prefix="", suffix=""):
yield f"{prefix}{{"
yield from indent([
yield ""
for cls in (Prefix, RM):
- for (mode, subcls) in {"get": cls.c_getter,
- "set": cls.c_setter}.items():
+ table = {
+ "get": cls.c_getter,
+ "set": cls.c_setter,
+ }
+ for (mode, subcls) in table.items():
yield subcls.__class__.c_var(name=f"svp64_{cls.__name__.lower()}_{mode}")
yield from subcls.c_value()
yield ""
if __name__ == "__main__":
parser = _argparse.ArgumentParser()
- parser.add_argument("codegen", type=Codegen, choices=Codegen,
- help="code generator")
+ parser.add_argument("codegen",
+ type=Codegen, choices=Codegen,
+ help="code generator")
args = vars(parser.parse_args())
main(**args)