diff options
author | Lionel Landwerlin <[email protected]> | 2018-07-28 14:27:49 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-08-04 09:40:14 +0100 |
commit | 87a3c9778138a5d8b930c92cfe2feefb2587cd61 (patch) | |
tree | be9e49fdf8ccedbf89a395d435d83f8d1e3593c4 /src/intel/tools | |
parent | 02ebc064eaad850766cdda06ae41626aadc7d444 (diff) |
intel: aubinator: simplify decoding
Since we don't support streaming an aub file, we can drop the decoding
status enum.
v2: include stdbool (Eric)
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/intel/tools')
-rw-r--r-- | src/intel/tools/aubinator.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index 3fec04c24c4..9a3b1d1ef1d 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <stdbool.h> #include <getopt.h> #include <unistd.h> @@ -712,13 +713,7 @@ aub_file_open(const char *filename) #define MAKE_GEN(major, minor) ( ((major) << 8) | (minor) ) -enum { - AUB_ITEM_DECODE_OK, - AUB_ITEM_DECODE_FAILED, - AUB_ITEM_DECODE_NEED_MORE_DATA, -}; - -static int +static bool aub_file_decode_batch(struct aub_file *file) { uint32_t *p, h, *new_cursor; @@ -741,7 +736,7 @@ aub_file_decode_batch(struct aub_file *file) fprintf(outfile, "unknown opcode %d at %td/%td\n", OPCODE(h), file->cursor - file->map, file->end - file->map); - return AUB_ITEM_DECODE_FAILED; + return false; } new_cursor = p + header_length + bias; @@ -782,7 +777,7 @@ aub_file_decode_batch(struct aub_file *file) } file->cursor = new_cursor; - return AUB_ITEM_DECODE_OK; + return true; } static int @@ -914,7 +909,7 @@ int main(int argc, char *argv[]) file = aub_file_open(input_file); while (aub_file_more_stuff(file) && - aub_file_decode_batch(file) == AUB_ITEM_DECODE_OK); + aub_file_decode_batch(file)); fflush(stdout); /* close the stdout which is opened to write the output */ |