From 13b1d32a9ab412a6d7e4fc95762c53f9d94e1a14 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 10 Jul 2015 11:33:05 +0200 Subject: [PATCH] Rename pointer on functions members xxx_func -> func_xxx --- src/gmio_core/buffer.c | 8 ++--- src/gmio_core/buffer.h | 6 ++-- src/gmio_core/error.h | 2 +- src/gmio_core/internal/helper_stream.h | 36 +++++++++---------- src/gmio_core/internal/helper_task_iface.h | 12 +++---- src/gmio_core/internal/helper_transfer.h | 4 +-- src/gmio_core/stream.c | 12 +++---- src/gmio_core/stream.h | 12 +++---- src/gmio_core/task_iface.h | 4 +-- .../internal/helper_stl_mesh_creator.h | 24 ++++++------- src/gmio_stl/internal/stl_rw_common.c | 2 +- src/gmio_stl/internal/stl_rw_common.h | 2 +- src/gmio_stl/internal/stla_write.c | 2 +- src/gmio_stl/internal/stlb_write.c | 10 +++--- src/gmio_stl/stl_error.h | 2 +- src/gmio_stl/stl_io.h | 2 +- src/gmio_stl/stl_mesh.h | 2 +- src/gmio_stl/stl_mesh_creator.h | 8 ++--- src/gmio_stl/stla_read.c | 2 +- src/gmio_stl/stlb_read.c | 10 +++--- tests/stream_buffer.c | 12 +++---- tests/test_stl_io.c | 6 ++-- 22 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/gmio_core/buffer.c b/src/gmio_core/buffer.c index f6b3811..012e0bf 100644 --- a/src/gmio_core/buffer.c +++ b/src/gmio_core/buffer.c @@ -24,12 +24,12 @@ GMIO_INLINE gmio_buffer_t gmio_buffer_null() } gmio_buffer_t gmio_buffer( - void* ptr, size_t size, void (*deallocate_func)(void*)) + void* ptr, size_t size, void (*func_deallocate)(void*)) { gmio_buffer_t buff; buff.ptr = ptr; buff.size = ptr != NULL ? size : 0; - buff.deallocate_func = deallocate_func; + buff.func_deallocate = func_deallocate; return buff; } @@ -50,8 +50,8 @@ gmio_buffer_t gmio_buffer_realloc(void* ptr, size_t size) void gmio_buffer_deallocate(gmio_buffer_t *buffer) { - if (buffer != NULL && buffer->deallocate_func != NULL) - buffer->deallocate_func(buffer->ptr); + if (buffer != NULL && buffer->func_deallocate != NULL) + buffer->func_deallocate(buffer->ptr); } static gmio_buffer_t gmio_buffer_default_internal_ctor() diff --git a/src/gmio_core/buffer.h b/src/gmio_core/buffer.h index 6173c10..7d52e4a 100644 --- a/src/gmio_core/buffer.h +++ b/src/gmio_core/buffer.h @@ -35,7 +35,7 @@ struct gmio_buffer /*! Optional pointer on a function that deallocates the memory block * beginning at \p ptr */ - void (*deallocate_func)(void* ptr); + void (*func_deallocate)(void* ptr); }; typedef struct gmio_buffer gmio_buffer_t; @@ -46,7 +46,7 @@ GMIO_C_LINKAGE_BEGIN * If \p ptr is NULL then gmio_buffer::size is forced to \c 0 */ GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer( - void* ptr, size_t size, void (*deallocate_func)(void*)); + void* ptr, size_t size, void (*func_deallocate)(void*)); /*! Returns a gmio_buffer object allocated with standard \c malloc() */ GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_malloc(size_t size); @@ -57,7 +57,7 @@ GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_calloc(size_t num, size_t size); /*! Returns a gmio_buffer object allocated with standard \c realloc() */ GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_realloc(void* ptr, size_t size); -/*! Safe and convenient call to gmio_buffer::deallocate_func() */ +/*! Safe and convenient call to gmio_buffer::func_deallocate() */ GMIO_LIB_EXPORT void gmio_buffer_deallocate(gmio_buffer_t* buffer); /*! Typedef for a pointer to a function that creates an allocated buffer diff --git a/src/gmio_core/error.h b/src/gmio_core/error.h index 73c5002..42baf0f 100644 --- a/src/gmio_core/error.h +++ b/src/gmio_core/error.h @@ -41,7 +41,7 @@ enum gmio_error GMIO_ERROR_STREAM, /*! Transfer was stopped by user, that is to say - * gmio_transfer::is_stop_requested_func() returned GMIO_TRUE */ + * gmio_transfer::func_is_stop_requested() returned GMIO_TRUE */ GMIO_ERROR_TRANSFER_STOPPED, /*! An error occured after a call to a function diff --git a/src/gmio_core/internal/helper_stream.h b/src/gmio_core/internal/helper_stream.h index cda6cfa..620b3c8 100644 --- a/src/gmio_core/internal/helper_stream.h +++ b/src/gmio_core/internal/helper_stream.h @@ -18,53 +18,53 @@ #include "../stream.h" -/*! Safe and convenient function for gmio_stream::at_end_func() */ +/*! Safe and convenient function for gmio_stream::func_at_end() */ GMIO_INLINE gmio_bool_t gmio_stream_at_end(gmio_stream_t* stream) { - if (stream != NULL && stream->at_end_func != NULL) - return stream->at_end_func(stream->cookie); + if (stream != NULL && stream->func_at_end != NULL) + return stream->func_at_end(stream->cookie); return GMIO_FALSE; } -/*! Safe and convenient function for gmio_stream::error_func() */ +/*! Safe and convenient function for gmio_stream::func_error() */ GMIO_INLINE int gmio_stream_error(gmio_stream_t* stream) { - if (stream != NULL && stream->error_func != NULL) - return stream->error_func(stream->cookie); + if (stream != NULL && stream->func_error != NULL) + return stream->func_error(stream->cookie); return 0; } -/*! Safe and convenient function for gmio_stream::read_func() */ +/*! Safe and convenient function for gmio_stream::func_read() */ GMIO_INLINE size_t gmio_stream_read( gmio_stream_t* stream, void *ptr, size_t size, size_t count) { - if (stream != NULL && stream->read_func != NULL) - return stream->read_func(stream->cookie, ptr, size, count); + if (stream != NULL && stream->func_read != NULL) + return stream->func_read(stream->cookie, ptr, size, count); return 0; } -/*! Safe and convenient function for gmio_stream::write_func() */ +/*! Safe and convenient function for gmio_stream::func_write() */ GMIO_INLINE size_t gmio_stream_write( gmio_stream_t* stream, const void *ptr, size_t size, size_t count) { - if (stream != NULL && stream->write_func != NULL) - return stream->write_func(stream->cookie, ptr, size, count); + if (stream != NULL && stream->func_write != NULL) + return stream->func_write(stream->cookie, ptr, size, count); return 0; } -/*! Safe and convenient function for gmio_stream::size_func() */ +/*! Safe and convenient function for gmio_stream::func_size() */ GMIO_INLINE size_t gmio_stream_size(gmio_stream_t* stream) { - if (stream != NULL && stream->size_func != NULL) - return stream->size_func(stream->cookie); + if (stream != NULL && stream->func_size != NULL) + return stream->func_size(stream->cookie); return 0; } -/*! Safe and convenient function for gmio_stream::rewind_func() */ +/*! Safe and convenient function for gmio_stream::func_rewind() */ GMIO_INLINE void gmio_stream_rewind(gmio_stream_t* stream) { - if (stream != NULL && stream->rewind_func != NULL) - stream->rewind_func(stream->cookie); + if (stream != NULL && stream->func_rewind != NULL) + stream->func_rewind(stream->cookie); } #endif /* GMIO_INTERNAL_HELPER_STREAM_H */ diff --git a/src/gmio_core/internal/helper_task_iface.h b/src/gmio_core/internal/helper_task_iface.h index e38cbe7..d6514c0 100644 --- a/src/gmio_core/internal/helper_task_iface.h +++ b/src/gmio_core/internal/helper_task_iface.h @@ -20,21 +20,21 @@ #include -/*! Safe and convenient function for gmio_task_iface::is_stop_requested_func() */ +/*! Safe and convenient function for gmio_task_iface::func_is_stop_requested() */ GMIO_INLINE gmio_bool_t gmio_task_iface_is_stop_requested( const gmio_task_iface_t* itask) { - if (itask != NULL && itask->is_stop_requested_func != NULL) - return itask->is_stop_requested_func(itask->cookie); + if (itask != NULL && itask->func_is_stop_requested != NULL) + return itask->func_is_stop_requested(itask->cookie); return GMIO_FALSE; } -/*! Safe and convenient function for gmio_task_iface::handle_progress_func() */ +/*! Safe and convenient function for gmio_task_iface::func_handle_progress() */ GMIO_INLINE void gmio_task_iface_handle_progress( const gmio_task_iface_t* itask, size_t value, size_t max_value) { - if (itask != NULL && itask->handle_progress_func != NULL) - itask->handle_progress_func(itask->cookie, value, max_value); + if (itask != NULL && itask->func_handle_progress != NULL) + itask->func_handle_progress(itask->cookie, value, max_value); } #endif /* GMIO_INTERNAL_HELPER_TASK_IFACE_H */ diff --git a/src/gmio_core/internal/helper_transfer.h b/src/gmio_core/internal/helper_transfer.h index bfbdd37..60cd687 100644 --- a/src/gmio_core/internal/helper_transfer.h +++ b/src/gmio_core/internal/helper_transfer.h @@ -19,7 +19,7 @@ #include "../transfer.h" #include "helper_task_iface.h" -/*! Safe and convenient function for gmio_task_iface::is_stop_requested_func() +/*! Safe and convenient function for gmio_task_iface::func_is_stop_requested() * through gmio_transfer::task_iface */ GMIO_INLINE gmio_bool_t gmio_transfer_is_stop_requested( @@ -30,7 +30,7 @@ GMIO_INLINE gmio_bool_t gmio_transfer_is_stop_requested( return GMIO_FALSE; } -/*! Safe and convenient function for gmio_task_iface::handle_progress_func() +/*! Safe and convenient function for gmio_task_iface::func_handle_progress() * through gmio_transfer::task_iface */ GMIO_INLINE void gmio_transfer_handle_progress( diff --git a/src/gmio_core/stream.c b/src/gmio_core/stream.c index 0a36cb0..a1a7526 100644 --- a/src/gmio_core/stream.c +++ b/src/gmio_core/stream.c @@ -138,11 +138,11 @@ gmio_stream_t gmio_stream_stdio(FILE* file) { gmio_stream_t stream = { 0 }; stream.cookie = file; - stream.at_end_func = gmio_stream_stdio_at_end; - stream.error_func = gmio_stream_stdio_error; - stream.read_func = gmio_stream_stdio_read; - stream.write_func = gmio_stream_stdio_write; - stream.size_func = gmio_stream_stdio_size; - stream.rewind_func = gmio_stream_stdio_rewind; + stream.func_at_end = gmio_stream_stdio_at_end; + stream.func_error = gmio_stream_stdio_error; + stream.func_read = gmio_stream_stdio_read; + stream.func_write = gmio_stream_stdio_write; + stream.func_size = gmio_stream_stdio_size; + stream.func_rewind = gmio_stream_stdio_rewind; return stream; } diff --git a/src/gmio_core/stream.h b/src/gmio_core/stream.h index 9a9addd..0af78c8 100644 --- a/src/gmio_core/stream.h +++ b/src/gmio_core/stream.h @@ -50,7 +50,7 @@ struct gmio_stream * The function should behaves like C standard [feof()] * (http://pubs.opengroup.org/onlinepubs/007904975/functions/feof.html) */ - gmio_bool_t (*at_end_func)(void* cookie); + gmio_bool_t (*func_at_end)(void* cookie); /*! Pointer on a function that checks error indicator * @@ -60,7 +60,7 @@ struct gmio_stream * The function should behaves like C standard [ferror()] * (http://pubs.opengroup.org/onlinepubs/007904975/functions/ferror.html) */ - int (*error_func)(void* cookie); + int (*func_error)(void* cookie); /*! Pointer on a function that reads block of data from stream * @@ -73,7 +73,7 @@ struct gmio_stream * * \returns The total number of elements successfully read */ - size_t (*read_func)(void* cookie, void* ptr, size_t size, size_t count); + size_t (*func_read)(void* cookie, void* ptr, size_t size, size_t count); /*! Pointer on a function that writes block of data to stream * @@ -86,10 +86,10 @@ struct gmio_stream * * \returns The total number of elements successfully written */ - size_t (*write_func)(void* cookie, const void* ptr, size_t size, size_t count); + size_t (*func_write)(void* cookie, const void* ptr, size_t size, size_t count); /*! Pointer on a function that returns the size(in bytes) of the stream */ - size_t (*size_func)(void* cookie); + size_t (*func_size)(void* cookie); /*! Pointer on a function that moves the position indicator within the * stream to the beginning @@ -97,7 +97,7 @@ struct gmio_stream * The function should behaves like C standard [rewind()] * (http://pubs.opengroup.org/onlinepubs/007904975/functions/rewind.html) */ - void (*rewind_func)(void* cookie); + void (*func_rewind)(void* cookie); }; typedef struct gmio_stream gmio_stream_t; diff --git a/src/gmio_core/task_iface.h b/src/gmio_core/task_iface.h index 6ac876f..10f9689 100644 --- a/src/gmio_core/task_iface.h +++ b/src/gmio_core/task_iface.h @@ -35,7 +35,7 @@ struct gmio_task_iface * If \c GMIO_TRUE is returned then the current task should abort as * soon as possible, otherwise it can continue execution. */ - gmio_bool_t (*is_stop_requested_func)(void* cookie); + gmio_bool_t (*func_is_stop_requested)(void* cookie); /*! Optional pointer on a function that is called anytime some new progress * was done @@ -44,7 +44,7 @@ struct gmio_task_iface * \param value Current value of the task progress (<= \p max_value ) * \param max_value Maximum value of the task progress */ - void (*handle_progress_func)(void* cookie, size_t value, size_t max_value); + void (*func_handle_progress)(void* cookie, size_t value, size_t max_value); }; typedef struct gmio_task_iface gmio_task_iface_t; diff --git a/src/gmio_stl/internal/helper_stl_mesh_creator.h b/src/gmio_stl/internal/helper_stl_mesh_creator.h index 12c63dc..3e65b6b 100644 --- a/src/gmio_stl/internal/helper_stl_mesh_creator.h +++ b/src/gmio_stl/internal/helper_stl_mesh_creator.h @@ -19,47 +19,47 @@ #include "../stl_mesh_creator.h" /*! Safe and convenient function for - * gmio_stl_mesh_creator::ascii_begin_solid_func() */ + * gmio_stl_mesh_creator::func_ascii_begin_solid() */ GMIO_INLINE void gmio_stl_mesh_creator_ascii_begin_solid( gmio_stl_mesh_creator_t* creator, size_t stream_size, const char* solid_name) { - if (creator != NULL && creator->ascii_begin_solid_func != NULL) { - creator->ascii_begin_solid_func( + if (creator != NULL && creator->func_ascii_begin_solid != NULL) { + creator->func_ascii_begin_solid( creator->cookie, stream_size, solid_name); } } /*! Safe and convenient function for - * gmio_stl_mesh_creator::binary_begin_solid_func() */ + * gmio_stl_mesh_creator::func_binary_begin_solid() */ GMIO_INLINE void gmio_stl_mesh_creator_binary_begin_solid( gmio_stl_mesh_creator_t* creator, uint32_t tri_count, const gmio_stlb_header_t* header) { - if (creator != NULL && creator->binary_begin_solid_func != NULL) - creator->binary_begin_solid_func(creator->cookie, tri_count, header); + if (creator != NULL && creator->func_binary_begin_solid != NULL) + creator->func_binary_begin_solid(creator->cookie, tri_count, header); } /*! Safe and convenient function for - * gmio_stl_mesh_creator::add_triangle_func() */ + * gmio_stl_mesh_creator::func_add_triangle() */ GMIO_INLINE void gmio_stl_mesh_creator_add_triangle( gmio_stl_mesh_creator_t* creator, uint32_t tri_id, const gmio_stl_triangle_t* triangle) { - if (creator != NULL && creator->add_triangle_func != NULL) - creator->add_triangle_func(creator->cookie, tri_id, triangle); + if (creator != NULL && creator->func_add_triangle != NULL) + creator->func_add_triangle(creator->cookie, tri_id, triangle); } /*! Safe and convenient function for - * gmio_stl_mesh_creator::end_solid_func() */ + * gmio_stl_mesh_creator::func_end_solid() */ GMIO_INLINE void gmio_stl_mesh_creator_end_solid( gmio_stl_mesh_creator_t* creator) { - if (creator != NULL && creator->end_solid_func != NULL) - creator->end_solid_func(creator->cookie); + if (creator != NULL && creator->func_end_solid != NULL) + creator->func_end_solid(creator->cookie); } #endif /* GMIO_INTERNAL_HELPER_STL_MESH_CREATOR_H */ diff --git a/src/gmio_stl/internal/stl_rw_common.c b/src/gmio_stl/internal/stl_rw_common.c index 9fd8824..610b0d6 100644 --- a/src/gmio_stl/internal/stl_rw_common.c +++ b/src/gmio_stl/internal/stl_rw_common.c @@ -37,7 +37,7 @@ gmio_bool_t gmio_check_transfer(int *error, const gmio_transfer_t* trsf) gmio_bool_t gmio_stl_check_mesh(int *error, const gmio_stl_mesh_t* mesh) { if (mesh == NULL - || (mesh->triangle_count > 0 && mesh->get_triangle_func == NULL)) + || (mesh->triangle_count > 0 && mesh->func_get_triangle == NULL)) { *error = GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC; } diff --git a/src/gmio_stl/internal/stl_rw_common.h b/src/gmio_stl/internal/stl_rw_common.h index 2e105f1..f926f3e 100644 --- a/src/gmio_stl/internal/stl_rw_common.h +++ b/src/gmio_stl/internal/stl_rw_common.h @@ -28,7 +28,7 @@ struct gmio_stlb_readwrite_helper { uint32_t facet_count; uint32_t i_facet_offset; - void (*fix_endian_func)(gmio_stl_triangle_t* tri); + void (*func_fix_endian)(gmio_stl_triangle_t* tri); }; typedef struct gmio_stlb_readwrite_helper gmio_stlb_readwrite_helper_t; diff --git a/src/gmio_stl/internal/stla_write.c b/src/gmio_stl/internal/stla_write.c index 5deaab4..3482478 100644 --- a/src/gmio_stl/internal/stla_write.c +++ b/src/gmio_stl/internal/stla_write.c @@ -203,7 +203,7 @@ int gmio_stla_write( ibuffer_facet < clamped_facet_count; ++ibuffer_facet) { - mesh->get_triangle_func(mesh->cookie, ibuffer_facet, &tri); + mesh->func_get_triangle(mesh->cookie, ibuffer_facet, &tri); buffc = gmio_write_string(buffc, "facet normal "); buffc = gmio_write_coords(buffc, coords_format, &tri.normal); buffc = gmio_write_eol(buffc); diff --git a/src/gmio_stl/internal/stlb_write.c b/src/gmio_stl/internal/stlb_write.c index 8a82fa7..8186dbf 100644 --- a/src/gmio_stl/internal/stlb_write.c +++ b/src/gmio_stl/internal/stlb_write.c @@ -46,7 +46,7 @@ static void gmio_stlb_write_facets( uint32_t buffer_offset = 0; uint32_t i_facet = 0; - if (mesh == NULL || mesh->get_triangle_func == NULL) + if (mesh == NULL || mesh->func_get_triangle == NULL) return; triangle.attribute_byte_count = 0; @@ -54,10 +54,10 @@ static void gmio_stlb_write_facets( i_facet < (i_facet_offset + facet_count); ++i_facet) { - mesh->get_triangle_func(mesh->cookie, i_facet, &triangle); + mesh->func_get_triangle(mesh->cookie, i_facet, &triangle); - if (wparams->fix_endian_func != NULL) - wparams->fix_endian_func(&triangle); + if (wparams->func_fix_endian != NULL) + wparams->func_fix_endian(&triangle); write_triangle_memcpy(&triangle, buffer + buffer_offset); @@ -90,7 +90,7 @@ int gmio_stlb_write( /* Initialize wparams */ if (byte_order != GMIO_ENDIANNESS_HOST) - wparams.fix_endian_func = gmio_stl_triangle_bswap; + wparams.func_fix_endian = gmio_stl_triangle_bswap; wparams.facet_count = gmio_size_to_uint32( trsf->buffer.size / GMIO_STLB_TRIANGLE_RAWSIZE); diff --git a/src/gmio_stl/stl_error.h b/src/gmio_stl/stl_error.h index 7716432..0bfab73 100644 --- a/src/gmio_stl/stl_error.h +++ b/src/gmio_stl/stl_error.h @@ -30,7 +30,7 @@ enum gmio_stl_error /*! STL format could not be guessed in read function */ GMIO_STL_ERROR_UNKNOWN_FORMAT = GMIO_STL_ERROR_TAG + 0x01, - /*! Common STL write error indicating gmio_stl_mesh::get_triangle_func() + /*! Common STL write error indicating gmio_stl_mesh::func_get_triangle() * pointer is NULL */ GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC = GMIO_STL_ERROR_TAG + 0x02, diff --git a/src/gmio_stl/stl_io.h b/src/gmio_stl/stl_io.h index 12b2e3a..dc60e82 100644 --- a/src/gmio_stl/stl_io.h +++ b/src/gmio_stl/stl_io.h @@ -113,7 +113,7 @@ int gmio_stl_write( * \param trsf Defines needed objects for the read operation * \param creator Defines the callbacks for the mesh creation * - * Stream size is passed to gmio_task_iface::handle_progress_func() as the + * Stream size is passed to gmio_task_iface::func_handle_progress() as the * \p max_value argument. * * Possible options in a future version could be: diff --git a/src/gmio_stl/stl_mesh.h b/src/gmio_stl/stl_mesh.h index c2406b5..c1823dc 100644 --- a/src/gmio_stl/stl_mesh.h +++ b/src/gmio_stl/stl_mesh.h @@ -35,7 +35,7 @@ struct gmio_stl_mesh /*! Pointer on a function that stores the mesh triangle of index \p tri_id * into \p triangle */ - void (*get_triangle_func)( + void (*func_get_triangle)( const void* cookie, uint32_t tri_id, gmio_stl_triangle_t* triangle); }; diff --git a/src/gmio_stl/stl_mesh_creator.h b/src/gmio_stl/stl_mesh_creator.h index e28453d..93e477c 100644 --- a/src/gmio_stl/stl_mesh_creator.h +++ b/src/gmio_stl/stl_mesh_creator.h @@ -44,7 +44,7 @@ struct gmio_stl_mesh_creator * The argument \p stream_size is the total size (in bytes) of the input * stream */ - void (*ascii_begin_solid_func)( + void (*func_ascii_begin_solid)( void* cookie, size_t stream_size, const char* solid_name); /*! Pointer on a function that handles declaration of a mesh with @@ -54,7 +54,7 @@ struct gmio_stl_mesh_creator * * The argument \p header contains the header data(80 bytes) */ - void (*binary_begin_solid_func)( + void (*func_binary_begin_solid)( void* cookie, uint32_t tri_count, const gmio_stlb_header_t* header); /*! Pointer on a function that adds a triangle to the user mesh @@ -64,7 +64,7 @@ struct gmio_stl_mesh_creator * * The argument \p tri_id is the index of the mesh triangle */ - void (*add_triangle_func)( + void (*func_add_triangle)( void* cookie, uint32_t tri_id, const gmio_stl_triangle_t* triangle); /*! Pointer on a function that finalizes creation of the user mesh @@ -72,7 +72,7 @@ struct gmio_stl_mesh_creator * Optional function called at the end of the read process, ie. after all * triangles have been added */ - void (*end_solid_func)(void* cookie); + void (*func_end_solid)(void* cookie); }; typedef struct gmio_stl_mesh_creator gmio_stl_mesh_creator_t; diff --git a/src/gmio_stl/stla_read.c b/src/gmio_stl/stla_read.c index 6a9875f..d0deeec 100644 --- a/src/gmio_stl/stla_read.c +++ b/src/gmio_stl/stla_read.c @@ -90,7 +90,7 @@ typedef struct size_t stream_size; /* Offset (in bytes) from beginning of stream : current position */ size_t stream_offset; - /* Cache for gmio_transfer::is_stop_requested_func() */ + /* Cache for gmio_transfer::func_is_stop_requested() */ gmio_bool_t is_stop_requested; } gmio_string_stream_fwd_iterator_cookie_t; diff --git a/src/gmio_stl/stlb_read.c b/src/gmio_stl/stlb_read.c index 86e29db..f7d25f9 100644 --- a/src/gmio_stl/stlb_read.c +++ b/src/gmio_stl/stlb_read.c @@ -48,7 +48,7 @@ static void gmio_stlb_read_facets( uint32_t buffer_offset = 0; uint32_t i_facet = 0; - if (creator == NULL || creator->add_triangle_func == NULL) + if (creator == NULL || creator->func_add_triangle == NULL) return; for (i_facet = 0; i_facet < facet_count; ++i_facet) { @@ -56,11 +56,11 @@ static void gmio_stlb_read_facets( read_triangle_memcpy(buffer + buffer_offset, &triangle); buffer_offset += GMIO_STLB_TRIANGLE_RAWSIZE; - if (rparams->fix_endian_func != NULL) - rparams->fix_endian_func(&triangle); + if (rparams->func_fix_endian != NULL) + rparams->func_fix_endian(&triangle); /* Declare triangle */ - creator->add_triangle_func( + creator->func_add_triangle( creator->cookie, i_facet_offset + i_facet, &triangle); } } @@ -89,7 +89,7 @@ int gmio_stlb_read( /* Initialize rparams */ if (byte_order != GMIO_ENDIANNESS_HOST) - rparams.fix_endian_func = gmio_stl_triangle_bswap; + rparams.func_fix_endian = gmio_stl_triangle_bswap; /* Read header */ if (gmio_stream_read(&trsf->stream, &header, GMIO_STLB_HEADER_SIZE, 1) diff --git a/tests/stream_buffer.c b/tests/stream_buffer.c index 6181b5c..79fd8bd 100644 --- a/tests/stream_buffer.c +++ b/tests/stream_buffer.c @@ -93,10 +93,10 @@ static void gmio_stream_buffer_rewind(void* cookie) void gmio_stream_set_buffer(gmio_stream_t *stream, gmio_stream_buffer_t* buff) { stream->cookie = buff; - stream->at_end_func = gmio_stream_buffer_at_end; - stream->error_func = gmio_stream_buffer_error; - stream->read_func = gmio_stream_buffer_read; - stream->write_func = gmio_stream_buffer_write; - stream->size_func = gmio_stream_buffer_size; - stream->rewind_func = gmio_stream_buffer_rewind; + stream->func_at_end = gmio_stream_buffer_at_end; + stream->func_error = gmio_stream_buffer_error; + stream->func_read = gmio_stream_buffer_read; + stream->func_write = gmio_stream_buffer_write; + stream->func_size = gmio_stream_buffer_size; + stream->func_rewind = gmio_stream_buffer_rewind; } diff --git a/tests/test_stl_io.c b/tests/test_stl_io.c index 5fc34c4..d1f9ac3 100644 --- a/tests/test_stl_io.c +++ b/tests/test_stl_io.c @@ -123,8 +123,8 @@ const char* test_stl_read() stl_testcase_result_t result = {0}; meshc.cookie = &result; - meshc.ascii_begin_solid_func = &ascii_begin_solid; - meshc.add_triangle_func = &add_triangle; + meshc.func_ascii_begin_solid = &ascii_begin_solid; + meshc.func_add_triangle = &add_triangle; for (i = 0; i < expected_count; ++i) { const gmio_stl_format_t format = @@ -212,7 +212,7 @@ void generate_stlb_tests_models() mesh.cookie = &tri_array; mesh.triangle_count = tri_array.count; - mesh.get_triangle_func = &stl_triangle_array_get_triangle; + mesh.func_get_triangle = &stl_triangle_array_get_triangle; gmio_stl_write_file( GMIO_STL_FORMAT_BINARY_LE,