Commit 0651db52 authored by Clément Stenac's avatar Clément Stenac

%f in galaktos (Closes:#585)

parent 13817ff8
......@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
/* Library functions to manipulate initial condition values */
......@@ -115,6 +115,7 @@ void init_cond_to_string(init_cond_t * init_cond) {
/* Create a string "param_name=val" */
switch (init_cond->param->type) {
lldiv_t div;
case P_TYPE_BOOL:
sprintf(string, "%s=%d\n", init_cond->param->name, init_cond->init_val.bool_val);
......@@ -123,7 +124,9 @@ void init_cond_to_string(init_cond_t * init_cond) {
sprintf(string, "%s=%d\n", init_cond->param->name, init_cond->init_val.int_val);
break;
case P_TYPE_DOUBLE:
sprintf(string, "%s=%f\n", init_cond->param->name, init_cond->init_val.double_val);
div = lldiv( init_cond->init_val.double_val * 1000000,
1000000 );
sprintf(string, "%s="I64Fd".%06u\n", init_cond->param->name, div.quot, (unsigned int) div.rem );
break;
default:
return;
......
......@@ -22,6 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
#include <stdio.h>
......@@ -886,7 +887,11 @@ void write_init(init_cond_t * init_cond) {
sprintf(s, "%s=%d\n", init_cond->param->name, init_cond->init_val.int_val);
else if (init_cond->param->type == P_TYPE_DOUBLE)
sprintf(s, "%s=%f\n", init_cond->param->name, init_cond->init_val.double_val);
{
lldiv_t div = lldiv( init_cond->init_val.double_val * 1000000,1000000 );
sprintf(s, "%s="I64Fd".%06u\n", init_cond->param->name, div.quot,
(unsigned int) div.rem );
}
else { printf("write_init: unknown parameter type!\n"); return; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment