Changeset 1882


Ignore:
Timestamp:
Jan 25, 2012, 4:34:38 PM (7 years ago)
Author:
ksherdy
Message:

Removed SEGMENT_BLOCKS as a global #define. Added int segment_blocks as a parameter to do_segments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r1865 r1882  
    579579                        return "#define " + pfx + "do_segment(" + parameters + ")\\\n do {" \
    580580                        + "\\\n" + self.indent(icount) + "  int i;" \
    581                         + "\\\n" + self.indent(icount) + "  for (i = 0; i < SEGMENT_BLOCKS; i++)" \
     581                        + "\\\n" + self.indent(icount) + "  for (i = 0; i < segment_blocks; i++)" \
    582582                        + "\\\n" + self.indent(icount) + "    " + pfx + "do_block(" + do_block_call_args + ");" \
    583583                        + "\\\n" + self.indent(icount + 2) + "} while (0)"
    584584                return self.indent(icount) + "void " + pfx + "do_segment(" + parameters + ") {" \
    585585                + "\n" + self.indent(icount) + "  int i;" \
    586                 + "\n" + self.indent(icount) + "  for (i = 0; i < SEGMENT_BLOCKS; i++)" \
     586                + "\n" + self.indent(icount) + "  for (i = 0; i < segment_blocks; i++)" \
    587587                + "\n" + self.indent(icount) + "    " + pfx + "do_block(" + do_block_call_args + ");" \
    588588                + "\n" + self.indent(icount + 2) + "}"
     
    627627                if self.use_C_syntax:
    628628                        #return ", ".join([self.type_name + " * " + + self.instance_name] + [upper1(p) + " " + lower1(p) + "[]" for p in parameters])
    629                         return ", ".join([lower1(self.type_name)] + [lower1(p) for p in parameters])
    630                 else: return ", ".join([upper1(p) + " " + lower1(p) + "[]" for p in parameters])
     629                        return ", ".join([lower1(self.type_name)] + [lower1(p) for p in parameters] + ["int segment_blocks"])
     630                else: return ", ".join([upper1(p) + " " + lower1(p) + "[]" for p in parameters] + ["int segment_blocks"])
    631631
    632632        def do_segment_args(self, parameters):
Note: See TracChangeset for help on using the changeset viewer.