Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Try to standardise on a string length
Since it doesn't matter if it's longer. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
99eba10b76336457898c4ee2c28ed254 |
User & Date: | base@atomicules.co.uk 2013-08-31 07:50:20 |
2013-09-02
| ||
09:29 |
Actually make it work this time.
See this commit: 8d3e66b5ecffa8bcf7691c3f0600840b934beb1a I'm such an idiot. - Remove `set_top_row` when setting the shutter menu to the correct | |
2013-08-31
| ||
07:50 |
Try to standardise on a string length
Since it doesn't matter if it's longer. | |
07:47 | Remove extraneous line that came from menu_scroll.c check-in: ed161d4179 user: base@atomicules.co.uk tags: origin/master, trunk | |
Changes to exposurses.c.
︙ | ︙ | |||
58 59 60 61 62 63 64 | void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color); int exposure(int iso); int selection_counter; double shutter(int exposure, double aperture); double aperture(int exposure, int shutter); int nearest_match(double x, int menu); double fraction_to_double(char *fraction); | | | | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color); int exposure(int iso); int selection_counter; double shutter(int exposure, double aperture); double aperture(int exposure, int shutter); int nearest_match(double x, int menu); double fraction_to_double(char *fraction); /* No one will ever need more than 9 bytes! */ char iso_sel[9] = ""; char shutter_sel[9] = ""; char aperture_sel[9] = ""; int menu_counter = 1; int main() { int c; MENU **menu; WINDOW **win; int n_iso, i; |
︙ | ︙ | |||
344 345 346 347 348 349 350 | return sqrt(pow(2, exposure) * shutter); } int nearest_match (double x, int menu) { /* Need to search array for closest match */ int n; int diff_idx = 0; | | | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | return sqrt(pow(2, exposure) * shutter); } int nearest_match (double x, int menu) { /* Need to search array for closest match */ int n; int diff_idx = 0; char array_value_str[9]; double array_value_db; double diff; /* Need a starting value for difference */ switch(menu) { case 1: array_value_db = strtod(iso_array[0], NULL); |
︙ | ︙ | |||
398 399 400 401 402 403 404 | break; } return diff_idx; } double fraction_to_double(char *fraction) { double fraction_as_db; | | | 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | break; } return diff_idx; } double fraction_to_double(char *fraction) { double fraction_as_db; char denominator[9]; char *ptr = strchr(fraction, "/"); if (ptr) { /*then split*/ strncpy(denominator, fraction+2, 5); fraction_as_db = 1/strtod(denominator, NULL); } else { fraction_as_db = strtod(fraction, NULL); } return fraction_as_db; } |