-#!/usr/bin/env python
+from __future__ import print_function
from mako.template import Template
from sys import argv
#include <stdint.h>
+#include "errors.h"
#include "format_unpack.h"
#include "format_utils.h"
#include "macros.h"
#include "util/format_rgb9e5.h"
-#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
+#include "util/format_r11g11b10f.h"
#include "util/format_srgb.h"
#define UNPACK(SRC, OFFSET, BITS) (((SRC) >> (OFFSET)) & MAX_UINT(BITS))
case ${f.name}:
for (i = 0; i < n; ++i) {
unpack_float_${f.short_name()}(s, dst[i]);
- s += ${f.block_size() / 8};
+ s += ${f.block_size() // 8};
}
break;
%endfor
case ${f.name}:
for (i = 0; i < n; ++i) {
unpack_ubyte_${f.short_name()}(s, dst[i]);
- s += ${f.block_size() / 8};
+ s += ${f.block_size() // 8};
}
break;
%endfor
case ${f.name}:
for (i = 0; i < n; ++i) {
unpack_int_${f.short_name()}(s, dst[i]);
- s += ${f.block_size() / 8};
+ s += ${f.block_size() // 8};
}
break;
%endfor
}
"""
-template = Template(string);
+template = Template(string, future_imports=['division']);
-print template.render(argv = argv[0:])
+print(template.render(argv = argv[0:]))