comparison tableprint.c @ 11979:59f399926c12 libavcodec

tableprint: use the type name as-is for the functions' names. This drops one parameter from the functions' macros, and require structures to be typedeffed, but ensures that it is possible to map 1-to-1 the type to the function name.
author flameeyes
date Sun, 27 Jun 2010 12:20:39 +0000
parents 8ad2b8f20e6a
children
comparison
equal deleted inserted replaced
11978:db5c3a602ddd 11979:59f399926c12
22 22
23 #include <stdio.h> 23 #include <stdio.h>
24 #include <inttypes.h> 24 #include <inttypes.h>
25 #include "tableprint.h" 25 #include "tableprint.h"
26 26
27 WRITE_1D_FUNC(int8, int8_t, "%3"PRIi8, 15) 27 WRITE_1D_FUNC(int8_t, "%3"PRIi8, 15)
28 WRITE_1D_FUNC(uint8, uint8_t, "0x%02"PRIx8, 15) 28 WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15)
29 WRITE_1D_FUNC(uint16, uint16_t, "0x%08"PRIx16, 7) 29 WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7)
30 WRITE_1D_FUNC(uint32, uint32_t, "0x%08"PRIx32, 7) 30 WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7)
31 WRITE_1D_FUNC(float, float, "%.18e", 3) 31 WRITE_1D_FUNC(float, "%.18e", 3)
32 32
33 WRITE_2D_FUNC(int8, int8_t) 33 WRITE_2D_FUNC(int8_t)
34 WRITE_2D_FUNC(uint8, uint8_t) 34 WRITE_2D_FUNC(uint8_t)
35 WRITE_2D_FUNC(uint32, uint32_t) 35 WRITE_2D_FUNC(uint32_t)
36 WRITE_2D_FUNC(float, float) 36 WRITE_2D_FUNC(float)
37 37
38 void write_fileheader(void) { 38 void write_fileheader(void) {
39 printf("/* This file was generated by libavcodec/tableprint */\n"); 39 printf("/* This file was generated by libavcodec/tableprint */\n");
40 printf("#include <stdint.h>\n"); 40 printf("#include <stdint.h>\n");
41 } 41 }