star-uvm

Spatial structuring of unstructured volumetric meshes
git clone git://git.meso-star.fr/star-uvm.git
Log | Files | Refs | README | LICENSE

commit a648840fad80f17d9d50bc95a25e9d903741b999
parent a1837bc466d05c52688226b15a87997dbd6f125f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 21 Jul 2023 16:43:07 +0200

Fix Star-Mesh API break in suvm_voxelize tool

The development version of Star-Mesh introduced an API break on loading
from the input stream by making the use of memory mapping optional. This
commit not only corrects the API break but also enables memory mapping
when supported by the input stream, i.e. when it is not the standard
input.

Diffstat:
Msrc/suvm_voxelize.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/suvm_voxelize.c b/src/suvm_voxelize.c @@ -72,7 +72,6 @@ print_help(const char* cmd) " -v make the program verobse.\n"); printf("\n"); printf( -"Copyright (C) 2020-2023 |Méso|Star> <contact@meso-star.com>.\n" "This is free software released under the GNU GPL license, version 3 or\n" "later. You are free to change or redistribute it under certain\n" "conditions <http://gnu.org.licenses/gpl.html>\n"); @@ -305,6 +304,7 @@ main(int argc, char** argv) const char* stream_in_name = "stdin"; struct smsh* smsh = NULL; struct smsh_create_args smsh_args = SMSH_CREATE_ARGS_DEFAULT; + struct smsh_load_stream_args load_stream_args = SMSH_LOAD_STREAM_ARGS_NULL; struct smsh_desc desc = SMSH_DESC_NULL; struct suvm_device* suvm = NULL; struct suvm_volume* vol = NULL; @@ -349,7 +349,10 @@ main(int argc, char** argv) smsh_args.verbose = args.verbose; res = smsh_create(&smsh_args, &smsh); if(res != RES_OK) goto error; - res = smsh_load_stream(smsh, stream_in, stream_in_name); + load_stream_args.stream = stream_in; + load_stream_args.name = stream_in_name; + load_stream_args.memory_mapping = stream_in != stdin; + res = smsh_load_stream(smsh, &load_stream_args); if(res != RES_OK) goto error; res = smsh_get_desc(smsh, &desc); if(res != RES_OK) goto error;