diff options
-rw-r--r-- | dimension/main.c | 3 | ||||
-rw-r--r-- | dimension/parse.c | 10 | ||||
-rw-r--r-- | dimension/realize.c | 2 | ||||
-rw-r--r-- | libdimension/color.c | 16 | ||||
-rw-r--r-- | tests/libdimension/png.c | 3 | ||||
-rw-r--r-- | tests/libdimension/render.c | 3 |
6 files changed, 24 insertions, 13 deletions
diff --git a/dimension/main.c b/dimension/main.c index 708184d..f780484 100644 --- a/dimension/main.c +++ b/dimension/main.c @@ -39,7 +39,8 @@ static void print_usage(FILE *file, const char *arg0); static void print_version(FILE *file); int -main(int argc, char **argv) { +main(int argc, char **argv) +{ /* * Parse the command-line options */ diff --git a/dimension/parse.c b/dimension/parse.c index 3216962..fc067cf 100644 --- a/dimension/parse.c +++ b/dimension/parse.c @@ -562,7 +562,7 @@ dmnsn_eval_zeroary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) { dmnsn_astnode ret = dmnsn_copy_astnode(astnode); - switch(astnode.type) { + switch (astnode.type) { case DMNSN_AST_PI: dmnsn_make_ast_float(&ret, 4*atan(1.0)); break; @@ -688,7 +688,7 @@ dmnsn_eval_unary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) long n = *(long *)rhs.ptr; ret = dmnsn_copy_astnode(astnode); - switch(astnode.type) { + switch (astnode.type) { case DMNSN_AST_DOT_X: case DMNSN_AST_DOT_Y: case DMNSN_AST_DOT_Z: @@ -792,7 +792,7 @@ dmnsn_eval_unary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) double n = *(double *)rhs.ptr; ret = dmnsn_copy_astnode(astnode); - switch(astnode.type) { + switch (astnode.type) { case DMNSN_AST_DOT_X: case DMNSN_AST_DOT_Y: case DMNSN_AST_DOT_Z: @@ -895,7 +895,7 @@ dmnsn_eval_unary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) } else if (rhs.type == DMNSN_AST_STRING) { ret = dmnsn_copy_astnode(astnode); - switch(astnode.type) { + switch (astnode.type) { case DMNSN_AST_ASC: dmnsn_make_ast_integer(&ret, ((char *)rhs.ptr)[0]); break; @@ -1571,7 +1571,7 @@ dmnsn_eval_ternary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) dmnsn_array_get(astnode.children, 2, &iffalse); test = dmnsn_eval_scalar(test, symtable); - switch(astnode.type) { + switch (astnode.type) { case DMNSN_AST_TERNARY: dmnsn_assert(test.type == DMNSN_AST_INTEGER, "Conditional expression evaluated to non-integer."); diff --git a/dimension/realize.c b/dimension/realize.c index 160bf79..563327c 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -456,7 +456,7 @@ dmnsn_realize_pigment_modifiers(dmnsn_astnode astnode, dmnsn_pigment *pigment) dmnsn_assert(astnode.type == DMNSN_AST_PIGMENT_MODIFIERS, "Expected pigment modifiers."); - DMNSN_ARRAY_FOREACH(dmnsn_astnode *, modifier, astnode.children) { + DMNSN_ARRAY_FOREACH (dmnsn_astnode *, modifier, astnode.children) { switch (modifier->type) { case DMNSN_AST_TRANSFORMATION: pigment->trans = dmnsn_matrix_mul( diff --git a/libdimension/color.c b/libdimension/color.c index 7af23b8..8712938 100644 --- a/libdimension/color.c +++ b/libdimension/color.c @@ -91,7 +91,9 @@ dmnsn_color_is_black(dmnsn_color color) } /* sRGB's `C' function */ -static double dmnsn_sRGB_C(double Clinear) { +static double +dmnsn_sRGB_C(double Clinear) +{ /* * If C represents R, G, and B, then the sRGB values are now found as follows: * @@ -136,7 +138,9 @@ dmnsn_color_from_xyY(dmnsn_CIE_xyY xyY) } /* Inverse function of CIE L*a*b*'s `f' function, for the reverse conversion */ -static double dmnsn_Lab_finv(double t) { +static double +dmnsn_Lab_finv(double t) +{ if (t > 6.0/29.0) { return t*t*t; } else { @@ -199,7 +203,9 @@ dmnsn_color_from_sRGB(dmnsn_sRGB sRGB) } /* Inverse function of sRGB's `C' function, for the reverse conversion */ -static double dmnsn_sRGB_Cinv(double CsRGB) { +static double +dmnsn_sRGB_Cinv(double CsRGB) +{ /* * If C represents R, G, and B, then the Clinear values are now found as * follows: @@ -248,7 +254,9 @@ dmnsn_xyY_from_color(dmnsn_color color) } /* CIE L*a*b*'s `f' function */ -static double dmnsn_Lab_f(double t) { +static double +dmnsn_Lab_f(double t) +{ if (t > 216.0/24389.0) { return pow(t, 1.0/3.0); } else { diff --git a/tests/libdimension/png.c b/tests/libdimension/png.c index cc8ecb4..f28d50f 100644 --- a/tests/libdimension/png.c +++ b/tests/libdimension/png.c @@ -22,7 +22,8 @@ #include <stdio.h> int -main() { +main() +{ /* Set the resilience low for tests */ dmnsn_set_resilience(DMNSN_SEVERITY_LOW); diff --git a/tests/libdimension/render.c b/tests/libdimension/render.c index 5059778..97196f7 100644 --- a/tests/libdimension/render.c +++ b/tests/libdimension/render.c @@ -23,7 +23,8 @@ #include <stdio.h> int -main() { +main() +{ bool have_png = true, have_gl = true; /* Set the resilience low for tests */ |