tablegen: implement and use WRITE_ARRAY macros

Two macros (WRITE_ARRAY and WRITE_ARRAY_2D) take the prefix (modifiers)
(not all tables are static, and they might not be constant either), the
type, and the name of the array. It'll be copied with same name and type,
and with the correct size of the currently-defined object.

Originally committed as revision 23821 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Diego Pettenò
2010-06-27 12:21:12 +00:00
parent ac014798ff
commit 350120d269
6 changed files with 35 additions and 54 deletions

View File

@@ -32,13 +32,8 @@ int main(void)
write_fileheader();
printf("static const uint8_t linear_to_alaw[1 << 14] = {\n");
write_uint8_t_array(linear_to_alaw, 1 << 14);
printf("};\n");
printf("static const uint8_t linear_to_ulaw[1 << 14] = {\n");
write_uint8_t_array(linear_to_ulaw, 1 << 14);
printf("};\n");
WRITE_ARRAY("static const", uint8_t, linear_to_alaw);
WRITE_ARRAY("static const", uint8_t, linear_to_ulaw);
return 0;
}