exposurses

Check-in [bd27f3bed9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rename arrays to free up name for functions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: bd27f3bed99041a067e4559b2ea40bfbb215fa925c9fadf4d69a0b068f179b9a
User & Date: base@atomicules.co.uk 2013-08-17 12:18:10
Context
2013-08-17
12:23
Add exposure equations (don't do anything yet though) check-in: 2264820974 user: base@atomicules.co.uk tags: origin/master, trunk
12:18
Rename arrays to free up name for functions check-in: bd27f3bed9 user: base@atomicules.co.uk tags: origin/master, trunk
2013-07-13
22:13
Make "make clean" actually clean everything check-in: 7c39adc01d user: atomicules@lavabit.com tags: origin/master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to exposurses.c.

     2      2   http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html */
     3      3   #include <curses.h>
     4      4   #include <menu.h>
     5      5   
     6      6   #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
     7      7   #define CTRLD 	4
     8      8   
     9         -char *iso[] = {
            9  +char *iso_array[] = {
    10     10   	"50",
    11     11   	"100",
    12     12   	"200",
    13     13   	"400",
    14     14   	"800",
    15     15   	"1600",
    16     16   	"3200"
    17     17   };
    18     18   
    19         -char *shutter[] = {
           19  +char *shutter_array[] = {
    20     20   	"1/1000",
    21     21   	"1/500",
    22     22   	"1/250",
    23     23   	"1/125",
    24     24   	"1/60",
    25     25   	"1/30",
    26     26   	"1/15",
    27     27   	"1/8",
    28     28   	"1/4",
    29     29   	"1/2",
    30     30   	"1"
    31     31   };
    32     32   
    33         -char *aperture[] = {
           33  +char *aperture_array[] = {
    34     34   	"f/1.4",
    35     35   	"f/2",
    36     36   	"f/2.8",
    37     37   	"f/4",
    38     38   	"f/5.6",
    39     39   	"f/8",
    40     40   	"f/11",
................................................................................
    68     68   	cbreak();
    69     69   	noecho();
    70     70   	keypad(stdscr, TRUE);
    71     71   	init_pair(1, COLOR_RED, COLOR_BLACK);
    72     72   	init_pair(2, COLOR_CYAN, COLOR_BLACK);
    73     73   
    74     74   	/* Create items */
    75         -	n_iso = ARRAY_SIZE(iso);
    76         -	n_shutter = ARRAY_SIZE(shutter);
    77         -	n_aperture = ARRAY_SIZE(aperture);
           75  +	n_iso = ARRAY_SIZE(iso_array);
           76  +	n_shutter = ARRAY_SIZE(shutter_array);
           77  +	n_aperture = ARRAY_SIZE(aperture_array);
    78     78   	iso_items = (ITEM **)calloc(n_iso, sizeof(ITEM *));
    79     79   	for(i = 0; i < n_iso; ++i) {
    80         -		iso_items[i] = new_item(iso[i], iso[i]);
           80  +		iso_items[i] = new_item(iso_array[i], iso_array[i]);
    81     81   		set_item_userptr(iso_items[i], selection);
    82     82   	}
    83     83   	shutter_items = (ITEM **)calloc(n_shutter, sizeof(ITEM *));
    84     84   	for(i = 0; i < n_shutter; ++i){
    85         -		shutter_items[i] = new_item(shutter[i], shutter[i]);
           85  +		shutter_items[i] = new_item(shutter_array[i], shutter_array[i]);
    86     86   		set_item_userptr(shutter_items[i], selection);
    87     87   	}
    88     88   	aperture_items = (ITEM **)calloc(n_aperture, sizeof(ITEM *));
    89     89   	for(i = 0; i < n_aperture; ++i){
    90         -		aperture_items[i] = new_item(aperture[i], aperture[i]);
           90  +		aperture_items[i] = new_item(aperture_array[i], aperture_array[i]);
    91     91   		set_item_userptr(aperture_items[i], selection);
    92     92   	}
    93     93   
    94     94   	/* Create menu */
    95     95   	iso_menu = new_menu((ITEM **)iso_items);
    96     96   	shutter_menu = new_menu((ITEM **)shutter_items);
    97     97   	aperture_menu = new_menu((ITEM **)aperture_items);