(self, start, end)
return c_code
makes an c array from data used by copy as c code
makes an c array from data used by copy as c code
makes an c array from data used by copy as c code
def make_c_array(self, start, end):
        """ makes an c array from data used by copy as c code
        """
        c_code = '// generated by dwarf\nunsigned char rawData[{0}] = '.format(
            end - start)
        c_code += '{\n\t'

        for i in range(start, end):
            if (i - start) and ((i - start) % 12 == 0):
                c_code = c_code[0:-1]  # remove last space
                c_code += '\n\t'  # next line

            if self._hex_style == 'upper':
                c_code += '0x{0:02X}, '.format(self.data[i])
            else:
                c_code += '0x{0:02x}, '.format(self.data[i])

        # remove last ', '
        c_code = c_code[0:-2]
        c_code += '\n};'

        return c_code
def make_c_array ( self , start , end ) : c_code = '// generated by dwarf\nunsigned char rawData[{0}] = ' . format ( end - start ) c_code += '{\n\t' for i in range ( start , end ) : if ( i - start ) and ( ( i - start ) % 12 == 0 ) : c_code = c_code [ 0 : - 1 ] # remove last space c_code += '\n\t' # next line if self . _hex_style == 'upper' : c_code += '0x{0:02X}, ' . format ( self . data [ i ] ) else : c_code += '0x{0:02x}, ' . format ( self . data [ i ] ) # remove last ', ' c_code = c_code [ 0 : - 2 ] c_code += '\n};' return c_code