bench_libstl: adapt to API changes

This commit is contained in:
Hugues Delorme 2014-03-14 10:24:05 +01:00
parent 8540248028
commit 7879c50b98
2 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,7 @@
include(../../qmake/config.pri)
CONFIG -= build_all
*-g++*:QMAKE_CFLAGS += -ansi -pedantic-errors
TEMPLATE = app

View File

@ -1,6 +1,5 @@
#include <datax/libstl/stla_read.h>
#include <datax/libstl/stlb_read.h>
#include <datax/error.h>
#include <datax_core/error.h>
#include <datax_stl/stl_io.h>
#include "../commons/bench_tools.h"
#include <stdio.h>
@ -22,9 +21,11 @@ static void dummy_process_triangle(void* cookie,
static void libstl_foug_stlb_read(const char* filepath)
{
/* uint8_t stack_buff[30 * 1024]; */
my_igeom_t cookie;
foug_transfer_t trsf;
foug_stlb_geom_input_t geom;
foug_stl_geom_creator_t geom_creator;
int result;
FILE* file = fopen(filepath, "rb");
@ -34,16 +35,18 @@ static void libstl_foug_stlb_read(const char* filepath)
}
cookie.facet_count = 0;
memset(&geom, 0, sizeof(foug_stlb_geom_input_t));
geom.cookie = &cookie;
geom.process_triangle_func = (foug_stlb_process_triangle_func_t)dummy_process_triangle;
memset(&geom_creator, 0, sizeof(foug_stl_geom_creator_t));
geom_creator.cookie = &cookie;
geom_creator.add_triangle_func = dummy_process_triangle;
memset(&trsf, 0, sizeof(foug_transfer_t));
foug_stream_set_stdio(&trsf.stream, file);
trsf.buffer = (uint8_t*)malloc(512 * 1024);
trsf.buffer_size = 512 * 1024;
/* trsf.buffer = stack_buff;
trsf.buffer_size = 24 * 1024; */
result = foug_stlb_read(&geom, &trsf, FOUG_LITTLE_ENDIAN);
result = foug_stlb_read(&geom_creator, &trsf, FOUG_LITTLE_ENDIAN);
if (foug_datax_error(result))
fprintf(stderr, "foug_stlb_read() error %i", result);