diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-06-11 15:42:45 -0700 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-06-11 15:44:16 -0700 |
commit | 0559d06f61cd3f30b5925fe062654eca83eb6dd6 (patch) | |
tree | 7c4d588b4827ddeede470b405c3ea511f3a8bfd2 /src/render_hkl.c | |
parent | e5adbd4bdf620467c44a7ad99a366e39f04578a2 (diff) |
Tidy up switch statements
Diffstat (limited to 'src/render_hkl.c')
-rw-r--r-- | src/render_hkl.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/src/render_hkl.c b/src/render_hkl.c index e18ae90d..4e17e307 100644 --- a/src/render_hkl.c +++ b/src/render_hkl.c @@ -330,34 +330,27 @@ static void povray_render_animation(UnitCell *cell, double *ref, s = 6; } switch ( s ) { - case 0 : { /* Black to blue */ - r = 0.0; g = 0.0; b = p; - break; - } - case 1 : { /* Blue to green */ - r = 0.0; g = p; b = 1.0-p; - break; - } - case 2 : { /* Green to red */ - r =p; g = 1.0-p; b = 0.0; - break; - } - case 3 : { /* Red to Orange */ - r = 1.0; g = 0.5*p; b = 0.0; - break; - } - case 4 : { /* Orange to Yellow */ - r = 1.0; g = 0.5 + 0.5*p; b = 0.0; - break; - } - case 5 : { /* Yellow to White */ - r = 1.0; g = 1.0; b = 1.0*p; - break; - } - case 6 : { /* Pixel has hit the maximum value */ - r = 1.0; g = 1.0; b = 1.0; - break; - } + case 0 : /* Black to blue */ + r = 0.0; g = 0.0; b = p; + break; + case 1 : /* Blue to green */ + r = 0.0; g = p; b = 1.0-p; + break; + case 2 : /* Green to red */ + r =p; g = 1.0-p; b = 0.0; + break; + case 3 : /* Red to Orange */ + r = 1.0; g = 0.5*p; b = 0.0; + break; + case 4 : /* Orange to Yellow */ + r = 1.0; g = 0.5 + 0.5*p; b = 0.0; + break; + case 5 : /* Yellow to White */ + r = 1.0; g = 1.0; b = 1.0*p; + break; + case 6 : /* Pixel has hit the maximum value */ + r = 1.0; g = 1.0; b = 1.0; + break; } val = max-val; @@ -448,24 +441,20 @@ int main(int argc, char *argv[]) while ((c = getopt_long(argc, argv, "hj:", longopts, NULL)) != -1) { switch (c) { - case 'h' : { + case 'h' : show_help(argv[0]); return 0; - } - case 'j' : { + case 'j' : nproc = atoi(optarg); break; - } - case 0 : { + case 0 : break; - } - default : { + default : return 1; } - } } |