Skip to content
Snippets Groups Projects
Commit f4be252b authored by Martin Bauer's avatar Martin Bauer
Browse files

Removed unnecessary whitespaces from generated code

parent 53caa7e0
Branches
Tags
No related merge requests found
......@@ -161,8 +161,8 @@ class CBackend:
def _print_SympyAssignment(self, node):
if node.is_declaration:
data_type = "const " + str(node.lhs.dtype) + " " if node.is_const else str(node.lhs.dtype) + " "
return "%s %s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs),
self.sympy_printer.doprint(node.rhs))
return "%s%s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs),
self.sympy_printer.doprint(node.rhs))
else:
lhs_type = get_type_of_expression(node.lhs)
if type(lhs_type) is VectorType and node.lhs.func == cast_func:
......
......@@ -461,7 +461,12 @@ class PointerType(Type):
return (self.base_type, self.const, self.restrict) == (other.base_type, other.const, other.restrict)
def __str__(self):
return "%s *%s%s" % (self.base_type, " RESTRICT " if self.restrict else "", " const " if self.const else "")
components = [str(self.base_type), '*']
if self.restrict:
components.append('RESTRICT')
if self.const:
components.append("const")
return " ".join(components)
def __repr__(self):
return str(self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment